/*
* 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.
*/
static final String sOldPropertyPrefix = "com.apple.macos."; // old prefix for things like 'useScreenMenuBar'
static final String sPropertyPrefix = "apple.laf."; // new prefix for things like 'useScreenMenuBar'
// for lazy initalizers. Following the pattern from metal.
/**
* Return a short string that identifies this look and feel, e.g.
* Distinct look and feels should have different names, e.g.
* a subclass of MotifLookAndFeel that changes the way a few components
* that would be useful to a user trying to select a L&F from a list
* of names.
*/
return "Mac OS X";
}
/**
* Return a string that identifies this look and feel. This string
* will be used by applications/services that want to recognize
* well known look and feel implementations. Presently
* the well known names are "Motif", "Windows", "Mac", "Metal". Note
* that a LookAndFeel derived from a well known superclass
* that doesn't make any fundamental changes to the look or feel
* shouldn't override this method.
*/
return "Aqua";
}
/**
* Return a one line description of this look and feel implementation,
* the user, e.g. in the title of a window or in a ToolTip message.
*/
return "Aqua Look and Feel for Mac OS X";
}
/**
* Returns true if the <code>LookAndFeel</code> returned
* <code>RootPaneUI</code> instances support providing Window decorations
* in a <code>JRootPane</code>.
* <p>
* The default implementation returns false, subclasses that support
* Window decorations should override this and return true.
*
* @return True if the RootPaneUI instances created support client side
* decorations
* @see JDialog#setDefaultLookAndFeelDecorated
* @see JFrame#setDefaultLookAndFeelDecorated
* @see JRootPane#setWindowDecorationStyle
* @since 1.4
*/
public boolean getSupportsWindowDecorations() {
return false;
}
/**
* If the underlying platform has a "native" look and feel, and this
* is an implementation of it, return true.
*/
public boolean isNativeLookAndFeel() {
return true;
}
/**
* Return true if the underlying platform supports and or permits
* this look and feel. This method returns false if the look
* and feel depends on special resources or legal agreements that
* aren't defined for the current platform.
*
* @see UIManager#setLookAndFeel
*/
public boolean isSupportedLookAndFeel() {
return true;
}
/**
* UIManager.setLookAndFeel calls this method before the first
* call (and typically the only call) to getDefaults(). Subclasses
* should do any one-time setup they need here, rather than
* in a static initializer, because look and feel class objects
* may be loaded just to discover that isSupportedLookAndFeel()
* returns false.
*
* @see #uninitialize
* @see UIManager#setLookAndFeel
*/
public void initialize() {
java.security.AccessController.doPrivileged((PrivilegedAction<?>)new sun.security.action.LoadLibraryAction("osxui"));
return null;
}
});
super.initialize();
KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventPostProcessor(AquaMnemonicHandler.getInstance());
}
/**
* UIManager.setLookAndFeel calls this method just before we're
* replaced by a new default look and feel. Subclasses may
* choose to free up some resources here.
*
* @see #initialize
*/
public void uninitialize() {
KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventPostProcessor(AquaMnemonicHandler.getInstance());
}
super.uninitialize();
}
/**
* Returns an <code>ActionMap</code>.
* <P>
* This <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 in a <code>JComponent</code> UI's lifecycle,
* the ComponentUI is responsible for getting the appropriate
* <code>Action</code> out of the <code>ActionMap</code> and passing
* it on to <code>playSound</code>.
* <P>
* The <code>Actions</code> in this <code>ActionMap</code> are
* created by the <code>createAudioAction</code> method.
*
* @return an ActionMap containing Actions
* responsible for rendering auditory cues
* @see #createAudioAction
* @see #playSound(Action)
* @since 1.4
*/
audioActionMap = new ActionMapUIResource();
}
}
return audioActionMap;
}
/**
* We override getDefaults() so we can install our own debug defaults
* if needed for testing
*/
// use debug defaults if you want to see every query into the defaults object.
//UIDefaults table = new DebugDefaults();
try {
// PopupFactory.getSharedInstance().setPopupType(2);
// Here we install all the Basic defaults in case we missed some in our System color
// or component defaults that follow. Eventually we will take this out.
// This is a big negative to performance so we want to get it out as soon
// as we are comfortable with the Aqua defaults.
super.initSystemColorDefaults(table);
super.initComponentDefaults(table);
// Because the last elements added win in precedence we add all of our aqua elements here.
} catch(final Exception e) {
e.printStackTrace();
}
return table;
}
/**
* 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.
*/
try {
final ResourceBundle aquaProperties = MacOSXResourceBundle.getMacResourceBundle(PKG_PREFIX + "resources.aqua");
while (propertyKeys.hasMoreElements()) {
}
} catch (final Exception e) {
}
}
/**
* This is the last step in the getDefaults routine usually called from our superclass
*/
// <rdar://problem/5189013> Entire Java application window refreshes when moving off Shortcut menu item
final Boolean buttonShouldBeOpaque = AquaUtils.shouldUseOpaqueButtons() ? Boolean.TRUE : Boolean.FALSE;
// *** List value objects
return new DefaultListCellRenderer.UIResource();
}
};
// SJA - I'm basing this on what is in the MetalLookAndFeel class, but
// without being based on BasicLookAndFeel. We want more flexibility.
// The key to doing this well is to use Lazy initializing classes as
// much as possible.
// Here I want to go to native and get all the values we'd need for colors etc.
// final ColorUIResource lightGray = new ColorUIResource(232, 232, 232);
// Contrast tab UI colors
final ColorUIResource selectedTabTitleDisabledColor = new ColorUIResource(new Color(1, 1, 1, 0.55f));
final ColorUIResource selectedTabTitleShadowDisabledColor = new ColorUIResource(new Color(0, 0, 0, 0.25f));
// sja todo Make these lazy values so we only get them when required - if we deem it necessary
// it may be the case that we think the overhead of a proxy lazy value is not worth delaying
// creating the object if we think that most swing apps will use this.
// the lazy value is useful for delaying initialization until this default value is actually
// accessed by the LAF instead of at init time, so making it lazy should speed up
// our launch times of Swing apps.
// *** Text value objects
final Object editorMargin = zeroInsets; // this is not correct - look at TextEdit to determine the right margin
final Object textFieldBorder = new SwingLazyValue(PKG_PREFIX + "AquaTextFieldBorder", "getTextFieldBorder");
final Object scollListBorder = new SwingLazyValue(PKG_PREFIX + "AquaScrollRegionBorder", "getScrollRegionBorder");
final Object aquaTitledBorder = new SwingLazyValue(PKG_PREFIX + "AquaGroupBorder", "getBorderForTitledBorder");
final Object aquaInsetBorder = new SwingLazyValue(PKG_PREFIX + "AquaGroupBorder", "getTitlelessBorder");
// we can't seem to proxy Colors
final Color selectionInactiveBackground = AquaImageFactory.getSelectionInactiveBackgroundColorUIResource();
final Color selectionInactiveForeground = AquaImageFactory.getSelectionInactiveForegroundColorUIResource();
final Object internalFrameBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getInternalFrameBorder");
final Color desktopBackgroundColor = new ColorUIResource(new Color(65, 105, 170));//SystemColor.desktop
"SPACE", "pressed",
"released SPACE", "released"
});
// sja testing
final Object confirmIcon = new SwingLazyValue(kAquaImageFactoryName, "getConfirmImageIcon"); // AquaImageFactory.getConfirmImageIcon();
final Object cautionIcon = new SwingLazyValue(kAquaImageFactoryName, "getCautionImageIcon"); // AquaImageFactory.getCautionImageIcon();
final Object stopIcon = new SwingLazyValue(kAquaImageFactoryName, "getStopImageIcon"); // AquaImageFactory.getStopImageIcon();
final Object securityIcon = new SwingLazyValue(kAquaImageFactoryName, "getLockImageIcon"); // AquaImageFactory.getLockImageIcon();
// Buttons
"Button.background", controlBackgroundColor,
"Button.foreground", black,
"Button.disabledText", disabled,
"Button.select", selected,
"Button.font", controlFont,
"Button.focusInputMap", controlFocusInputMap,
"Button.opaque", buttonShouldBeOpaque,
"CheckBox.background", controlBackgroundColor,
"CheckBox.foreground", black,
"CheckBox.disabledText", disabled,
"CheckBox.select", selected,
"CheckBox.font", controlFont,
// radar 3583849. This property never gets
// used. The border for the Checkbox gets overridden
// by AquaRadiButtonUI.setThemeBorder(). Needs refactoring. (vm)
// why is button focus commented out?
//"CheckBox.focus", getFocusColor(),
"CheckBox.focusInputMap", controlFocusInputMap,
"CheckBoxMenuItem.font", menuFont,
"CheckBoxMenuItem.acceleratorFont", menuFont,
"CheckBoxMenuItem.background", menuBackgroundColor,
"CheckBoxMenuItem.foreground", menuForegroundColor,
"CheckBoxMenuItem.selectionBackground", menuSelectedBackgroundColor,
"CheckBoxMenuItem.selectionForeground", menuSelectedForegroundColor,
"CheckBoxMenuItem.disabledBackground", menuDisabledBackgroundColor,
"CheckBoxMenuItem.disabledForeground", menuDisabledForegroundColor,
"CheckBoxMenuItem.acceleratorForeground", menuAccelForegroundColor,
"CheckBoxMenuItem.acceleratorSelectionForeground", menuAccelSelectionForegroundColor,
"CheckBoxMenuItem.acceleratorDelimiter", "",
"CheckBoxMenuItem.margin", menuItemMargin,
//"CheckBoxMenuItem.arrowIcon", null,
"ColorChooser.background", panelBackgroundColor,
// *** ComboBox
"ComboBox.font", controlFont,
"ComboBox.background", controlBackgroundColor, //menuBackgroundColor, // "menu" when it has no scrollbar, "listView" when it does
"ComboBox.foreground", menuForegroundColor,
"ComboBox.selectionBackground", menuSelectedBackgroundColor,
"ComboBox.selectionForeground", menuSelectedForegroundColor,
"ComboBox.disabledBackground", menuDisabledBackgroundColor,
"ComboBox.disabledForeground", menuDisabledForegroundColor,
"DesktopIcon.border", internalFrameBorder,
"DesktopIcon.borderColor", smokyGlass,
"DesktopIcon.borderRimColor", dockIconRim,
"DesktopIcon.labelBackground", mediumTranslucentBlack,
"Desktop.background", desktopBackgroundColor,
"EditorPane.font", controlFont,
"EditorPane.background", textBackground,
"EditorPane.foreground", textForeground,
"EditorPane.selectionBackground", textHighlight,
"EditorPane.selectionForeground", textHighlightText,
"EditorPane.caretForeground", textForeground,
"EditorPane.caretBlinkRate", textCaretBlinkRate,
"EditorPane.inactiveForeground", textInactiveText,
"EditorPane.inactiveBackground", textInactiveBackground,
"EditorPane.border", textAreaBorder,
"EditorPane.margin", editorMargin,
// File View
"FileChooser.cancelButtonMnemonic", zero,
"FileChooser.saveButtonMnemonic", zero,
"FileChooser.openButtonMnemonic", zero,
"FileChooser.updateButtonMnemonic", zero,
"FileChooser.helpButtonMnemonic", zero,
"FileChooser.directoryOpenButtonMnemonic", zero,
"FileChooser.lookInLabelMnemonic", zero,
"FileChooser.fileNameLabelMnemonic", zero,
"FileChooser.filesOfTypeLabelMnemonic", zero,
"Focus.color", focusRingColor,
"FormattedTextField.font", controlFont,
"FormattedTextField.background", textBackground,
"FormattedTextField.foreground", textForeground,
"FormattedTextField.inactiveForeground", textInactiveText,
"FormattedTextField.inactiveBackground", textInactiveBackground,
"FormattedTextField.selectionBackground", textHighlight,
"FormattedTextField.selectionForeground", textHighlightText,
"FormattedTextField.caretForeground", textForeground,
"FormattedTextField.caretBlinkRate", textCaretBlinkRate,
"FormattedTextField.border", textFieldBorder,
"FormattedTextField.margin", zeroInsets,
"IconButton.font", controlSmallFont,
"InternalFrame.titleFont", menuFont,
"InternalFrame.background", windowBackgroundColor,
"InternalFrame.borderColor", windowBackgroundColor,
"InternalFrame.icon", null,
"InternalFrame.paletteTitleFont", menuFont,
"InternalFrame.paletteBackground", windowBackgroundColor,
"InternalFrame.optionDialogTitleFont", menuFont,
"InternalFrame.optionDialogBackground", windowBackgroundColor,
/* Default frame icons are undefined for Basic. */
"InternalFrame.closeIcon", new SwingLazyValue(PKG_PREFIX + "AquaInternalFrameUI", "exportCloseIcon"),
"InternalFrame.maximizeIcon", new SwingLazyValue(PKG_PREFIX + "AquaInternalFrameUI", "exportZoomIcon"),
"InternalFrame.iconifyIcon", new SwingLazyValue(PKG_PREFIX + "AquaInternalFrameUI", "exportMinimizeIcon"),
"InternalFrame.minimizeIcon", new SwingLazyValue(PKG_PREFIX + "AquaInternalFrameUI", "exportMinimizeIcon"),
// this could be either grow or icon
// we decided to make it icon so that anyone who uses
// these for ui will have different icons for max and min
// these icons are pretty crappy to use in Mac OS X since
// they really are interactive but we have to return a static
// icon for now.
// InternalFrame Auditory Cue Mappings
"InternalFrame.closeSound", null,
"InternalFrame.maximizeSound", null,
"InternalFrame.minimizeSound", null,
"InternalFrame.restoreDownSound", null,
"InternalFrame.restoreUpSound", null,
"InternalFrame.activeTitleBackground", windowBackgroundColor,
"InternalFrame.activeTitleForeground", textForeground,
"InternalFrame.inactiveTitleBackground", windowBackgroundColor,
"InternalFrame.inactiveTitleForeground", textInactiveText,
"InternalFrame.windowBindings", new Object[]{
"shift ESCAPE", "showSystemMenu",
"ctrl SPACE", "showSystemMenu",
"ESCAPE", "hideSystemMenu"
},
// Radar [3543438]. We now define the TitledBorder properties for font and color.
// Aqua HIG doesn't define TitledBorders as Swing does. Eventually, we might want to
// re-think TitledBorder to behave more like a Box (NSBox). (vm)
"TitledBorder.font", controlFont,
"TitledBorder.titleColor", black,
// "TitledBorder.border", -- we inherit this property from BasicLookAndFeel (etched border)
"TitledBorder.aquaVariant", aquaTitledBorder, // this is the border that matches what aqua really looks like
// *** Label
"Label.background", controlBackgroundColor,
"Label.foreground", black,
"Label.disabledForeground", disabled,
"Label.disabledShadow", disabledShadow,
"Label.opaque", useOpaqueComponents,
"Label.border", null,
"List.font", viewFont, // [3577901] Aqua HIG says "default font of text in lists and tables" should be 12 point (vm).
"List.background", white,
"List.foreground", black,
"List.selectionBackground", selectionBackground,
"List.selectionForeground", selectionForeground,
"List.selectionInactiveBackground", selectionInactiveBackground,
"List.selectionInactiveForeground", selectionInactiveForeground,
"List.focusCellHighlightBorder", focusCellHighlightBorder,
"List.border", null,
"List.cellRenderer", listCellRendererActiveValue,
"List.sourceListBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getSourceListBackgroundPainter"),
"List.sourceListSelectionBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getSourceListSelectionBackgroundPainter"),
"List.sourceListFocusedSelectionBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getSourceListFocusedSelectionBackgroundPainter"),
"List.evenRowBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getListEvenBackgroundPainter"),
"List.oddRowBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaListUI", "getListOddBackgroundPainter"),
// <rdar://Problem/3743210> The modifier for the Mac is meta, not control.
//"List.scrollPaneBorder", listBoxBorder, // Not used in Swing1.1
//"ListItem.border", ThemeMenu.listItemBorder(), // for inset calculation
// *** Menus
"Menu.font", menuFont,
"Menu.acceleratorFont", menuFont,
"Menu.background", menuBackgroundColor,
"Menu.foreground", menuForegroundColor,
"Menu.selectionBackground", menuSelectedBackgroundColor,
"Menu.selectionForeground", menuSelectedForegroundColor,
"Menu.disabledBackground", menuDisabledBackgroundColor,
"Menu.disabledForeground", menuDisabledForegroundColor,
"Menu.acceleratorForeground", menuAccelForegroundColor,
"Menu.acceleratorSelectionForeground", menuAccelSelectionForegroundColor,
//"Menu.border", ThemeMenu.menuItemBorder(), // for inset calculation
"Menu.border", menuBorder,
"Menu.margin", menuItemMargin,
//"Menu.checkIcon", emptyCheckIcon, // A non-drawing GlyphIcon to make the spacing consistent
"MenuBar.font", menuFont,
"MenuBar.foreground", menuForegroundColor,
"MenuBar.selectionForeground", menuSelectedForegroundColor,
"MenuBar.disabledBackground", menuDisabledBackgroundColor, //ThemeBrush.GetThemeBrushForMenu(false, false), // not a menu item, not selected
"MenuBar.disabledForeground", menuDisabledForegroundColor,
"MenuBar.backgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaMenuPainter", "getMenuBarPainter"),
"MenuBar.selectedBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaMenuPainter", "getSelectedMenuBarItemPainter"),
"MenuItem.font", menuFont,
"MenuItem.acceleratorFont", menuFont,
"MenuItem.background", menuBackgroundColor,
"MenuItem.foreground", menuForegroundColor,
"MenuItem.selectionBackground", menuSelectedBackgroundColor,
"MenuItem.selectionForeground", menuSelectedForegroundColor,
"MenuItem.disabledBackground", menuDisabledBackgroundColor,
"MenuItem.disabledForeground", menuDisabledForegroundColor,
"MenuItem.acceleratorForeground", menuAccelForegroundColor,
"MenuItem.acceleratorSelectionForeground", menuAccelSelectionForegroundColor,
"MenuItem.acceleratorDelimiter", "",
"MenuItem.border", menuBorder,
"MenuItem.margin", menuItemMargin,
//"MenuItem.checkIcon", emptyCheckIcon, // A non-drawing GlyphIcon to make the spacing consistent
//"MenuItem.arrowIcon", null,
"MenuItem.selectedBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaMenuPainter", "getSelectedMenuItemPainter"),
// *** 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", alertHeaderFont,
"OptionPane.messageFont", controlFont,
"OptionPane.buttonFont", controlFont,
"OptionPane.background", windowBackgroundColor,
"OptionPane.foreground", black,
"OptionPane.messageForeground", black,
"OptionPane.messageAreaBorder", zeroBorder,
"OptionPane.errorIcon", stopIcon,
"OptionPane.informationIcon", confirmIcon,
"OptionPane.warningIcon", cautionIcon,
"OptionPane.questionIcon", confirmIcon,
"_SecurityDecisionIcon", securityIcon,
// OptionPane Auditory Cue Mappings
"OptionPane.errorSound", null,
"OptionPane.questionSound", null,
"OptionPane.warningSound", null,
"OptionPane.yesButtonMnemonic", "",
"OptionPane.noButtonMnemonic", "",
"OptionPane.okButtonMnemonic", "",
"OptionPane.cancelButtonMnemonic", "",
"Panel.font", controlFont,
"Panel.foreground", black,
"Panel.opaque", useOpaqueComponents,
"PasswordField.font", controlFont,
"PasswordField.background", textBackground,
"PasswordField.foreground", textForeground,
"PasswordField.inactiveForeground", textInactiveText,
"PasswordField.inactiveBackground", textInactiveBackground,
"PasswordField.selectionBackground", textHighlight,
"PasswordField.selectionForeground", textHighlightText,
"PasswordField.caretForeground", textForeground,
"PasswordField.caretBlinkRate", textCaretBlinkRate,
"PasswordField.border", textFieldBorder,
"PasswordField.margin", zeroInsets,
"PasswordField.capsLockIconColor", textPasswordFieldCapsLockIconColor,
"PopupMenu.font", menuFont,
"PopupMenu.background", menuBackgroundColor,
// Fix for 7154516: make popups opaque
"PopupMenu.translucentBackground", white,
"PopupMenu.foreground", menuForegroundColor,
"PopupMenu.selectionBackground", menuSelectedBackgroundColor,
"PopupMenu.selectionForeground", menuSelectedForegroundColor,
"PopupMenu.border", menuBorder,
// "PopupMenu.margin",
"ProgressBar.font", controlFont,
"ProgressBar.foreground", black,
"ProgressBar.background", controlBackgroundColor,
"ProgressBar.selectionForeground", black,
"ProgressBar.selectionBackground", white,
"RadioButton.background", controlBackgroundColor,
"RadioButton.foreground", black,
"RadioButton.disabledText", disabled,
"RadioButton.select", selected,
"RadioButton.icon", new SwingLazyValue(PKG_PREFIX + "AquaButtonRadioUI", "getSizingRadioButtonIcon"),
"RadioButton.font", controlFont,
"RadioButton.focusInputMap", controlFocusInputMap,
"RadioButtonMenuItem.font", menuFont,
"RadioButtonMenuItem.acceleratorFont", menuFont,
"RadioButtonMenuItem.background", menuBackgroundColor,
"RadioButtonMenuItem.foreground", menuForegroundColor,
"RadioButtonMenuItem.selectionBackground", menuSelectedBackgroundColor,
"RadioButtonMenuItem.selectionForeground", menuSelectedForegroundColor,
"RadioButtonMenuItem.disabledBackground", menuDisabledBackgroundColor,
"RadioButtonMenuItem.disabledForeground", menuDisabledForegroundColor,
"RadioButtonMenuItem.acceleratorForeground", menuAccelForegroundColor,
"RadioButtonMenuItem.acceleratorSelectionForeground", menuAccelSelectionForegroundColor,
"RadioButtonMenuItem.acceleratorDelimiter", "",
"RadioButtonMenuItem.margin", menuItemMargin,
//"RadioButtonMenuItem.arrowIcon", null,
"Separator.background", null,
"ScrollBar.border", null,
"ScrollBar.background", white,
"ScrollBar.foreground", black,
"ScrollPane.font", controlFont,
"ScrollPane.background", white,
"ScrollPane.border", scollListBorder,
"ScrollPane.viewportBorder", null,
"Viewport.font", controlFont,
"Viewport.foreground", black,
// *** Slider
"Slider.font", controlSmallFont,
//"Slider.highlight", table.get("controlLtHighlight"),
//"Slider.shadow", table.get("controlShadow"),
//"Slider.focus", table.get("controlDkShadow"),
"Slider.border", null,
// *** Spinner
"Spinner.font", controlFont,
"Spinner.background", controlBackgroundColor,
"Spinner.foreground", black,
"Spinner.border", null,
// *** SplitPane
//"SplitPane.highlight", table.get("controlLtHighlight"),
//"SplitPane.shadow", table.get("controlShadow"),
"SplitPane.background", panelBackgroundColor,
"SplitPane.border", scollListBorder,
"SplitPaneDivider.horizontalGradientVariant", new SwingLazyValue(PKG_PREFIX + "AquaSplitPaneDividerUI", "getHorizontalSplitDividerGradientVariant"),
// *** TabbedPane
"TabbedPane.font", controlFont,
"TabbedPane.smallFont", controlSmallFont,
// tabs on a custom pane get erased when they are removed.
"TabbedPane.foreground", black, //ThemeTextColor.GetThemeTextColor(AppearanceConstants.kThemeTextColorTabFrontActive),
//"TabbedPane.lightHighlight", table.get("controlLtHighlight"),
//"TabbedPane.highlight", table.get("controlHighlight"),
//"TabbedPane.shadow", table.get("controlShadow"),
//"TabbedPane.darkShadow", table.get("controlDkShadow"),
//"TabbedPane.focus", table.get("controlText"),
"TabbedPane.opaque", useOpaqueComponents,
"TabbedPane.tabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab (top, left, bottom, right)
//"TabbedPane.rightTabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab (top, left, bottom, right)
//"TabbedPane.tabAreaInsets", new InsetsUIResource(3, 9, -1, 9), // Tabs relative to edge of pane (negative value for overlapping)
"TabbedPane.tabAreaInsets", new InsetsUIResource(3, 9, -1, 9), // Tabs relative to edge of pane (negative value for overlapping)
// (top = side opposite pane, left = edge || to pane, bottom = side adjacent to pane, right = left) - see rotateInsets
//"TabbedPane.selectedTabPadInsets", new InsetsUIResource(0, 0, 1, 0), // Really outsets, this is where we allow for overlap
"TabbedPane.selectedTabPadInsets", new InsetsUIResource(0, 0, 0, 0), // Really outsets, this is where we allow for overlap
"TabbedPane.selectedTabTitlePressedColor", selectedTabTitlePressedColor,
"TabbedPane.selectedTabTitleDisabledColor", selectedTabTitleDisabledColor,
"TabbedPane.selectedTabTitleNormalColor", selectedTabTitleNormalColor,
"TabbedPane.selectedTabTitleShadowDisabledColor", selectedTabTitleShadowDisabledColor,
"TabbedPane.selectedTabTitleShadowNormalColor", selectedTabTitleShadowNormalColor,
"TabbedPane.nonSelectedTabTitleNormalColor", nonSelectedTabTitleNormalColor,
// *** Table
"Table.font", viewFont, // [3577901] Aqua HIG says "default font of text in lists and tables" should be 12 point (vm).
"Table.selectionForeground", selectionForeground,
"Table.selectionBackground", selectionBackground,
"Table.selectionInactiveBackground", selectionInactiveBackground,
"Table.selectionInactiveForeground", selectionInactiveForeground,
"Table.focusCellBackground", textHighlightText,
"Table.focusCellForeground", textHighlight,
"Table.focusCellHighlightBorder", focusCellHighlightBorder,
"Table.scrollPaneBorder", scollListBorder,
"TableHeader.font", controlSmallFont,
"TableHeader.foreground", black,
"TableHeader.cellBorder", listHeaderBorder,
// *** Text
"TextArea.font", controlFont,
"TextArea.background", textBackground,
"TextArea.foreground", textForeground,
"TextArea.inactiveForeground", textInactiveText,
"TextArea.inactiveBackground", textInactiveBackground,
"TextArea.selectionBackground", textHighlight,
"TextArea.selectionForeground", textHighlightText,
"TextArea.caretForeground", textForeground,
"TextArea.caretBlinkRate", textCaretBlinkRate,
"TextArea.border", textAreaBorder,
"TextArea.margin", zeroInsets,
"TextComponent.selectionBackgroundInactive", textHighlightInactive,
"TextField.font", controlFont,
"TextField.background", textBackground,
"TextField.foreground", textForeground,
"TextField.inactiveForeground", textInactiveText,
"TextField.inactiveBackground", textInactiveBackground,
"TextField.selectionBackground", textHighlight,
"TextField.selectionForeground", textHighlightText,
"TextField.caretForeground", textForeground,
"TextField.caretBlinkRate", textCaretBlinkRate,
"TextField.border", textFieldBorder,
"TextField.margin", zeroInsets,
"TextPane.font", controlFont,
"TextPane.background", textBackground,
"TextPane.foreground", textForeground,
"TextPane.selectionBackground", textHighlight,
"TextPane.selectionForeground", textHighlightText,
"TextPane.caretForeground", textForeground,
"TextPane.caretBlinkRate", textCaretBlinkRate,
"TextPane.inactiveForeground", textInactiveText,
"TextPane.inactiveBackground", textInactiveBackground,
"TextPane.border", textAreaBorder,
"TextPane.margin", editorMargin,
// *** ToggleButton
"ToggleButton.background", controlBackgroundColor,
"ToggleButton.foreground", black,
"ToggleButton.disabledText", disabled,
// we need to go through and find out if these are used, and if not what to set
// so that subclasses will get good aqua like colors.
// "ToggleButton.select", getControlShadow(),
// "ToggleButton.text", getControl(),
// "ToggleButton.disabledSelectedText", getControlDarkShadow(),
// "ToggleButton.disabledBackground", getControl(),
// "ToggleButton.disabledSelectedBackground", getControlShadow(),
//"ToggleButton.focus", getFocusColor(),
"ToggleButton.border", new SwingLazyValue(PKG_PREFIX + "AquaButtonBorder", "getDynamicButtonBorder"), // sja make this lazy!
"ToggleButton.font", controlFont,
"ToggleButton.focusInputMap", controlFocusInputMap,
// *** ToolBar
"ToolBar.font", controlFont,
"ToolBar.background", panelBackgroundColor,
"ToolBar.dockingBackground", panelBackgroundColor,
"ToolBar.dockingForeground", selectionBackground,
"ToolBar.floatingBackground", panelBackgroundColor,
"ToolBar.borderHandleColor", toolbarDragHandleColor,
//"ToolBar.separatorSize", new DimensionUIResource( 10, 10 ),
"ToolBar.separatorSize", null,
// *** ToolBarButton
// *** ToolTips
"ToolTip.font", controlSmallFont,
//$ Tooltips - Same color as help balloons?
"ToolTip.background", toolTipBackground,
"ToolTip.foreground", black,
"ToolTip.border", toolTipBorder,
// *** Tree
"Tree.font", viewFont, // [3577901] Aqua HIG says "default font of text in lists and tables" should be 12 point (vm).
"Tree.background", white,
"Tree.foreground", black,
// for now no lines
"Tree.textForeground", black,
"Tree.textBackground", white,
"Tree.selectionForeground", selectionForeground,
"Tree.selectionBackground", selectionBackground,
"Tree.selectionInactiveBackground", selectionInactiveBackground,
"Tree.selectionInactiveForeground", selectionInactiveForeground,
"Tree.selectionBorderColor", selectionBackground, // match the background so it looks like we don't draw anything
// "Tree.editorBorder", textFieldBorder, // If you still have Sun bug 4376328 in DefaultTreeCellEditor, it has to have the same insets as TextField.border
"Tree.rowHeight", new Integer(19),// iconHeight + 3, to match finder - a zero would have the renderer decide, except that leaves the icons touching
"Tree.openIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeOpenFolderIcon"), // Open folder icon
"Tree.closedIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeFolderIcon"), // Closed folder icon
"Tree.rightToLeftCollapsedIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeRightToLeftCollapsedIcon"),
}
// 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" /* ??? */
// };
//
// loadSystemColors(table, defaultSystemColors, isNativeLookAndFeel());
}
/**
* Initialize the uiClassID to AquaComponentUI 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 #getDefaults
*/
final Object[] uiDefaults = {
"TabbedPaneUI", PKG_PREFIX + (JRSUIUtils.TabbedPane.shouldUseTabbedPaneContrastUI() ? "AquaTabbedPaneContrastUI" : "AquaTabbedPaneUI"),
// as we implement aqua versions of the swing elements
// we will aad the com.apple.laf.FooUI classes to this table.
// text UIs
};
}
}