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.aqua;
043:
044: import org.netbeans.swing.plaf.LFCustoms;
045: import org.netbeans.swing.plaf.util.GuaranteedValue;
046: import org.netbeans.swing.plaf.util.UIUtils;
047:
048: import javax.swing.*;
049: import javax.swing.border.Border;
050: import javax.swing.plaf.FontUIResource;
051: import java.awt.*;
052:
053: /** Default system-provided customizer for Windows XP LF
054: * Public only to be accessible by ProxyLazyValue, please don't abuse.
055: */
056: public final class AquaLFCustoms extends LFCustoms {
057:
058: public Object[] createLookAndFeelCustomizationKeysAndValues() {
059: Integer cus = (Integer) UIManager.get("customFontSize"); //NOI18N
060: Object[] result;
061: if (cus != null) {
062: int uiFontSize = cus.intValue();
063: Font controlFont = new GuaranteedValue(
064: new String[] { "controlFont", "Tree.font",
065: "Label.font" },
066: new FontUIResource("Dialog", Font.PLAIN, uiFontSize))
067: .getFont(); //NOI18N
068: result = new Object[] {
069: "Button.font",
070: controlFont,
071: "Tree.font",
072: controlFont,
073: "ToggleButton.font",
074: controlFont,
075: "Menu.font",
076: controlFont,
077: "MenuBar.font",
078: controlFont,
079: "MenuItem.font",
080: controlFont,
081: "CheckBoxMenuItem.font",
082: controlFont,
083: "RadioButtonMenuItem.font",
084: controlFont,
085: "PopupMenu.font",
086: controlFont,
087: "List.font",
088: controlFont,
089: "Label.font",
090: controlFont,
091: "ComboBox.font",
092: controlFont,
093: "PopupMenuSeparatorUI",
094: "org.netbeans.swing.plaf.aqua.AquaSeparatorUI",
095: "SeparatorUI",
096: "org.netbeans.swing.plaf.aqua.AquaSeparatorUI",
097: "PopupMenu.border",
098: BorderFactory.createEmptyBorder(4, 0, 4, 0),
099: SLIDING_BUTTON_UI,
100: "org.netbeans.swing.tabcontrol.plaf.AquaSlidingButtonUI",
101:
102: EDITOR_ERRORSTRIPE_SCROLLBAR_INSETS,
103: new Insets(18, 0, 18, 0),
104:
105: }; //NOI18N
106: } else {
107: result = new Object[] {
108: "controlFont",
109: new GuaranteedValue(new String[] { "Label.font",
110: "Tree.font" }, new FontUIResource("Dialog",
111: Font.PLAIN, 14)).getFont(),
112: "PopupMenuSeparatorUI",
113: "org.netbeans.swing.plaf.aqua.AquaSeparatorUI",
114: "SeparatorUI",
115: "org.netbeans.swing.plaf.aqua.AquaSeparatorUI",
116: "PopupMenu.border",
117: BorderFactory.createEmptyBorder(4, 0, 4, 0),
118: SLIDING_BUTTON_UI,
119: "org.netbeans.swing.tabcontrol.plaf.AquaSlidingButtonUI",
120:
121: EDITOR_ERRORSTRIPE_SCROLLBAR_INSETS,
122: new Insets(18, 0, 18, 0), };
123: }
124: return result;
125: }
126:
127: public Object[] createApplicationSpecificKeysAndValues() {
128: Border topOnly = BorderFactory.createMatteBorder(1, 0, 0, 0,
129: UIManager.getColor("controlShadow").brighter()); //NOI18N
130: Border bottomOnly = BorderFactory.createMatteBorder(0, 0, 1, 0,
131: UIManager.getColor("controlShadow").brighter()); //NOI18N
132:
133: Border empty = BorderFactory.createEmptyBorder();
134:
135: Image explorerIcon = UIUtils
136: .loadImage("org/netbeans/swing/plaf/resources/osx-folder.png"); //NOI18N
137:
138: Border lowerBorder = new AquaRoundedLowerBorder();
139: Border tabsBorder = new AquaEditorTabControlBorder();
140:
141: Object[] result = {
142: TOOLBAR_UI,
143: "org.netbeans.swing.plaf.aqua.PlainAquaToolbarUI",
144:
145: // XXX - EXPLORER_STATUS_BORDER,
146: DESKTOP_BACKGROUND,
147: new Color(226, 223, 214), //NOI18N
148: SCROLLPANE_BORDER_COLOR,
149: new Color(127, 157, 185),
150: EXPLORER_FOLDER_ICON,
151: explorerIcon,
152: EXPLORER_FOLDER_OPENED_ICON,
153: explorerIcon,
154: DESKTOP_BORDER,
155: empty,
156: SCROLLPANE_BORDER,
157: UIManager.get("ScrollPane.border"),
158: EXPLORER_STATUS_BORDER,
159: topOnly,
160: EDITOR_STATUS_LEFT_BORDER,
161: topOnly,
162: EDITOR_STATUS_RIGHT_BORDER,
163: topOnly,
164: EDITOR_STATUS_INNER_BORDER,
165: topOnly,
166: EDITOR_STATUS_ONLYONEBORDER,
167: topOnly,
168: EDITOR_TOOLBAR_BORDER,
169: new PlainAquaToolbarUI.AquaTbBorder(),
170:
171: EDITOR_TAB_OUTER_BORDER,
172: BorderFactory.createEmptyBorder(),
173: EDITOR_TAB_CONTENT_BORDER,
174: lowerBorder,
175: EDITOR_TAB_TABS_BORDER,
176: tabsBorder,
177:
178: VIEW_TAB_OUTER_BORDER,
179: BorderFactory.createEmptyBorder(),
180: VIEW_TAB_TABS_BORDER,
181: BorderFactory.createEmptyBorder(),
182: VIEW_TAB_CONTENT_BORDER,
183: lowerBorder,
184:
185: //UI Delegates for the tab control
186: EDITOR_TAB_DISPLAYER_UI,
187: "org.netbeans.swing.tabcontrol.plaf.AquaEditorTabDisplayerUI",
188: VIEW_TAB_DISPLAYER_UI,
189: "org.netbeans.swing.tabcontrol.plaf.AquaViewTabDisplayerUI",
190: SLIDING_TAB_BUTTON_UI,
191: "org.netbeans.swing.tabcontrol.plaf.SlidingTabDisplayerButtonUI$Aqua",
192:
193: EXPLORER_MINISTATUSBAR_BORDER,
194: BorderFactory.createEmptyBorder(),
195:
196: "floatingBorder",
197: new FakeDropShadowBorder(),
198:
199: TAB_ACTIVE_SELECTION_FOREGROUND,
200: new GuaranteedValue("textText", Color.BLACK),
201:
202: // progress component related
203: "nbProgressBar.Foreground",
204: new Color(49, 106, 197),
205: "nbProgressBar.Background",
206: Color.WHITE,
207: "nbProgressBar.popupDynaText.foreground",
208: new Color(141, 136, 122),
209: "nbProgressBar.popupText.background",
210: new Color(249, 249, 249),
211: "nbProgressBar.popupText.foreground",
212: UIManager.getColor("TextField.foreground"),
213: "nbProgressBar.popupText.selectBackground",
214: UIManager.getColor("List.selectionBackground"),
215: "nbProgressBar.popupText.selectForeground",
216: UIManager.getColor("List.selectionForeground"),
217: PROGRESS_CANCEL_BUTTON_ICON,
218: UIUtils
219: .loadImage("org/netbeans/swing/plaf/resources/cancel_task_linux_mac.png"),
220:
221: }; //NOI18N
222: return result;
223: }
224:
225: }
|