package View.MainFrame;

import java.awt.Image;
import java.awt.image.BufferedImage;

import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

public class MyImages {

    public static Image getLightKeyboardImage() {
        BufferedImage oDefaultLightKeyboardBufferedImage = null;
        try {
            oDefaultLightKeyboardBufferedImage = ImageIO.read(new File("Learning_is_keyboard/graphics/light_mode/light_default2.png"));
        } catch (IOException e) {
            e.printStackTrace();
        }

        return oDefaultLightKeyboardBufferedImage.getScaledInstance(1000, 329, Image.SCALE_SMOOTH);
    }

    public static Image getLight_Key_0_Tilde_Image() {
        BufferedImage oDefaultLightKeyboardBufferedImage = null;
        try {
            oDefaultLightKeyboardBufferedImage = ImageIO.read(new File("Learning_is_keyboard/graphics/light_mode/single_keys/key_0_tilde.png"));
        } catch (IOException e) {
            e.printStackTrace();
        }

        return oDefaultLightKeyboardBufferedImage.getScaledInstance(73, 67, Image.SCALE_SMOOTH);
    }

    public static Image getLight_Key_1_One_Image() {
        BufferedImage oDefaultLightKeyboardBufferedImage = null;
        try {
            oDefaultLightKeyboardBufferedImage = ImageIO.read(new File("Learning_is_keyboard/graphics/light_mode/single_keys/key_1_one.png"));
        } catch (IOException e) {
            e.printStackTrace();
        }

        return oDefaultLightKeyboardBufferedImage.getScaledInstance(68, 61, Image.SCALE_SMOOTH);
    }

    public static Image getLight_Key_2_Two_Image() {
        BufferedImage oDefaultLightKeyboardBufferedImage = null;
        try {
            oDefaultLightKeyboardBufferedImage = ImageIO.read(new File("Learning_is_keyboard/graphics/light_mode/single_keys/key_2_two.png"));
        } catch (IOException e) {
            e.printStackTrace();
        }

        return oDefaultLightKeyboardBufferedImage.getScaledInstance(76, 64, Image.SCALE_SMOOTH);
    }

    /**
     * Doesn't get called since keyevent doesn't recognize if tab was pressed.
     * @return
     */
    public static Image getLight_Key_14_Tab_Image() {
        BufferedImage oDefaultLightKeyboardBufferedImage = null;
        try {
            oDefaultLightKeyboardBufferedImage = ImageIO.read(new File("Learning_is_keyboard/graphics/light_mode/single_keys/key_14_tab.png"));
        } catch (IOException e) {
            e.printStackTrace();
        }

        return oDefaultLightKeyboardBufferedImage.getScaledInstance(110, 76, Image.SCALE_SMOOTH);
    }

    public static Image getLight_Key_15_Q_Image() {
        BufferedImage oDefaultLightKeyboardBufferedImage = null;
        try {
            oDefaultLightKeyboardBufferedImage = ImageIO.read(new File("Learning_is_keyboard/graphics/light_mode/single_keys/key_15_q.png"));
        } catch (IOException e) {
            e.printStackTrace();
        }

        return oDefaultLightKeyboardBufferedImage.getScaledInstance(89, 87, Image.SCALE_SMOOTH);
    }

    public static Image getLight_Key_41_Shift_Image() {
        BufferedImage oDefaultLightKeyboardBufferedImage = null;
        try {
            oDefaultLightKeyboardBufferedImage = ImageIO.read(new File("Learning_is_keyboard/graphics/light_mode/single_keys/key_41_shift.png"));
        } catch (IOException e) {
            e.printStackTrace();
        }

        return oDefaultLightKeyboardBufferedImage.getScaledInstance(909, 98, Image.SCALE_SMOOTH);
    }

    public static Image getDarkKeyboardImage() {
        BufferedImage oDefaultDarkKeyboardBufferedImage = null;
        try {
            oDefaultDarkKeyboardBufferedImage = ImageIO.read(new File("Learning_is_keyboard/graphics/dark_mode/dark_default.png"));
        } catch (IOException e) {
            e.printStackTrace();
        }

        return oDefaultDarkKeyboardBufferedImage.getScaledInstance(1000, 329, Image.SCALE_SMOOTH);
    }

    public static Image getImage(int i) {
        Image oImageToReturn = getLightKeyboardImage();
        switch (i) {
            case (0): {
                oImageToReturn = getLightKeyboardImage();
            }break;
            case (1): {
                oImageToReturn = getLight_Key_0_Tilde_Image();
            }break;
            case (2): {
                oImageToReturn = getLight_Key_1_One_Image();
            }break;
            case (3): {
                oImageToReturn = getLight_Key_2_Two_Image();
            }break;
            case (14): {
                oImageToReturn = getLight_Key_14_Tab_Image();
            }break;
            case (15): {
                oImageToReturn = getLight_Key_15_Q_Image();
            }break;
            case (41): {
                oImageToReturn = getLight_Key_41_Shift_Image();
            }break;
        }
        return oImageToReturn;
    }
}
