package com.apple.laf;
import java.awt.*;
import java.security.PrivilegedAction;
import java.util.*;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.plaf.*;
import javax.swing.plaf.basic.BasicLookAndFeel;
import sun.swing.*;
import apple.laf.*;
public class AquaLookAndFeel extends BasicLookAndFeel {
static final String sOldPropertyPrefix = "com.apple.macos.";
static final String sPropertyPrefix = "apple.laf.";
private static final String PKG_PREFIX = "com.apple.laf.";
private static final String kAquaImageFactoryName = PKG_PREFIX + "AquaImageFactory";
private static final String kAquaFontsName = PKG_PREFIX + "AquaFonts";
public String getName() {
return "Mac OS X";
}
public String getID() {
return "Aqua";
}
public String getDescription() {
return "Aqua Look and Feel for Mac OS X";
}
public boolean getSupportsWindowDecorations() {
return false;
}
public boolean isNativeLookAndFeel() {
return true;
}
public boolean isSupportedLookAndFeel() {
return true;
}
public void initialize() {
java.security.AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run() {
System.loadLibrary("osxui");
return null;
}
});
java.security.AccessController.doPrivileged(new PrivilegedAction<Void>(){
@Override
public Void run() {
JRSUIControl.initJRSUI();
return null;
}
});
super.initialize();
final ScreenPopupFactory spf = new ScreenPopupFactory();
spf.setActive(true);
PopupFactory.setSharedInstance(spf);
KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventPostProcessor(AquaMnemonicHandler.getInstance());
}
public void uninitialize() {
KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventPostProcessor(AquaMnemonicHandler.getInstance());
final PopupFactory popupFactory = PopupFactory.getSharedInstance();
if (popupFactory != null && popupFactory instanceof ScreenPopupFactory) {
((ScreenPopupFactory)popupFactory).setActive(false);
}
super.uninitialize();
}
protected ActionMap getAudioActionMap() {
ActionMap audioActionMap = (ActionMap)UIManager.get("AuditoryCues.actionMap");
if (audioActionMap != null) return audioActionMap;
final Object[] acList = (Object[])UIManager.get("AuditoryCues.cueList");
if (acList != null) {
audioActionMap = new ActionMapUIResource();
for (int counter = acList.length - 1; counter >= 0; counter--) {
audioActionMap.put(acList[counter], createAudioAction(acList[counter]));
}
}
UIManager.getLookAndFeelDefaults().put("AuditoryCues.actionMap", audioActionMap);
return audioActionMap;
}
public UIDefaults getDefaults() {
final UIDefaults table = new UIDefaults();
try {
initClassDefaults(table);
super.initSystemColorDefaults(table);
super.initComponentDefaults(table);
initSystemColorDefaults(table);
initComponentDefaults(table);
} catch(final Exception e) {
e.printStackTrace();
}
return table;
}
private void initResourceBundle(final UIDefaults table) {
table.setDefaultLocale(Locale.getDefault());
table.addResourceBundle(PKG_PREFIX + "resources.aqua");
try {
final ResourceBundle aquaProperties = ResourceBundle.getBundle(PKG_PREFIX + "resources.aqua");
final Enumeration<String> propertyKeys = aquaProperties.getKeys();
while (propertyKeys.hasMoreElements()) {
final String key = propertyKeys.nextElement();
table.put(key, aquaProperties.getString(key));
}
} catch (final Exception e) {
}
}
protected void initComponentDefaults(final UIDefaults table) {
initResourceBundle(table);
final InsetsUIResource zeroInsets = new InsetsUIResource(0, 0, 0, 0);
final InsetsUIResource menuItemMargin = zeroInsets;
final Boolean useOpaqueComponents = Boolean.TRUE;
final Boolean buttonShouldBeOpaque = AquaUtils.shouldUseOpaqueButtons() ? Boolean.TRUE : Boolean.FALSE;
final Object listCellRendererActiveValue = new UIDefaults.ActiveValue(){
public Object createValue(UIDefaults defaultsTable) {
return new DefaultListCellRenderer.UIResource();
}
};
final Border toolTipBorder = new BorderUIResource.EmptyBorderUIResource(2, 0, 2, 0);
final ColorUIResource toolTipBackground = new ColorUIResource(255, 255, (int)(255.0 * 0.80));
final ColorUIResource black = new ColorUIResource(Color.black);
final ColorUIResource white = new ColorUIResource(Color.white);
final ColorUIResource smokyGlass = new ColorUIResource(new Color(0, 0, 0, 152));
final ColorUIResource dockIconRim = new ColorUIResource(new Color(192, 192, 192, 192));
final ColorUIResource mediumTranslucentBlack = new ColorUIResource(new Color(0, 0, 0, 100));
final ColorUIResource translucentWhite = new ColorUIResource(new Color(255, 255, 255, 254));
final ColorUIResource disabled = new ColorUIResource(0.5f, 0.5f, 0.5f);
final ColorUIResource disabledShadow = new ColorUIResource(0.25f, 0.25f, 0.25f);
final ColorUIResource selected = new ColorUIResource(1.0f, 0.4f, 0.4f);
final ColorUIResource selectedTabTitlePressedColor = new ColorUIResource(240, 240, 240);
final ColorUIResource selectedTabTitleDisabledColor = new ColorUIResource(new Color(1, 1, 1, 0.55f));
final ColorUIResource selectedTabTitleNormalColor = white;
final ColorUIResource selectedTabTitleShadowDisabledColor = new ColorUIResource(new Color(0, 0, 0, 0.25f));
final ColorUIResource selectedTabTitleShadowNormalColor = mediumTranslucentBlack;
final ColorUIResource nonSelectedTabTitleNormalColor = black;
final ColorUIResource toolbarDragHandleColor = new ColorUIResource(140, 140, 140);
final Object marginBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders$MarginBorder");
final Object zero = new Integer(0);
final Object editorMargin = zeroInsets;
final Object textCaretBlinkRate = new Integer(500);
final Object textFieldBorder = new SwingLazyValue(PKG_PREFIX + "AquaTextFieldBorder", "getTextFieldBorder");
final Object textAreaBorder = marginBorder;
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");
final Border listHeaderBorder = AquaTableHeaderBorder.getListHeaderBorder();
final Border zeroBorder = new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0);
final Color selectionBackground = AquaImageFactory.getSelectionBackgroundColorUIResource();
final Color selectionForeground = AquaImageFactory.getSelectionForegroundColorUIResource();
final Color selectionInactiveBackground = AquaImageFactory.getSelectionInactiveBackgroundColorUIResource();
final Color selectionInactiveForeground = AquaImageFactory.getSelectionInactiveForegroundColorUIResource();
final Color textHighlightText = AquaImageFactory.getTextSelectionForegroundColorUIResource();
final Color textHighlight = AquaImageFactory.getTextSelectionBackgroundColorUIResource();
final Color textHighlightInactive = new ColorUIResource(212, 212, 212);
final Color textInactiveText = disabled;
final Color textForeground = black;
final Color textBackground = white;
final Color textInactiveBackground = white;
final Color textPasswordFieldCapsLockIconColor = mediumTranslucentBlack;
final Object internalFrameBorder = new SwingLazyValue("javax.swing.plaf.basic.BasicBorders", "getInternalFrameBorder");
final Color desktopBackgroundColor = new ColorUIResource(new Color(65, 105, 170));
final Color focusRingColor = AquaImageFactory.getFocusRingColorUIResource();
final Border focusCellHighlightBorder = new BorderUIResource.LineBorderUIResource(focusRingColor);
final Color windowBackgroundColor = AquaImageFactory.getWindowBackgroundColorUIResource();
final Color panelBackgroundColor = windowBackgroundColor;
final Color tabBackgroundColor = windowBackgroundColor;
final Color controlBackgroundColor = windowBackgroundColor;
final Object controlFont = new SwingLazyValue(kAquaFontsName, "getControlTextFont");
final Object controlSmallFont = new SwingLazyValue(kAquaFontsName, "getControlTextSmallFont");
final Object alertHeaderFont = new SwingLazyValue(kAquaFontsName, "getAlertHeaderFont");
final Object menuFont = new SwingLazyValue(kAquaFontsName, "getMenuFont");
final Object viewFont = new SwingLazyValue(kAquaFontsName, "getViewFont");
final Color menuBackgroundColor = new ColorUIResource(Color.white);
final Color menuForegroundColor = black;
final Color menuSelectedForegroundColor = white;
final Color menuSelectedBackgroundColor = focusRingColor;
final Color menuDisabledBackgroundColor = menuBackgroundColor;
final Color menuDisabledForegroundColor = disabled;
final Color menuAccelForegroundColor = black;
final Color menuAccelSelectionForegroundColor = black;
final Border menuBorder = new AquaMenuBorder();
final UIDefaults.LazyInputMap controlFocusInputMap = new UIDefaults.LazyInputMap(new Object[]{
"SPACE", "pressed",
"released SPACE", "released"
});
final Object confirmIcon = new SwingLazyValue(kAquaImageFactoryName, "getConfirmImageIcon");
final Object cautionIcon = new SwingLazyValue(kAquaImageFactoryName, "getCautionImageIcon");
final Object stopIcon = new SwingLazyValue(kAquaImageFactoryName, "getStopImageIcon");
final Object securityIcon = new SwingLazyValue(kAquaImageFactoryName, "getLockImageIcon");
final AquaKeyBindings aquaKeyBindings = AquaKeyBindings.instance();
final Object[] defaults = {
"control", windowBackgroundColor,
"Button.background", controlBackgroundColor,
"Button.foreground", black,
"Button.disabledText", disabled,
"Button.select", selected,
"Button.border", new SwingLazyValue(PKG_PREFIX + "AquaButtonBorder", "getDynamicButtonBorder"),
"Button.font", controlFont,
"Button.textIconGap", new Integer(4),
"Button.textShiftOffset", zero,
"Button.focusInputMap", controlFocusInputMap,
"Button.margin", new InsetsUIResource(0, 2, 0, 2),
"Button.opaque", buttonShouldBeOpaque,
"CheckBox.background", controlBackgroundColor,
"CheckBox.foreground", black,
"CheckBox.disabledText", disabled,
"CheckBox.select", selected,
"CheckBox.icon", new SwingLazyValue(PKG_PREFIX + "AquaButtonCheckBoxUI", "getSizingCheckBoxIcon"),
"CheckBox.font", controlFont,
"CheckBox.border", AquaButtonBorder.getBevelButtonBorder(),
"CheckBox.margin", new InsetsUIResource(1, 1, 0, 1),
"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.border", menuBorder,
"CheckBoxMenuItem.margin", menuItemMargin,
"CheckBoxMenuItem.borderPainted", Boolean.TRUE,
"CheckBoxMenuItem.checkIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuItemCheckIcon"),
"CheckBoxMenuItem.dashIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuItemDashIcon"),
"ColorChooser.background", panelBackgroundColor,
"ComboBox.font", controlFont,
"ComboBox.background", controlBackgroundColor,
"ComboBox.foreground", menuForegroundColor,
"ComboBox.selectionBackground", menuSelectedBackgroundColor,
"ComboBox.selectionForeground", menuSelectedForegroundColor,
"ComboBox.disabledBackground", menuDisabledBackgroundColor,
"ComboBox.disabledForeground", menuDisabledForegroundColor,
"ComboBox.ancestorInputMap", aquaKeyBindings.getComboBoxInputMap(),
"DesktopIcon.border", internalFrameBorder,
"DesktopIcon.borderColor", smokyGlass,
"DesktopIcon.borderRimColor", dockIconRim,
"DesktopIcon.labelBackground", mediumTranslucentBlack,
"Desktop.background", desktopBackgroundColor,
"EditorPane.focusInputMap", aquaKeyBindings.getMultiLineTextInputMap(),
"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,
"FileChooser.newFolderIcon", AquaIcon.SystemIcon.getFolderIconUIResource(),
"FileChooser.upFolderIcon", AquaIcon.SystemIcon.getFolderIconUIResource(),
"FileChooser.homeFolderIcon", AquaIcon.SystemIcon.getDesktopIconUIResource(),
"FileChooser.detailsViewIcon", AquaIcon.SystemIcon.getComputerIconUIResource(),
"FileChooser.listViewIcon", AquaIcon.SystemIcon.getComputerIconUIResource(),
"FileView.directoryIcon", AquaIcon.SystemIcon.getFolderIconUIResource(),
"FileView.fileIcon", AquaIcon.SystemIcon.getDocumentIconUIResource(),
"FileView.computerIcon", AquaIcon.SystemIcon.getDesktopIconUIResource(),
"FileView.hardDriveIcon", AquaIcon.SystemIcon.getHardDriveIconUIResource(),
"FileView.floppyDriveIcon", AquaIcon.SystemIcon.getFloppyIconUIResource(),
"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.focusInputMap", aquaKeyBindings.getFormattedTextFieldInputMap(),
"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.borderShadow", Color.red,
"InternalFrame.borderDarkShadow", Color.green,
"InternalFrame.borderHighlight", Color.blue,
"InternalFrame.borderLight", Color.yellow,
"InternalFrame.opaque", Boolean.FALSE,
"InternalFrame.border", null,
"InternalFrame.icon", null,
"InternalFrame.paletteBorder", null,
"InternalFrame.paletteTitleFont", menuFont,
"InternalFrame.paletteBackground", windowBackgroundColor,
"InternalFrame.optionDialogBorder", null,
"InternalFrame.optionDialogTitleFont", menuFont,
"InternalFrame.optionDialogBackground", windowBackgroundColor,
"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"),
"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"
},
"TitledBorder.font", controlFont,
"TitledBorder.titleColor", black,
"TitledBorder.aquaVariant", aquaTitledBorder,
"InsetBorder.aquaVariant", aquaInsetBorder,
"Label.font", controlFont,
"Label.background", controlBackgroundColor,
"Label.foreground", black,
"Label.disabledForeground", disabled,
"Label.disabledShadow", disabledShadow,
"Label.opaque", useOpaqueComponents,
"Label.border", null,
"List.font", viewFont,
"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"),
"List.focusInputMap", aquaKeyBindings.getListInputMap(),
"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", menuBorder,
"Menu.borderPainted", Boolean.FALSE,
"Menu.margin", menuItemMargin,
"Menu.arrowIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuArrowIcon"),
"Menu.consumesTabs", Boolean.TRUE,
"Menu.menuPopupOffsetY", new Integer(1),
"Menu.submenuPopupOffsetY", new Integer(-4),
"MenuBar.font", menuFont,
"MenuBar.background", menuBackgroundColor,
"MenuBar.foreground", menuForegroundColor,
"MenuBar.border", new AquaMenuBarBorder(),
"MenuBar.margin", new InsetsUIResource(0, 8, 0, 8),
"MenuBar.selectionBackground", menuSelectedBackgroundColor,
"MenuBar.selectionForeground", menuSelectedForegroundColor,
"MenuBar.disabledBackground", menuDisabledBackgroundColor,
"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.borderPainted", Boolean.TRUE,
"MenuItem.selectedBackgroundPainter", new SwingLazyValue(PKG_PREFIX + "AquaMenuPainter", "getSelectedMenuItemPainter"),
"OptionPane.font", alertHeaderFont,
"OptionPane.messageFont", controlFont,
"OptionPane.buttonFont", controlFont,
"OptionPane.background", windowBackgroundColor,
"OptionPane.foreground", black,
"OptionPane.messageForeground", black,
"OptionPane.border", new BorderUIResource.EmptyBorderUIResource(12, 21, 17, 21),
"OptionPane.messageAreaBorder", zeroBorder,
"OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(13, 0, 0, 0),
"OptionPane.minimumSize", new DimensionUIResource(262, 90),
"OptionPane.errorIcon", stopIcon,
"OptionPane.informationIcon", confirmIcon,
"OptionPane.warningIcon", cautionIcon,
"OptionPane.questionIcon", confirmIcon,
"_SecurityDecisionIcon", securityIcon,
"OptionPane.windowBindings", new Object[]{"ESCAPE", "close"},
"OptionPane.errorSound", null,
"OptionPane.informationSound", null,
"OptionPane.questionSound", null,
"OptionPane.warningSound", null,
"OptionPane.buttonClickThreshhold", new Integer(500),
"OptionPane.yesButtonMnemonic", "",
"OptionPane.noButtonMnemonic", "",
"OptionPane.okButtonMnemonic", "",
"OptionPane.cancelButtonMnemonic", "",
"Panel.font", controlFont,
"Panel.background", panelBackgroundColor,
"Panel.foreground", black,
"Panel.opaque", useOpaqueComponents,
"PasswordField.focusInputMap", aquaKeyBindings.getPasswordFieldInputMap(),
"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.echoChar", new Character((char)0x25CF),
"PasswordField.capsLockIconColor", textPasswordFieldCapsLockIconColor,
"PopupMenu.font", menuFont,
"PopupMenu.background", menuBackgroundColor,
"PopupMenu.translucentBackground", white,
"PopupMenu.foreground", menuForegroundColor,
"PopupMenu.selectionBackground", menuSelectedBackgroundColor,
"PopupMenu.selectionForeground", menuSelectedForegroundColor,
"PopupMenu.border", menuBorder,
"ProgressBar.font", controlFont,
"ProgressBar.foreground", black,
"ProgressBar.background", controlBackgroundColor,
"ProgressBar.selectionForeground", black,
"ProgressBar.selectionBackground", white,
"ProgressBar.border", new BorderUIResource(BorderFactory.createEmptyBorder()),
"ProgressBar.repaintInterval", new Integer(20),
"RadioButton.background", controlBackgroundColor,
"RadioButton.foreground", black,
"RadioButton.disabledText", disabled,
"RadioButton.select", selected,
"RadioButton.icon", new SwingLazyValue(PKG_PREFIX + "AquaButtonRadioUI", "getSizingRadioButtonIcon"),
"RadioButton.font", controlFont,
"RadioButton.border", AquaButtonBorder.getBevelButtonBorder(),
"RadioButton.margin", new InsetsUIResource(1, 1, 0, 1),
"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.border", menuBorder,
"RadioButtonMenuItem.margin", menuItemMargin,
"RadioButtonMenuItem.borderPainted", Boolean.TRUE,
"RadioButtonMenuItem.checkIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuItemCheckIcon"),
"RadioButtonMenuItem.dashIcon", new SwingLazyValue(kAquaImageFactoryName, "getMenuItemDashIcon"),
"Separator.background", null,
"Separator.foreground", new ColorUIResource(0xD4, 0xD4, 0xD4),
"ScrollBar.border", null,
"ScrollBar.focusInputMap", aquaKeyBindings.getScrollBarInputMap(),
"ScrollBar.focusInputMap.RightToLeft", aquaKeyBindings.getScrollBarRightToLeftInputMap(),
"ScrollBar.width", new Integer(16),
"ScrollBar.background", white,
"ScrollBar.foreground", black,
"ScrollPane.font", controlFont,
"ScrollPane.background", white,
"ScrollPane.foreground", black,
"ScrollPane.border", scollListBorder,
"ScrollPane.viewportBorder", null,
"ScrollPane.ancestorInputMap", aquaKeyBindings.getScrollPaneInputMap(),
"ScrollPane.ancestorInputMap.RightToLeft", new UIDefaults.LazyInputMap(new Object[]{}),
"Viewport.font", controlFont,
"Viewport.background", white,
"Viewport.foreground", black,
"Slider.foreground", black, "Slider.background", controlBackgroundColor,
"Slider.font", controlSmallFont,
"Slider.tickColor", new ColorUIResource(Color.GRAY),
"Slider.border", null,
"Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2),
"Slider.focusInputMap", aquaKeyBindings.getSliderInputMap(),
"Slider.focusInputMap.RightToLeft", aquaKeyBindings.getSliderRightToLeftInputMap(),
"Spinner.font", controlFont,
"Spinner.background", controlBackgroundColor,
"Spinner.foreground", black,
"Spinner.border", null,
"Spinner.arrowButtonSize", new Dimension(16, 5),
"Spinner.ancestorInputMap", aquaKeyBindings.getSpinnerInputMap(),
"Spinner.editorBorderPainted", Boolean.TRUE,
"Spinner.editorAlignment", SwingConstants.TRAILING,
"SplitPane.background", panelBackgroundColor,
"SplitPane.border", scollListBorder,
"SplitPane.dividerSize", new Integer(9),
"SplitPaneDivider.border", null,
"SplitPaneDivider.horizontalGradientVariant", new SwingLazyValue(PKG_PREFIX + "AquaSplitPaneDividerUI", "getHorizontalSplitDividerGradientVariant"),
"TabbedPane.font", controlFont,
"TabbedPane.smallFont", controlSmallFont,
"TabbedPane.useSmallLayout", Boolean.FALSE,
"TabbedPane.background", tabBackgroundColor,
"TabbedPane.foreground", black,
"TabbedPane.opaque", useOpaqueComponents,
"TabbedPane.textIconGap", new Integer(4),
"TabbedPane.tabInsets", new InsetsUIResource(0, 10, 3, 10),
"TabbedPane.leftTabInsets", new InsetsUIResource(0, 10, 3, 10),
"TabbedPane.rightTabInsets", new InsetsUIResource(0, 10, 3, 10),
"TabbedPane.tabAreaInsets", new InsetsUIResource(3, 9, -1, 9),
"TabbedPane.contentBorderInsets", new InsetsUIResource(8, 0, 0, 0),
"TabbedPane.selectedTabPadInsets", new InsetsUIResource(0, 0, 0, 0),
"TabbedPane.tabsOverlapBorder", Boolean.TRUE,
"TabbedPane.selectedTabTitlePressedColor", selectedTabTitlePressedColor,
"TabbedPane.selectedTabTitleDisabledColor", selectedTabTitleDisabledColor,
"TabbedPane.selectedTabTitleNormalColor", selectedTabTitleNormalColor,
"TabbedPane.selectedTabTitleShadowDisabledColor", selectedTabTitleShadowDisabledColor,
"TabbedPane.selectedTabTitleShadowNormalColor", selectedTabTitleShadowNormalColor,
"TabbedPane.nonSelectedTabTitleNormalColor", nonSelectedTabTitleNormalColor,
"Table.font", viewFont,
"Table.foreground", black,
"Table.background", white,
"Table.selectionForeground", selectionForeground,
"Table.selectionBackground", selectionBackground,
"Table.selectionInactiveBackground", selectionInactiveBackground,
"Table.selectionInactiveForeground", selectionInactiveForeground,
"Table.gridColor", white,
"Table.focusCellBackground", textHighlightText,
"Table.focusCellForeground", textHighlight,
"Table.focusCellHighlightBorder", focusCellHighlightBorder,
"Table.scrollPaneBorder", scollListBorder,
"Table.ancestorInputMap", aquaKeyBindings.getTableInputMap(),
"Table.ancestorInputMap.RightToLeft", aquaKeyBindings.getTableRightToLeftInputMap(),
"TableHeader.font", controlSmallFont,
"TableHeader.foreground", black,
"TableHeader.background", white,
"TableHeader.cellBorder", listHeaderBorder,
"TextArea.focusInputMap", aquaKeyBindings.getMultiLineTextInputMap(),
"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.focusInputMap", aquaKeyBindings.getTextFieldInputMap(),
"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.focusInputMap", aquaKeyBindings.getMultiLineTextInputMap(),
"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.background", controlBackgroundColor,
"ToggleButton.foreground", black,
"ToggleButton.disabledText", disabled,
"ToggleButton.border", new SwingLazyValue(PKG_PREFIX + "AquaButtonBorder", "getDynamicButtonBorder"),
"ToggleButton.font", controlFont,
"ToggleButton.focusInputMap", controlFocusInputMap,
"ToggleButton.margin", new InsetsUIResource(2, 2, 2, 2),
"ToolBar.font", controlFont,
"ToolBar.background", panelBackgroundColor,
"ToolBar.foreground", new ColorUIResource(Color.gray),
"ToolBar.dockingBackground", panelBackgroundColor,
"ToolBar.dockingForeground", selectionBackground,
"ToolBar.floatingBackground", panelBackgroundColor,
"ToolBar.floatingForeground", new ColorUIResource(Color.darkGray),
"ToolBar.border", new SwingLazyValue(PKG_PREFIX + "AquaToolBarUI", "getToolBarBorder"),
"ToolBar.borderHandleColor", toolbarDragHandleColor,
"ToolBar.separatorSize", null,
"ToolBarButton.margin", new InsetsUIResource(3, 3, 3, 3),
"ToolBarButton.insets", new InsetsUIResource(1, 1, 1, 1),
"ToolTip.font", controlSmallFont,
"ToolTip.background", toolTipBackground,
"ToolTip.foreground", black,
"ToolTip.border", toolTipBorder,
"Tree.font", viewFont,
"Tree.background", white,
"Tree.foreground", black,
"Tree.hash", white,
"Tree.line", white,
"Tree.textForeground", black,
"Tree.textBackground", white,
"Tree.selectionForeground", selectionForeground,
"Tree.selectionBackground", selectionBackground,
"Tree.selectionInactiveBackground", selectionInactiveBackground,
"Tree.selectionInactiveForeground", selectionInactiveForeground,
"Tree.selectionBorderColor", selectionBackground,
"Tree.editorBorderSelectionColor", null,
"Tree.leftChildIndent", new Integer(7),
"Tree.rightChildIndent", new Integer(13),
"Tree.rowHeight", new Integer(19),
"Tree.scrollsOnExpand", Boolean.FALSE,
"Tree.openIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeOpenFolderIcon"),
"Tree.closedIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeFolderIcon"),
"Tree.leafIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeDocumentIcon"),
"Tree.expandedIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeExpandedIcon"),
"Tree.collapsedIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeCollapsedIcon"),
"Tree.rightToLeftCollapsedIcon", new SwingLazyValue(kAquaImageFactoryName, "getTreeRightToLeftCollapsedIcon"),
"Tree.changeSelectionWithFocus", Boolean.TRUE,
"Tree.drawsFocusBorderAroundIcon", Boolean.FALSE,
"Tree.focusInputMap", aquaKeyBindings.getTreeInputMap(),
"Tree.focusInputMap.RightToLeft", aquaKeyBindings.getTreeRightToLeftInputMap(),
"Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[]{"ESCAPE", "cancel"}),};
table.putDefaults(defaults);
Object aaTextInfo = SwingUtilities2.AATextInfo.getAATextInfo(true);
table.put(SwingUtilities2.AA_TEXT_PROPERTY_KEY, aaTextInfo);
}
protected void initSystemColorDefaults(final UIDefaults table) {
}
protected void initClassDefaults(final UIDefaults table) {
final String basicPackageName = "javax.swing.plaf.basic.";
final Object[] uiDefaults = {
"ButtonUI", PKG_PREFIX + "AquaButtonUI",
"CheckBoxUI", PKG_PREFIX + "AquaButtonCheckBoxUI",
"CheckBoxMenuItemUI", PKG_PREFIX + "AquaMenuItemUI",
"LabelUI", PKG_PREFIX + "AquaLabelUI",
"ListUI", PKG_PREFIX + "AquaListUI",
"MenuUI", PKG_PREFIX + "AquaMenuUI",
"MenuItemUI", PKG_PREFIX + "AquaMenuItemUI",
"OptionPaneUI", PKG_PREFIX + "AquaOptionPaneUI",
"PanelUI", PKG_PREFIX + "AquaPanelUI",
"RadioButtonMenuItemUI", PKG_PREFIX + "AquaMenuItemUI",
"RadioButtonUI", PKG_PREFIX + "AquaButtonRadioUI",
"ProgressBarUI", PKG_PREFIX + "AquaProgressBarUI",
"RootPaneUI", PKG_PREFIX + "AquaRootPaneUI",
"SliderUI", PKG_PREFIX + "AquaSliderUI",
"ScrollBarUI", PKG_PREFIX + "AquaScrollBarUI",
"TabbedPaneUI", PKG_PREFIX + (JRSUIUtils.TabbedPane.shouldUseTabbedPaneContrastUI() ? "AquaTabbedPaneContrastUI" : "AquaTabbedPaneUI"),
"TableUI", PKG_PREFIX + "AquaTableUI",
"ToggleButtonUI", PKG_PREFIX + "AquaButtonToggleUI",
"ToolBarUI", PKG_PREFIX + "AquaToolBarUI",
"ToolTipUI", PKG_PREFIX + "AquaToolTipUI",
"TreeUI", PKG_PREFIX + "AquaTreeUI",
"InternalFrameUI", PKG_PREFIX + "AquaInternalFrameUI",
"DesktopIconUI", PKG_PREFIX + "AquaInternalFrameDockIconUI",
"DesktopPaneUI", PKG_PREFIX + "AquaInternalFramePaneUI",
"EditorPaneUI", PKG_PREFIX + "AquaEditorPaneUI",
"TextFieldUI", PKG_PREFIX + "AquaTextFieldUI",
"TextPaneUI", PKG_PREFIX + "AquaTextPaneUI",
"ComboBoxUI", PKG_PREFIX + "AquaComboBoxUI",
"PopupMenuUI", PKG_PREFIX + "AquaPopupMenuUI",
"TextAreaUI", PKG_PREFIX + "AquaTextAreaUI",
"MenuBarUI", PKG_PREFIX + "AquaMenuBarUI",
"FileChooserUI", PKG_PREFIX + "AquaFileChooserUI",
"PasswordFieldUI", PKG_PREFIX + "AquaTextPasswordFieldUI",
"TableHeaderUI", PKG_PREFIX + "AquaTableHeaderUI",
"FormattedTextFieldUI", PKG_PREFIX + "AquaTextFieldFormattedUI",
"SpinnerUI", PKG_PREFIX + "AquaSpinnerUI",
"SplitPaneUI", PKG_PREFIX + "AquaSplitPaneUI",
"ScrollPaneUI", PKG_PREFIX + "AquaScrollPaneUI",
"PopupMenuSeparatorUI", PKG_PREFIX + "AquaPopupMenuSeparatorUI",
"SeparatorUI", PKG_PREFIX + "AquaPopupMenuSeparatorUI",
"ToolBarSeparatorUI", PKG_PREFIX + "AquaToolBarSeparatorUI",
"ColorChooserUI", basicPackageName + "BasicColorChooserUI",
"ViewportUI", basicPackageName + "BasicViewportUI",
};
table.putDefaults(uiDefaults);
}
}