/*
!=======================================================================
!
!  PROGRAM  PHASE-Viewer  (PHASE-Viewer 2014.01 ver.3.3.0)
!
!  Created on 2005/12/02, 21:50
!  AUTHOR(S): KOGA, Junichiro
!  File : Resources.java
!  
!  Contact address :  Phase System Consortium
!                     E-mail: phase_system@nims.go.jp URL https://azuma.nims.go.jp
!
!
!   Since 2002, this program set had been intensively developed as a part of the following 
!  national projects supported by the Ministry of Education, Culture, Sports, Science and
!  Technology (MEXT) of Japan; "Frontier Simulation Software for Industrial Science
!  (FSIS)" from 2002 to 2005, "Revolutionary Simulation Software (RSS21)" from 2006 to
!  2008. "Research and Development of Innovative Simulation Software (RISS)" from 2008
!  to 2013. These projects is lead by the Center for Research on Innovative Simulation 
!  Software (CISS), the Institute of Industrial Science (IIS), the University of Tokyo.
!   Since 2013, this program set has been further developed centering on PHASE System
!  Consortium. 
!   The activity of development of this program set has been supervised by Takahisa Ohno.
!
!=======================================================================
 */

package ciss.phase_viewer.common;

import java.util.HashMap;
import java.util.Vector;

import javax.swing.ImageIcon;

import org.apache.log4j.Logger;

/**
 * アイコンなどを作成.
 * 
 * @author
 */
public class Resources {
    private static Logger logger = Logger.getLogger(Resources.class.getName());

    public static final String PROP16 = "/toolbarButtonGraphics/general/Properties16.gif";
    public static final String EXPORT16 = "/toolbarButtonGraphics/general/Export16.gif";
    public static final String SAVE16 = "/toolbarButtonGraphics/general/Save16.gif";
    public static final String SAVE24 = "/toolbarButtonGraphics/general/Save24.gif";

    public static final String EXIT16 = "/org/javalobby/icons/16x16/Exit.gif";
    public static final String BLUECIRCLE16 = "/org/javalobby/icons/16x16/BlueCircle.gif";

    public static final String HOME20 = "/org/javalobby/icons/20x20/Home.gif";
    public static final String MAGNIFYPLUS20 = "/org/javalobby/icons/20x20/MagnifyPlus.gif";
    public static final String MAGNIFYMINUS20 = "/org/javalobby/icons/20x20/MagnifyMinus.gif";
    public static final String ROTCWDOWN20 = "/org/javalobby/icons/20x20/RotCWDown.gif";
    public static final String ROTCCDOWN20 = "/org/javalobby/icons/20x20/RotCCDown.gif";
    public static final String VCRBack20 = "/org/javalobby/icons/20x20/VCRBack.gif";
    public static final String VCRForward20 = "/org/javalobby/icons/20x20/VCRForward.gif";
    public static final String VCRRewind20 = "/org/javalobby/icons/20x20/VCRRewind.gif";
    public static final String VCRFastForward20 = "/org/javalobby/icons/20x20/VCRFastForward.gif";
    public static final String VCRBegin20 = "/org/javalobby/icons/20x20/VCRBegin.gif";
    public static final String VCREnd20 = "/org/javalobby/icons/20x20/VCREnd.gif";
    public static final String VCRPlay20 = "/org/javalobby/icons/20x20/VCRPlay.gif";
    public static final String VCRStop20 = "/org/javalobby/icons/20x20/VCRStop.gif";
    public static final String PRINT20 = "/org/javalobby/icons/20x20/Print.gif";
    public static final String EXIT20 = "/org/javalobby/icons/20x20/Exit.gif";
    public static final String WIDEN20 = "/org/javalobby/icons/20x20/Widen.gif";
    public static final String DOWN20 = "/org/javalobby/icons/20x20/Down.gif";
    public static final String UP20 = "/org/javalobby/icons/20x20/Up.gif";
    public static final String DELETE20 = "/org/javalobby/icons/20x20/Delete.gif";

    public static final String LINEGRAPH20 = "/org/javalobby/icons/20x20/LineGraph.gif";

    public static final String ENVELOPE20 = "/org/javalobby/icons/20x20/Envelope.gif";

    public static final Vector iconCache = new Vector();
    public static final Vector keys = new Vector();

    private static final HashMap iconMap = new HashMap();

    /**
     * 基本的にstaticな変数/メソッドのみ. --> privateなコンストラクター.
     */
    private Resources() {
    }

    /**
     * 引数で指定されるアイコンを返す. 登録されていないアイコンの場合nullを返すかも.
     * 
     * @param 識別用の文字列
     * @return アイコン.
     */
    public static final ImageIcon getIcon(String key) {
        if (iconMap.get(key) != null) {
            return (ImageIcon) iconMap.get(key);
        }
        // for ( int i=0 ; i<keys.size() ; i++ ) {
        // if ( key.equals((String) keys.get(i)) ) {
        // return (ImageIcon) iconCache.get(i);
        // }
        // }
        ImageIcon icon = new ImageIcon(Resources.class.getResource(key));
        iconMap.put(key, icon);
        // iconCache.addElement(icon);
        // keys.addElement(key);
        return icon;
    }

}
