// Path: core/client/src/main/java/de/danner_web/studip_client/utils/ResourceLoader.java
// public class ResourceLoader {
// 
//     /**
//      * This method generates an URL to the resource specified by the input path
//      * 
//      * @param path
//      * @return URL to the resource
//      */
//     public static URL getURL(String path) {
//         return ResourceLoader.class.getClassLoader().getResource(path);
//     }
// 
//     /**
//      * This method generates a SVGIcon from the svg with the given path
//      * 
//      * @param path
//      *            to a svg graphic
//      * @return SVGIcon of the path
//      */
//     public static SVGIcon getSVGIcon(String path) {
//         // Read SVG Image from jar File
//         InputStream in = ResourceLoader.class.getClassLoader().getResourceAsStream(path);
//         BufferedReader reader = new BufferedReader(new InputStreamReader(in));
// 
//         // Load SVG Image Stream to SVG Cache
//         URI uri = SVGCache.getSVGUniverse().loadSVG(reader, path);
//         SVGIcon svgicon = new SVGIcon();
//         svgicon.setAntiAlias(true);
//         svgicon.setScaleToFit(true);
//         svgicon.setSvgURI(uri);
// 
//         return svgicon;
//     }
// }
// 
// Path: core/client/src/main/java/de/danner_web/studip_client/utils/Template.java
// public class Template {
// 
// 	private static final String PREFIX = "icons/";
// 
// 	// ActionButton images
// 	public static final String PLUGIN_DELETE = PREFIX + "plugin_delete.svg";
// 	public static final String PLUGIN_SETTINGS = PREFIX + "plugin_settings.svg";
// 	public static final String PLUGIN_ADD = PREFIX + "plugin_add.svg";
// 	public static final String PLUGIN_ACTIVATE = PREFIX + "plugin_activate.svg";
// 
// 	public static final String PLUGIN_VERIFIED = PREFIX + "plugin_verified.svg";
// 	public static final String PLUGIN_NOT_VERIFIED = PREFIX + "plugin_not_verified.svg";
// 
// 	// OnOffButton images
// 	public static final String ON_OFF_BUTTON_BG_EN = PREFIX + "onoff_bg_en.png";
// 	public static final String ON_OFF_BUTTON_BG_DE = PREFIX + "onoff_bg_de.png";
// 	public static final String ON_OFF_BUTTON_SLIDER = PREFIX + "onoff_slider.png";
// 
// 	// DropdownButton
// 	public static final String DROP_DOWN_BUTTON = PREFIX + "dropdown_button.png";
// 
// 	// BackButton images
// 	public static final String BACK_BUTTON = PREFIX + "arrow_back.png";
// 	public static final String BACK_BUTTON_HOVER = PREFIX + "arrow_back_hover.png";
// 
// 	// Main menu icons
// 	public static final String MENU_ACTIVITY = PREFIX + "main_menu_activity.svg";
// 	public static final String MENU_SETTINGS = PREFIX + "main_menu_settings.svg";
// 	public static final String MENU_LOGGER = PREFIX + "main_menu_logging.svg";
// 	public static final String MENU_PLUGINS = PREFIX + "main_menu_plugin.svg";
// 	public static final String MENU_ABOUT = PREFIX + "main_menu_about.svg";
// 
// 	// Favicon
// 	public static final String FAVICON = PREFIX + "favicon.png";
// 
// 	public static final String AUTHORIZE = PREFIX + "authorize.png";
// 
// 	// About logo
// 	public static final String LOGO = PREFIX + "logo.svg";
// 
// 	// Colors
// 	public static final Color COLOR_DARK = Color.decode("#222222");
// 	public static final Color COLOR_DARK_GRAY = Color.decode("#353535");
// 	public static final Color COLOR_LIGHT_GRAY = Color.decode("#DDDDDD");
// 	public static final Color COLOR_LIGHTER_GRAY = Color.decode("#EEEEEE");
// 	public static final Color COLOR_GRAY = Color.decode("#AAAAAA");
// 	public static final Color COLOR_ACCENT = Color.decode("#0772A1");
// 	public static final Color COLOR_ACCENT_LIGHT = Color.decode("#a8bfdb");
// 
// 	// Tree icons
// 	public static final String TREE_EXPANDED = PREFIX + "tree_expanded.svg";
// 	public static final String TREE_COLLAPSED = PREFIX + "tree_collapsed.svg";
// 	public static final String TREE_DOCUMENT = PREFIX + "tree_document.svg";
// 	public static final String TREE_DOCUMENT_INACTIVE = PREFIX + "tree_document_inactive.svg";
// 	public static final String TREE_FOLDER = PREFIX + "tree_folder.svg";
// 	public static final String TREE_FOLDER_INACTIVE = PREFIX + "tree_folder_inactive.svg";
// 	public static final String TREE_FOLDER_OPEN = PREFIX + "tree_folder_open.svg";
// 	public static final String TREE_FOLDER_OPEN_INACTIVE = PREFIX + "tree_folder_open_inactive.svg";
// 
// }


import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import javax.swing.JButton;
import com.kitfox.svg.SVGCache;
import com.kitfox.svg.SVGElement;
import com.kitfox.svg.SVGElementException;
import com.kitfox.svg.animation.AnimationElement;
import com.kitfox.svg.app.beans.SVGIcon;
import de.danner_web.studip_client.utils.ResourceLoader;
import de.danner_web.studip_client.utils.Template;
package de.danner_web.studip_client.view.components.buttons;





public class ActionButton extends JButton {

    private static final long serialVersionUID = 660817787015769043L;

    // private Image imgDefault, imgHover, imgInactive;
    private SVGIcon icon;

    private static final int HEIGHT = 28;
    private static final int WIDTH = HEIGHT;

    private boolean active = false;

    public enum ActionType {
        DELETE, ADD, SETTINGS, ACTIVATE
    }

    public ActionButton(ActionType type) {
        super();
        this.setContentAreaFilled(false);
        this.setBorderPainted(false);
        this.setFocusPainted(false);

        // Load icon for type
        switch (type) {
        case DELETE:
// Path: core/client/src/main/java/de/danner_web/studip_client/utils/ResourceLoader.java
// public class ResourceLoader {
// 
//     /**
//      * This method generates an URL to the resource specified by the input path
//      * 
//      * @param path
//      * @return URL to the resource
//      */
//     public static URL getURL(String path) {
//         return ResourceLoader.class.getClassLoader().getResource(path);
//     }
// 
//     /**
//      * This method generates a SVGIcon from the svg with the given path
//      * 
//      * @param path
//      *            to a svg graphic
//      * @return SVGIcon of the path
//      */
//     public static SVGIcon getSVGIcon(String path) {
//         // Read SVG Image from jar File
//         InputStream in = ResourceLoader.class.getClassLoader().getResourceAsStream(path);
//         BufferedReader reader = new BufferedReader(new InputStreamReader(in));
// 
//         // Load SVG Image Stream to SVG Cache
//         URI uri = SVGCache.getSVGUniverse().loadSVG(reader, path);
//         SVGIcon svgicon = new SVGIcon();
//         svgicon.setAntiAlias(true);
//         svgicon.setScaleToFit(true);
//         svgicon.setSvgURI(uri);
// 
//         return svgicon;
//     }
// }
// 
// Path: core/client/src/main/java/de/danner_web/studip_client/utils/Template.java
// public class Template {
// 
// 	private static final String PREFIX = "icons/";
// 
// 	// ActionButton images
// 	public static final String PLUGIN_DELETE = PREFIX + "plugin_delete.svg";
// 	public static final String PLUGIN_SETTINGS = PREFIX + "plugin_settings.svg";
// 	public static final String PLUGIN_ADD = PREFIX + "plugin_add.svg";
// 	public static final String PLUGIN_ACTIVATE = PREFIX + "plugin_activate.svg";
// 
// 	public static final String PLUGIN_VERIFIED = PREFIX + "plugin_verified.svg";
// 	public static final String PLUGIN_NOT_VERIFIED = PREFIX + "plugin_not_verified.svg";
// 
// 	// OnOffButton images
// 	public static final String ON_OFF_BUTTON_BG_EN = PREFIX + "onoff_bg_en.png";
// 	public static final String ON_OFF_BUTTON_BG_DE = PREFIX + "onoff_bg_de.png";
// 	public static final String ON_OFF_BUTTON_SLIDER = PREFIX + "onoff_slider.png";
// 
// 	// DropdownButton
// 	public static final String DROP_DOWN_BUTTON = PREFIX + "dropdown_button.png";
// 
// 	// BackButton images
// 	public static final String BACK_BUTTON = PREFIX + "arrow_back.png";
// 	public static final String BACK_BUTTON_HOVER = PREFIX + "arrow_back_hover.png";
// 
// 	// Main menu icons
// 	public static final String MENU_ACTIVITY = PREFIX + "main_menu_activity.svg";
// 	public static final String MENU_SETTINGS = PREFIX + "main_menu_settings.svg";
// 	public static final String MENU_LOGGER = PREFIX + "main_menu_logging.svg";
// 	public static final String MENU_PLUGINS = PREFIX + "main_menu_plugin.svg";
// 	public static final String MENU_ABOUT = PREFIX + "main_menu_about.svg";
// 
// 	// Favicon
// 	public static final String FAVICON = PREFIX + "favicon.png";
// 
// 	public static final String AUTHORIZE = PREFIX + "authorize.png";
// 
// 	// About logo
// 	public static final String LOGO = PREFIX + "logo.svg";
// 
// 	// Colors
// 	public static final Color COLOR_DARK = Color.decode("#222222");
// 	public static final Color COLOR_DARK_GRAY = Color.decode("#353535");
// 	public static final Color COLOR_LIGHT_GRAY = Color.decode("#DDDDDD");
// 	public static final Color COLOR_LIGHTER_GRAY = Color.decode("#EEEEEE");
// 	public static final Color COLOR_GRAY = Color.decode("#AAAAAA");
// 	public static final Color COLOR_ACCENT = Color.decode("#0772A1");
// 	public static final Color COLOR_ACCENT_LIGHT = Color.decode("#a8bfdb");
// 
// 	// Tree icons
// 	public static final String TREE_EXPANDED = PREFIX + "tree_expanded.svg";
// 	public static final String TREE_COLLAPSED = PREFIX + "tree_collapsed.svg";
// 	public static final String TREE_DOCUMENT = PREFIX + "tree_document.svg";
// 	public static final String TREE_DOCUMENT_INACTIVE = PREFIX + "tree_document_inactive.svg";
// 	public static final String TREE_FOLDER = PREFIX + "tree_folder.svg";
// 	public static final String TREE_FOLDER_INACTIVE = PREFIX + "tree_folder_inactive.svg";
// 	public static final String TREE_FOLDER_OPEN = PREFIX + "tree_folder_open.svg";
// 	public static final String TREE_FOLDER_OPEN_INACTIVE = PREFIX + "tree_folder_open_inactive.svg";
// 
// }


// Path: core/client/src/main/java/de/danner_web/studip_client/view/components/buttons/ActionButton.java
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import javax.swing.JButton;
import com.kitfox.svg.SVGCache;
import com.kitfox.svg.SVGElement;
import com.kitfox.svg.SVGElementException;
import com.kitfox.svg.animation.AnimationElement;
import com.kitfox.svg.app.beans.SVGIcon;
import de.danner_web.studip_client.utils.ResourceLoader;
import de.danner_web.studip_client.utils.Template;

package de.danner_web.studip_client.view.components.buttons;





public class ActionButton extends JButton {

    private static final long serialVersionUID = 660817787015769043L;

    // private Image imgDefault, imgHover, imgInactive;
    private SVGIcon icon;

    private static final int HEIGHT = 28;
    private static final int WIDTH = HEIGHT;

    private boolean active = false;

    public enum ActionType {
        DELETE, ADD, SETTINGS, ACTIVATE
    }

    public ActionButton(ActionType type) {
        super();
        this.setContentAreaFilled(false);
        this.setBorderPainted(false);
        this.setFocusPainted(false);

        // Load icon for type
        switch (type) {
        case DELETE:
            icon = ResourceLoader.getSVGIcon(Template.PLUGIN_DELETE);