001: // This file is part of KeY - Integrated Deductive Software Design
002: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
003: // Universitaet Koblenz-Landau, Germany
004: // Chalmers University of Technology, Sweden
005: //
006: // The KeY system is protected by the GNU General Public License.
007: // See LICENSE.TXT for details.
008: //
009: //
010:
011: package de.uka.ilkd.key.gui;
012:
013: import java.awt.Image;
014:
015: import javax.swing.Icon;
016: import javax.swing.ImageIcon;
017:
018: import de.uka.ilkd.key.util.KeYResourceManager;
019:
020: public class IconFactory {
021:
022: private IconFactory() {
023: }
024:
025: static KeYResourceManager resManager = KeYResourceManager
026: .getManager();
027:
028: private static Image keyHole = getImage("images/ekey-mono.gif");
029: private static Image keyHoleAlmostClosed = getImage("images/ekey-brackets.gif");
030: private static Image keyHoleClosed = getImage("images/keyproved.gif");
031: private static Image keyLogo = getImage("images/key-color.gif");
032: private static Image keyLogoSmall = getImage("images/key-color-icon-square.png");
033: private static Image keyAssistant = getImage("assistant/kiki.png");
034: private static Icon provedFolderIcon = KeYFolderIcon
035: .getKeYFolderIconClosed();
036: private static Icon closableFolderIcon = KeYFolderIcon
037: .getKeYFolderIconClosable();
038:
039: private static Icon expandedIcon = KeYControlIcon
040: .getKeYExpandedIcon();
041: private static Icon collapsedIcon = KeYControlIcon
042: .getKeYCollapsedIcon();
043:
044: private static Image reuse = getImage("images/toolbar/ff.gif");
045: private static Image goalBack = getImage("images/toolbar/goalBack.png");
046: private static Image autoResume = getImage("images/toolbar/autoResume.png");
047: private static Image autoResumeDisabled = getImage("images/toolbar/autoResumeDisabled.png");
048: private static Image autoModeStart = getImage("images/toolbar/autoModeStart.png");
049: private static Image autoModeStop = getImage("images/toolbar/autoModeStop.png");
050: private static Image autoModeConfigArrow = getImage("images/toolbar/autoModeConfigArrow.png");
051: private static Image decisionProcedureICS = getImage("images/toolbar/decisionProcedureICS.png");
052: private static Image decisionProcedureSimplify = getImage("images/toolbar/decisionProcedureSimplify.png");
053:
054: private static Image junit = getImage("images/toolbar/junit_logo.png");
055:
056: private static Image openKeYFile = getImage("images/toolbar/open.png");
057: private static Image openMostRecentKeYFile = getImage("images/toolbar/openMostRecent.png");
058: private static Image saveFile = getImage("images/toolbar/saveFile.png");
059:
060: private static Image interactiveAppLogo = getImage("images/interactiveAppLogo.png");
061:
062: public static Image getImage(String s) {
063: ImageIcon ii = resManager.createImageIcon(IconFactory.class, s);
064: Image im = ii.getImage();
065: return im;
066: }
067:
068: public static ImageIcon scaleIcon(Image im, int x, int y) {
069: Image scaledim = im.getScaledInstance(x, y, Image.SCALE_SMOOTH);
070: return new ImageIcon(scaledim);
071: }
072:
073: public static ImageIcon keyHole(int x, int y) {
074: return scaleIcon(keyHole, x, y);
075: }
076:
077: public static ImageIcon keyAssistant(int x, int y) {
078: return scaleIcon(keyAssistant, x, y);
079: }
080:
081: public static ImageIcon keyHoleClosed(int x, int y) {
082: return scaleIcon(keyHoleClosed, x, y);
083: }
084:
085: public static ImageIcon keyHoleAlmostClosed(int x, int y) {
086: return scaleIcon(keyHoleAlmostClosed, x, y);
087: }
088:
089: public static ImageIcon keyLogo(int x, int y) {
090: return scaleIcon(keyLogo, x, y);
091: }
092:
093: public static ImageIcon reuseLogo() {
094: return scaleIcon(reuse, 15, 15);
095: }
096:
097: public static ImageIcon resumeLogo(int size) {
098: return scaleIcon(autoResume, size, size);
099: }
100:
101: public static ImageIcon resumeDisabledLogo(int size) {
102: return scaleIcon(autoResumeDisabled, size, size);
103: }
104:
105: public static ImageIcon autoModeStartLogo(int size) {
106: return scaleIcon(autoModeStart, size, size);
107: }
108:
109: public static ImageIcon autoModeStopLogo(int size) {
110: return scaleIcon(autoModeStop, size, size);
111: }
112:
113: public static ImageIcon selectStrategyArrow(int size) {
114: return scaleIcon(autoModeConfigArrow, size / 2, size);
115: }
116:
117: public static ImageIcon simplifyLogo(int size) {
118: return scaleIcon(decisionProcedureSimplify, size, size);
119: }
120:
121: public static ImageIcon junitLogo(int size) {
122: return scaleIcon(junit, size, size);
123: }
124:
125: public static ImageIcon icsLogo(int size) {
126: return scaleIcon(decisionProcedureICS, size, size);
127: }
128:
129: public static ImageIcon goalBackLogo(int size) {
130: return scaleIcon(goalBack, size, size);
131: }
132:
133: public static Icon provedFolderIcon() {
134: return provedFolderIcon;
135: }
136:
137: public static Icon closableFolderIcon() {
138: return closableFolderIcon;
139: }
140:
141: public static Icon expandedIcon() {
142: return expandedIcon;
143: }
144:
145: public static Icon collapsedIcon() {
146: return collapsedIcon;
147: }
148:
149: public static Image keyLogo() {
150: return keyLogoSmall;
151: }
152:
153: public static Icon openMostRecent(int size) {
154: return scaleIcon(openMostRecentKeYFile, size, size);
155: }
156:
157: public static Icon openKeYFile(int size) {
158: return scaleIcon(openKeYFile, size, size);
159: }
160:
161: public static Icon saveFile(int size) {
162: return scaleIcon(saveFile, size, size);
163: }
164:
165: public static Icon interactiveAppLogo(int size) {
166: return scaleIcon(interactiveAppLogo, size, size);
167: }
168:
169: }
|