package de.lazyzero.kkMulticopterFlashTool.utils;

import java.awt.Image;

import javax.swing.ImageIcon;

import de.lazyzero.kkMulticopterFlashTool.KKMulticopterFlashTool;


public class Icons {

	
	public static final String app = "KK.png";
	public static final String LICENSE = "3floppy_unmount.png";
	public static final String SAVE = "3floppy_unmount.png";
	public static final String EXIT = "exit.png";
	public static final String ABOUT = "error.png";
	public static final String SETTINGS = "package_utilities.png";
	public static final String LANGUAGE = "babelfish.png";
	public static final String GERMAN = "german.png";
	public static final String ENGLISH = "english.png";
	public static final String FRENCH = "french.png";
	public static final String ITALIAN = "italian.png";
	public static final String DUTCH = "dutch.png";
	public static final String RUN = "runit.png"; 
	public static final String STOP = "no.png"; 
	public static final String CONFIG = "agt_utilities.png";
	public static final String TRASH = "trash.png";
	public static final String EXPORT = "cal.png";
	public static final String OPEN = "folder_green.png";
	public static final String LOAD = "floppy_unmount.png";
	
	private static final String iconpath = "gui/resources/icons/";
	public static final String RELOAD = "agt_reload.png";
	
	public static ImageIcon getIcon22(String iconname) {
        return getIcon(iconname, 22);
    }
    public static ImageIcon getIcon32(String iconname) {
        return getIcon(iconname, 32);
    }
    public static ImageIcon getIcon16(String iconname) {
        return getIcon(iconname, 16);
    }
    public static ImageIcon getIcon48(String iconname) {
        return getIcon(iconname, 48);
    }
    public static ImageIcon getIcon64(String iconname) {
        return getIcon(iconname, 64);
    }
    public static ImageIcon getIcon(String iconname) {
        
        java.net.URL imgURL = KKMulticopterFlashTool.class.getResource(iconpath + iconname);
        
        if (imgURL != null) {
            return new ImageIcon(imgURL);
        } 
        return null;
    }
    
    public static ImageIcon getIcon(String iconname, int size) {
        
        java.net.URL imgURL = KKMulticopterFlashTool.class.getResource(iconpath + iconname);
        
        if (imgURL != null) {
            return new ImageIcon(new ImageIcon(imgURL).getImage().getScaledInstance(size,size,Image.SCALE_SMOOTH));
        } 
        return null;
    }
    public static Image getImage(String iconname, int height) {
        
        java.net.URL imgURL = KKMulticopterFlashTool.class.getResource(iconpath + iconname);
        
        if (imgURL != null) {
        	return new ImageIcon(imgURL).getImage().getScaledInstance(-1,height,Image.SCALE_SMOOTH);
        }
        return null;     
    }
}
