Source Code Cross Referenced for STheme.java in  » Swing-Library » Swinglets » com » javelin » swinglets » theme » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Swing Library » Swinglets » com.javelin.swinglets.theme 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright Javelin Software, All rights reserved.
003:         */
004:
005:        package com.javelin.swinglets.theme;
006:
007:        import java.awt.*;
008:        import java.util.*;
009:        import java.io.*;
010:
011:        import com.javelin.swinglets.*;
012:
013:        /**
014:         * STheme represents a neutral way of expressing Themes for Look and Feels.
015:         * 
016:         * @author Robin Sharp
017:         */
018:
019:        public abstract class STheme {
020:            //Background 1X1 Transparent Image
021:            public final static String BACKGROUND_ICON = "1X1";
022:
023:            //Tree
024:            public final static String TREE_OPEN_ICON = "TREE_OPEN";
025:            public final static String TREE_LEAF_ICON = "TREE_LEAF";
026:            public final static String TREE_CLOSED_ICON = "TREE_CLOSED";
027:
028:            //Tabs
029:            public final static String TAB_TL_ICON = "TAB_TL";
030:            public final static String TAB_BL_ICON = "TAB_BL";
031:            public final static String TAB_TM_ICON = "TAB_TM";
032:            public final static String TAB_TR_ICON = "TAB_TR";
033:            public final static String TAB_BR_ICON = "TAB_BR";
034:
035:            //FRAME
036:            public final static String FRAME_ICON = "FRAMEICO";
037:            public final static String FRAME_DESKTOP = "FRAMEDSK";
038:            public final static String FRAME_MIN = "FRAMEMIN";
039:            public final static String FRAME_MAX = "FRAMEMAX";
040:            public final static String FRAME_RESTORE = "FRAMERES";
041:            public final static String FRAME_CLOSE = "FRAMECLO";
042:            public final static String FRAME_BAR = "FRAMEBAR";
043:
044:            //SPLIT PANE - default size = 8
045:            public final static String VERTICAL_DIV = "VER_DIV";
046:            public final static String HORIZONTAL_DIV = "HOR_DIV";
047:
048:            // STATIC METHODS ////////////////////////////////////////////
049:
050:            /**
051:             * Put a Theme into the hashtable. 
052:             */
053:            public static synchronized void putTheme(STheme theme) {
054:                themes.put(theme.getName().toLowerCase(), theme);
055:            }
056:
057:            /**
058:             * Get a Theme by path to a properties file.
059:             */
060:            public static synchronized STheme getTheme(String name) {
061:                STheme theme = (STheme) themes.get(name.toLowerCase());
062:
063:                if (theme == null) {
064:                    throw new IllegalArgumentException("Cannot find the theme "
065:                            + name);
066:                }
067:
068:                return theme;
069:            }
070:
071:            /**
072:             * Get the enumeration of Themes.
073:             */
074:            public static Enumeration getThemes() {
075:                return themes.elements();
076:            }
077:
078:            // NAME //////////////////////////////////////////////////////////////
079:
080:            public abstract String getName();
081:
082:            // FONT //////////////////////////////////////////////////////////////
083:
084:            public abstract SFont getControlTextFont();
085:
086:            public abstract SFont getSystemTextFont();
087:
088:            public abstract SFont getUserTextFont();
089:
090:            public abstract SFont getMenuTextFont();
091:
092:            public abstract SFont getWindowTitleFont();
093:
094:            public abstract SFont getSubTextFont();
095:
096:            // ICONS /////////////////////////////////////////////////////////////
097:
098:            /**
099:             * Get the path for the icons. This is relative to the 
100:             * SwingletManager. ImagePath.
101:             */
102:            public String getPath() {
103:                return path;
104:            }
105:
106:            /**
107:             * Set the path for the icons.
108:             */
109:            public void setPath(String path) {
110:                this .path = path;
111:            }
112:
113:            /**
114:             * Get an icons for the given key. This list of manditory keys
115:             * is listed at the top of this class.
116:             */
117:            public abstract SIcon getIcon(String key);
118:
119:            // COLORS ////////////////////////////////////////////////////////////
120:
121:            public SColor getFocusColor() {
122:                return getPrimary2();
123:            }
124:
125:            public SColor getDesktopColor() {
126:                return getPrimary2();
127:            }
128:
129:            public SColor getControl() {
130:                return getSecondary3();
131:            }
132:
133:            public SColor getControlShadow() {
134:                return getSecondary2();
135:            }
136:
137:            public SColor getControlDarkShadow() {
138:                return getSecondary1();
139:            }
140:
141:            public SColor getControlInfo() {
142:                return getContrast3();
143:            }
144:
145:            public SColor getControlHighlight() {
146:                return getContrast1();
147:            }
148:
149:            public SColor getControlDisabled() {
150:                return getSecondary2();
151:            }
152:
153:            public SColor getPrimaryControl() {
154:                return getPrimary3();
155:            }
156:
157:            public SColor getPrimaryControlShadow() {
158:                return getPrimary2();
159:            }
160:
161:            public SColor getPrimaryControlDarkShadow() {
162:                return getPrimary1();
163:            }
164:
165:            public SColor getPrimaryControlInfo() {
166:                return getContrast3();
167:            }
168:
169:            public SColor getPrimaryControlHighlight() {
170:                return getContrast1();
171:            }
172:
173:            public SColor getSystemTextColor() {
174:                return getPrimary1();
175:            }
176:
177:            public SColor getControlTextColor() {
178:                return getControlInfo();
179:            }
180:
181:            public SColor getInactiveControlTextColor() {
182:                return getControlDisabled();
183:            }
184:
185:            public SColor getInactiveSystemTextColor() {
186:                return getSecondary2();
187:            }
188:
189:            public SColor getUserTextColor() {
190:                return getContrast3();
191:            }
192:
193:            public SColor getTextHighlightColor() {
194:                return getPrimary3();
195:            }
196:
197:            public SColor getHighlightedTextColor() {
198:                return getControlTextColor();
199:            }
200:
201:            public SColor getWindowBackground() {
202:                return getWhite();
203:            }
204:
205:            public SColor getWindowTitleBackground() {
206:                return getPrimary3();
207:            }
208:
209:            public SColor getWindowTitleForeground() {
210:                return getContrast2();
211:            }
212:
213:            public SColor getWindowTitleInactiveBackground() {
214:                return getSecondary3();
215:            }
216:
217:            public SColor getWindowTitleInactiveForeground() {
218:                return getContrast2();
219:            }
220:
221:            public SColor getMenuBackground() {
222:                return getSecondary3();
223:            }
224:
225:            public SColor getMenuForeground() {
226:                return getContrast3();
227:            }
228:
229:            public SColor getMenuSelectedBackground() {
230:                return getPrimary2();
231:            }
232:
233:            public SColor getMenuSelectedForeground() {
234:                return getContrast3();
235:            }
236:
237:            public SColor getMenuDisabledForeground() {
238:                return getSecondary2();
239:            }
240:
241:            public SColor getSeparatorBackground() {
242:                return getContrast3();
243:            }
244:
245:            public SColor getSeparatorForeground() {
246:                return getPrimary1();
247:            }
248:
249:            public SColor getAcceleratorForeground() {
250:                return getPrimary1();
251:            }
252:
253:            public SColor getAcceleratorSelectedForeground() {
254:                return getContrast1();
255:            }
256:
257:            // OBJECT /////////////////////////////////////////////////////////////
258:
259:            /**
260:             * Return the name.
261:             */
262:            public String toString() {
263:                return getName();
264:            }
265:
266:            // PROTECTED //////////////////////////////////////////////////////////
267:
268:            protected String path;
269:
270:            //Colors - used for color highlights
271:            protected abstract SColor getPrimary1();
272:
273:            protected abstract SColor getPrimary2();
274:
275:            protected abstract SColor getPrimary3();
276:
277:            //Colors - used for contrast to primary
278:            protected abstract SColor getContrast1();
279:
280:            protected abstract SColor getContrast2();
281:
282:            protected abstract SColor getContrast3();
283:
284:            //Gray Colors - used for backgrounds
285:            protected abstract SColor getSecondary1();
286:
287:            protected abstract SColor getSecondary2();
288:
289:            protected abstract SColor getSecondary3();
290:
291:            protected SColor getWhite() {
292:                return white;
293:            }
294:
295:            protected SColor getBlack() {
296:                return black;
297:            }
298:
299:            private final static SColor white = SColor.white;
300:            private final static SColor black = SColor.black;
301:
302:            protected static Hashtable themes = new Hashtable();
303:
304:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.