/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* <p>These classes are designed to be used while the
* corresponding <code>LookAndFeel</code> class has been installed
* (<code>UIManager.setLookAndFeel(new <i>XXX</i>LookAndFeel())</code>).
* Using them while a different <code>LookAndFeel</code> is installed
* may produce unexpected results, including exceptions.
* Additionally, changing the <code>LookAndFeel</code>
* maintained by the <code>UIManager</code> without updating the
* corresponding <code>ComponentUI</code> of any
* <code>JComponent</code>s may also produce unexpected results,
* such as the wrong colors showing up, and is generally not
* encouraged.
*
*/
/**
* Implements the Windows95/98/NT/2000 Look and Feel.
* UI classes not implemented specifically for Windows will
* default to those implemented in Basic.
* <p>
* <strong>Warning:</strong>
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is appropriate
* for short term storage or RMI between applications running the same
* version of Swing. A future release of Swing will provide support for
* long term persistence.
*
* @author unattributed
*/
{
/**
* A client property that can be used with any JComponent that will end up
* calling the LookAndFeel.getDisabledIcon method. This client property,
* when set to Boolean.TRUE, will cause getDisabledIcon to use an
* alternate algorithm for creating disabled icons to produce icons
* that appear similar to the native Windows file chooser
*/
"WindowsLookAndFeel.generateHiResDisabledIcon");
private boolean updatePending = false;
private boolean useSystemFontSettings = true;
private boolean useSystemFontSizeSettings;
// These properties are not used directly, but are kept as
// private members to avoid being GC'd.
/**
* Base dialog units along the horizontal axis.
*/
private int baseUnitX;
/**
* Base dialog units along the vertical axis.
*/
private int baseUnitY;
return "Windows";
}
return "The Microsoft Windows Look and Feel";
}
return "Windows";
}
public boolean isNativeLookAndFeel() {
}
public boolean isSupportedLookAndFeel() {
return isNativeLookAndFeel();
}
public void initialize() {
super.initialize();
// Set the flag which determines which version of Windows should
// be rendered. This flag only need to be set once.
// if version <= 4.0 then the classic LAF should be loaded.
isClassicWindows = true;
} else {
isClassicWindows = false;
}
// Using the fonts set by the user can potentially cause
// performance and compatibility issues, so allow this feature
// to be switched off either at runtime or programmatically
//
new GetPropertyAction("swing.useSystemFontSettings"));
if (useSystemFontSettings) {
}
}
/**
* Initialize the uiClassID to BasicComponentUI mapping.
* The JComponent classes define their own uiClassID constants
* (see AbstractComponent.getUIClassID). This table must
* map those constants to a BasicComponentUI class of the
* appropriate type.
*
* @see BasicLookAndFeel#getDefaults
*/
{
super.initClassDefaults(table);
Object[] uiDefaults = {
};
}
/**
* Load the SystemColors into the defaults table. The keys
* for SystemColor defaults are the same as the names of
* the public fields in SystemColor. If the table is being
* created on a native Windows platform we use the SystemColor
* values, otherwise we create color objects whose values match
* the defaults Windows95 colors.
*/
{
String[] defaultSystemColors = {
"desktop", "#005C5C", /* Color of the desktop background */
"activeCaption", "#000080", /* Color for captions (title bars) when they are active. */
"activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */
"activeCaptionBorder", "#C0C0C0", /* Border color for caption (title bar) window borders. */
"inactiveCaption", "#808080", /* Color for captions (title bars) when not active. */
"inactiveCaptionText", "#C0C0C0", /* Text color for text in inactive captions (title bars). */
"inactiveCaptionBorder", "#C0C0C0", /* Border color for inactive caption (title bar) window borders. */
"window", "#FFFFFF", /* Default color for the interior of windows */
"windowBorder", "#000000", /* ??? */
"windowText", "#000000", /* ??? */
"menu", "#C0C0C0", /* Background color for menus */
"menuPressedItemB", "#000080", /* LightShadow of menubutton highlight */
"menuPressedItemF", "#FFFFFF", /* Default color for foreground "text" in menu item */
"menuText", "#000000", /* Text color for menus */
"text", "#C0C0C0", /* Text background color */
"textText", "#000000", /* Text foreground color */
"textHighlight", "#000080", /* Text background color when selected */
"textHighlightText", "#FFFFFF", /* Text color when selected */
"textInactiveText", "#808080", /* Text color when disabled */
"control", "#C0C0C0", /* Default color for controls (buttons, sliders, etc) */
"controlText", "#000000", /* Default color for text in controls */
"controlHighlight", "#C0C0C0",
/*"controlHighlight", "#E0E0E0",*/ /* Specular highlight (opposite of the shadow) */
"controlLtHighlight", "#FFFFFF", /* Highlight color for controls */
"controlShadow", "#808080", /* Shadow color for controls */
"controlDkShadow", "#000000", /* Dark shadow color for controls */
"scrollbar", "#E0E0E0", /* Scrollbar background (usually the "track") */
"info", "#FFFFE1", /* ??? */
"infoText", "#000000" /* ??? */
};
}
/**
* Initialize the defaults table with the name of the ResourceBundle
* used for getting localized defaults.
*/
}
// XXX - there are probably a lot of redundant values that could be removed.
// ie. Take a look at RadioButtonBorder, etc...
{
super.initComponentDefaults( table );
// *** Shared Fonts
"javax.swing.plaf.FontUIResource",
null,
"javax.swing.plaf.FontUIResource",
null,
"javax.swing.plaf.FontUIResource",
null,
"javax.swing.plaf.FontUIResource",
null,
// *** Colors
// XXX - some of these doens't seem to be used
// Set the flag which determines which version of Windows should
// be rendered. This flag only need to be set once.
// if version <= 4.0 then the classic LAF should be loaded.
// *** Tree
// *** Text
"control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
"control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
});
"control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
"control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
});
"control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
"shift PAGE_UP", "selection-page-up",
"shift PAGE_DOWN", "selection-page-down",
"ctrl shift PAGE_UP", "selection-page-left",
"ctrl shift PAGE_DOWN", "selection-page-right",
"control T", "next-link-action",
"control shift T", "previous-link-action",
"control SPACE", "activate-link-action",
"control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/
});
"win.3d.backgroundColor",
"win.3d.lightColor",
"win.3d.highlightColor",
"win.3d.shadowColor",
"win.3d.darkShadowColor",
"win.button.textColor",
"win.menu.backgroundColor",
"win.menubar.backgroundColor",
"win.menu.textColor",
"win.item.highlightColor",
"win.item.highlightTextColor",
"win.frame.backgroundColor",
"win.frame.textColor",
"win.frame.sizingBorderWidth",
"win.frame.captionHeight",
"win.frame.captionButtonWidth",
"win.frame.captionButtonHeight",
"win.text.grayedTextColor",
"win.scrollbar.backgroundColor",
//The following four lines were commented out as part of bug 4991597
//This code *is* correct, however it differs from WindowsXP and is, apparently
//a Windows XP bug. Until Windows fixes this bug, we shall also exhibit the same
//behavior
//Object ReadOnlyTextBackground = new XPColorValue(Part.EP_EDITTEXT, State.READONLY, Prop.FILLCOLOR,
// ControlBackgroundColor);
//Object DisabledTextBackground = new XPColorValue(Part.EP_EDITTEXT, State.DISABLED, Prop.FILLCOLOR,
// ControlBackgroundColor);
if (useSystemFontSettings) {
/* Put the desktop AA settings in the defaults.
* JComponent.setUI() retrieves this and makes it available
* as a client property on the JComponent. Use the same key name
* for both client property and UIDefaults.
* Also need to set up listeners for changes in these settings.
*/
this.aaSettings =
}
if (useSystemFontSizeSettings) {
ControlFont = new WindowsFontSizeProperty("win.defaultGUI.font.height", Font.DIALOG, Font.PLAIN, 12);
MessageFont = new WindowsFontSizeProperty("win.messagebox.font.height", Font.DIALOG, Font.PLAIN, 12);
WindowFont = new WindowsFontSizeProperty("win.frame.captionFont.height", Font.DIALOG, Font.BOLD, 12);
ToolTipFont = new WindowsFontSizeProperty("win.tooltip.font.height", Font.SANS_SERIF, Font.PLAIN, 12);
}
if (!(this instanceof WindowsClassicLookAndFeel) &&
// These desktop properties are not used directly, but are needed to
// trigger realoading of UI's.
}
// *** Auditory Feedback
// this key defines which of the various cues to render
// Overridden from BasicL&F. This L&F should play all sounds
// all the time. The infrastructure decides what to play.
// This is disabled until sound bugs can be resolved.
"TextField.focusInputMap", fieldInputMap,
"PasswordField.focusInputMap", passwordInputMap,
"TextArea.focusInputMap", multilineInputMap,
"TextPane.focusInputMap", multilineInputMap,
"EditorPane.focusInputMap", multilineInputMap,
// Buttons
"Button.font", ControlFont,
"Button.background", ControlBackgroundColor,
// Button.foreground, Button.shadow, Button.darkShadow,
// Button.disabledForground, and Button.disabledShadow are only
// used for Windows Classic. Windows XP will use colors
// from the current visual style.
"Button.foreground", ControlTextColor,
"Button.shadow", ControlShadowColor,
"Button.darkShadow", ControlDarkShadowColor,
"Button.light", ControlLightColor,
"Button.highlight", ControlHighlightColor,
"Button.disabledForeground", InactiveTextColor,
"Button.disabledShadow", ControlHighlightColor,
"Button.focus", buttonFocusColor,
// W2K keyboard navigation hidding.
"Button.showMnemonics", showMnemonics,
"Button.focusInputMap",
"SPACE", "pressed",
"released SPACE", "released"
}),
"Caret.width",
"CheckBox.font", ControlFont,
"CheckBox.interiorBackground", WindowBackgroundColor,
"CheckBox.background", ControlBackgroundColor,
"CheckBox.foreground", WindowTextColor,
"CheckBox.shadow", ControlShadowColor,
"CheckBox.darkShadow", ControlDarkShadowColor,
"CheckBox.light", ControlLightColor,
"CheckBox.highlight", ControlHighlightColor,
"CheckBox.focus", buttonFocusColor,
"CheckBox.focusInputMap",
"SPACE", "pressed",
"released SPACE", "released"
}),
// margin is 2 all the way around, BasicBorders.RadioButtonBorder
// (checkbox uses RadioButtonBorder) is 2 all the way around too.
"CheckBoxMenuItem.font", MenuFont,
"CheckBoxMenuItem.background", MenuBackgroundColor,
"CheckBoxMenuItem.foreground", MenuTextColor,
"CheckBoxMenuItem.selectionForeground", SelectionTextColor,
"CheckBoxMenuItem.selectionBackground", SelectionBackgroundColor,
"CheckBoxMenuItem.acceleratorForeground", MenuTextColor,
"CheckBoxMenuItem.acceleratorSelectionForeground", SelectionTextColor,
"CheckBoxMenuItem.commandSound", "win.sound.menuCommand",
"ComboBox.font", ControlFont,
"ComboBox.background", WindowBackgroundColor,
"ComboBox.foreground", WindowTextColor,
"ComboBox.buttonBackground", ControlBackgroundColor,
"ComboBox.buttonShadow", ControlShadowColor,
"ComboBox.buttonDarkShadow", ControlDarkShadowColor,
"ComboBox.buttonHighlight", ControlHighlightColor,
"ComboBox.selectionBackground", SelectionBackgroundColor,
"ComboBox.selectionForeground", SelectionTextColor,
"ComboBox.disabledBackground",
"ComboBox.disabledForeground",
"ESCAPE", "hidePopup",
"PAGE_UP", "pageUpPassThrough",
"PAGE_DOWN", "pageDownPassThrough",
"HOME", "homePassThrough",
"END", "endPassThrough",
"DOWN", "selectNext2",
"KP_DOWN", "selectNext2",
"UP", "selectPrevious2",
"KP_UP", "selectPrevious2",
"ENTER", "enterPressed",
"F4", "togglePopup",
"alt DOWN", "togglePopup",
"alt KP_DOWN", "togglePopup",
"alt UP", "togglePopup",
"alt KP_UP", "togglePopup"
}),
// DeskTop.
"Desktop.background", new DesktopProperty(
"win.desktop.backgroundColor",
"Desktop.ancestorInputMap",
"ctrl F5", "restore",
"ctrl F4", "close",
"ctrl F7", "move",
"ctrl F8", "resize",
"RIGHT", "right",
"KP_RIGHT", "right",
"LEFT", "left",
"KP_LEFT", "left",
"UP", "up",
"KP_UP", "up",
"DOWN", "down",
"KP_DOWN", "down",
"ESCAPE", "escape",
"ctrl F9", "minimize",
"ctrl F10", "maximize",
"ctrl F6", "selectNextFrame",
"ctrl TAB", "selectNextFrame",
"ctrl alt F6", "selectNextFrame",
"shift ctrl alt F6", "selectPreviousFrame",
"ctrl F12", "navigateNext",
"shift ctrl F12", "navigatePrevious"
}),
// DesktopIcon
"EditorPane.font", ControlFont,
"EditorPane.background", WindowBackgroundColor,
"EditorPane.foreground", WindowTextColor,
"EditorPane.selectionBackground", SelectionBackgroundColor,
"EditorPane.selectionForeground", SelectionTextColor,
"EditorPane.caretForeground", WindowTextColor,
"EditorPane.inactiveForeground", InactiveTextColor,
"EditorPane.inactiveBackground", WindowBackgroundColor,
"EditorPane.disabledBackground", DisabledTextBackground,
"icons/HomeFolder.gif"),
"FileChooser.listFont", IconFont,
new SwingLazyValue(
"javax.swing.plaf.BorderUIResource",
"getLoweredBevelBorderUIResource")),
"icons/ListView.gif"),
"icons/DetailsView.gif"),
"icons/ListView.gif"),
"icons/UpFolder.gif"),
"icons/NewFolder.gif"),
"FileChooser.ancestorInputMap",
"ESCAPE", "cancelSelection",
"F2", "editFileName",
"F5", "refresh",
"BACK_SPACE", "Go Up"
}),
WindowsLookAndFeel.class,
"icons/Directory.gif"),
WindowsLookAndFeel.class,
WindowsLookAndFeel.class,
"icons/Computer.gif"),
WindowsLookAndFeel.class,
"icons/HardDrive.gif"),
WindowsLookAndFeel.class,
"icons/FloppyDrive.gif"),
"FormattedTextField.font", ControlFont,
"InternalFrame.titleFont", WindowFont,
"InternalFrame.titlePaneHeight", TitlePaneHeight,
"InternalFrame.titleButtonWidth", TitleButtonWidth,
"InternalFrame.titleButtonHeight", TitleButtonHeight,
"InternalFrame.titleButtonToolTipsOn", hotTrackingOn,
"InternalFrame.borderColor", ControlBackgroundColor,
"InternalFrame.borderShadow", ControlShadowColor,
"InternalFrame.borderDarkShadow", ControlDarkShadowColor,
"InternalFrame.borderHighlight", ControlHighlightColor,
"InternalFrame.borderLight", ControlLightColor,
"InternalFrame.borderWidth", WindowBorderWidth,
"InternalFrame.minimizeIconBackground", ControlBackgroundColor,
"InternalFrame.resizeIconHighlight", ControlLightColor,
"InternalFrame.resizeIconShadow", ControlShadowColor,
"InternalFrame.activeBorderColor", new DesktopProperty(
"win.frame.activeBorderColor",
"InternalFrame.inactiveBorderColor", new DesktopProperty(
"win.frame.inactiveBorderColor",
"InternalFrame.activeTitleBackground", new DesktopProperty(
"win.frame.activeCaptionColor",
"InternalFrame.activeTitleGradient", new DesktopProperty(
"win.frame.activeCaptionGradientColor",
"InternalFrame.activeTitleForeground", new DesktopProperty(
"win.frame.captionTextColor",
"InternalFrame.inactiveTitleBackground", new DesktopProperty(
"win.frame.inactiveCaptionColor",
"InternalFrame.inactiveTitleGradient", new DesktopProperty(
"win.frame.inactiveCaptionGradientColor",
"InternalFrame.inactiveTitleForeground", new DesktopProperty(
"win.frame.inactiveCaptionTextColor",
"InternalFrame.maximizeIcon",
"InternalFrame.minimizeIcon",
"InternalFrame.iconifyIcon",
"InternalFrame.closeIcon",
"InternalFrame.icon",
new SwingLazyValue(
"com.sun.java.swing.plaf.windows.WindowsInternalFrameTitlePane$ScalableIconUIResource",
// The constructor takes one arg: an array of UIDefaults.LazyValue
// representing the icons
new Object[][] { {
} }),
// Internal Frame Auditory Cue Mappings
"InternalFrame.closeSound", "win.sound.close",
"InternalFrame.maximizeSound", "win.sound.maximize",
"InternalFrame.minimizeSound", "win.sound.minimize",
"InternalFrame.restoreDownSound", "win.sound.restoreDown",
"InternalFrame.restoreUpSound", "win.sound.restoreUp",
"InternalFrame.windowBindings", new Object[] {
"shift ESCAPE", "showSystemMenu",
"ctrl SPACE", "showSystemMenu",
"ESCAPE", "hideSystemMenu"},
// Label
"Label.font", ControlFont,
"Label.background", ControlBackgroundColor,
"Label.foreground", WindowTextColor,
"Label.disabledForeground", InactiveTextColor,
"Label.disabledShadow", ControlHighlightColor,
// List.
"List.font", ControlFont,
"List.background", WindowBackgroundColor,
"List.foreground", WindowTextColor,
"List.selectionBackground", SelectionBackgroundColor,
"List.selectionForeground", SelectionTextColor,
"List.focusInputMap",
"ctrl C", "copy",
"ctrl V", "paste",
"ctrl X", "cut",
"COPY", "copy",
"PASTE", "paste",
"CUT", "cut",
"control INSERT", "copy",
"shift INSERT", "paste",
"shift DELETE", "cut",
"UP", "selectPreviousRow",
"KP_UP", "selectPreviousRow",
"shift UP", "selectPreviousRowExtendSelection",
"shift KP_UP", "selectPreviousRowExtendSelection",
"ctrl shift UP", "selectPreviousRowExtendSelection",
"ctrl shift KP_UP", "selectPreviousRowExtendSelection",
"ctrl UP", "selectPreviousRowChangeLead",
"ctrl KP_UP", "selectPreviousRowChangeLead",
"DOWN", "selectNextRow",
"KP_DOWN", "selectNextRow",
"shift DOWN", "selectNextRowExtendSelection",
"shift KP_DOWN", "selectNextRowExtendSelection",
"ctrl shift DOWN", "selectNextRowExtendSelection",
"ctrl shift KP_DOWN", "selectNextRowExtendSelection",
"ctrl DOWN", "selectNextRowChangeLead",
"ctrl KP_DOWN", "selectNextRowChangeLead",
"LEFT", "selectPreviousColumn",
"KP_LEFT", "selectPreviousColumn",
"shift LEFT", "selectPreviousColumnExtendSelection",
"shift KP_LEFT", "selectPreviousColumnExtendSelection",
"ctrl shift LEFT", "selectPreviousColumnExtendSelection",
"ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
"ctrl LEFT", "selectPreviousColumnChangeLead",
"ctrl KP_LEFT", "selectPreviousColumnChangeLead",
"RIGHT", "selectNextColumn",
"KP_RIGHT", "selectNextColumn",
"shift RIGHT", "selectNextColumnExtendSelection",
"shift KP_RIGHT", "selectNextColumnExtendSelection",
"ctrl shift RIGHT", "selectNextColumnExtendSelection",
"ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
"ctrl RIGHT", "selectNextColumnChangeLead",
"ctrl KP_RIGHT", "selectNextColumnChangeLead",
"HOME", "selectFirstRow",
"shift HOME", "selectFirstRowExtendSelection",
"ctrl shift HOME", "selectFirstRowExtendSelection",
"ctrl HOME", "selectFirstRowChangeLead",
"END", "selectLastRow",
"shift END", "selectLastRowExtendSelection",
"ctrl shift END", "selectLastRowExtendSelection",
"ctrl END", "selectLastRowChangeLead",
"PAGE_UP", "scrollUp",
"shift PAGE_UP", "scrollUpExtendSelection",
"ctrl shift PAGE_UP", "scrollUpExtendSelection",
"ctrl PAGE_UP", "scrollUpChangeLead",
"PAGE_DOWN", "scrollDown",
"shift PAGE_DOWN", "scrollDownExtendSelection",
"ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
"ctrl PAGE_DOWN", "scrollDownChangeLead",
"ctrl A", "selectAll",
"ctrl SLASH", "selectAll",
"ctrl BACK_SLASH", "clearSelection",
"SPACE", "addToSelection",
"ctrl SPACE", "toggleAndAnchor",
"shift SPACE", "extendTo",
"ctrl shift SPACE", "moveSelectionTo"
}),
// PopupMenu
"PopupMenu.font", MenuFont,
"PopupMenu.background", MenuBackgroundColor,
"PopupMenu.foreground", MenuTextColor,
"PopupMenu.popupSound", "win.sound.menuPopup",
// Menus
"Menu.font", MenuFont,
"Menu.foreground", MenuTextColor,
"Menu.background", MenuBackgroundColor,
"Menu.selectionForeground", SelectionTextColor,
"Menu.selectionBackground", SelectionBackgroundColor,
"Menu.acceleratorForeground", MenuTextColor,
"Menu.acceleratorSelectionForeground", SelectionTextColor,
// MenuBar.
"MenuBar.font", MenuFont,
"MenuBar.foreground", MenuTextColor,
"MenuBar.shadow", ControlShadowColor,
"MenuBar.highlight", ControlHighlightColor,
"MenuBar.height", menuBarHeight,
"MenuBar.rolloverEnabled", hotTrackingOn,
"MenuBar.windowBindings", new Object[] {
"F10", "takeFocus" },
"MenuItem.font", MenuFont,
"MenuItem.acceleratorFont", MenuFont,
"MenuItem.foreground", MenuTextColor,
"MenuItem.background", MenuBackgroundColor,
"MenuItem.selectionForeground", SelectionTextColor,
"MenuItem.selectionBackground", SelectionBackgroundColor,
"MenuItem.disabledForeground", InactiveTextColor,
"MenuItem.acceleratorForeground", MenuTextColor,
"MenuItem.acceleratorSelectionForeground", SelectionTextColor,
"MenuItem.acceleratorDelimiter", menuItemAcceleratorDelimiter,
// Menu Item Auditory Cue Mapping
"MenuItem.commandSound", "win.sound.menuCommand",
// indicates that keyboard navigation won't skip disabled menu items
"RadioButton.font", ControlFont,
"RadioButton.interiorBackground", WindowBackgroundColor,
"RadioButton.background", ControlBackgroundColor,
"RadioButton.foreground", WindowTextColor,
"RadioButton.shadow", ControlShadowColor,
"RadioButton.darkShadow", ControlDarkShadowColor,
"RadioButton.light", ControlLightColor,
"RadioButton.highlight", ControlHighlightColor,
"RadioButton.focus", buttonFocusColor,
"RadioButton.focusInputMap",
"SPACE", "pressed",
"released SPACE", "released"
}),
// margin is 2 all the way around, BasicBorders.RadioButtonBorder
// is 2 all the way around too.
"RadioButtonMenuItem.font", MenuFont,
"RadioButtonMenuItem.foreground", MenuTextColor,
"RadioButtonMenuItem.background", MenuBackgroundColor,
"RadioButtonMenuItem.selectionForeground", SelectionTextColor,
"RadioButtonMenuItem.selectionBackground", SelectionBackgroundColor,
"RadioButtonMenuItem.disabledForeground", InactiveTextColor,
"RadioButtonMenuItem.acceleratorForeground", MenuTextColor,
"RadioButtonMenuItem.acceleratorSelectionForeground", SelectionTextColor,
"RadioButtonMenuItem.commandSound", "win.sound.menuCommand",
// OptionPane.
"OptionPane.font", MessageFont,
"OptionPane.messageFont", MessageFont,
"OptionPane.buttonFont", MessageFont,
"OptionPane.background", ControlBackgroundColor,
"OptionPane.foreground", WindowTextColor,
"OptionPane.messageForeground", ControlTextColor,
"icons/Inform.gif"),
"icons/Question.gif"),
"OptionPane.windowBindings", new Object[] {
"ESCAPE", "close" },
// Option Pane Auditory Cue Mappings
"OptionPane.errorSound", "win.sound.hand", // Error
"OptionPane.informationSound", "win.sound.asterisk", // Info Plain
"OptionPane.questionSound", "win.sound.question", // Question
"OptionPane.warningSound", "win.sound.exclamation", // Warning
"FormattedTextField.focusInputMap",
"ctrl BACK_SLASH", "unselect",
"control shift O", "toggle-componentOrientation",
"ESCAPE", "reset-field-edit",
"UP", "increment",
"KP_UP", "increment",
"DOWN", "decrement",
"KP_DOWN", "decrement",
}),
"FormattedTextField.inactiveBackground", ReadOnlyTextBackground,
"FormattedTextField.disabledBackground", DisabledTextBackground,
// *** Panel
"Panel.font", ControlFont,
"Panel.background", ControlBackgroundColor,
"Panel.foreground", WindowTextColor,
// *** PasswordField
"PasswordField.font", ControlFont,
"PasswordField.background", TextBackground,
"PasswordField.foreground", WindowTextColor,
"PasswordField.selectionBackground", SelectionBackgroundColor,
"PasswordField.selectionForeground", SelectionTextColor,
"PasswordField.caretForeground",WindowTextColor,
new Character('*')),
// *** ProgressBar
"ProgressBar.font", ControlFont,
"ProgressBar.foreground", SelectionBackgroundColor,
"ProgressBar.background", ControlBackgroundColor,
"ProgressBar.shadow", ControlShadowColor,
"ProgressBar.highlight", ControlHighlightColor,
"ProgressBar.selectionForeground", ControlBackgroundColor,
"ProgressBar.selectionBackground", SelectionBackgroundColor,
// *** RootPane.
// These bindings are only enabled when there is a default
// button set on the rootpane.
"RootPane.defaultButtonWindowKeyBindings", new Object[] {
"ENTER", "press",
"released ENTER", "release",
"ctrl ENTER", "press",
"ctrl released ENTER", "release"
},
// *** ScrollBar.
"ScrollBar.background", ScrollbarBackgroundColor,
"ScrollBar.foreground", ControlBackgroundColor,
"ScrollBar.track", white,
"ScrollBar.trackForeground", ScrollbarBackgroundColor,
"ScrollBar.trackHighlight", black,
"ScrollBar.trackHighlightForeground", scrollBarTrackHighlight,
"ScrollBar.thumb", ControlBackgroundColor,
"ScrollBar.thumbHighlight", ControlHighlightColor,
"ScrollBar.thumbDarkShadow", ControlDarkShadowColor,
"ScrollBar.thumbShadow", ControlShadowColor,
"ScrollBar.width", scrollBarWidth,
"ScrollBar.ancestorInputMap",
"RIGHT", "positiveUnitIncrement",
"KP_RIGHT", "positiveUnitIncrement",
"DOWN", "positiveUnitIncrement",
"KP_DOWN", "positiveUnitIncrement",
"PAGE_DOWN", "positiveBlockIncrement",
"ctrl PAGE_DOWN", "positiveBlockIncrement",
"LEFT", "negativeUnitIncrement",
"KP_LEFT", "negativeUnitIncrement",
"UP", "negativeUnitIncrement",
"KP_UP", "negativeUnitIncrement",
"PAGE_UP", "negativeBlockIncrement",
"ctrl PAGE_UP", "negativeBlockIncrement",
"HOME", "minScroll",
"END", "maxScroll"
}),
// *** ScrollPane.
"ScrollPane.font", ControlFont,
"ScrollPane.background", ControlBackgroundColor,
"ScrollPane.foreground", ControlTextColor,
"ScrollPane.ancestorInputMap",
"RIGHT", "unitScrollRight",
"KP_RIGHT", "unitScrollRight",
"DOWN", "unitScrollDown",
"KP_DOWN", "unitScrollDown",
"LEFT", "unitScrollLeft",
"KP_LEFT", "unitScrollLeft",
"UP", "unitScrollUp",
"KP_UP", "unitScrollUp",
"PAGE_UP", "scrollUp",
"PAGE_DOWN", "scrollDown",
"ctrl PAGE_UP", "scrollLeft",
"ctrl PAGE_DOWN", "scrollRight",
"ctrl HOME", "scrollHome",
"ctrl END", "scrollEnd"
}),
// *** Separator
"Separator.background", ControlHighlightColor,
"Separator.foreground", ControlShadowColor,
// *** Slider.
"Slider.font", ControlFont,
"Slider.foreground", ControlBackgroundColor,
"Slider.background", ControlBackgroundColor,
"Slider.highlight", ControlHighlightColor,
"Slider.shadow", ControlShadowColor,
"Slider.focus", ControlDarkShadowColor,
"Slider.focusInputMap",
"RIGHT", "positiveUnitIncrement",
"KP_RIGHT", "positiveUnitIncrement",
"DOWN", "negativeUnitIncrement",
"KP_DOWN", "negativeUnitIncrement",
"PAGE_DOWN", "negativeBlockIncrement",
"LEFT", "negativeUnitIncrement",
"KP_LEFT", "negativeUnitIncrement",
"UP", "positiveUnitIncrement",
"KP_UP", "positiveUnitIncrement",
"PAGE_UP", "positiveBlockIncrement",
"HOME", "minScroll",
"END", "maxScroll"
}),
// Spinner
"Spinner.font", ControlFont,
"Spinner.ancestorInputMap",
"UP", "increment",
"KP_UP", "increment",
"DOWN", "decrement",
"KP_DOWN", "decrement",
}),
// *** SplitPane
"SplitPane.background", ControlBackgroundColor,
"SplitPane.highlight", ControlHighlightColor,
"SplitPane.shadow", ControlShadowColor,
"SplitPane.darkShadow", ControlDarkShadowColor,
"SplitPane.ancestorInputMap",
"UP", "negativeIncrement",
"DOWN", "positiveIncrement",
"LEFT", "negativeIncrement",
"RIGHT", "positiveIncrement",
"KP_UP", "negativeIncrement",
"KP_DOWN", "positiveIncrement",
"KP_LEFT", "negativeIncrement",
"KP_RIGHT", "positiveIncrement",
"HOME", "selectMin",
"END", "selectMax",
"F8", "startResize",
"F6", "toggleFocus",
"ctrl TAB", "focusOutForward",
"ctrl shift TAB", "focusOutBackward"
}),
// *** TabbedPane
"TabbedPane.font", ControlFont,
"TabbedPane.background", ControlBackgroundColor,
"TabbedPane.foreground", ControlTextColor,
"TabbedPane.highlight", ControlHighlightColor,
"TabbedPane.light", ControlLightColor,
"TabbedPane.shadow", ControlShadowColor,
"TabbedPane.darkShadow", ControlDarkShadowColor,
"TabbedPane.focus", ControlTextColor,
"TabbedPane.focusInputMap",
"RIGHT", "navigateRight",
"KP_RIGHT", "navigateRight",
"LEFT", "navigateLeft",
"KP_LEFT", "navigateLeft",
"UP", "navigateUp",
"KP_UP", "navigateUp",
"DOWN", "navigateDown",
"KP_DOWN", "navigateDown",
"ctrl DOWN", "requestFocusForVisibleComponent",
"ctrl KP_DOWN", "requestFocusForVisibleComponent",
}),
"TabbedPane.ancestorInputMap",
"ctrl TAB", "navigateNext",
"ctrl shift TAB", "navigatePrevious",
"ctrl PAGE_DOWN", "navigatePageDown",
"ctrl PAGE_UP", "navigatePageUp",
"ctrl UP", "requestFocus",
"ctrl KP_UP", "requestFocus",
}),
// *** Table
"Table.font", ControlFont,
"Table.highlight", ControlHighlightColor,
"Table.light", ControlLightColor,
"Table.shadow", ControlShadowColor,
"Table.darkShadow", ControlDarkShadowColor,
"Table.selectionForeground", SelectionTextColor,
"Table.selectionBackground", SelectionBackgroundColor,
"Table.focusCellBackground", WindowBackgroundColor,
"Table.focusCellForeground", ControlTextColor,
"Table.ancestorInputMap",
"ctrl C", "copy",
"ctrl V", "paste",
"ctrl X", "cut",
"COPY", "copy",
"PASTE", "paste",
"CUT", "cut",
"control INSERT", "copy",
"shift INSERT", "paste",
"shift DELETE", "cut",
"RIGHT", "selectNextColumn",
"KP_RIGHT", "selectNextColumn",
"shift RIGHT", "selectNextColumnExtendSelection",
"shift KP_RIGHT", "selectNextColumnExtendSelection",
"ctrl shift RIGHT", "selectNextColumnExtendSelection",
"ctrl shift KP_RIGHT", "selectNextColumnExtendSelection",
"ctrl RIGHT", "selectNextColumnChangeLead",
"ctrl KP_RIGHT", "selectNextColumnChangeLead",
"LEFT", "selectPreviousColumn",
"KP_LEFT", "selectPreviousColumn",
"shift LEFT", "selectPreviousColumnExtendSelection",
"shift KP_LEFT", "selectPreviousColumnExtendSelection",
"ctrl shift LEFT", "selectPreviousColumnExtendSelection",
"ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection",
"ctrl LEFT", "selectPreviousColumnChangeLead",
"ctrl KP_LEFT", "selectPreviousColumnChangeLead",
"DOWN", "selectNextRow",
"KP_DOWN", "selectNextRow",
"shift DOWN", "selectNextRowExtendSelection",
"shift KP_DOWN", "selectNextRowExtendSelection",
"ctrl shift DOWN", "selectNextRowExtendSelection",
"ctrl shift KP_DOWN", "selectNextRowExtendSelection",
"ctrl DOWN", "selectNextRowChangeLead",
"ctrl KP_DOWN", "selectNextRowChangeLead",
"UP", "selectPreviousRow",
"KP_UP", "selectPreviousRow",
"shift UP", "selectPreviousRowExtendSelection",
"shift KP_UP", "selectPreviousRowExtendSelection",
"ctrl shift UP", "selectPreviousRowExtendSelection",
"ctrl shift KP_UP", "selectPreviousRowExtendSelection",
"ctrl UP", "selectPreviousRowChangeLead",
"ctrl KP_UP", "selectPreviousRowChangeLead",
"HOME", "selectFirstColumn",
"shift HOME", "selectFirstColumnExtendSelection",
"ctrl shift HOME", "selectFirstRowExtendSelection",
"ctrl HOME", "selectFirstRow",
"END", "selectLastColumn",
"shift END", "selectLastColumnExtendSelection",
"ctrl shift END", "selectLastRowExtendSelection",
"ctrl END", "selectLastRow",
"PAGE_UP", "scrollUpChangeSelection",
"shift PAGE_UP", "scrollUpExtendSelection",
"ctrl shift PAGE_UP", "scrollLeftExtendSelection",
"ctrl PAGE_UP", "scrollLeftChangeSelection",
"PAGE_DOWN", "scrollDownChangeSelection",
"shift PAGE_DOWN", "scrollDownExtendSelection",
"ctrl shift PAGE_DOWN", "scrollRightExtendSelection",
"ctrl PAGE_DOWN", "scrollRightChangeSelection",
"TAB", "selectNextColumnCell",
"shift TAB", "selectPreviousColumnCell",
"ENTER", "selectNextRowCell",
"shift ENTER", "selectPreviousRowCell",
"ctrl A", "selectAll",
"ctrl SLASH", "selectAll",
"ctrl BACK_SLASH", "clearSelection",
"ESCAPE", "cancel",
"F2", "startEditing",
"SPACE", "addToSelection",
"ctrl SPACE", "toggleAndAnchor",
"shift SPACE", "extendTo",
"ctrl shift SPACE", "moveSelectionTo",
"F8", "focusHeader"
}),
"Table.sortIconHighlight", ControlShadowColor,
"Table.sortIconLight", white,
"TableHeader.font", ControlFont,
"TableHeader.focusCellBackground",
WindowBackgroundColor), // or white bg otherwise
// *** TextArea
"TextArea.font", FixedControlFont,
"TextArea.background", WindowBackgroundColor,
"TextArea.foreground", WindowTextColor,
"TextArea.inactiveForeground", InactiveTextColor,
"TextArea.inactiveBackground", WindowBackgroundColor,
"TextArea.disabledBackground", DisabledTextBackground,
"TextArea.selectionBackground", SelectionBackgroundColor,
"TextArea.selectionForeground", SelectionTextColor,
"TextArea.caretForeground", WindowTextColor,
// *** TextField
"TextField.font", ControlFont,
"TextField.background", TextBackground,
"TextField.foreground", WindowTextColor,
"TextField.shadow", ControlShadowColor,
"TextField.darkShadow", ControlDarkShadowColor,
"TextField.light", ControlLightColor,
"TextField.highlight", ControlHighlightColor,
"TextField.selectionBackground", SelectionBackgroundColor,
"TextField.selectionForeground", SelectionTextColor,
"TextField.caretForeground", WindowTextColor,
// *** TextPane
"TextPane.font", ControlFont,
"TextPane.background", WindowBackgroundColor,
"TextPane.foreground", WindowTextColor,
"TextPane.selectionBackground", SelectionBackgroundColor,
"TextPane.selectionForeground", SelectionTextColor,
"TextPane.inactiveBackground", WindowBackgroundColor,
"TextPane.disabledBackground", DisabledTextBackground,
"TextPane.caretForeground", WindowTextColor,
// *** TitledBorder
"TitledBorder.font", ControlFont,
"TitledBorder.titleColor",
// *** ToggleButton
"ToggleButton.font", ControlFont,
"ToggleButton.background", ControlBackgroundColor,
"ToggleButton.foreground", ControlTextColor,
"ToggleButton.shadow", ControlShadowColor,
"ToggleButton.darkShadow", ControlDarkShadowColor,
"ToggleButton.light", ControlLightColor,
"ToggleButton.highlight", ControlHighlightColor,
"ToggleButton.focus", ControlTextColor,
"ToggleButton.focusInputMap",
"SPACE", "pressed",
"released SPACE", "released"
}),
// *** ToolBar
"ToolBar.font", MenuFont,
"ToolBar.background", ControlBackgroundColor,
"ToolBar.foreground", ControlTextColor,
"ToolBar.shadow", ControlShadowColor,
"ToolBar.darkShadow", ControlDarkShadowColor,
"ToolBar.light", ControlLightColor,
"ToolBar.highlight", ControlHighlightColor,
"ToolBar.dockingBackground", ControlBackgroundColor,
"ToolBar.dockingForeground", red,
"ToolBar.floatingBackground", ControlBackgroundColor,
"ToolBar.floatingForeground", darkGray,
"ToolBar.ancestorInputMap",
"UP", "navigateUp",
"KP_UP", "navigateUp",
"DOWN", "navigateDown",
"KP_DOWN", "navigateDown",
"LEFT", "navigateLeft",
"KP_LEFT", "navigateLeft",
"RIGHT", "navigateRight",
"KP_RIGHT", "navigateRight"
}),
"ToolBar.separatorSize", null,
// *** ToolTip
"ToolTip.font", ToolTipFont,
// *** ToolTipManager
"ToolTipManager.enableToolTipMode", "activeApplication",
// *** Tree
"Tree.selectionBorderColor", black,
"Tree.font", ControlFont,
"Tree.background", WindowBackgroundColor,
"Tree.foreground", WindowTextColor,
"Tree.hash", gray,
"Tree.textForeground", WindowTextColor,
"Tree.textBackground", WindowBackgroundColor,
"Tree.selectionForeground", SelectionTextColor,
"Tree.selectionBackground", SelectionBackgroundColor,
"Tree.expandedIcon", treeExpandedIcon,
"Tree.collapsedIcon", treeCollapsedIcon,
"shell32Icon 5", "icons/TreeOpen.gif"),
"shell32Icon 4", "icons/TreeClosed.gif"),
"Tree.focusInputMap",
"ADD", "expand",
"SUBTRACT", "collapse",
"ctrl C", "copy",
"ctrl V", "paste",
"ctrl X", "cut",
"COPY", "copy",
"PASTE", "paste",
"CUT", "cut",
"control INSERT", "copy",
"shift INSERT", "paste",
"shift DELETE", "cut",
"UP", "selectPrevious",
"KP_UP", "selectPrevious",
"shift UP", "selectPreviousExtendSelection",
"shift KP_UP", "selectPreviousExtendSelection",
"ctrl shift UP", "selectPreviousExtendSelection",
"ctrl shift KP_UP", "selectPreviousExtendSelection",
"ctrl UP", "selectPreviousChangeLead",
"ctrl KP_UP", "selectPreviousChangeLead",
"DOWN", "selectNext",
"KP_DOWN", "selectNext",
"shift DOWN", "selectNextExtendSelection",
"shift KP_DOWN", "selectNextExtendSelection",
"ctrl shift DOWN", "selectNextExtendSelection",
"ctrl shift KP_DOWN", "selectNextExtendSelection",
"ctrl DOWN", "selectNextChangeLead",
"ctrl KP_DOWN", "selectNextChangeLead",
"RIGHT", "selectChild",
"KP_RIGHT", "selectChild",
"LEFT", "selectParent",
"KP_LEFT", "selectParent",
"PAGE_UP", "scrollUpChangeSelection",
"shift PAGE_UP", "scrollUpExtendSelection",
"ctrl shift PAGE_UP", "scrollUpExtendSelection",
"ctrl PAGE_UP", "scrollUpChangeLead",
"PAGE_DOWN", "scrollDownChangeSelection",
"shift PAGE_DOWN", "scrollDownExtendSelection",
"ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
"ctrl PAGE_DOWN", "scrollDownChangeLead",
"HOME", "selectFirst",
"shift HOME", "selectFirstExtendSelection",
"ctrl shift HOME", "selectFirstExtendSelection",
"ctrl HOME", "selectFirstChangeLead",
"END", "selectLast",
"shift END", "selectLastExtendSelection",
"ctrl shift END", "selectLastExtendSelection",
"ctrl END", "selectLastChangeLead",
"F2", "startEditing",
"ctrl A", "selectAll",
"ctrl SLASH", "selectAll",
"ctrl BACK_SLASH", "clearSelection",
"ctrl LEFT", "scrollLeft",
"ctrl KP_LEFT", "scrollLeft",
"ctrl RIGHT", "scrollRight",
"ctrl KP_RIGHT", "scrollRight",
"SPACE", "addToSelection",
"ctrl SPACE", "toggleAndAnchor",
"shift SPACE", "extendTo",
"ctrl shift SPACE", "moveSelectionTo"
}),
"Tree.ancestorInputMap",
"ESCAPE", "cancel"
}),
// *** Viewport
"Viewport.font", ControlFont,
"Viewport.background", ControlBackgroundColor,
"Viewport.foreground", WindowTextColor,
};
}
static boolean isOnVista() {
}
if (! isOnVista()) {
return;
}
/* START handling menus for Vista */
"CheckBoxMenuItem", "RadioButtonMenuItem",
};
/* all the menus need to be non opaque. */
menuDefaults[j++] = key;
menuDefaults[j++] =
}
/*
* acceleratorSelectionForeground color is the same as
* acceleratorForeground
*/
menuDefaults[j++] = key;
menuDefaults[j++] =
new XPValue(
menuClasses[i] + ".acceleratorForeground"),
oldValue);
}
/* they have the same MenuItemCheckIconFactory */
menuDefaults[j++] = key;
menuDefaults[j++] =
}
menuDefaults[j++] = key;
menuDefaults[j++] =
oldValue);
}
/* height can be even */
menuDefaults[j++] = key;
}
/* no margins */
menuDefaults[j++] = key;
}
/* set checkIcon offset */
menuDefaults[j++] = key;
menuDefaults[j++] =
}
/* set width of the gap after check icon */
menuDefaults[j++] = key;
menuDefaults[j++] =
}
/* text is started after this position */
}
};
menuDefaults[j++] = key;
}
/*
* JPopupMenu has a bit of free space around menu items
*/
new SwingLazyValue(
"javax.swing.plaf.basic.BasicBorders",
"getInternalFrameBorder"),
/* END handling menus for Vista */
/* START table handling for Vista */
new SwingLazyValue(
"sun.swing.plaf.windows.ClassicSortArrowIcon",
new SwingLazyValue(
"sun.swing.plaf.windows.ClassicSortArrowIcon",
/* END table handling for Vista */
}
/**
* If we support loading of fonts from the desktop this will return
* a DesktopProperty representing the font. If the font can't be
* represented in the current encoding this will return null and
* turn off the use of system fonts.
*/
if (useSystemFontSettings) {
}
return null;
}
// When a desktop property change is detected, these classes must be
// reinitialized in the defaults table to ensure the classes reference
// the updated desktop property values (colors mostly)
//
new SwingLazyValue(
"javax.swing.plaf.basic.BasicBorders",
"getButtonBorder"));
new SwingLazyValue(
"javax.swing.plaf.basic.BasicBorders",
"getTextFieldBorder"));
null);
// For focus rectangle for cells and trees.
"com.sun.java.swing.plaf.windows.WindowsBorders",
"getFocusCellHighlightBorder");
"javax.swing.plaf.BorderUIResource",
"getEtchedBorderUIResource");
"com.sun.java.swing.plaf.windows.WindowsBorders",
"getInternalFrameBorder");
"javax.swing.plaf.BorderUIResource",
"getLoweredBevelBorderUIResource");
"javax.swing.plaf.basic.BasicBorders$MarginBorder");
"javax.swing.plaf.basic.BasicBorders",
"getMenuBarBorder");
new SwingLazyValue(
"javax.swing.plaf.basic.BasicBorders",
"getInternalFrameBorder"));
// *** ProgressBar
"com.sun.java.swing.plaf.windows.WindowsBorders",
"getProgressBarBorder");
"javax.swing.plaf.basic.BasicBorders",
"getRadioButtonBorder");
"com.sun.java.swing.plaf.windows.WindowsBorders",
"getTableHeaderBorder");
// *** ToolBar
"com.sun.java.swing.plaf.windows.WindowsBorders",
"getToolBarBorder");
// *** ToolTips
"javax.swing.plaf.BorderUIResource",
"getBlackLineBorderUIResource");
"com.sun.java.swing.plaf.windows.WindowsIconFactory",
"getCheckBoxIcon");
"com.sun.java.swing.plaf.windows.WindowsIconFactory",
"getRadioButtonIcon");
"com.sun.java.swing.plaf.windows.WindowsIconFactory",
"getRadioButtonMenuItemIcon");
"com.sun.java.swing.plaf.windows.WindowsIconFactory",
"getMenuItemCheckIcon");
"com.sun.java.swing.plaf.windows.WindowsIconFactory",
"getMenuItemArrowIcon");
"com.sun.java.swing.plaf.windows.WindowsIconFactory",
"getMenuArrowIcon");
Object[] lazyDefaults = {
"Button.border", buttonBorder,
"CheckBox.border", radioButtonBorder,
"ComboBox.border", comboBoxBorder,
"DesktopIcon.border", internalFrameBorder,
"FormattedTextField.border", textFieldBorder,
"FormattedTextField.margin", textFieldMargin,
"InternalFrame.border", internalFrameBorder,
"List.focusCellHighlightBorder", focusCellHighlightBorder,
"Table.focusCellHighlightBorder", focusCellHighlightBorder,
"Menu.border", marginBorder,
"MenuBar.border", menuBarBorder,
"MenuItem.border", marginBorder,
"PasswordField.border", textFieldBorder,
"PasswordField.margin", textFieldMargin,
"PopupMenu.border", popupMenuBorder,
"ProgressBar.border", progressBarBorder,
"RadioButton.border", radioButtonBorder,
"ScrollPane.border", scrollPaneBorder,
"Spinner.border", spinnerBorder,
"Spinner.arrowButtonInsets", spinnerArrowInsets,
"Table.scrollPaneBorder", tableScrollPaneBorder,
"TableHeader.cellBorder", tableHeaderBorder,
"TextArea.margin", textFieldMargin,
"TextField.border", textFieldBorder,
"TextField.margin", textFieldMargin,
"TitledBorder.border",
"ToggleButton.border", radioButtonBorder,
"ToolBar.border", toolBarBorder,
"ToolTip.border", toolTipBorder,
"CheckBox.icon", checkBoxIcon,
"Menu.arrowIcon", menuArrowIcon,
"MenuItem.checkIcon", menuItemCheckIcon,
"MenuItem.arrowIcon", menuItemArrowIcon,
"RadioButton.icon", radioButtonIcon,
"RadioButtonMenuItem.checkIcon", radioButtonMenuItemIcon,
"InternalFrame.layoutTitlePaneAtOrigin",
"Table.ascendingSortIcon", new XPValue(
new SwingLazyValue(
"sun.swing.icon.SortArrowIcon",
"Table.sortIconColor" }),
new SwingLazyValue(
"sun.swing.plaf.windows.ClassicSortArrowIcon",
"Table.descendingSortIcon", new XPValue(
new SwingLazyValue(
"sun.swing.icon.SortArrowIcon",
"Table.sortIconColor" }),
new SwingLazyValue(
"sun.swing.plaf.windows.ClassicSortArrowIcon",
};
return lazyDefaults;
}
public void uninitialize() {
super.uninitialize();
}
}
// Toggle flag for drawing the mnemonic state
private static boolean isMnemonicHidden = true;
// should be disabled.
private static boolean isClassicWindows = false;
/**
* Sets the state of the hide mnemonic flag. This flag is used by the
* component UI delegates to determine if the mnemonic should be rendered.
* This method is a non operation if the underlying operating system
* does not support the mnemonic hiding feature.
*
* @param hide true if mnemonics should be hidden
* @since 1.4
*/
// Do not hide mnemonics if the UI defaults do not support this
isMnemonicHidden = false;
} else {
}
}
/**
* Gets the state of the hide mnemonic flag. This only has meaning
* if this feature is supported by the underlying OS.
*
* @return true if mnemonics are hidden, otherwise, false
* @see #setMnemonicHidden
* @since 1.4
*/
public static boolean isMnemonicHidden() {
// Do not hide mnemonics if the UI defaults do not support this
isMnemonicHidden = false;
}
return isMnemonicHidden;
}
/**
* Gets the state of the flag which indicates if the old Windows
* look and feel should be rendered. This flag is used by the
* component UI delegates as a hint to determine which style the component
* should be rendered.
*
* @return true if Windows 95 and Windows NT 4 look and feel should
* be rendered
* @since 1.4
*/
public static boolean isClassicWindows() {
return isClassicWindows;
}
/**
* <p>
* Invoked when the user attempts an invalid operation,
* such as pasting into an uneditable <code>JTextField</code>
* that has focus.
* </p>
* <p>
* If the user has enabled visual error indication on
* the desktop, this method will flash the caption bar
* of the active window. The user can also set the
* property awt.visualbell=true to achieve the same
* results.
* </p>
*
* @param component Component the error occured in, may be
* null indicating the error condition is
* not directly associated with a
* <code>Component</code>.
*
* @see javax.swing.LookAndFeel#provideErrorFeedback
*/
super.provideErrorFeedback(component);
}
/**
* {@inheritDoc}
*/
style = new WindowsLayoutStyle();
}
return style;
}
// ********* Auditory Cue support methods and objects *********
/**
* Returns an <code>Action</code>.
* <P>
* This Action contains the information and logic to render an
* auditory cue. The <code>Object</code> that is passed to this
* method contains the information needed to render the auditory
* cue. Normally, this <code>Object</code> is a <code>String</code>
* that points to a <code>Toolkit</code> <code>desktopProperty</code>.
* This <code>desktopProperty</code> is resolved by AWT and the
* Windows OS.
* <P>
* This <code>Action</code>'s <code>actionPerformed</code> method
* is fired by the <code>playSound</code> method.
*
* @return an Action which knows how to render the auditory
* cue for one particular system or user activity
* @see #playSound(Action)
* @since 1.4
*/
} else {
return null;
}
}
if (c instanceof JRootPane) {
}
}
} else {
c.repaint();
}
}
/**
* Pass the name String to the super constructor. This is used
* later to identify the Action and decide whether to play it or
* not. Store the resource String. It is used to get the audio
* resource. In this case, the resource is a <code>Runnable</code>
* supplied by <code>Toolkit</code>. This <code>Runnable</code> is
* effectively a pointer down into the Win32 OS that knows how to
* play the right sound.
*
* @since 1.4
*/
/**
* We use the String as the name of the Action and as a pointer to
* the underlying OSes audio resource.
*/
super(name);
}
if (audioRunnable == null) {
}
if (audioRunnable != null) {
// Runnable appears to block until completed playing, hence
// start up another thread to handle playing.
}
}
}
/**
* Gets an <code>Icon</code> from the native libraries if available,
* otherwise gets it from an image resource file.
*/
this.nativeImage = nativeImage;
}
if (nativeImage != null) {
}
}
WindowsLookAndFeel.class,
resource);
}
}
/**
* Gets an <code>Icon</code> from the native libraries if available.
* A desktop property is used to trigger reloading the icon when needed.
*/
this.nativeImageName = nativeImageName;
this.fallbackName = fallbackName;
// This desktop property is needed to trigger reloading the icon.
// It is kept in member variable to avoid GC.
super.updateUI();
}
};
}
}
}
}
BasicLookAndFeel.class, fallbackName);
}
return icon;
}
}
/**
* Icon backed-up by XP Skin.
*/
}
/**
* Draw the icon at the specified location. Icon implementations
* may use the Component argument to get properties useful for
* painting, e.g. the foreground or background color.
*/
}
}
/**
* Returns the icon's width.
*
* @return an int specifying the fixed width of the icon.
*/
public int getIconWidth() {
int width = 0;
}
return width;
}
/**
* Returns the icon's height.
*
* @return an int specifying the fixed height of the icon.
*/
public int getIconHeight() {
int height = 0;
}
return height;
}
}
/**
* DesktopProperty for fonts. If a font with the name 'MS Sans Serif'
* is returned, it is mapped to 'Microsoft Sans Serif'.
*/
}
}
super.invalidate(laf);
}
// 4950968: Workaround to mimic the way Windows maps the default
// font size of 6 pts to the smallest available bitmap font size.
// This happens mostly on Win 98/Me & NT.
int dpi;
try {
} catch (HeadlessException ex) {
dpi = 96;
}
}
}
}
if (!(font instanceof UIResource)) {
}
}
else {
}
return font;
}
return super.configureValue(value);
}
}
/**
* DesktopProperty for fonts that only gets sizes from the desktop,
* font name and style are passed into the constructor
*/
private int fontSize;
private int fontStyle;
}
}
}
return value;
}
}
/**
* A value wrapper that actively retrieves values from xp or falls back
* to the classic value if not running XP styles.
*/
// A constant that lets you specify null when using XP styles.
this.classicValue = classicValue;
}
}
} else if (value == NULL_VALUE) {
}
return value;
}
}
}
}
} else {
return value;
}
}
}
}
super(xpValue, classicValue);
this.extraMargin = extraMargin;
}
if (extraMargin != null) {
return new BorderUIResource.
} else {
return xpBorder;
}
}
}
}
}
private static class XPColorValueKey {
}
}
}
private int direction;
}
}
}
}
// This call adds a property change listener for the property,
// which triggers a call to updateUI(). The value returned
// is not interesting here.
}
protected void updateUI() {
super.updateUI();
// Make sure property change listener is readded each time
}
}
super(key);
}
protected void updateUI() {
super.updateUI();
}
}
// Windows LayoutStyle. From:
// Checks args
parent);
switch(type) {
case INDENT:
// Windows doesn't spec this
if (indent > 0) {
return indent;
}
return 10;
}
// Fall through to related.
case RELATED:
// Between text labels and their associated controls (for
// example, text boxes and list boxes): 3
// NOTE: We're not honoring:
// 'Text label beside a button 3 down from the top of
// the button,' but I suspect that is an attempt to
// enforce a baseline layout which will be handled
// separately. In order to enforce this we would need
// this API to return a more complicated type (Insets,
// or something else).
}
// Between related controls: 4
case UNRELATED:
// Between unrelated controls: 7
}
return 0;
}
// Checks args
}
}
/**
* Converts the dialog unit argument to pixels along the specified
* axis.
*/
if (baseUnitX == 0) {
}
}
}
/**
* Calculates the dialog unit mapping.
*/
private void calculateBaseUnits() {
// This calculation comes from:
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
// The -1 comes from experimentation.
}
/**
* {@inheritDoc}
*
* @since 1.6
*/
// if the component has a HI_RES_DISABLED_ICON_CLIENT_KEY
// client property set to Boolean.TRUE, then use the new
// hi res algorithm for creating the disabled icon (used
// in particular by the WindowsFileChooserUI class)
return new ImageIconUIResource(resultImage);
}
}
public RGBGrayFilter() {
canFilterIndexColorModel = true;
}
// find the average of red, green, and blue
// pull out the alpha channel
// calc the average
// turn back into rgb
(int)(avg * 255f);
return rgbval;
}
}
public FocusColorProperty () {
// Fallback value is never used bacause of the configureValue method doesn't return null
}
if (! ((Boolean)Toolkit.getDefaultToolkit().getDesktopProperty("win.highContrast.on")).booleanValue()){
}
}
}
}