KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > swing > plaf > aqua > AquaLFCustoms


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.swing.plaf.aqua;
21
22 import org.netbeans.swing.plaf.LFCustoms;
23 import org.netbeans.swing.plaf.util.GuaranteedValue;
24 import org.netbeans.swing.plaf.util.UIUtils;
25
26 import javax.swing.*;
27 import javax.swing.border.Border JavaDoc;
28 import javax.swing.plaf.FontUIResource JavaDoc;
29 import java.awt.*;
30
31
32 /** Default system-provided customizer for Windows XP LF
33  * Public only to be accessible by ProxyLazyValue, please don't abuse.
34  */

35 public final class AquaLFCustoms extends LFCustoms {
36
37
38     public Object JavaDoc[] createLookAndFeelCustomizationKeysAndValues() {
39         Integer JavaDoc cus = (Integer JavaDoc) UIManager.get("customFontSize"); //NOI18N
40
Object JavaDoc[] result;
41         if (cus != null) {
42             int uiFontSize = cus.intValue();
43             Font controlFont = new GuaranteedValue (new String JavaDoc[] {"controlFont", "Tree.font", "Label.font"},
44                                                 new FontUIResource JavaDoc("Dialog", Font.PLAIN, uiFontSize)).getFont(); //NOI18N
45
result = new Object JavaDoc[] {
46                 "Button.font", controlFont,
47                 "Tree.font", controlFont,
48                 "ToggleButton.font", controlFont,
49                 "Menu.font", controlFont,
50                 "MenuBar.font", controlFont,
51                 "MenuItem.font", controlFont,
52                 "CheckBoxMenuItem.font", controlFont,
53                 "RadioButtonMenuItem.font", controlFont,
54                 "PopupMenu.font", controlFont,
55                 "List.font", controlFont,
56                 "Label.font", controlFont,
57                 "ComboBox.font", controlFont,
58                 "PopupMenuSeparatorUI", "org.netbeans.swing.plaf.aqua.AquaSeparatorUI",
59                 "SeparatorUI", "org.netbeans.swing.plaf.aqua.AquaSeparatorUI",
60                 "PopupMenu.border", BorderFactory.createEmptyBorder(4, 0, 4, 0),
61                  SLIDING_BUTTON_UI, "org.netbeans.swing.tabcontrol.plaf.AquaSlidingButtonUI",
62
63                 EDITOR_ERRORSTRIPE_SCROLLBAR_INSETS, new Insets(18, 0, 18, 0),
64
65             }; //NOI18N
66
} else {
67             result = new Object JavaDoc[] {
68                 "controlFont", new GuaranteedValue (new String JavaDoc[] {"Label.font", "Tree.font"}, new FontUIResource JavaDoc("Dialog", Font.PLAIN, 14)).getFont(),
69                 "PopupMenuSeparatorUI", "org.netbeans.swing.plaf.aqua.AquaSeparatorUI",
70                 "SeparatorUI", "org.netbeans.swing.plaf.aqua.AquaSeparatorUI",
71                 "PopupMenu.border", BorderFactory.createEmptyBorder(4, 0, 4, 0),
72                  SLIDING_BUTTON_UI, "org.netbeans.swing.tabcontrol.plaf.AquaSlidingButtonUI",
73         
74                 EDITOR_ERRORSTRIPE_SCROLLBAR_INSETS, new Insets(18, 0, 18, 0),
75             };
76         }
77         return result;
78     }
79
80     public Object JavaDoc[] createApplicationSpecificKeysAndValues () {
81         Border JavaDoc topOnly = BorderFactory.createMatteBorder(1, 0, 0, 0,
82             UIManager.getColor("controlShadow").brighter()); //NOI18N
83
Border JavaDoc bottomOnly = BorderFactory.createMatteBorder(0, 0, 1, 0,
84             UIManager.getColor("controlShadow").brighter()); //NOI18N
85

86         Border JavaDoc empty = BorderFactory.createEmptyBorder();
87
88         Image explorerIcon = UIUtils.loadImage(
89             "org/netbeans/swing/plaf/resources/osx-folder.png"); //NOI18N
90

91         Border JavaDoc lowerBorder = new AquaRoundedLowerBorder();
92         Border JavaDoc tabsBorder = new AquaEditorTabControlBorder();
93
94         Object JavaDoc[] result = {
95             TOOLBAR_UI, "org.netbeans.swing.plaf.aqua.PlainAquaToolbarUI",
96
97             // XXX - EXPLORER_STATUS_BORDER,
98
DESKTOP_BACKGROUND, new Color(226, 223, 214), //NOI18N
99
SCROLLPANE_BORDER_COLOR, new Color(127, 157, 185),
100             EXPLORER_FOLDER_ICON ,explorerIcon,
101             EXPLORER_FOLDER_OPENED_ICON, explorerIcon,
102             DESKTOP_BORDER, empty,
103             SCROLLPANE_BORDER, UIManager.get("ScrollPane.border"),
104             EXPLORER_STATUS_BORDER, topOnly,
105             EDITOR_STATUS_LEFT_BORDER, topOnly,
106             EDITOR_STATUS_RIGHT_BORDER, topOnly,
107             EDITOR_STATUS_INNER_BORDER, topOnly,
108             EDITOR_STATUS_ONLYONEBORDER, topOnly,
109             EDITOR_TOOLBAR_BORDER, new PlainAquaToolbarUI.AquaTbBorder(),
110
111             EDITOR_TAB_OUTER_BORDER, BorderFactory.createEmptyBorder(),
112             EDITOR_TAB_CONTENT_BORDER, lowerBorder,
113             EDITOR_TAB_TABS_BORDER, tabsBorder,
114
115             VIEW_TAB_OUTER_BORDER, BorderFactory.createEmptyBorder(),
116             VIEW_TAB_TABS_BORDER, BorderFactory.createEmptyBorder(),
117             VIEW_TAB_CONTENT_BORDER, lowerBorder,
118
119
120             //UI Delegates for the tab control
121
EDITOR_TAB_DISPLAYER_UI, "org.netbeans.swing.tabcontrol.plaf.AquaEditorTabDisplayerUI",
122             VIEW_TAB_DISPLAYER_UI, "org.netbeans.swing.tabcontrol.plaf.AquaViewTabDisplayerUI",
123             SLIDING_TAB_BUTTON_UI, "org.netbeans.swing.tabcontrol.plaf.SlidingTabDisplayerButtonUI$Aqua",
124
125             EXPLORER_MINISTATUSBAR_BORDER, BorderFactory.createEmptyBorder(),
126             
127             "floatingBorder", new FakeDropShadowBorder(),
128                     
129             TAB_ACTIVE_SELECTION_FOREGROUND, new GuaranteedValue ("textText", Color.BLACK),
130                     
131             // progress component related
132
"nbProgressBar.Foreground", new Color(49, 106, 197),
133             "nbProgressBar.Background", Color.WHITE,
134             "nbProgressBar.popupDynaText.foreground", new Color(141, 136, 122),
135             "nbProgressBar.popupText.background", new Color(249, 249, 249),
136             "nbProgressBar.popupText.foreground", UIManager.getColor("TextField.foreground"),
137             "nbProgressBar.popupText.selectBackground", UIManager.getColor("List.selectionBackground"),
138             "nbProgressBar.popupText.selectForeground", UIManager.getColor("List.selectionForeground"),
139             PROGRESS_CANCEL_BUTTON_ICON, UIUtils.loadImage("org/netbeans/swing/plaf/resources/cancel_task_linux_mac.png"),
140                     
141         }; //NOI18N
142
return result;
143     }
144     
145     
146 }
147
Popular Tags