Source Code Cross Referenced for SDefaultTheme.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:         * SDefaultTheme represents a concrete implementation of a default theme.
015:         * 
016:         * @author Robin Sharp
017:         */
018:
019:        public class SDefaultTheme extends STheme {
020:            /**
021:             * Path relative to 
022:             */
023:            public SDefaultTheme() {
024:            }
025:
026:            /**
027:             * Get a Theme by path to a properties file.
028:             */
029:            public static synchronized STheme getDefaultTheme() {
030:                return STheme.getTheme("metal");
031:            }
032:
033:            /**
034:             * Get the name.
035:             */
036:            public String getName() {
037:                return name;
038:            }
039:
040:            /**
041:             * Set the name.
042:             */
043:            public void setName(String name) {
044:                this .name = name;
045:            }
046:
047:            /**
048:             * Get the icon ny name.
049:             */
050:            public SIcon getIcon(String key) {
051:                SIcon icon = (SIcon) icons.get(key);
052:
053:                if (icon == null) {
054:                    icon = newIcon(key);
055:                    icons.put(icon, key);
056:                }
057:
058:                return icon;
059:            }
060:
061:            /**
062:             * Load an Icon from the respective theme directory
063:             * <P>
064:             * "com/javelin/swinglets/theme/" + name + ".gif"
065:             */
066:            protected SIcon newIcon(String key) {
067:                return new SIcon(getPath() + "/" + key + ".gif");
068:            }
069:
070:            /**
071:             * Get Text Color.
072:             */
073:            protected SColor getPrimary1() {
074:                return primary1;
075:            }
076:
077:            /**
078:             * Set the Text Color.
079:             */
080:            public void setPrimary1(String color) {
081:                primary1 = SColor.getColor(color);
082:            }
083:
084:            /**
085:             * Get Focus, Desktop.
086:             */
087:            protected SColor getPrimary2() {
088:                return primary2;
089:            }
090:
091:            /**
092:             * Set the Focus, Desktop..
093:             */
094:            public void setPrimary2(String color) {
095:                primary2 = SColor.getColor(color);
096:            }
097:
098:            /**
099:             * Get Menu Background.
100:             */
101:            protected SColor getPrimary3() {
102:                return primary3;
103:            }
104:
105:            /**
106:             * Set the Menu Background..
107:             */
108:            public void setPrimary3(String color) {
109:                primary3 = SColor.getColor(color);
110:            }
111:
112:            /**
113:             * Get Text Color.
114:             */
115:            protected SColor getContrast1() {
116:                return contrast1;
117:            }
118:
119:            /**
120:             * Set the Text Color.
121:             */
122:            public void setContrast1(String color) {
123:                contrast1 = SColor.getColor(color);
124:            }
125:
126:            /**
127:             * Get Focus, Desktop.
128:             */
129:            protected SColor getContrast2() {
130:                return contrast2;
131:            }
132:
133:            /**
134:             * Set the Focus, Desktop..
135:             */
136:            public void setContrast2(String color) {
137:                contrast2 = SColor.getColor(color);
138:            }
139:
140:            /**
141:             * Get Menu Background.
142:             */
143:            protected SColor getContrast3() {
144:                return contrast3;
145:            }
146:
147:            /**
148:             * Set the Menu Background..
149:             */
150:            public void setContrast3(String color) {
151:                contrast3 = SColor.getColor(color);
152:            }
153:
154:            /**
155:             * Get Text Color - disabled.
156:             */
157:            protected SColor getSecondary1() {
158:                return secondary1;
159:            }
160:
161:            /**
162:             * Set the Text Color - disabled.
163:             */
164:            public void setSecondary1(String color) {
165:                secondary1 = SColor.getColor(color);
166:            }
167:
168:            /**
169:             * Get Focus, Desktop - disabled.
170:             */
171:            protected SColor getSecondary2() {
172:                return secondary2;
173:            }
174:
175:            /**
176:             * Set the Focus, Desktop - disabled.
177:             */
178:            public void setSecondary2(String color) {
179:                secondary2 = SColor.getColor(color);
180:            }
181:
182:            /**
183:             * Get Menu Background - disabled.
184:             */
185:            protected SColor getSecondary3() {
186:                return secondary3;
187:            }
188:
189:            /**
190:             * Set Menu Background - disabled.
191:             */
192:            public void setSecondary3(String color) {
193:                secondary3 = SColor.getColor(color);
194:            }
195:
196:            /**
197:             * Get Control Text sFont.
198:             */
199:            public SFont getControlTextFont() {
200:                return controlFont;
201:            }
202:
203:            /**
204:             * Set Control Text SFont.
205:             */
206:            public void setControlTextFont(String font) {
207:                controlFont = SFont.getFont(font);
208:            }
209:
210:            /**
211:             * Get System Text SFont.
212:             */
213:            public SFont getSystemTextFont() {
214:                return systemFont;
215:            }
216:
217:            /**
218:             * Set Control Text SFont.
219:             */
220:            public void setSystemTextFont(String font) {
221:                systemFont = SFont.getFont(font);
222:            }
223:
224:            /**
225:             * Get User Text SFont.
226:             */
227:            public SFont getUserTextFont() {
228:                return userFont;
229:            }
230:
231:            /**
232:             * Set Control Text SFont.
233:             */
234:            public void setUserTextFont(String font) {
235:                userFont = SFont.getFont(font);
236:            }
237:
238:            /**
239:             * Get Menu Text SFont.
240:             */
241:            public SFont getMenuTextFont() {
242:                return menuFont;
243:            }
244:
245:            /**
246:             * Set Menu Text SFont.
247:             */
248:            public void setMenuTextFont(String font) {
249:                menuFont = SFont.getFont(font);
250:            }
251:
252:            /**
253:             * Get Window Title SFont.
254:             */
255:            public SFont getWindowTitleFont() {
256:                return getControlTextFont();
257:            }
258:
259:            /**
260:             * Set Window Title SFont.
261:             */
262:            public void setWindowTitleFont(String font) {
263:                windowTitleFont = SFont.getFont(font);
264:            }
265:
266:            /**
267:             * Get Sub Text SFont.
268:             */
269:            public SFont getSubTextFont() {
270:                return subFont;
271:            }
272:
273:            /**
274:             * Get Sub Text SFont.
275:             */
276:            public void setSubTextFont(String font) {
277:                subFont = SFont.getFont(font);
278:            }
279:
280:            // PRIVATE //////////////////////////////////////////////////////////////////////////
281:
282:            private SColor primary1;
283:            private SColor primary2;
284:            private SColor primary3;
285:
286:            private SColor contrast1;
287:            private SColor contrast2;
288:            private SColor contrast3;
289:
290:            private SColor secondary1;
291:            private SColor secondary2;
292:            private SColor secondary3;
293:
294:            private SFont controlFont;
295:            private SFont systemFont;
296:            private SFont userFont;
297:            private SFont menuFont;
298:            private SFont windowTitleFont;
299:            private SFont subFont;
300:
301:            private String name;
302:            private Hashtable icons = new Hashtable();
303:
304:            static {
305:                try {
306:                    STheme
307:                            .putTheme((STheme) SComponentLoader
308:                                    .loadProperties(STheme.class
309:                                            .getResourceAsStream("metal/metal.properties")));
310:
311:                    STheme
312:                            .putTheme((STheme) SComponentLoader
313:                                    .loadProperties(STheme.class
314:                                            .getResourceAsStream("metal/emerald.properties")));
315:
316:                    STheme
317:                            .putTheme((STheme) SComponentLoader
318:                                    .loadProperties(STheme.class
319:                                            .getResourceAsStream("metal/aqua.properties")));
320:
321:                    STheme
322:                            .putTheme((STheme) SComponentLoader
323:                                    .loadProperties(STheme.class
324:                                            .getResourceAsStream("windows/windows.properties")));
325:                } catch (Exception e) {
326:                    e.printStackTrace();
327:                }
328:            }
329:
330:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.