Source Code Cross Referenced for JTaskPaneGroupAddon.java in  » Swing-Library » l2fprod-common » com » l2fprod » common » swing » plaf » 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 » l2fprod common » com.l2fprod.common.swing.plaf 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * L2FProd.com Common Components 7.3 License.
003:         *
004:         * Copyright 2005-2007 L2FProd.com
005:         *
006:         * Licensed under the Apache License, Version 2.0 (the "License");
007:         * you may not use this file except in compliance with the License.
008:         * You may obtain a copy of the License at
009:         *
010:         *     http://www.apache.org/licenses/LICENSE-2.0
011:         *
012:         * Unless required by applicable law or agreed to in writing, software
013:         * distributed under the License is distributed on an "AS IS" BASIS,
014:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015:         * See the License for the specific language governing permissions and
016:         * limitations under the License.
017:         */package com.l2fprod.common.swing.plaf;
018:
019:        import com.l2fprod.common.swing.JTaskPaneGroup;
020:        import com.l2fprod.common.swing.plaf.windows.WindowsClassicLookAndFeelAddons;
021:        import com.l2fprod.common.swing.plaf.windows.WindowsLookAndFeelAddons;
022:        import com.l2fprod.common.util.JVM;
023:        import com.l2fprod.common.util.OS;
024:
025:        import java.awt.Color;
026:        import java.awt.Font;
027:        import java.awt.SystemColor;
028:        import java.awt.Toolkit;
029:        import java.lang.reflect.Method;
030:        import java.util.Arrays;
031:        import java.util.List;
032:
033:        import javax.swing.UIDefaults;
034:        import javax.swing.UIManager;
035:        import javax.swing.plaf.ColorUIResource;
036:        import javax.swing.plaf.FontUIResource;
037:        import javax.swing.plaf.metal.MetalLookAndFeel;
038:
039:        /**
040:         * Addon for <code>JTaskPaneGroup</code>.<br>
041:         *
042:         * @author <a href="mailto:fred@L2FProd.com">Frederic Lavigne</a>
043:         */
044:        public class JTaskPaneGroupAddon extends AbstractComponentAddon {
045:
046:            public JTaskPaneGroupAddon() {
047:                super ("JTaskPaneGroup");
048:            }
049:
050:            protected void addBasicDefaults(LookAndFeelAddons addon,
051:                    List defaults) {
052:                Font taskPaneFont = UIManager.getFont("Label.font");
053:                if (taskPaneFont == null) {
054:                    taskPaneFont = new Font("Dialog", Font.PLAIN, 12);
055:                }
056:                taskPaneFont = taskPaneFont.deriveFont(Font.BOLD);
057:
058:                Color menuBackground = new ColorUIResource(SystemColor.menu);
059:                defaults
060:                        .addAll(Arrays
061:                                .asList(new Object[] {
062:                                        JTaskPaneGroup.UI_CLASS_ID,
063:                                        "com.l2fprod.common.swing.plaf.basic.BasicTaskPaneGroupUI",
064:                                        "TaskPaneGroup.font",
065:                                        new FontUIResource(taskPaneFont),
066:                                        "TaskPaneGroup.background",
067:                                        UIManager.getColor("List.background"),
068:                                        "TaskPaneGroup.specialTitleBackground",
069:                                        new ColorUIResource(menuBackground
070:                                                .darker()),
071:                                        "TaskPaneGroup.titleBackgroundGradientStart",
072:                                        menuBackground,
073:                                        "TaskPaneGroup.titleBackgroundGradientEnd",
074:                                        menuBackground,
075:                                        "TaskPaneGroup.titleForeground",
076:                                        new ColorUIResource(
077:                                                SystemColor.menuText),
078:                                        "TaskPaneGroup.specialTitleForeground",
079:                                        new ColorUIResource(
080:                                                SystemColor.menuText)
081:                                                .brighter(),
082:                                        "TaskPaneGroup.animate",
083:                                        Boolean.TRUE,
084:                                        "TaskPaneGroup.focusInputMap",
085:                                        new UIDefaults.LazyInputMap(
086:                                                new Object[] { "ENTER",
087:                                                        "toggleExpanded",
088:                                                        "SPACE",
089:                                                        "toggleExpanded" }), }));
090:            }
091:
092:            protected void addMetalDefaults(LookAndFeelAddons addon,
093:                    List defaults) {
094:                super .addMetalDefaults(addon, defaults);
095:                // if using Ocean, use the Glossy l&f
096:                String taskPaneGroupUI = "com.l2fprod.common.swing.plaf.metal.MetalTaskPaneGroupUI";
097:                if (JVM.current().isOrLater(JVM.JDK1_5)) {
098:                    try {
099:                        Method method = MetalLookAndFeel.class.getMethod(
100:                                "getCurrentTheme", null);
101:                        Object currentTheme = method.invoke(null, null);
102:                        if (Class.forName("javax.swing.plaf.metal.OceanTheme")
103:                                .isInstance(currentTheme)) {
104:                            taskPaneGroupUI = "com.l2fprod.common.swing.plaf.misc.GlossyTaskPaneGroupUI";
105:                        }
106:                    } catch (Exception e) {
107:                    }
108:                }
109:                defaults.addAll(Arrays.asList(new Object[] {
110:                        JTaskPaneGroup.UI_CLASS_ID, taskPaneGroupUI,
111:                        "TaskPaneGroup.foreground",
112:                        UIManager.getColor("activeCaptionText"),
113:                        "TaskPaneGroup.background",
114:                        MetalLookAndFeel.getControl(),
115:                        "TaskPaneGroup.specialTitleBackground",
116:                        MetalLookAndFeel.getPrimaryControl(),
117:                        "TaskPaneGroup.titleBackgroundGradientStart",
118:                        MetalLookAndFeel.getPrimaryControl(),
119:                        "TaskPaneGroup.titleBackgroundGradientEnd",
120:                        MetalLookAndFeel.getPrimaryControlHighlight(),
121:                        "TaskPaneGroup.titleForeground",
122:                        MetalLookAndFeel.getControlTextColor(),
123:                        "TaskPaneGroup.specialTitleForeground",
124:                        MetalLookAndFeel.getControlTextColor(),
125:                        "TaskPaneGroup.borderColor",
126:                        MetalLookAndFeel.getPrimaryControl(),
127:                        "TaskPaneGroup.titleOver",
128:                        MetalLookAndFeel.getControl().darker(),
129:                        "TaskPaneGroup.specialTitleOver",
130:                        MetalLookAndFeel.getPrimaryControlHighlight() }));
131:            }
132:
133:            protected void addWindowsDefaults(LookAndFeelAddons addon,
134:                    List defaults) {
135:                super .addWindowsDefaults(addon, defaults);
136:
137:                if (addon instanceof  WindowsLookAndFeelAddons) {
138:                    defaults
139:                            .addAll(Arrays
140:                                    .asList(new Object[] {
141:                                            JTaskPaneGroup.UI_CLASS_ID,
142:                                            "com.l2fprod.common.swing.plaf.windows.WindowsTaskPaneGroupUI" }));
143:
144:                    String xpStyle = OS.getWindowsVisualStyle();
145:                    if (WindowsLookAndFeelAddons.HOMESTEAD_VISUAL_STYLE
146:                            .equalsIgnoreCase(xpStyle)) {
147:                        defaults.addAll(Arrays.asList(new Object[] {
148:                                "TaskPaneGroup.foreground",
149:                                new ColorUIResource(86, 102, 45),
150:                                "TaskPaneGroup.background",
151:                                new ColorUIResource(246, 246, 236),
152:                                "TaskPaneGroup.specialTitleBackground",
153:                                new ColorUIResource(224, 231, 184),
154:                                "TaskPaneGroup.titleBackgroundGradientStart",
155:                                new ColorUIResource(255, 255, 255),
156:                                "TaskPaneGroup.titleBackgroundGradientEnd",
157:                                new ColorUIResource(224, 231, 184),
158:                                "TaskPaneGroup.titleForeground",
159:                                new ColorUIResource(86, 102, 45),
160:                                "TaskPaneGroup.titleOver",
161:                                new ColorUIResource(114, 146, 29),
162:                                "TaskPaneGroup.specialTitleForeground",
163:                                new ColorUIResource(86, 102, 45),
164:                                "TaskPaneGroup.specialTitleOver",
165:                                new ColorUIResource(114, 146, 29),
166:                                "TaskPaneGroup.borderColor",
167:                                new ColorUIResource(255, 255, 255), }));
168:                    } else if (WindowsLookAndFeelAddons.SILVER_VISUAL_STYLE
169:                            .equalsIgnoreCase(xpStyle)) {
170:                        defaults.addAll(Arrays.asList(new Object[] {
171:                                "TaskPaneGroup.foreground",
172:                                new ColorUIResource(Color.black),
173:                                "TaskPaneGroup.background",
174:                                new ColorUIResource(240, 241, 245),
175:                                "TaskPaneGroup.specialTitleBackground",
176:                                new ColorUIResource(222, 222, 222),
177:                                "TaskPaneGroup.titleBackgroundGradientStart",
178:                                new ColorUIResource(Color.white),
179:                                "TaskPaneGroup.titleBackgroundGradientEnd",
180:                                new ColorUIResource(214, 215, 224),
181:                                "TaskPaneGroup.titleForeground",
182:                                new ColorUIResource(Color.black),
183:                                "TaskPaneGroup.titleOver",
184:                                new ColorUIResource(126, 124, 124),
185:                                "TaskPaneGroup.specialTitleForeground",
186:                                new ColorUIResource(Color.black),
187:                                "TaskPaneGroup.specialTitleOver",
188:                                new ColorUIResource(126, 124, 124),
189:                                "TaskPaneGroup.borderColor",
190:                                new ColorUIResource(Color.white), }));
191:                    } else if (OS.isWindowsVista()) {
192:                        final Toolkit toolkit = Toolkit.getDefaultToolkit();
193:                        defaults
194:                                .addAll(Arrays
195:                                        .asList(new Object[] {
196:                                                "TaskPaneGroup.foreground",
197:                                                new ColorUIResource(Color.white),
198:                                                "TaskPaneGroup.background",
199:                                                new ColorUIResource(
200:                                                        (Color) toolkit
201:                                                                .getDesktopProperty("win.3d.backgroundColor")),
202:                                                "TaskPaneGroup.specialTitleBackground",
203:                                                new ColorUIResource(33, 89, 201),
204:                                                "TaskPaneGroup.titleBackgroundGradientStart",
205:                                                new ColorUIResource(Color.white),
206:                                                "TaskPaneGroup.titleBackgroundGradientEnd",
207:                                                new ColorUIResource(
208:                                                        (Color) toolkit
209:                                                                .getDesktopProperty("win.frame.inactiveCaptionColor")),
210:                                                "TaskPaneGroup.titleForeground",
211:                                                new ColorUIResource(
212:                                                        (Color) toolkit
213:                                                                .getDesktopProperty("win.frame.inactiveCaptionTextColor")),
214:                                                "TaskPaneGroup.specialTitleForeground",
215:                                                new ColorUIResource(Color.white),
216:                                                "TaskPaneGroup.borderColor",
217:                                                new ColorUIResource(Color.white), }));
218:                    } else {
219:                        defaults.addAll(Arrays.asList(new Object[] {
220:                                "TaskPaneGroup.foreground",
221:                                new ColorUIResource(Color.white),
222:                                "TaskPaneGroup.background",
223:                                new ColorUIResource(214, 223, 247),
224:                                "TaskPaneGroup.specialTitleBackground",
225:                                new ColorUIResource(33, 89, 201),
226:                                "TaskPaneGroup.titleBackgroundGradientStart",
227:                                new ColorUIResource(Color.white),
228:                                "TaskPaneGroup.titleBackgroundGradientEnd",
229:                                new ColorUIResource(199, 212, 247),
230:                                "TaskPaneGroup.titleForeground",
231:                                new ColorUIResource(33, 89, 201),
232:                                "TaskPaneGroup.specialTitleForeground",
233:                                new ColorUIResource(Color.white),
234:                                "TaskPaneGroup.borderColor",
235:                                new ColorUIResource(Color.white), }));
236:                    }
237:                }
238:
239:                if (addon instanceof  WindowsClassicLookAndFeelAddons) {
240:                    defaults
241:                            .addAll(Arrays
242:                                    .asList(new Object[] {
243:                                            JTaskPaneGroup.UI_CLASS_ID,
244:                                            "com.l2fprod.common.swing.plaf.windows.WindowsClassicTaskPaneGroupUI",
245:                                            "TaskPaneGroup.foreground",
246:                                            new ColorUIResource(Color.black),
247:                                            "TaskPaneGroup.background",
248:                                            new ColorUIResource(Color.white),
249:                                            "TaskPaneGroup.specialTitleBackground",
250:                                            new ColorUIResource(10, 36, 106),
251:                                            "TaskPaneGroup.titleBackgroundGradientStart",
252:                                            new ColorUIResource(212, 208, 200),
253:                                            "TaskPaneGroup.titleBackgroundGradientEnd",
254:                                            new ColorUIResource(212, 208, 200),
255:                                            "TaskPaneGroup.titleForeground",
256:                                            new ColorUIResource(Color.black),
257:                                            "TaskPaneGroup.specialTitleForeground",
258:                                            new ColorUIResource(Color.white),
259:                                            "TaskPaneGroup.borderColor",
260:                                            new ColorUIResource(212, 208, 200), }));
261:                }
262:            }
263:
264:            protected void addMacDefaults(LookAndFeelAddons addon, List defaults) {
265:                super .addMacDefaults(addon, defaults);
266:                defaults
267:                        .addAll(Arrays
268:                                .asList(new Object[] {
269:                                        JTaskPaneGroup.UI_CLASS_ID,
270:                                        "com.l2fprod.common.swing.plaf.misc.GlossyTaskPaneGroupUI",
271:                                        "TaskPaneGroup.background",
272:                                        new ColorUIResource(245, 245, 245),
273:                                        "TaskPaneGroup.titleForeground",
274:                                        new ColorUIResource(Color.black),
275:                                        "TaskPaneGroup.specialTitleBackground",
276:                                        new ColorUIResource(188, 188, 188),
277:                                        "TaskPaneGroup.specialTitleForeground",
278:                                        new ColorUIResource(Color.black),
279:                                        "TaskPaneGroup.titleBackgroundGradientStart",
280:                                        new ColorUIResource(250, 250, 250),
281:                                        "TaskPaneGroup.titleBackgroundGradientEnd",
282:                                        new ColorUIResource(188, 188, 188),
283:                                        "TaskPaneGroup.borderColor",
284:                                        new ColorUIResource(97, 97, 97),
285:                                        "TaskPaneGroup.titleOver",
286:                                        new ColorUIResource(125, 125, 97),
287:                                        "TaskPaneGroup.specialTitleOver",
288:                                        new ColorUIResource(125, 125, 97), }));
289:            }
290:
291:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.