package View.MainFrame;

import javax.swing.JPanel;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Dimension;

public class MyLayeredKeyboardPanel extends JPanel {

    //[0] == If 0 image is not painted, if 1 image is painted
    //[1] == x-Coordinate for image
    //[2] == y-Coordinate for image
    private int[][] aiiImages = new int[62][3];
    
    private int iTheme = 0;

    public MyLayeredKeyboardPanel() {
        this.setPreferredSize(new Dimension(1000, 500));
        initImagePositions();
    }

    @Override
    public void paint(Graphics g) {
        Graphics2D g2D = (Graphics2D) g;

        for (int i = 0; i < aiiImages.length; i++) {
            if (aiiImages[i][0] == 1) {
                g2D.drawImage(MyImages.getImage(i), aiiImages[i][1], aiiImages[i][2], null);
            }
        }        
    }

    public void setImage(int iSet, int iIndex) {
        aiiImages[iIndex][0] = iSet;
    }

    public void setTheme(int i) {
        iTheme = i;
    }

    private void initImagePositions() {
        //Background
        aiiImages[0][0] = 1;
        aiiImages[0][1] = aiiImages[0][2] = 0;

        //` / ~ Key
        aiiImages[1][1] = 80;
        aiiImages[1][2] = 1;

        //1 / ! Key
        aiiImages[2][1] = 142;
        aiiImages[2][2] = 0;
    }
}