/*
 * @(#)Icons.java  1.2 2008-01-05
 *
 * Copyright (c) 2002-2008 Werner Randelshofer, Immensee, Switzerland.
 * All rights reserved.
 *
 * You may not use, copy or modify this file, except in compliance with the
 * license agreement you entered into with Werner Randelshofer.
 * For details see accompanying license terms.
 */

package ch.randelshofer.gui;

import java.awt.*;
import java.awt.geom.*;

import javax.swing.*;

/**
 * Provides constants for commonly used Icons.
 *
 * @author Werner Randelshofer
 * @version 1.2 2008-01-05 Added playerSettingsIcon. 
 * <br>1.1 2007-06-06 Method getActionsIcon added.
 * <br>1.0.1 2002-11-17 Appeareance of POPUP_ICON changed.
 * <br>1.0 2002-05-09 Created.
 */
public class Icons {
    private static Icon playerResetIcon;
    private static Icon playerResetPlacardIcon;
    private static Icon playerRecordIcon;
    private static Icon playerRecordPressedIcon;
    private static Icon scriptCheckIcon;
    private static Icon actionsTableHeaderIcon;
    private static Icon actionsPlacardIcon;
    private static Icon playerStartIcon;
    private static Icon playerForwardIcon;
    private static Icon playerBackIcon;
    private static Icon playerPauseIcon;
    private static Icon playerSettingsIcon;
    private static Icon popupSmallIcon;
    private static Icon editAddPlacardIcon;
    
    /**
     * The reset icon consists of a rectangle (at west)
     * and a triangle pointing to the rectangle (towards west).
     */
    public static Icon getPlayerResetIcon() {
        if (playerResetIcon == null) {
            playerResetIcon = new LazyImageIcon(
                    Icons.class.getResource("images/PlayerReset.icon.png"),
                    10, 10
                    );
        }
        return playerResetIcon;
    }
    
    
    /**
     * The reset icon consists of a rectangle (at west)
     * and a triangle pointing to the rectangle (towards west).
     */
    public static Icon getPlayerResetPlacardIcon() {
        if (playerResetPlacardIcon == null) {
            playerResetPlacardIcon = new LazyImageIcon(
                    Icons.class.getResource("images/PlayerReset.placardIcon.png"),
                    20, 19
                    );
        }
        return playerResetPlacardIcon;
    }
    
    
    /**
     * The record icon consists of a filled circle.
     */
    public static Icon getPlayerRecordIcon() {
        if (playerRecordIcon == null) {
            playerRecordIcon = new LazyImageIcon(
                    Icons.class.getResource("images/PlayerRecord.icon.png"),
                    10, 10
                    );
        }
        return playerRecordIcon;
    }
    
    /**
     * The record icon consists of a filled circle.
     */
    public static Icon getPlayerStopRecordingIcon() {
        if (playerRecordPressedIcon == null) {
            playerRecordPressedIcon = new LazyImageIcon(
                    Icons.class.getResource("images/PlayerStopRecording.icon.png"),
                    10, 10
                    );
        }
        return playerRecordPressedIcon;
    }
    
    public static Icon getScriptCheckIcon() {
        if (scriptCheckIcon == null) {
            scriptCheckIcon = new VectorIcon(
                    new Polygon(
                    new int[] { 0, 1, 3, 8, 9, 4, 3 },
                    new int[] { 5, 5, 8, 0, 0, 9, 9 },
                    7
                    ),
                    10, 10, Color.black, Color.black
                    );
        }
        return scriptCheckIcon;
    }
    
    /**
     * The actions icon consists of a cogweel.
     */
    public static Icon getActionsIcon() {
        if (actionsTableHeaderIcon == null) {
            actionsTableHeaderIcon = new LazyImageIcon(
                    Icons.class.getResource("images/Actions.tableHeaderIcon.png"),
                    10, 10
                    );
        }
        return actionsTableHeaderIcon;
    }
    
    /**
     * The actions icon consists of a cogweel.
     */
    public static Icon getActionsPlacardIcon() {
        if (actionsPlacardIcon == null) {
            actionsPlacardIcon = new LazyImageIcon(
                    Icons.class.getResource("images/Actions.placardIcon.png"),
                    20, 19
                    );
        }
        return actionsPlacardIcon;
    }
    /**
     * The start icon consists of a triangle pointing
     * to east.
     */
    public static Icon getPlayerStartIcon() {
        if (playerStartIcon == null) {
            playerStartIcon = new LazyImageIcon(
                    Icons.class.getResource("images/PlayerStart.icon.png"),
                    10, 10
                    );
        }
        return playerStartIcon;
    }
    /**
     * The pause icon consists of two rectangles.
     */
    public static Icon getPlayerPauseIcon() {
        if (playerPauseIcon == null) {
            playerPauseIcon = new LazyImageIcon(
                    Icons.class.getResource("images/PlayerPause.icon.png"),
                    10, 10
                    );
        }
        return playerPauseIcon;
    }
    /**
     * The back icon consists of rectangle (at east)
     * and of a triangle pointing to west.
     */
    public static Icon getPlayerBackIcon() {
        if (playerBackIcon == null) {
            playerBackIcon = new LazyImageIcon(
                    Icons.class.getResource("images/PlayerBack.icon.png"),
                    10, 10
                    );
        }
        return playerBackIcon;
    }
    
    /**
     * The forward icon consists of rectangle (at east)
     * and of a triangle pointing to west.
     */
    public static Icon getPlayerForwardIcon() {
        if (playerForwardIcon == null) {
            playerForwardIcon = new LazyImageIcon(
                    Icons.class.getResource("images/PlayerForward.icon.png"),
                    10, 10
                    );
        }
        return playerForwardIcon;
    }

    public static Icon getEditAddPlacardIcon() {
        if (editAddPlacardIcon == null) {
            editAddPlacardIcon = new LazyImageIcon(
                    Icons.class.getResource("images/EditAdd.placardIcon.png"),
                    20, 19
                    );
        }
        return editAddPlacardIcon;
    }
    /**
     * The reset icon consists of a rectangle (at west)
     * and a triangle pointing to the rectangle (towards west).
     */
    public static Icon getPlayerSettingsIcon() {
        if (playerSettingsIcon == null) {
            playerSettingsIcon = new LazyImageIcon(
                    Icons.class.getResource("images/PlayerSettings.icon.png"),
                    10, 10
                    );
        }
        return playerSettingsIcon;
    }
    
    /** Private to prevent creation of instances. */
    private Icons() {
    }
    
}
