Source Code Cross Referenced for VistaLFCustoms.java in  » IDE-Netbeans » library » org » netbeans » swing » plaf » winvista » 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 » IDE Netbeans » library » org.netbeans.swing.plaf.winvista 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003:         *
004:         * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005:         *
006:         * The contents of this file are subject to the terms of either the GNU
007:         * General Public License Version 2 only ("GPL") or the Common
008:         * Development and Distribution License("CDDL") (collectively, the
009:         * "License"). You may not use this file except in compliance with the
010:         * License. You can obtain a copy of the License at
011:         * http://www.netbeans.org/cddl-gplv2.html
012:         * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013:         * specific language governing permissions and limitations under the
014:         * License.  When distributing the software, include this License Header
015:         * Notice in each file and include the License file at
016:         * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
017:         * particular file as subject to the "Classpath" exception as provided
018:         * by Sun in the GPL Version 2 section of the License file that
019:         * accompanied this code. If applicable, add the following below the
020:         * License Header, with the fields enclosed by brackets [] replaced by
021:         * your own identifying information:
022:         * "Portions Copyrighted [year] [name of copyright owner]"
023:         *
024:         * Contributor(s):
025:         *
026:         * The Original Software is NetBeans. The Initial Developer of the Original
027:         * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028:         * Microsystems, Inc. All Rights Reserved.
029:         *
030:         * If you wish your version of this file to be governed by only the CDDL
031:         * or only the GPL Version 2, indicate your decision by adding
032:         * "[Contributor] elects to include this software in this distribution
033:         * under the [CDDL or GPL Version 2] license." If you do not indicate a
034:         * single choice of license, a recipient has the option to distribute
035:         * your version of this file under either the CDDL, the GPL Version 2 or
036:         * to extend the choice of license to its licensees as provided above.
037:         * However, if you add GPL Version 2 code and therefore, elected the GPL
038:         * Version 2 license, then the option applies only if the new code is
039:         * made subject to such option by the copyright holder.
040:         */
041:
042:        package org.netbeans.swing.plaf.winvista;
043:
044:        import java.awt.GraphicsEnvironment;
045:        import java.util.Locale;
046:        import javax.swing.UIManager;
047:        import javax.swing.plaf.ColorUIResource;
048:        import javax.swing.plaf.FontUIResource;
049:        import org.netbeans.swing.plaf.LFCustoms;
050:        import org.netbeans.swing.plaf.util.GuaranteedValue;
051:        import org.netbeans.swing.plaf.util.UIBootstrapValue;
052:        import org.netbeans.swing.plaf.util.UIUtils;
053:
054:        import javax.swing.*;
055:        import javax.swing.border.EmptyBorder;
056:        import javax.swing.border.MatteBorder;
057:        import java.awt.*;
058:
059:        /** Default system-provided customizer for Windows Vista LF 
060:         * Public only to be accessible by ProxyLazyValue, please don't abuse.
061:         */
062:        public final class VistaLFCustoms extends LFCustoms {
063:            private static final String TAB_FOCUS_FILL_UPPER = "tab_focus_fill_upper"; //NOI18N    
064:            private static final String TAB_FOCUS_FILL_DARK_LOWER = "tab_focus_fill_dark_lower"; //NOI18N    
065:            private static final String TAB_FOCUS_FILL_BRIGHT_LOWER = "tab_focus_fill_bright_lower"; //NOI18N 
066:
067:            private static final String TAB_UNSEL_FILL_DARK_UPPER = "tab_unsel_fill_dark_upper"; //NOI18N
068:            private static final String TAB_UNSEL_FILL_BRIGHT_UPPER = "tab_unsel_fill_bright_upper"; //NOI18N  
069:            private static final String TAB_UNSEL_FILL_DARK_LOWER = "tab_unsel_fill_dark_lower"; //NOI18N
070:            private static final String TAB_UNSEL_FILL_BRIGHT_LOWER = "tab_unsel_fill_bright_lower"; //NOI18N  
071:
072:            private static final String TAB_SEL_FILL = "tab_sel_fill"; //NOI18N
073:
074:            private static final String TAB_MOUSE_OVER_FILL_BRIGHT_UPPER = "tab_mouse_over_fill_bright_upper"; //NOI18N
075:            private static final String TAB_MOUSE_OVER_FILL_DARK_UPPER = "tab_mouse_over_fill_dark_upper"; //NOI18N
076:            private static final String TAB_MOUSE_OVER_FILL_BRIGHT_LOWER = "tab_mouse_over_fill_bright_lower"; //NOI18N
077:            private static final String TAB_MOUSE_OVER_FILL_DARK_LOWER = "tab_mouse_over_fill_dark_lower"; //NOI18N
078:
079:            private static final String TAB_BORDER = "tab_border"; //NOI18N      
080:            private static final String TAB_SEL_BORDER = "tab_sel_border"; //NOI18N
081:            private static final String TAB_BORDER_INNER = "tab_border_inner"; //NOI18N      
082:
083:            static final String SCROLLPANE_BORDER_COLOR = "scrollpane_border"; //NOI18N
084:
085:            public Object[] createLookAndFeelCustomizationKeysAndValues() {
086:                int fontsize = 11;
087:                Integer in = (Integer) UIManager.get(CUSTOM_FONT_SIZE); //NOI18N
088:                if (in != null) {
089:                    fontsize = in.intValue();
090:                }
091:
092:                Object[] result = new Object[] {
093:                        //Work around a bug in windows which sets the text area font to
094:                        //"MonoSpaced", causing all accessible dialogs to have monospaced text
095:                        "TextArea.font",
096:                        new GuaranteedValue("Label.font", new Font("Dialog",
097:                                Font.PLAIN, fontsize)),
098:
099:                        EDITOR_ERRORSTRIPE_SCROLLBAR_INSETS,
100:                        new Insets(17, 0, 17, 0), };
101:
102:                return result;
103:            }
104:
105:            public Object[] createApplicationSpecificKeysAndValues() {
106:                UIBootstrapValue editorTabsUI = new VistaEditorColorings(
107:                        "org.netbeans.swing.tabcontrol.plaf.WinVistaEditorTabDisplayerUI");
108:
109:                Object viewTabsUI = editorTabsUI
110:                        .createShared("org.netbeans.swing.tabcontrol.plaf.WinVistaViewTabDisplayerUI");
111:
112:                //TODO change icon (copy & paste)
113:                Image explorerIcon = UIUtils
114:                        .loadImage("org/netbeans/swing/plaf/resources/vista_folder.png");
115:
116:                Object propertySheetValues = new VistaPropertySheetColorings();
117:
118:                Object[] uiDefaults = {
119:                        EDITOR_TAB_DISPLAYER_UI,
120:                        editorTabsUI,
121:                        VIEW_TAB_DISPLAYER_UI,
122:                        viewTabsUI,
123:
124:                        DESKTOP_BACKGROUND,
125:                        new Color(226, 223, 214), //NOI18N
126:                        SCROLLPANE_BORDER_COLOR,
127:                        new Color(127, 157, 185),
128:                        DESKTOP_BORDER,
129:                        new EmptyBorder(6, 5, 4, 6),
130:                        SCROLLPANE_BORDER,
131:                        UIManager.get("ScrollPane.border"),
132:                        EXPLORER_STATUS_BORDER,
133:                        new StatusLineBorder(StatusLineBorder.TOP),
134:                        EXPLORER_FOLDER_ICON,
135:                        explorerIcon,
136:                        EXPLORER_FOLDER_OPENED_ICON,
137:                        explorerIcon,
138:                        EDITOR_STATUS_LEFT_BORDER,
139:                        new StatusLineBorder(StatusLineBorder.TOP
140:                                | StatusLineBorder.RIGHT),
141:                        EDITOR_STATUS_RIGHT_BORDER,
142:                        new StatusLineBorder(StatusLineBorder.TOP
143:                                | StatusLineBorder.LEFT),
144:                        EDITOR_STATUS_INNER_BORDER,
145:                        new StatusLineBorder(StatusLineBorder.TOP
146:                                | StatusLineBorder.LEFT
147:                                | StatusLineBorder.RIGHT),
148:                        EDITOR_STATUS_ONLYONEBORDER,
149:                        new StatusLineBorder(StatusLineBorder.TOP),
150:                        EDITOR_TOOLBAR_BORDER,
151:                        new EditorToolbarBorder(),
152:                        OUTPUT_SELECTION_BACKGROUND,
153:                        new Color(164, 180, 255),
154:
155:                        PROPERTYSHEET_BOOTSTRAP,
156:                        propertySheetValues,
157:
158:                        WORKPLACE_FILL,
159:                        new Color(226, 223, 214),
160:
161:                        DESKTOP_SPLITPANE_BORDER,
162:                        BorderFactory.createEmptyBorder(4, 0, 0, 0),
163:                        SLIDING_BUTTON_UI,
164:                        "org.netbeans.swing.tabcontrol.plaf.WinVistaSlidingButtonUI",
165:
166:                        // progress component related
167:                        "nbProgressBar.Foreground",
168:                        new Color(49, 106, 197),
169:                        "nbProgressBar.Background",
170:                        Color.WHITE,
171:                        "nbProgressBar.popupDynaText.foreground",
172:                        new Color(115, 115, 115),
173:                        "nbProgressBar.popupText.background",
174:                        new Color(249, 249, 249),
175:                        "nbProgressBar.popupText.foreground",
176:                        UIManager.getColor("TextField.foreground"),
177:                        "nbProgressBar.popupText.selectBackground",
178:                        UIManager.getColor("List.selectionBackground"),
179:                        "nbProgressBar.popupText.selectForeground",
180:                        UIManager.getColor("List.selectionForeground"),
181:                        PROGRESS_CANCEL_BUTTON_ICON,
182:                        UIUtils
183:                                .loadImage("org/netbeans/swing/plaf/resources/vista_mini_close_enabled.png"),
184:                        PROGRESS_CANCEL_BUTTON_ROLLOVER_ICON,
185:                        UIUtils
186:                                .loadImage("org/netbeans/swing/plaf/resources/vista_mini_close_over.png"),
187:                        PROGRESS_CANCEL_BUTTON_PRESSED_ICON,
188:                        UIUtils
189:                                .loadImage("org/netbeans/swing/plaf/resources/vista_mini_close_pressed.png")
190:
191:                }; //NOI18N
192:
193:                //Workaround for JDK 1.5.0 bug 5080144 - Disabled JTextFields stay white
194:                //XPTheme uses Color instead of ColorUIResource
195:                convert("TextField.background"); //NOI18N
196:                convert("TextField.inactiveBackground"); //NOI18N
197:                convert("TextField.disabledBackground"); //NOI18N
198:
199:                //#108517 - turn off ctrl+page_up and ctrl+page_down mapping
200:                return UIUtils
201:                        .addInputMapsWithoutCtrlPageUpAndCtrlPageDown(uiDefaults);
202:            }
203:
204:            /**
205:             * Takes a UIManager color key and ensures that it is stored as a 
206:             * ColorUIResource, not a Color. 
207:             */
208:            private static final void convert(String key) {
209:                Color c = UIManager.getColor(key);
210:                if (c != null && !(c instanceof  ColorUIResource)) {
211:                    UIManager.put(key, new ColorUIResource(c));
212:                }
213:            }
214:
215:            protected Object[] additionalKeys() {
216:                Object[] kv = new VistaEditorColorings("")
217:                        .createKeysAndValues();
218:                Object[] kv2 = new VistaPropertySheetColorings()
219:                        .createKeysAndValues();
220:                Object[] result = new Object[(kv.length / 2) + (kv2.length / 2)];
221:                int ct = 0;
222:                for (int i = 0; i < kv.length; i += 2) {
223:                    result[ct] = kv[i];
224:                    ct++;
225:                }
226:                for (int i = 0; i < kv2.length; i += 2) {
227:                    result[ct] = kv2[i];
228:                    ct++;
229:                }
230:                return result;
231:            }
232:
233:            private class VistaEditorColorings extends UIBootstrapValue.Lazy {
234:                public VistaEditorColorings(String name) {
235:                    super (name);
236:                }
237:
238:                public Object[] createKeysAndValues() {
239:                    return new Object[] {
240:                            //Tab control - XXX REPLACE WITH RelativeColor - need to figure out base
241:                            //colors for each color
242:                            //selected & focused
243:                            TAB_FOCUS_FILL_UPPER,
244:                            new Color(242, 249, 252),
245:                            TAB_FOCUS_FILL_BRIGHT_LOWER,
246:                            new Color(225, 241, 249),
247:                            TAB_FOCUS_FILL_DARK_LOWER,
248:                            new Color(216, 236, 246),
249:
250:                            //no selection, no focus
251:                            TAB_UNSEL_FILL_BRIGHT_UPPER,
252:                            new Color(235, 235, 235),
253:                            TAB_UNSEL_FILL_DARK_UPPER,
254:                            new Color(229, 229, 229),
255:                            TAB_UNSEL_FILL_BRIGHT_LOWER,
256:                            new Color(214, 214, 214),
257:                            TAB_UNSEL_FILL_DARK_LOWER,
258:                            new Color(203, 203, 203),
259:
260:                            //selected, no focus
261:                            TAB_SEL_FILL,
262:                            new Color(244, 244, 244),
263:
264:                            //no selection, mouse over
265:                            TAB_MOUSE_OVER_FILL_BRIGHT_UPPER,
266:                            new Color(223, 242, 252),
267:                            TAB_MOUSE_OVER_FILL_DARK_UPPER,
268:                            new Color(214, 239, 252),
269:                            TAB_MOUSE_OVER_FILL_BRIGHT_LOWER,
270:                            new Color(189, 228, 250),
271:                            TAB_MOUSE_OVER_FILL_DARK_LOWER,
272:                            new Color(171, 221, 248),
273:
274:                            TAB_BORDER,
275:                            new Color(137, 140, 149),
276:                            TAB_SEL_BORDER,
277:                            new Color(60, 127, 177),
278:                            TAB_BORDER_INNER,
279:                            new Color(255, 255, 255),
280:
281:                            //Borders for the tab control
282:                            EDITOR_TAB_OUTER_BORDER,
283:                            BorderFactory.createEmptyBorder(),
284:                            EDITOR_TAB_CONTENT_BORDER,
285:                            new MatteBorder(0, 1, 1, 1,
286:                                    new Color(137, 140, 149)),
287:                            EDITOR_TAB_TABS_BORDER,
288:                            BorderFactory.createEmptyBorder(),
289:
290:                            VIEW_TAB_OUTER_BORDER,
291:                            BorderFactory.createEmptyBorder(),
292:                            VIEW_TAB_CONTENT_BORDER,
293:                            new MatteBorder(0, 1, 1, 1,
294:                                    new Color(137, 140, 149)),
295:                            VIEW_TAB_TABS_BORDER,
296:                            BorderFactory.createEmptyBorder(), };
297:                }
298:            }
299:
300:            private class VistaPropertySheetColorings extends
301:                    UIBootstrapValue.Lazy {
302:                public VistaPropertySheetColorings() {
303:                    super ("propertySheet"); //NOI18N
304:                }
305:
306:                public Object[] createKeysAndValues() {
307:                    return new Object[] { PROPSHEET_SELECTION_BACKGROUND,
308:                            new Color(49, 106, 197),
309:                            PROPSHEET_SELECTION_FOREGROUND, Color.WHITE,
310:                            PROPSHEET_SET_BACKGROUND, new Color(213, 213, 213),
311:                            PROPSHEET_SET_FOREGROUND, Color.BLACK,
312:                            PROPSHEET_SELECTED_SET_BACKGROUND,
313:                            new Color(49, 106, 197),
314:                            PROPSHEET_SELECTED_SET_FOREGROUND, Color.WHITE,
315:                            PROPSHEET_DISABLED_FOREGROUND,
316:                            new Color(161, 161, 146),
317:                            PROPSHEET_BUTTON_FOREGROUND, Color.BLACK, };
318:                }
319:            }
320:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.