/*
* 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.
*/
/**
* A base class to use in creating a look and feel for Swing.
* <p>
* Each of the {@code ComponentUI}s provided by {@code
* BasicLookAndFeel} derives its behavior from the defaults
* table. Unless otherwise noted each of the {@code ComponentUI}
* implementations in this package document the set of defaults they
* use. Unless otherwise noted the defaults are installed at the time
* {@code installUI} is invoked, and follow the recommendations
* outlined in {@code LookAndFeel} for installing defaults.
* <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. As of 1.4, support for long term storage
* of all JavaBeans<sup><font size="-2">TM</font></sup>
* has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}.
*
* @author unattributed
*/
{
/**
* Whether or not the developer has created a JPopupMenu.
*/
static boolean needsEventHelper;
/**
* Lock used when manipulating clipPlaying.
*/
/**
* The Clip that is currently playing (set in AudioAction).
*/
/*
* Listen for our AppContext being disposed
*/
/**
* Returns the look and feel defaults. The returned {@code UIDefaults}
* is populated by invoking, in order, {@code initClassDefaults},
* {@code initSystemColorDefaults} and {@code initComponentDefaults}.
* <p>
* While this method is public, it should only be invoked by the
* {@code UIManager} when the look and feel is set as the current
* look and feel and after {@code initialize} has been invoked.
*
* @return the look and feel defaults
*
* @see #initClassDefaults
* @see #initSystemColorDefaults
* @see #initComponentDefaults
*/
return table;
}
/**
* {@inheritDoc}
*/
public void initialize() {
if (needsEventHelper) {
}
}
void installAWTEventListener() {
invocator = new AWTEventHelper();
needsEventHelper = true;
// Add a PropertyChangeListener to our AppContext so we're alerted
// when the AppContext is disposed(), at which time this laf should
// be uninitialize()d.
disposer = new PropertyChangeListener() {
uninitialize();
}
};
disposer);
}
}
/**
* {@inheritDoc}
*/
public void uninitialize() {
synchronized (BasicPopupMenuUI.MOUSE_GRABBER_KEY) {
}
}
synchronized (BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY) {
}
}
}
// Note that we're likely calling removePropertyChangeListener()
// during the course of AppContext.firePropertyChange().
// However, EventListenerAggreggate has code to safely modify
// the list under such circumstances.
disposer);
}
}
/**
* Populates {@code table} with mappings from {@code uiClassID} to the
* fully qualified name of the ui class. The value for a
* particular {@code uiClassID} is {@code
* "javax.swing.plaf.basic.Basic + uiClassID"}. For example, the
* value for the {@code uiClassID} {@code TreeUI} is {@code
* "javax.swing.plaf.basic.BasicTreeUI"}.
*
* @param table the {@code UIDefaults} instance the entries are
* added to
* @throws NullPointerException if {@code table} is {@code null}
*
* @see javax.swing.LookAndFeel
* @see #getDefaults
*/
{
Object[] uiDefaults = {
};
}
/**
* Populates {@code table} with system colors. This creates an
* array of {@code name-color} pairs and invokes {@code
* loadSystemColors}.
* <p>
* The name is a {@code String} that corresponds to the name of
* one of the static {@code SystemColor} fields in the {@code
* SystemColor} class. A name-color pair is created for every
* such {@code SystemColor} field.
* <p>
* The {@code color} corresponds to a hex {@code String} as
* understood by {@code Color.decode}. For example, one of the
* {@code name-color} pairs is {@code
* "desktop"-"#005C5C"}. This corresponds to the {@code
* SystemColor} field {@code desktop}, with a color value of
* {@code new Color(0x005C5C)}.
* <p>
* The following shows two of the {@code name-color} pairs:
* <pre>
* String[] nameColorPairs = new String[] {
* "desktop", "#005C5C",
* "activeCaption", "#000080" };
* loadSystemColors(table, nameColorPairs, isNativeLookAndFeel());
* </pre>
*
* As previously stated, this invokes {@code loadSystemColors}
* with the supplied {@code table} and {@code name-color} pair
* array. The last argument to {@code loadSystemColors} indicates
* whether the value of the field in {@code SystemColor} should be
* used. This method passes the value of {@code
* isNativeLookAndFeel()} as the last argument to {@code loadSystemColors}.
*
* @param table the {@code UIDefaults} object the values are added to
* @throws NullPointerException if {@code table} is {@code null}
*
* @see java.awt.SystemColor
* @see #getDefaults
* @see #loadSystemColors
*/
{
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 */
"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", /* 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" /* ??? */
};
}
/**
* Populates {@code table} with the {@code name-color} pairs in
* {@code systemColors}. Refer to
* {@link #initSystemColorDefaults(UIDefaults)} for details on
* the format of {@code systemColors}.
* <p>
* An entry is added to {@code table} for each of the {@code name-color}
* pairs in {@code systemColors}. The entry key is
* the {@code name} of the {@code name-color} pair.
* <p>
* The value of the entry corresponds to the {@code color} of the
* {@code name-color} pair. The value of the entry is calculated
* in one of two ways. With either approach the value is always a
* {@code ColorUIResource}.
* <p>
* If {@code useNative} is {@code false}, the {@code color} is
* created by using {@code Color.decode} to convert the {@code
* String} into a {@code Color}. If {@code decode} can not convert
* the {@code String} into a {@code Color} ({@code
* NumberFormatException} is thrown) then a {@code
* ColorUIResource} of black is used.
* <p>
* If {@code useNative} is {@code true}, the {@code color} is the
* value of the field in {@code SystemColor} with the same name as
* the {@code name} of the {@code name-color} pair. If the field
* is not valid, a {@code ColorUIResource} of black is used.
*
* @param table the {@code UIDefaults} object the values are added to
* @param systemColors array of {@code name-color} pairs as described
* in {@link #initSystemColorDefaults(UIDefaults)}
* @param useNative whether the color is obtained from {@code SystemColor}
* or {@code Color.decode}
* @throws NullPointerException if {@code systemColors} is {@code null}; or
* {@code systemColors} is not empty, and {@code table} is
* {@code null}; or one of the
* names of the {@code name-color} pairs is {@code null}; or
* {@code useNative} is {@code false} and one of the
* {@code colors} of the {@code name-color} pairs is {@code null}
* @throws ArrayIndexOutOfBoundsException if {@code useNative} is
* {@code false} and {@code systemColors.length} is odd
*
* @see #initSystemColorDefaults(javax.swing.UIDefaults)
* @see java.awt.SystemColor
* @see java.awt.Color#decode(String)
*/
{
/* PENDING(hmuller) We don't load the system colors below because
* they're not reliable. Hopefully we'll be able to do better in
* a future version of AWT.
*/
if (useNative) {
try {
} catch (Exception e) {
}
}
} else {
try {
}
catch(NumberFormatException e) {
e.printStackTrace();
}
}
}
}
/**
* Initialize the defaults table with the name of the ResourceBundle
* used for getting localized defaults. Also initialize the default
* locale used when no locale is passed into UIDefaults.get(). The
* default locale should generally not be relied upon. It is here for
* compatability with releases prior to 1.4.
*/
}
/**
* Populates {@code table} with the defaults for the basic look and
* feel.
*
* @param table the {@code UIDefaults} to add the values to
* @throws NullPointerException if {@code table} is {@code null}
*/
{
// *** Shared Integers
// *** Shared Longs
// *** Shared Fonts
"javax.swing.plaf.FontUIResource",
null,
"javax.swing.plaf.FontUIResource",
null,
"javax.swing.plaf.FontUIResource",
null,
"javax.swing.plaf.FontUIResource",
null,
"javax.swing.plaf.FontUIResource",
null,
// *** Shared Colors
// *** Shared Insets
// *** Shared Borders
"javax.swing.plaf.basic.BasicBorders$MarginBorder");
"javax.swing.plaf.BorderUIResource",
"getEtchedBorderUIResource");
"javax.swing.plaf.BorderUIResource",
"getLoweredBevelBorderUIResource");
"javax.swing.plaf.basic.BasicBorders",
"getInternalFrameBorder");
"javax.swing.plaf.BorderUIResource",
"getBlackLineBorderUIResource");
"javax.swing.plaf.BorderUIResource$LineBorderUIResource",
null,
"javax.swing.plaf.BorderUIResource$BevelBorderUIResource",
null,
controlShadow });
// *** Button value objects
new SwingLazyValue(
"javax.swing.plaf.basic.BasicBorders",
"getButtonBorder");
new SwingLazyValue(
"javax.swing.plaf.basic.BasicBorders",
"getToggleButtonBorder");
new SwingLazyValue(
"javax.swing.plaf.basic.BasicBorders",
"getRadioButtonBorder");
// *** FileChooser / FileView value objects
BasicLookAndFeel.class,
"icons/NewFolder.gif");
BasicLookAndFeel.class,
"icons/UpFolder.gif");
BasicLookAndFeel.class,
"icons/HomeFolder.gif");
BasicLookAndFeel.class,
"icons/DetailsView.gif");
BasicLookAndFeel.class,
"icons/ListView.gif");
BasicLookAndFeel.class,
"icons/Directory.gif");
BasicLookAndFeel.class,
BasicLookAndFeel.class,
"icons/Computer.gif");
BasicLookAndFeel.class,
"icons/HardDrive.gif");
BasicLookAndFeel.class,
"icons/FloppyDrive.gif");
// *** InternalFrame value objects
"javax.swing.plaf.basic.BasicBorders",
"getInternalFrameBorder");
// *** List value objects
return new DefaultListCellRenderer.UIResource();
}
};
// *** Menus value objects
new SwingLazyValue(
"javax.swing.plaf.basic.BasicBorders",
"getMenuBarBorder");
new SwingLazyValue(
"javax.swing.plaf.basic.BasicIconFactory",
"getMenuItemCheckIcon");
new SwingLazyValue(
"javax.swing.plaf.basic.BasicIconFactory",
"getMenuItemArrowIcon");
new SwingLazyValue(
"javax.swing.plaf.basic.BasicIconFactory",
"getMenuArrowIcon");
new SwingLazyValue(
"javax.swing.plaf.basic.BasicIconFactory",
"getCheckBoxIcon");
new SwingLazyValue(
"javax.swing.plaf.basic.BasicIconFactory",
"getRadioButtonIcon");
new SwingLazyValue(
"javax.swing.plaf.basic.BasicIconFactory",
"getCheckBoxMenuItemIcon");
new SwingLazyValue(
"javax.swing.plaf.basic.BasicIconFactory",
"getRadioButtonMenuItemIcon");
// *** OptionPane value objects
"javax.swing.plaf.BorderUIResource$EmptyBorderUIResource",
"javax.swing.plaf.BorderUIResource$EmptyBorderUIResource",
"javax.swing.plaf.BorderUIResource$EmptyBorderUIResource",
// *** ProgessBar value objects
new SwingLazyValue(
"javax.swing.plaf.basic.BasicBorders",
"getProgressBarBorder");
// ** ScrollBar value objects
// ** Slider value objects
// *** SplitPane value objects
new SwingLazyValue(
"javax.swing.plaf.basic.BasicBorders",
"getSplitPaneBorder");
new SwingLazyValue(
"javax.swing.plaf.basic.BasicBorders",
"getSplitPaneDividerBorder");
// ** TabbedBane value objects
// *** Text value objects
new SwingLazyValue(
"javax.swing.plaf.basic.BasicBorders",
"getTextFieldBorder");
"CheckBoxMenuItem.commandSound",
"InternalFrame.closeSound",
"InternalFrame.maximizeSound",
"InternalFrame.minimizeSound",
"InternalFrame.restoreDownSound",
"InternalFrame.restoreUpSound",
"MenuItem.commandSound",
"OptionPane.errorSound",
"OptionPane.informationSound",
"OptionPane.questionSound",
"OptionPane.warningSound",
"PopupMenu.popupSound",
"RadioButtonMenuItem.commandSound"};
// *** Component Defaults
// *** Auditory Feedback
"AuditoryCues.cueList", allAuditoryCues,
"AuditoryCues.allAuditoryCues", allAuditoryCues,
"AuditoryCues.noAuditoryCues", noAuditoryCues,
// this key defines which of the various cues to render.
// L&Fs that want auditory feedback NEED to override playList.
"AuditoryCues.playList", null,
// *** Buttons
"Button.font", dialogPlain12,
"Button.background", control,
"Button.foreground", controlText,
"Button.shadow", controlShadow,
"Button.darkShadow", controlDkShadow,
"Button.light", controlHighlight,
"Button.highlight", controlLtHighlight,
"Button.border", buttonBorder,
"Button.textIconGap", four,
"Button.textShiftOffset", zero,
"SPACE", "pressed",
"released SPACE", "released",
"ENTER", "pressed",
"released ENTER", "released"
}),
"ToggleButton.font", dialogPlain12,
"ToggleButton.background", control,
"ToggleButton.foreground", controlText,
"ToggleButton.shadow", controlShadow,
"ToggleButton.darkShadow", controlDkShadow,
"ToggleButton.light", controlHighlight,
"ToggleButton.highlight", controlLtHighlight,
"ToggleButton.border", buttonToggleBorder,
"ToggleButton.textIconGap", four,
"ToggleButton.textShiftOffset", zero,
"ToggleButton.focusInputMap",
"SPACE", "pressed",
"released SPACE", "released"
}),
"RadioButton.font", dialogPlain12,
"RadioButton.background", control,
"RadioButton.foreground", controlText,
"RadioButton.shadow", controlShadow,
"RadioButton.darkShadow", controlDkShadow,
"RadioButton.light", controlHighlight,
"RadioButton.highlight", controlLtHighlight,
"RadioButton.border", radioButtonBorder,
"RadioButton.margin", twoInsets,
"RadioButton.textIconGap", four,
"RadioButton.textShiftOffset", zero,
"RadioButton.icon", radioButtonIcon,
"RadioButton.focusInputMap",
"SPACE", "pressed",
"released SPACE", "released",
"RETURN", "pressed"
}),
"CheckBox.font", dialogPlain12,
"CheckBox.background", control,
"CheckBox.foreground", controlText,
"CheckBox.border", radioButtonBorder,
"CheckBox.margin", twoInsets,
"CheckBox.textIconGap", four,
"CheckBox.textShiftOffset", zero,
"CheckBox.icon", checkBoxIcon,
"CheckBox.focusInputMap",
"SPACE", "pressed",
"released SPACE", "released"
}),
// *** ColorChooser
"ColorChooser.font", dialogPlain12,
"ColorChooser.background", control,
"ColorChooser.foreground", controlText,
"ColorChooser.swatchesDefaultRecentColor", control,
// *** ComboBox
"ComboBox.font", sansSerifPlain12,
"ComboBox.background", window,
"ComboBox.foreground", textText,
"ComboBox.buttonBackground", control,
"ComboBox.buttonShadow", controlShadow,
"ComboBox.buttonDarkShadow", controlDkShadow,
"ComboBox.buttonHighlight", controlLtHighlight,
"ComboBox.selectionBackground", textHighlight,
"ComboBox.selectionForeground", textHighlightText,
"ComboBox.disabledBackground", control,
"ComboBox.disabledForeground", textInactiveText,
"ComboBox.timeFactor", oneThousand,
"ComboBox.ancestorInputMap",
"ESCAPE", "hidePopup",
"PAGE_UP", "pageUpPassThrough",
"PAGE_DOWN", "pageDownPassThrough",
"HOME", "homePassThrough",
"END", "endPassThrough",
"ENTER", "enterPressed"
}),
// *** FileChooser
"FileChooser.newFolderIcon", newFolderIcon,
"FileChooser.upFolderIcon", upFolderIcon,
"FileChooser.homeFolderIcon", homeFolderIcon,
"FileChooser.detailsViewIcon", detailsViewIcon,
"FileChooser.listViewIcon", listViewIcon,
"FileChooser.ancestorInputMap",
"ESCAPE", "cancelSelection",
"F5", "refresh",
}),
"FileView.directoryIcon", directoryIcon,
"FileView.fileIcon", fileIcon,
"FileView.computerIcon", computerIcon,
"FileView.hardDriveIcon", hardDriveIcon,
"FileView.floppyDriveIcon", floppyDriveIcon,
// *** InternalFrame
"InternalFrame.titleFont", dialogBold12,
"InternalFrame.borderColor", control,
"InternalFrame.borderShadow", controlShadow,
"InternalFrame.borderDarkShadow", controlDkShadow,
"InternalFrame.borderHighlight", controlLtHighlight,
"InternalFrame.borderLight", controlHighlight,
"InternalFrame.border", internalFrameBorder,
BasicLookAndFeel.class,
"icons/JavaCup16.png"),
/* Default frame icons are undefined for Basic. */
"InternalFrame.maximizeIcon",
new SwingLazyValue(
"javax.swing.plaf.basic.BasicIconFactory",
"createEmptyFrameIcon"),
"InternalFrame.minimizeIcon",
new SwingLazyValue(
"javax.swing.plaf.basic.BasicIconFactory",
"createEmptyFrameIcon"),
"InternalFrame.iconifyIcon",
new SwingLazyValue(
"javax.swing.plaf.basic.BasicIconFactory",
"createEmptyFrameIcon"),
"InternalFrame.closeIcon",
new SwingLazyValue(
"javax.swing.plaf.basic.BasicIconFactory",
"createEmptyFrameIcon"),
// InternalFrame Auditory Cue Mappings
"InternalFrame.closeSound", null,
"InternalFrame.maximizeSound", null,
"InternalFrame.minimizeSound", null,
"InternalFrame.restoreDownSound", null,
"InternalFrame.restoreUpSound", null,
"InternalFrame.windowBindings", new Object[] {
"shift ESCAPE", "showSystemMenu",
"ctrl SPACE", "showSystemMenu",
"ESCAPE", "hideSystemMenu"},
"DesktopIcon.border", internalFrameBorder,
"Desktop.minOnScreenInsets", threeInsets,
"Desktop.ancestorInputMap",
"ctrl F5", "restore",
"ctrl F4", "close",
"ctrl F7", "move",
"ctrl F8", "resize",
"RIGHT", "right",
"KP_RIGHT", "right",
"shift RIGHT", "shrinkRight",
"shift KP_RIGHT", "shrinkRight",
"LEFT", "left",
"KP_LEFT", "left",
"shift LEFT", "shrinkLeft",
"shift KP_LEFT", "shrinkLeft",
"UP", "up",
"KP_UP", "up",
"shift UP", "shrinkUp",
"shift KP_UP", "shrinkUp",
"DOWN", "down",
"KP_DOWN", "down",
"shift DOWN", "shrinkDown",
"shift KP_DOWN", "shrinkDown",
"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"
}),
// *** Label
"Label.font", dialogPlain12,
"Label.background", control,
"Label.foreground", controlText,
"Label.disabledForeground", white,
"Label.disabledShadow", controlShadow,
"Label.border", null,
// *** List
"List.font", dialogPlain12,
"List.background", window,
"List.foreground", textText,
"List.selectionBackground", textHighlight,
"List.selectionForeground", textHighlightText,
"List.noFocusBorder", noFocusBorder,
"List.focusCellHighlightBorder", focusCellHighlightBorder,
"List.dropLineColor", controlShadow,
"List.border", null,
"List.cellRenderer", listCellRendererActiveValue,
"List.timeFactor", oneThousand,
"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"
}),
"List.focusInputMap.RightToLeft",
"LEFT", "selectNextColumn",
"KP_LEFT", "selectNextColumn",
"shift LEFT", "selectNextColumnExtendSelection",
"shift KP_LEFT", "selectNextColumnExtendSelection",
"ctrl shift LEFT", "selectNextColumnExtendSelection",
"ctrl shift KP_LEFT", "selectNextColumnExtendSelection",
"ctrl LEFT", "selectNextColumnChangeLead",
"ctrl KP_LEFT", "selectNextColumnChangeLead",
"RIGHT", "selectPreviousColumn",
"KP_RIGHT", "selectPreviousColumn",
"shift RIGHT", "selectPreviousColumnExtendSelection",
"shift KP_RIGHT", "selectPreviousColumnExtendSelection",
"ctrl shift RIGHT", "selectPreviousColumnExtendSelection",
"ctrl shift KP_RIGHT", "selectPreviousColumnExtendSelection",
"ctrl RIGHT", "selectPreviousColumnChangeLead",
"ctrl KP_RIGHT", "selectPreviousColumnChangeLead",
}),
// *** Menus
"MenuBar.font", dialogPlain12,
"MenuBar.background", menu,
"MenuBar.foreground", menuText,
"MenuBar.shadow", controlShadow,
"MenuBar.highlight", controlLtHighlight,
"MenuBar.border", menuBarBorder,
"MenuBar.windowBindings", new Object[] {
"F10", "takeFocus" },
"MenuItem.font", dialogPlain12,
"MenuItem.acceleratorFont", dialogPlain12,
"MenuItem.background", menu,
"MenuItem.foreground", menuText,
"MenuItem.selectionForeground", textHighlightText,
"MenuItem.selectionBackground", textHighlight,
"MenuItem.disabledForeground", null,
"MenuItem.acceleratorForeground", menuText,
"MenuItem.acceleratorSelectionForeground", textHighlightText,
"MenuItem.acceleratorDelimiter", menuItemAcceleratorDelimiter,
"MenuItem.border", marginBorder,
"MenuItem.margin", twoInsets,
"MenuItem.checkIcon", menuItemCheckIcon,
"MenuItem.arrowIcon", menuItemArrowIcon,
"MenuItem.commandSound", null,
"RadioButtonMenuItem.font", dialogPlain12,
"RadioButtonMenuItem.acceleratorFont", dialogPlain12,
"RadioButtonMenuItem.background", menu,
"RadioButtonMenuItem.foreground", menuText,
"RadioButtonMenuItem.selectionForeground", textHighlightText,
"RadioButtonMenuItem.selectionBackground", textHighlight,
"RadioButtonMenuItem.disabledForeground", null,
"RadioButtonMenuItem.acceleratorForeground", menuText,
"RadioButtonMenuItem.acceleratorSelectionForeground", textHighlightText,
"RadioButtonMenuItem.border", marginBorder,
"RadioButtonMenuItem.margin", twoInsets,
"RadioButtonMenuItem.checkIcon", radioButtonMenuItemIcon,
"RadioButtonMenuItem.arrowIcon", menuItemArrowIcon,
"RadioButtonMenuItem.commandSound", null,
"CheckBoxMenuItem.font", dialogPlain12,
"CheckBoxMenuItem.acceleratorFont", dialogPlain12,
"CheckBoxMenuItem.background", menu,
"CheckBoxMenuItem.foreground", menuText,
"CheckBoxMenuItem.selectionForeground", textHighlightText,
"CheckBoxMenuItem.selectionBackground", textHighlight,
"CheckBoxMenuItem.disabledForeground", null,
"CheckBoxMenuItem.acceleratorForeground", menuText,
"CheckBoxMenuItem.acceleratorSelectionForeground", textHighlightText,
"CheckBoxMenuItem.border", marginBorder,
"CheckBoxMenuItem.margin", twoInsets,
"CheckBoxMenuItem.checkIcon", checkBoxMenuItemIcon,
"CheckBoxMenuItem.arrowIcon", menuItemArrowIcon,
"CheckBoxMenuItem.commandSound", null,
"Menu.font", dialogPlain12,
"Menu.acceleratorFont", dialogPlain12,
"Menu.background", menu,
"Menu.foreground", menuText,
"Menu.selectionForeground", textHighlightText,
"Menu.selectionBackground", textHighlight,
"Menu.disabledForeground", null,
"Menu.acceleratorForeground", menuText,
"Menu.acceleratorSelectionForeground", textHighlightText,
"Menu.border", marginBorder,
"Menu.margin", twoInsets,
"Menu.checkIcon", menuItemCheckIcon,
"Menu.arrowIcon", menuArrowIcon,
"Menu.shortcutKeys", new int[]{
},
// Menu.cancelMode affects the cancel menu action behaviour;
// currently supports:
// "hideLastSubmenu" (default)
// hides the last open submenu,
// and move selection one step back
// "hideMenuTree"
// resets selection and
// hide the entire structure of open menu and its submenus
"Menu.cancelMode", "hideLastSubmenu",
// Menu.preserveTopLevelSelection affects
// the cancel menu action behaviour
// if set to true then top level menu selection
// will be preserved when the last popup was cancelled;
// the menu itself will be unselect with the next cancel action
// PopupMenu
"PopupMenu.font", dialogPlain12,
"PopupMenu.background", menu,
"PopupMenu.foreground", menuText,
"PopupMenu.border", popupMenuBorder,
// Internal Frame Auditory Cue Mappings
"PopupMenu.popupSound", null,
// These window InputMap bindings are used when the Menu is
// selected.
"PopupMenu.selectedWindowInputMapBindings", new Object[] {
"ESCAPE", "cancel",
"DOWN", "selectNext",
"KP_DOWN", "selectNext",
"UP", "selectPrevious",
"KP_UP", "selectPrevious",
"LEFT", "selectParent",
"KP_LEFT", "selectParent",
"RIGHT", "selectChild",
"KP_RIGHT", "selectChild",
"ENTER", "return",
"ctrl ENTER", "return",
"SPACE", "return"
},
"PopupMenu.selectedWindowInputMapBindings.RightToLeft", new Object[] {
"LEFT", "selectChild",
"KP_LEFT", "selectChild",
"RIGHT", "selectParent",
"KP_RIGHT", "selectParent",
},
// *** OptionPane
// You can additionaly define OptionPane.messageFont which will
// dictate the fonts used for the message, and
// OptionPane.buttonFont, which defines the font for the buttons.
"OptionPane.font", dialogPlain12,
"OptionPane.background", control,
"OptionPane.foreground", controlText,
"OptionPane.messageForeground", controlText,
"OptionPane.border", optionPaneBorder,
"OptionPane.messageAreaBorder", zeroBorder,
"OptionPane.buttonAreaBorder", optionPaneButtonAreaBorder,
"OptionPane.minimumSize", optionPaneMinimumSize,
BasicLookAndFeel.class,
BasicLookAndFeel.class,
"icons/Inform.gif"),
BasicLookAndFeel.class,
BasicLookAndFeel.class,
"icons/Question.gif"),
"OptionPane.windowBindings", new Object[] {
"ESCAPE", "close" },
// OptionPane Auditory Cue Mappings
"OptionPane.errorSound", null,
"OptionPane.questionSound", null,
"OptionPane.warningSound", null,
"OptionPane.buttonClickThreshhold", fiveHundred,
// *** Panel
"Panel.font", dialogPlain12,
"Panel.background", control,
"Panel.foreground", textText,
// *** ProgressBar
"ProgressBar.font", dialogPlain12,
"ProgressBar.foreground", textHighlight,
"ProgressBar.background", control,
"ProgressBar.selectionForeground", control,
"ProgressBar.selectionBackground", textHighlight,
"ProgressBar.border", progressBarBorder,
"ProgressBar.cellSpacing", zero,
// *** Separator
"Separator.background", controlLtHighlight,
"Separator.foreground", controlShadow,
// *** ScrollBar/ScrollPane/Viewport
"ScrollBar.background", scrollBarTrack,
"ScrollBar.foreground", control,
"ScrollBar.trackHighlight", controlDkShadow,
"ScrollBar.thumb", control,
"ScrollBar.thumbHighlight", controlLtHighlight,
"ScrollBar.thumbDarkShadow", controlDkShadow,
"ScrollBar.thumbShadow", controlShadow,
"ScrollBar.border", null,
"ScrollBar.minimumThumbSize", minimumThumbSize,
"ScrollBar.maximumThumbSize", maximumThumbSize,
"ScrollBar.ancestorInputMap",
"RIGHT", "positiveUnitIncrement",
"KP_RIGHT", "positiveUnitIncrement",
"DOWN", "positiveUnitIncrement",
"KP_DOWN", "positiveUnitIncrement",
"PAGE_DOWN", "positiveBlockIncrement",
"LEFT", "negativeUnitIncrement",
"KP_LEFT", "negativeUnitIncrement",
"UP", "negativeUnitIncrement",
"KP_UP", "negativeUnitIncrement",
"PAGE_UP", "negativeBlockIncrement",
"HOME", "minScroll",
"END", "maxScroll"
}),
"ScrollBar.ancestorInputMap.RightToLeft",
"RIGHT", "negativeUnitIncrement",
"KP_RIGHT", "negativeUnitIncrement",
"LEFT", "positiveUnitIncrement",
"KP_LEFT", "positiveUnitIncrement",
}),
"ScrollPane.font", dialogPlain12,
"ScrollPane.background", control,
"ScrollPane.foreground", controlText,
"ScrollPane.border", textFieldBorder,
"ScrollPane.viewportBorder", null,
"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"
}),
"ScrollPane.ancestorInputMap.RightToLeft",
"ctrl PAGE_UP", "scrollRight",
"ctrl PAGE_DOWN", "scrollLeft",
}),
"Viewport.font", dialogPlain12,
"Viewport.background", control,
"Viewport.foreground", textText,
// *** Slider
"Slider.font", dialogPlain12,
"Slider.foreground", control,
"Slider.background", control,
"Slider.highlight", controlLtHighlight,
"Slider.shadow", controlShadow,
"Slider.focus", controlDkShadow,
"Slider.border", null,
"Slider.focusInsets", sliderFocusInsets,
"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"
}),
"Slider.focusInputMap.RightToLeft",
"RIGHT", "negativeUnitIncrement",
"KP_RIGHT", "negativeUnitIncrement",
"LEFT", "positiveUnitIncrement",
"KP_LEFT", "positiveUnitIncrement",
}),
// *** Spinner
"Spinner.font", monospacedPlain12,
"Spinner.background", control,
"Spinner.foreground", control,
"Spinner.border", textFieldBorder,
"Spinner.arrowButtonBorder", null,
"Spinner.arrowButtonInsets", null,
"Spinner.ancestorInputMap",
"UP", "increment",
"KP_UP", "increment",
"DOWN", "decrement",
"KP_DOWN", "decrement",
}),
// *** SplitPane
"SplitPane.background", control,
"SplitPane.highlight", controlLtHighlight,
"SplitPane.shadow", controlShadow,
"SplitPane.darkShadow", controlDkShadow,
"SplitPane.border", splitPaneBorder,
"SplitPaneDivider.border", splitPaneDividerBorder,
"SplitPaneDivider.draggingColor", darkGray,
"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", dialogPlain12,
"TabbedPane.background", control,
"TabbedPane.foreground", controlText,
"TabbedPane.highlight", controlLtHighlight,
"TabbedPane.light", controlHighlight,
"TabbedPane.shadow", controlShadow,
"TabbedPane.darkShadow", controlDkShadow,
"TabbedPane.selected", null,
"TabbedPane.focus", controlText,
"TabbedPane.textIconGap", four,
// Causes tabs to be painted on top of the content area border.
// The amount of overlap is then controlled by tabAreaInsets.bottom,
// which is zero by default
"TabbedPane.labelShift", 1,
"TabbedPane.selectedLabelShift", -1,
"TabbedPane.tabInsets", tabbedPaneTabInsets,
"TabbedPane.selectedTabPadInsets", tabbedPaneTabPadInsets,
"TabbedPane.tabAreaInsets", tabbedPaneTabAreaInsets,
"TabbedPane.contentBorderInsets", tabbedPaneContentBorderInsets,
"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 PAGE_DOWN", "navigatePageDown",
"ctrl PAGE_UP", "navigatePageUp",
"ctrl UP", "requestFocus",
"ctrl KP_UP", "requestFocus",
}),
// *** Table
"Table.font", dialogPlain12,
"Table.selectionForeground", textHighlightText,
"Table.selectionBackground", textHighlight,
"Table.dropLineColor", controlShadow,
"Table.dropLineShortColor", black,
"Table.focusCellBackground", window,
"Table.focusCellForeground", controlText,
"Table.focusCellHighlightBorder", focusCellHighlightBorder,
"Table.scrollPaneBorder", loweredBevelBorder,
"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.ancestorInputMap.RightToLeft",
"RIGHT", "selectPreviousColumn",
"KP_RIGHT", "selectPreviousColumn",
"shift RIGHT", "selectPreviousColumnExtendSelection",
"shift KP_RIGHT", "selectPreviousColumnExtendSelection",
"ctrl shift RIGHT", "selectPreviousColumnExtendSelection",
"ctrl shift KP_RIGHT", "selectPreviousColumnExtendSelection",
"ctrl RIGHT", "selectPreviousColumnChangeLead",
"ctrl KP_RIGHT", "selectPreviousColumnChangeLead",
"LEFT", "selectNextColumn",
"KP_LEFT", "selectNextColumn",
"shift LEFT", "selectNextColumnExtendSelection",
"shift KP_LEFT", "selectNextColumnExtendSelection",
"ctrl shift LEFT", "selectNextColumnExtendSelection",
"ctrl shift KP_LEFT", "selectNextColumnExtendSelection",
"ctrl LEFT", "selectNextColumnChangeLead",
"ctrl KP_LEFT", "selectNextColumnChangeLead",
"ctrl PAGE_UP", "scrollRightChangeSelection",
"ctrl PAGE_DOWN", "scrollLeftChangeSelection",
"ctrl shift PAGE_UP", "scrollRightExtendSelection",
"ctrl shift PAGE_DOWN", "scrollLeftExtendSelection",
}),
"Table.ascendingSortIcon", new SwingLazyValue(
"sun.swing.icon.SortArrowIcon",
"Table.sortIconColor" }),
"Table.descendingSortIcon", new SwingLazyValue(
"sun.swing.icon.SortArrowIcon",
"Table.sortIconColor" }),
"Table.sortIconColor", controlShadow,
"TableHeader.font", dialogPlain12,
"TableHeader.cellBorder", tableHeaderBorder,
// Support for changing the background/border of the currently
// selected header column when the header has the keyboard focus.
"TableHeader.focusCellForeground", null,
"TableHeader.focusCellBorder", null,
"TableHeader.ancestorInputMap",
"SPACE", "toggleSortOrder",
"LEFT", "selectColumnToLeft",
"KP_LEFT", "selectColumnToLeft",
"RIGHT", "selectColumnToRight",
"KP_RIGHT", "selectColumnToRight",
"alt LEFT", "moveColumnLeft",
"alt KP_LEFT", "moveColumnLeft",
"alt RIGHT", "moveColumnRight",
"alt KP_RIGHT", "moveColumnRight",
"alt shift LEFT", "resizeLeft",
"alt shift KP_LEFT", "resizeLeft",
"alt shift RIGHT", "resizeRight",
"alt shift KP_RIGHT", "resizeRight",
"ESCAPE", "focusTable",
}),
// *** Text
"TextField.font", sansSerifPlain12,
"TextField.background", window,
"TextField.foreground", textText,
"TextField.shadow", controlShadow,
"TextField.darkShadow", controlDkShadow,
"TextField.light", controlHighlight,
"TextField.highlight", controlLtHighlight,
"TextField.inactiveForeground", textInactiveText,
"TextField.inactiveBackground", control,
"TextField.selectionBackground", textHighlight,
"TextField.selectionForeground", textHighlightText,
"TextField.caretForeground", textText,
"TextField.caretBlinkRate", caretBlinkRate,
"TextField.border", textFieldBorder,
"TextField.margin", zeroInsets,
"FormattedTextField.font", sansSerifPlain12,
"FormattedTextField.background", window,
"FormattedTextField.foreground", textText,
"FormattedTextField.inactiveForeground", textInactiveText,
"FormattedTextField.inactiveBackground", control,
"FormattedTextField.selectionBackground", textHighlight,
"FormattedTextField.selectionForeground", textHighlightText,
"FormattedTextField.caretForeground", textText,
"FormattedTextField.caretBlinkRate", caretBlinkRate,
"FormattedTextField.border", textFieldBorder,
"FormattedTextField.margin", zeroInsets,
"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",
}),
"PasswordField.font", monospacedPlain12,
"PasswordField.background", window,
"PasswordField.foreground", textText,
"PasswordField.inactiveForeground", textInactiveText,
"PasswordField.inactiveBackground", control,
"PasswordField.selectionBackground", textHighlight,
"PasswordField.selectionForeground", textHighlightText,
"PasswordField.caretForeground", textText,
"PasswordField.caretBlinkRate", caretBlinkRate,
"PasswordField.border", textFieldBorder,
"PasswordField.margin", zeroInsets,
"PasswordField.echoChar", '*',
"TextArea.font", monospacedPlain12,
"TextArea.background", window,
"TextArea.foreground", textText,
"TextArea.inactiveForeground", textInactiveText,
"TextArea.selectionBackground", textHighlight,
"TextArea.selectionForeground", textHighlightText,
"TextArea.caretForeground", textText,
"TextArea.caretBlinkRate", caretBlinkRate,
"TextArea.border", marginBorder,
"TextArea.margin", zeroInsets,
"TextPane.font", serifPlain12,
"TextPane.background", white,
"TextPane.foreground", textText,
"TextPane.selectionBackground", textHighlight,
"TextPane.selectionForeground", textHighlightText,
"TextPane.caretForeground", textText,
"TextPane.caretBlinkRate", caretBlinkRate,
"TextPane.inactiveForeground", textInactiveText,
"TextPane.border", marginBorder,
"TextPane.margin", editorMargin,
"EditorPane.font", serifPlain12,
"EditorPane.background", white,
"EditorPane.foreground", textText,
"EditorPane.selectionBackground", textHighlight,
"EditorPane.selectionForeground", textHighlightText,
"EditorPane.caretForeground", textText,
"EditorPane.caretBlinkRate", caretBlinkRate,
"EditorPane.inactiveForeground", textInactiveText,
"EditorPane.border", marginBorder,
"EditorPane.margin", editorMargin,
BasicLookAndFeel.class,
BasicLookAndFeel.class,
// *** TitledBorder
"TitledBorder.font", dialogPlain12,
"TitledBorder.titleColor", controlText,
"TitledBorder.border", etchedBorder,
// *** ToolBar
"ToolBar.font", dialogPlain12,
"ToolBar.background", control,
"ToolBar.foreground", controlText,
"ToolBar.shadow", controlShadow,
"ToolBar.darkShadow", controlDkShadow,
"ToolBar.light", controlHighlight,
"ToolBar.highlight", controlLtHighlight,
"ToolBar.dockingBackground", control,
"ToolBar.dockingForeground", red,
"ToolBar.floatingBackground", control,
"ToolBar.floatingForeground", darkGray,
"ToolBar.border", etchedBorder,
"ToolBar.separatorSize", toolBarSeparatorSize,
"ToolBar.ancestorInputMap",
"UP", "navigateUp",
"KP_UP", "navigateUp",
"DOWN", "navigateDown",
"KP_DOWN", "navigateDown",
"LEFT", "navigateLeft",
"KP_LEFT", "navigateLeft",
"RIGHT", "navigateRight",
"KP_RIGHT", "navigateRight"
}),
// *** ToolTips
"ToolTip.font", sansSerifPlain12,
"ToolTip.border", blackLineBorder,
// ToolTips also support backgroundInactive, borderInactive,
// and foregroundInactive
// *** ToolTipManager
// ToolTipManager.enableToolTipMode currently supports:
// "allWindows" (default):
// enables tool tips for all windows of all java applications,
// whether the windows are active or inactive
// "activeApplication"
// enables tool tips for windows of an application only when
// the application has an active window
"ToolTipManager.enableToolTipMode", "allWindows",
// *** Tree
"Tree.font", dialogPlain12,
"Tree.background", window,
"Tree.foreground", textText,
"Tree.hash", gray,
"Tree.textForeground", textText,
"Tree.selectionForeground", textHighlightText,
"Tree.selectionBackground", textHighlight,
"Tree.selectionBorderColor", black,
"Tree.dropLineColor", controlShadow,
"Tree.editorBorder", blackLineBorder,
BasicLookAndFeel.class,
"icons/TreeOpen.gif"),
BasicLookAndFeel.class,
"icons/TreeClosed.gif"),
BasicLookAndFeel.class,
"icons/TreeLeaf.gif"),
"Tree.expandedIcon", null,
"Tree.collapsedIcon", null,
"Tree.timeFactor", oneThousand,
"Tree.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", "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.focusInputMap.RightToLeft",
"RIGHT", "selectParent",
"KP_RIGHT", "selectParent",
"LEFT", "selectChild",
"KP_LEFT", "selectChild",
}),
"Tree.ancestorInputMap",
"ESCAPE", "cancel"
}),
// Bind specific keys that can invoke popup on currently
// focused JComponent
"RootPane.ancestorInputMap",
"shift F10", "postPopup",
"CONTEXT_MENU", "postPopup"
}),
// 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"
},
};
}
static int getFocusAcceleratorKeyMask() {
if (tk instanceof SunToolkit) {
}
return ActionEvent.ALT_MASK;
}
/**
* Returns the ui that is of type <code>klass</code>, or null if
* one can not be found.
*/
return ui;
}
return null;
}
// ********* Auditory Cue support methods and objects *********
// also see the "AuditoryCues" section of the defaults table
/**
* Returns an <code>ActionMap</code> containing the audio actions
* for this look and feel.
* <P>
* The returned <code>ActionMap</code> contains <code>Actions</code> that
* embody the ability to render an auditory cue. These auditory
* cues map onto user and system activities that may be useful
* for an end user to know about (such as a dialog box appearing).
* <P>
* At the appropriate time,
* the {@code ComponentUI} is responsible for obtaining an
* <code>Action</code> out of the <code>ActionMap</code> and passing
* it to <code>playSound</code>.
* <P>
* This method first looks up the {@code ActionMap} from the
* defaults using the key {@code "AuditoryCues.actionMap"}.
* <p>
* If the value is {@code non-null}, it is returned. If the value
* of the default {@code "AuditoryCues.actionMap"} is {@code null}
* and the value of the default {@code "AuditoryCues.cueList"} is
* {@code non-null}, an {@code ActionMapUIResource} is created and
* populated. Population is done by iterating over each of the
* elements of the {@code "AuditoryCues.cueList"} array, and
* invoking {@code createAudioAction()} to create an {@code
* Action} for each element. The resulting {@code Action} is
* placed in the {@code ActionMapUIResource}, using the array
* element as the key. For example, if the {@code
* "AuditoryCues.cueList"} array contains a single-element, {@code
* "audioKey"}, the {@code ActionMapUIResource} is created, then
* populated by way of {@code actionMap.put(cueList[0],
* createAudioAction(cueList[0]))}.
* <p>
* If the value of the default {@code "AuditoryCues.actionMap"} is
* {@code null} and the value of the default
* {@code "AuditoryCues.cueList"} is {@code null}, an empty
* {@code ActionMapUIResource} is created.
*
*
* @return an ActionMap containing {@code Actions}
* responsible for playing auditory cues
* @throws ClassCastException if the value of the
* default {@code "AuditoryCues.actionMap"} is not an
* {@code ActionMap}, or the value of the default
* {@code "AuditoryCues.cueList"} is not an {@code Object[]}
* @see #createAudioAction
* @see #playSound(Action)
* @since 1.4
*/
"AuditoryCues.actionMap");
if (audioActionMap == null) {
audioActionMap = new ActionMapUIResource();
}
}
}
return audioActionMap;
}
/**
* Creates and returns an {@code Action} used to play a sound.
* <p>
* If {@code key} is {@code non-null}, an {@code Action} is created
* using the value from the defaults with key {@code key}. The value
* identifies the sound resource to load when
* {@code actionPerformed} is invoked on the {@code Action}. The
* sound resource is loaded into a {@code byte[]} by way of
* {@code getClass().getResourceAsStream()}.
*
* @param key the key identifying the audio action
* @return an {@code Action} used to play the source, or {@code null}
* if {@code key} is {@code null}
* @see #playSound(Action)
* @since 1.4
*/
} else {
return null;
}
}
/**
* 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. I is used to get the audio
* resource. In this case, the resource is an audio file.
*
* @since 1.4
*/
// We strive to only play one sound at a time (other platforms
// appear to do this). This is done by maintaining the field
// clipPlaying. Every time a sound is to be played,
// cancelCurrentSound is invoked to cancel any sound that may be
// playing.
private byte[] audioBuffer;
/**
* The String is the name of the Action and
* points to the audio resource.
* The byte[] is a buffer of the audio bits.
*/
super(name);
}
if (audioBuffer == null) {
}
if (audioBuffer != null) {
try {
new ByteArrayInputStream(audioBuffer));
clip.addLineListener(this);
synchronized(audioLock) {
clipPlaying = clip;
}
}
}
}
}
/**
* If the parameter is null, or equal to the currently
* playing sound, then cancel the currently playing sound.
*/
synchronized(audioLock) {
clipPlaying = null;
}
}
lastClip.removeLineListener(this);
}
}
}
/**
* Utility method that loads audio bits for the specified
* <code>soundFile</code> filename. If this method is unable to
* build a viable path name from the <code>baseClass</code> and
* <code>soundFile</code> passed into this method, it will
* return <code>null</code>.
*
* @param soundFile the name of the audio file to be retrieved
* from disk
* @return A byte[] with audio data or null
* @since 1.4
*/
return null;
}
/* Copy resource into a byte array. This is
* necessary because several browsers consider
* Class.getResource a security risk since it
* can be used to load additional classes.
* Class.getResourceAsStream just returns raw
* bytes, which we can convert to a sound.
*/
new PrivilegedAction<byte[]>() {
public byte[] run() {
try {
return null;
}
new BufferedInputStream(resource);
new ByteArrayOutputStream(1024);
byte[] buffer = new byte[1024];
int n;
}
return buffer;
} catch (IOException ioe) {
return null;
}
}
});
soundFile + " not found.");
return null;
}
" is zero-length");
return null;
}
return buffer;
}
/**
* If necessary, invokes {@code actionPerformed} on
* {@code audioAction} to play a sound.
* The {@code actionPerformed} method is invoked if the value of
* the {@code "AuditoryCues.playList"} default is a {@code
* non-null} {@code Object[]} containing a {@code String} entry
* equal to the name of the {@code audioAction}.
*
* @param audioAction an Action that knows how to render the audio
* associated with the system or user activity
* that is occurring; a value of {@code null}, is
* ignored
* @throws ClassCastException if {@code audioAction} is {@code non-null}
* and the value of the default {@code "AuditoryCues.playList"}
* is not an {@code Object[]}
* @since 1.4
*/
if (audioAction != null) {
if (audioStrings != null) {
// create a HashSet to help us decide to play or not
}
// get the name of the Action
// if the actionName is in the audioCues HashSet, play it.
actionName));
}
}
}
}
/**
* Sets the parent of the passed in ActionMap to be the audio action
* map.
*/
if (laf instanceof BasicLookAndFeel) {
}
}
/**
* Helper method to play a named sound.
*
* @param c JComponent to play the sound for.
* @param actionKey Key for the sound.
*/
if (laf instanceof BasicLookAndFeel) {
if (audioAction != null) {
// pass off firing the Action to a utility method
}
}
}
}
/**
* This class contains listener that watches for all the mouse
* events that can possibly invoke popup on the component
*/
AWTEventHelper() {
super();
AccessController.doPrivileged(this);
}
} else {
}
// Return value not used.
return null;
}
if(me.isPopupTrigger()) {
.getSelectedPath();
return;
// We shall not interfere with already opened menu
}
if(c instanceof JComponent) {
src = (JComponent) c;
} else if(c instanceof BasicSplitPaneDivider) {
// Special case - if user clicks on divider we must
// invoke popup from the SplitPane
src = (JComponent)
((BasicSplitPaneDivider)c).getParent();
}
}
}
}
}
}
/* Activate a JInternalFrame if necessary. */
return;
}
if (parent instanceof JInternalFrame) {
// Activate the frame.
catch (PropertyVetoException e1) { }
}
}
}
}
}
}
}