Path: blob/master/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java
41154 views
/*1* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package com.apple.laf;2627import java.awt.Color;28import java.awt.Dimension;29import java.awt.KeyboardFocusManager;30import java.security.PrivilegedAction;31import java.util.Enumeration;32import java.util.Locale;33import java.util.ResourceBundle;3435import javax.swing.Action;36import javax.swing.ActionMap;37import javax.swing.BorderFactory;38import javax.swing.DefaultListCellRenderer;39import javax.swing.JDialog;40import javax.swing.JFrame;41import javax.swing.JRootPane;42import javax.swing.PopupFactory;43import javax.swing.SwingConstants;44import javax.swing.UIDefaults;45import javax.swing.UIManager;46import javax.swing.border.Border;47import javax.swing.plaf.ActionMapUIResource;48import javax.swing.plaf.BorderUIResource;49import javax.swing.plaf.ColorUIResource;50import javax.swing.plaf.DimensionUIResource;51import javax.swing.plaf.InsetsUIResource;52import javax.swing.plaf.basic.BasicBorders;53import javax.swing.plaf.basic.BasicLookAndFeel;5455import apple.laf.JRSUIControl;56import apple.laf.JRSUIUtils;57import sun.swing.SwingAccessor;58import sun.swing.SwingUtilities2;5960import static javax.swing.UIDefaults.LazyValue;6162@SuppressWarnings("serial") // Superclass is not serializable across versions63public class AquaLookAndFeel extends BasicLookAndFeel {64static final String sPropertyPrefix = "apple.laf."; // new prefix for things like 'useScreenMenuBar'6566// for lazy initalizers. Following the pattern from metal.67private static final String PKG_PREFIX = "com.apple.laf.";6869/**70* Return a short string that identifies this look and feel, e.g.71* "CDE/Motif". This string should be appropriate for a menu item.72* Distinct look and feels should have different names, e.g.73* a subclass of MotifLookAndFeel that changes the way a few components74* are rendered should be called "CDE/Motif My Way"; something75* that would be useful to a user trying to select a L&F from a list76* of names.77*/78public String getName() {79return "Mac OS X";80}8182/**83* Return a string that identifies this look and feel. This string84* will be used by applications/services that want to recognize85* well known look and feel implementations. Presently86* the well known names are "Motif", "Windows", "Mac", "Metal". Note87* that a LookAndFeel derived from a well known superclass88* that doesn't make any fundamental changes to the look or feel89* shouldn't override this method.90*/91public String getID() {92return "Aqua";93}9495/**96* Return a one line description of this look and feel implementation,97* e.g. "The CDE/Motif Look and Feel". This string is intended for98* the user, e.g. in the title of a window or in a ToolTip message.99*/100public String getDescription() {101return "Aqua Look and Feel for Mac OS X";102}103104/**105* Returns true if the {@code LookAndFeel} returned106* {@code RootPaneUI} instances support providing Window decorations107* in a {@code JRootPane}.108* <p>109* The default implementation returns false, subclasses that support110* Window decorations should override this and return true.111*112* @return True if the RootPaneUI instances created support client side113* decorations114* @see JDialog#setDefaultLookAndFeelDecorated115* @see JFrame#setDefaultLookAndFeelDecorated116* @see JRootPane#setWindowDecorationStyle117* @since 1.4118*/119public boolean getSupportsWindowDecorations() {120return false;121}122123/**124* If the underlying platform has a "native" look and feel, and this125* is an implementation of it, return true.126*/127public boolean isNativeLookAndFeel() {128return true;129}130131/**132* Return true if the underlying platform supports and or permits133* this look and feel. This method returns false if the look134* and feel depends on special resources or legal agreements that135* aren't defined for the current platform.136*137* @see UIManager#setLookAndFeel138*/139public boolean isSupportedLookAndFeel() {140return true;141}142143/**144* UIManager.setLookAndFeel calls this method before the first145* call (and typically the only call) to getDefaults(). Subclasses146* should do any one-time setup they need here, rather than147* in a static initializer, because look and feel class objects148* may be loaded just to discover that isSupportedLookAndFeel()149* returns false.150*151* @see #uninitialize152* @see UIManager#setLookAndFeel153*/154@SuppressWarnings("removal")155public void initialize() {156java.security.AccessController.doPrivileged(new PrivilegedAction<Void>() {157public Void run() {158System.loadLibrary("osxui");159return null;160}161});162163java.security.AccessController.doPrivileged(new PrivilegedAction<Void>(){164@Override165public Void run() {166JRSUIControl.initJRSUI();167return null;168}169});170171super.initialize();172final ScreenPopupFactory spf = new ScreenPopupFactory();173spf.setActive(true);174PopupFactory.setSharedInstance(spf);175176KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventPostProcessor(AquaMnemonicHandler.getInstance());177}178179/**180* UIManager.setLookAndFeel calls this method just before we're181* replaced by a new default look and feel. Subclasses may182* choose to free up some resources here.183*184* @see #initialize185*/186public void uninitialize() {187KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventPostProcessor(AquaMnemonicHandler.getInstance());188189final PopupFactory popupFactory = PopupFactory.getSharedInstance();190if (popupFactory != null && popupFactory instanceof ScreenPopupFactory) {191((ScreenPopupFactory)popupFactory).setActive(false);192}193194super.uninitialize();195}196197/**198* Returns an {@code ActionMap}.199* <P>200* This {@code ActionMap} contains {@code Actions} that201* embody the ability to render an auditory cue. These auditory202* cues map onto user and system activities that may be useful203* for an end user to know about (such as a dialog box appearing).204* <P>205* At the appropriate time in a {@code JComponent} UI's lifecycle,206* the ComponentUI is responsible for getting the appropriate207* {@code Action} out of the {@code ActionMap} and passing208* it on to {@code playSound}.209* <P>210* The {@code Actions} in this {@code ActionMap} are211* created by the {@code createAudioAction} method.212*213* @return an ActionMap containing Actions214* responsible for rendering auditory cues215* @see #createAudioAction216* @see #playSound(Action)217* @since 1.4218*/219protected ActionMap getAudioActionMap() {220ActionMap audioActionMap = (ActionMap)UIManager.get("AuditoryCues.actionMap");221if (audioActionMap != null) return audioActionMap;222223final Object[] acList = (Object[])UIManager.get("AuditoryCues.cueList");224if (acList != null) {225audioActionMap = new ActionMapUIResource();226for (int counter = acList.length - 1; counter >= 0; counter--) {227audioActionMap.put(acList[counter], createAudioAction(acList[counter]));228}229}230UIManager.getLookAndFeelDefaults().put("AuditoryCues.actionMap", audioActionMap);231232return audioActionMap;233}234235/**236* We override getDefaults() so we can install our own debug defaults237* if needed for testing238*/239public UIDefaults getDefaults() {240final UIDefaults table = new UIDefaults();241// use debug defaults if you want to see every query into the defaults object.242//UIDefaults table = new DebugDefaults();243try {244// PopupFactory.getSharedInstance().setPopupType(2);245initClassDefaults(table);246247// Here we install all the Basic defaults in case we missed some in our System color248// or component defaults that follow. Eventually we will take this out.249// This is a big negative to performance so we want to get it out as soon250// as we are comfortable with the Aqua defaults.251super.initSystemColorDefaults(table);252super.initComponentDefaults(table);253254// Because the last elements added win in precedence we add all of our aqua elements here.255initSystemColorDefaults(table);256initComponentDefaults(table);257} catch(final Exception e) {258e.printStackTrace();259}260return table;261}262263/**264* Initialize the defaults table with the name of the ResourceBundle265* used for getting localized defaults. Also initialize the default266* locale used when no locale is passed into UIDefaults.get(). The267* default locale should generally not be relied upon. It is here for268* compatibility with releases prior to 1.4.269*/270private void initResourceBundle(final UIDefaults table) {271table.setDefaultLocale(Locale.getDefault());272SwingAccessor.getUIDefaultsAccessor().addInternalBundle(table,273PKG_PREFIX + "resources.aqua");274try {275final ResourceBundle aquaProperties = ResourceBundle.getBundle(PKG_PREFIX + "resources.aqua");276final Enumeration<String> propertyKeys = aquaProperties.getKeys();277278while (propertyKeys.hasMoreElements()) {279final String key = propertyKeys.nextElement();280table.put(key, aquaProperties.getString(key));281}282} catch (final Exception e) {283}284}285286/**287* This is the last step in the getDefaults routine usually called from our superclass288*/289protected void initComponentDefaults(final UIDefaults table) {290initResourceBundle(table);291292final InsetsUIResource zeroInsets = new InsetsUIResource(0, 0, 0, 0);293final InsetsUIResource menuItemMargin = zeroInsets;294295// <rdar://problem/5189013> Entire Java application window refreshes when moving off Shortcut menu item296final Boolean useOpaqueComponents = Boolean.TRUE;297298final Boolean buttonShouldBeOpaque = Boolean.FALSE;299300// *** List value objects301final Object listCellRendererActiveValue = new UIDefaults.ActiveValue(){302public Object createValue(UIDefaults defaultsTable) {303return new DefaultListCellRenderer.UIResource();304}305};306307// SJA - I'm basing this on what is in the MetalLookAndFeel class, but308// without being based on BasicLookAndFeel. We want more flexibility.309// The key to doing this well is to use Lazy initializing classes as310// much as possible.311312// Here I want to go to native and get all the values we'd need for colors etc.313final Border toolTipBorder = new BorderUIResource.EmptyBorderUIResource(2, 0, 2, 0);314final ColorUIResource toolTipBackground = new ColorUIResource(255, 255, (int)(255.0 * 0.80));315final ColorUIResource black = new ColorUIResource(Color.black);316final ColorUIResource white = new ColorUIResource(Color.white);317final ColorUIResource smokyGlass = new ColorUIResource(new Color(0, 0, 0, 152));318final ColorUIResource dockIconRim = new ColorUIResource(new Color(192, 192, 192, 192));319final ColorUIResource mediumTranslucentBlack = new ColorUIResource(new Color(0, 0, 0, 100));320final ColorUIResource translucentWhite = new ColorUIResource(new Color(255, 255, 255, 254));321// final ColorUIResource lightGray = new ColorUIResource(232, 232, 232);322final ColorUIResource disabled = new ColorUIResource(0.5f, 0.5f, 0.5f);323final ColorUIResource disabledShadow = new ColorUIResource(0.25f, 0.25f, 0.25f);324final ColorUIResource selected = new ColorUIResource(1.0f, 0.4f, 0.4f);325326// Contrast tab UI colors327328final ColorUIResource selectedTabTitlePressedColor = new ColorUIResource(240, 240, 240);329final ColorUIResource selectedTabTitleDisabledColor = new ColorUIResource(new Color(1, 1, 1, 0.55f));330final ColorUIResource selectedTabTitleNormalColor = white;331final Color selectedControlTextColor = AquaImageFactory.getSelectedControlColorUIResource();332final ColorUIResource selectedTabTitleShadowDisabledColor = new ColorUIResource(new Color(0, 0, 0, 0.25f));333final ColorUIResource selectedTabTitleShadowNormalColor = mediumTranslucentBlack;334final ColorUIResource nonSelectedTabTitleNormalColor = black;335336final ColorUIResource toolbarDragHandleColor = new ColorUIResource(140, 140, 140);337338// sja todo Make these lazy values so we only get them when required - if we deem it necessary339// it may be the case that we think the overhead of a proxy lazy value is not worth delaying340// creating the object if we think that most swing apps will use this.341// the lazy value is useful for delaying initialization until this default value is actually342// accessed by the LAF instead of at init time, so making it lazy should speed up343// our launch times of Swing apps.344345// *** Text value objects346final LazyValue marginBorder = t -> new BasicBorders.MarginBorder();347348final int zero = 0;349final Object editorMargin = zeroInsets; // this is not correct - look at TextEdit to determine the right margin350final int textCaretBlinkRate = 500;351final LazyValue textFieldBorder = t ->352AquaTextFieldBorder.getTextFieldBorder();353final Object textAreaBorder = marginBorder; // text areas have no real border - radar 311073354355final LazyValue scollListBorder = t ->356AquaScrollRegionBorder.getScrollRegionBorder();357final LazyValue aquaTitledBorder = t ->358AquaGroupBorder.getBorderForTitledBorder();359final LazyValue aquaInsetBorder = t ->360AquaGroupBorder.getTitlelessBorder();361362final Border listHeaderBorder = AquaTableHeaderBorder.getListHeaderBorder();363final Border zeroBorder = new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0);364365// we can't seem to proxy Colors366final Color selectionBackground = AquaImageFactory.getSelectionBackgroundColorUIResource();367final Color selectionForeground = AquaImageFactory.getSelectionForegroundColorUIResource();368final Color selectionInactiveBackground = AquaImageFactory.getSelectionInactiveBackgroundColorUIResource();369final Color selectionInactiveForeground = AquaImageFactory.getSelectionInactiveForegroundColorUIResource();370371final Color textHighlightText = AquaImageFactory.getTextSelectionForegroundColorUIResource();372final Color textHighlight = AquaImageFactory.getTextSelectionBackgroundColorUIResource();373final Color textHighlightInactive = new ColorUIResource(212, 212, 212);374375final Color textInactiveText = disabled;376final Color textForeground = black;377final Color textBackground = white;378final Color textInactiveBackground = white;379380final Color textPasswordFieldCapsLockIconColor = mediumTranslucentBlack;381382final LazyValue internalFrameBorder = t ->383BasicBorders.getInternalFrameBorder();384final Color desktopBackgroundColor = new ColorUIResource(new Color(65, 105, 170));//SystemColor.desktop385386final Color focusRingColor = AquaImageFactory.getFocusRingColorUIResource();387final Border focusCellHighlightBorder = new BorderUIResource.LineBorderUIResource(focusRingColor);388389final Color windowBackgroundColor = AquaImageFactory.getWindowBackgroundColorUIResource();390final Color panelBackgroundColor = windowBackgroundColor;391final Color tabBackgroundColor = windowBackgroundColor;392final Color controlBackgroundColor = windowBackgroundColor;393394final LazyValue controlFont = t -> AquaFonts.getControlTextFont();395final LazyValue controlSmallFont = t ->396AquaFonts.getControlTextSmallFont();397final LazyValue alertHeaderFont = t -> AquaFonts.getAlertHeaderFont();398final LazyValue menuFont = t -> AquaFonts.getMenuFont();399final LazyValue viewFont = t -> AquaFonts.getViewFont();400401final Color menuBackgroundColor = new ColorUIResource(Color.white);402final Color menuForegroundColor = black;403404final Color menuSelectedForegroundColor = white;405final Color menuSelectedBackgroundColor = focusRingColor;406407final Color menuDisabledBackgroundColor = menuBackgroundColor;408final Color menuDisabledForegroundColor = disabled;409410final Color menuAccelForegroundColor = black;411final Color menuAccelSelectionForegroundColor = black;412413final Border menuBorder = new AquaMenuBorder();414415final UIDefaults.LazyInputMap controlFocusInputMap = new UIDefaults.LazyInputMap(new Object[]{416"SPACE", "pressed",417"released SPACE", "released"418});419420// sja testing421final LazyValue confirmIcon = t ->422AquaImageFactory.getConfirmImageIcon();423final LazyValue cautionIcon = t ->424AquaImageFactory.getCautionImageIcon();425final LazyValue stopIcon = t ->426AquaImageFactory.getStopImageIcon();427final LazyValue securityIcon = t ->428AquaImageFactory.getLockImageIcon();429430final AquaKeyBindings aquaKeyBindings = AquaKeyBindings.instance();431432final Object[] defaults = {433"control", windowBackgroundColor, /* Default color for controls (buttons, sliders, etc) */434435// Buttons436"Button.background", controlBackgroundColor,437"Button.foreground", black,438"Button.disabledText", disabled,439"Button.select", selected,440"Button.border",(LazyValue) t -> AquaButtonBorder.getDynamicButtonBorder(),441"Button.font", controlFont,442"Button.textIconGap", Integer.valueOf(4),443"Button.textShiftOffset", zero, // radar 3308129 - aqua doesn't move images when pressed.444"Button.focusInputMap", controlFocusInputMap,445"Button.margin", new InsetsUIResource(0, 2, 0, 2),446"Button.opaque", buttonShouldBeOpaque,447448"CheckBox.background", controlBackgroundColor,449"CheckBox.foreground", black,450"CheckBox.disabledText", disabled,451"CheckBox.select", selected,452"CheckBox.icon",(LazyValue) t -> AquaButtonCheckBoxUI.getSizingCheckBoxIcon(),453"CheckBox.font", controlFont,454"CheckBox.border", AquaButtonBorder.getBevelButtonBorder(),455"CheckBox.margin", new InsetsUIResource(1, 1, 0, 1),456// radar 3583849. This property never gets457// used. The border for the Checkbox gets overridden458// by AquaRadiButtonUI.setThemeBorder(). Needs refactoring. (vm)459// why is button focus commented out?460//"CheckBox.focus", getFocusColor(),461"CheckBox.focusInputMap", controlFocusInputMap,462463"CheckBoxMenuItem.font", menuFont,464"CheckBoxMenuItem.acceleratorFont", menuFont,465"CheckBoxMenuItem.background", menuBackgroundColor,466"CheckBoxMenuItem.foreground", menuForegroundColor,467"CheckBoxMenuItem.selectionBackground", menuSelectedBackgroundColor,468"CheckBoxMenuItem.selectionForeground", menuSelectedForegroundColor,469"CheckBoxMenuItem.disabledBackground", menuDisabledBackgroundColor,470"CheckBoxMenuItem.disabledForeground", menuDisabledForegroundColor,471"CheckBoxMenuItem.acceleratorForeground", menuAccelForegroundColor,472"CheckBoxMenuItem.acceleratorSelectionForeground", menuAccelSelectionForegroundColor,473"CheckBoxMenuItem.acceleratorDelimiter", "",474"CheckBoxMenuItem.border", menuBorder, // for inset calculation475"CheckBoxMenuItem.margin", menuItemMargin,476"CheckBoxMenuItem.borderPainted", Boolean.TRUE,477"CheckBoxMenuItem.checkIcon",(LazyValue) t -> AquaImageFactory.getMenuItemCheckIcon(),478"CheckBoxMenuItem.dashIcon",(LazyValue) t -> AquaImageFactory.getMenuItemDashIcon(),479//"CheckBoxMenuItem.arrowIcon", null,480481"ColorChooser.background", panelBackgroundColor,482483// *** ComboBox484"ComboBox.font", controlFont,485"ComboBox.background", controlBackgroundColor, //menuBackgroundColor, // "menu" when it has no scrollbar, "listView" when it does486"ComboBox.foreground", menuForegroundColor,487"ComboBox.selectionBackground", menuSelectedBackgroundColor,488"ComboBox.selectionForeground", menuSelectedForegroundColor,489"ComboBox.disabledBackground", menuDisabledBackgroundColor,490"ComboBox.disabledForeground", menuDisabledForegroundColor,491"ComboBox.ancestorInputMap", aquaKeyBindings.getComboBoxInputMap(),492493"DesktopIcon.border", internalFrameBorder,494"DesktopIcon.borderColor", smokyGlass,495"DesktopIcon.borderRimColor", dockIconRim,496"DesktopIcon.labelBackground", mediumTranslucentBlack,497"Desktop.background", desktopBackgroundColor,498499"EditorPane.focusInputMap", aquaKeyBindings.getMultiLineTextInputMap(),500"EditorPane.font", controlFont,501"EditorPane.background", textBackground,502"EditorPane.foreground", textForeground,503"EditorPane.selectionBackground", textHighlight,504"EditorPane.selectionForeground", textHighlightText,505"EditorPane.caretForeground", textForeground,506"EditorPane.caretBlinkRate", textCaretBlinkRate,507"EditorPane.inactiveForeground", textInactiveText,508"EditorPane.inactiveBackground", textInactiveBackground,509"EditorPane.border", textAreaBorder,510"EditorPane.margin", editorMargin,511512"FileChooser.newFolderIcon", AquaIcon.SystemIcon.getFolderIconUIResource(),513"FileChooser.upFolderIcon", AquaIcon.SystemIcon.getFolderIconUIResource(),514"FileChooser.homeFolderIcon", AquaIcon.SystemIcon.getDesktopIconUIResource(),515"FileChooser.detailsViewIcon", AquaIcon.SystemIcon.getComputerIconUIResource(),516"FileChooser.listViewIcon", AquaIcon.SystemIcon.getComputerIconUIResource(),517518"FileView.directoryIcon", AquaIcon.SystemIcon.getFolderIconUIResource(),519"FileView.fileIcon", AquaIcon.SystemIcon.getDocumentIconUIResource(),520"FileView.computerIcon", AquaIcon.SystemIcon.getDesktopIconUIResource(),521"FileView.hardDriveIcon", AquaIcon.SystemIcon.getHardDriveIconUIResource(),522"FileView.floppyDriveIcon", AquaIcon.SystemIcon.getFloppyIconUIResource(),523524// File View525"FileChooser.cancelButtonMnemonic", zero,526"FileChooser.saveButtonMnemonic", zero,527"FileChooser.openButtonMnemonic", zero,528"FileChooser.updateButtonMnemonic", zero,529"FileChooser.helpButtonMnemonic", zero,530"FileChooser.directoryOpenButtonMnemonic", zero,531532"FileChooser.lookInLabelMnemonic", zero,533"FileChooser.fileNameLabelMnemonic", zero,534"FileChooser.filesOfTypeLabelMnemonic", zero,535536"Focus.color", focusRingColor,537538"FormattedTextField.focusInputMap", aquaKeyBindings.getFormattedTextFieldInputMap(),539"FormattedTextField.font", controlFont,540"FormattedTextField.background", textBackground,541"FormattedTextField.foreground", textForeground,542"FormattedTextField.inactiveForeground", textInactiveText,543"FormattedTextField.inactiveBackground", textInactiveBackground,544"FormattedTextField.selectionBackground", textHighlight,545"FormattedTextField.selectionForeground", textHighlightText,546"FormattedTextField.caretForeground", textForeground,547"FormattedTextField.caretBlinkRate", textCaretBlinkRate,548"FormattedTextField.border", textFieldBorder,549"FormattedTextField.margin", zeroInsets,550551"IconButton.font", controlSmallFont,552553"InternalFrame.titleFont", menuFont,554"InternalFrame.background", windowBackgroundColor,555"InternalFrame.borderColor", windowBackgroundColor,556"InternalFrame.borderShadow", Color.red,557"InternalFrame.borderDarkShadow", Color.green,558"InternalFrame.borderHighlight", Color.blue,559"InternalFrame.borderLight", Color.yellow,560"InternalFrame.opaque", Boolean.FALSE,561"InternalFrame.border", null, //internalFrameBorder,562"InternalFrame.icon", null,563564"InternalFrame.paletteBorder", null,//internalFrameBorder,565"InternalFrame.paletteTitleFont", menuFont,566"InternalFrame.paletteBackground", windowBackgroundColor,567568"InternalFrame.optionDialogBorder", null,//internalFrameBorder,569"InternalFrame.optionDialogTitleFont", menuFont,570"InternalFrame.optionDialogBackground", windowBackgroundColor,571572/* Default frame icons are undefined for Basic. */573574"InternalFrame.closeIcon",(LazyValue) t -> AquaInternalFrameUI.exportCloseIcon(),575"InternalFrame.maximizeIcon",(LazyValue) t -> AquaInternalFrameUI.exportZoomIcon(),576"InternalFrame.iconifyIcon",(LazyValue) t -> AquaInternalFrameUI.exportMinimizeIcon(),577"InternalFrame.minimizeIcon",(LazyValue) t -> AquaInternalFrameUI.exportMinimizeIcon(),578// this could be either grow or icon579// we decided to make it icon so that anyone who uses580// these for ui will have different icons for max and min581// these icons are pretty crappy to use in Mac OS X since582// they really are interactive but we have to return a static583// icon for now.584585// InternalFrame Auditory Cue Mappings586"InternalFrame.closeSound", null,587"InternalFrame.maximizeSound", null,588"InternalFrame.minimizeSound", null,589"InternalFrame.restoreDownSound", null,590"InternalFrame.restoreUpSound", null,591592"InternalFrame.activeTitleBackground", windowBackgroundColor,593"InternalFrame.activeTitleForeground", textForeground,594"InternalFrame.inactiveTitleBackground", windowBackgroundColor,595"InternalFrame.inactiveTitleForeground", textInactiveText,596"InternalFrame.windowBindings", new Object[]{597"shift ESCAPE", "showSystemMenu",598"ctrl SPACE", "showSystemMenu",599"ESCAPE", "hideSystemMenu"600},601602// Radar [3543438]. We now define the TitledBorder properties for font and color.603// Aqua HIG doesn't define TitledBorders as Swing does. Eventually, we might want to604// re-think TitledBorder to behave more like a Box (NSBox). (vm)605"TitledBorder.font", controlFont,606"TitledBorder.titleColor", black,607// "TitledBorder.border", -- we inherit this property from BasicLookAndFeel (etched border)608"TitledBorder.aquaVariant", aquaTitledBorder, // this is the border that matches what aqua really looks like609"InsetBorder.aquaVariant", aquaInsetBorder, // this is the title-less variant610611// *** Label612"Label.font", controlFont, // themeLabelFont is for small things like ToolbarButtons613"Label.background", controlBackgroundColor,614"Label.foreground", black,615"Label.disabledForeground", disabled,616"Label.disabledShadow", disabledShadow,617"Label.opaque", useOpaqueComponents,618"Label.border", null,619620"List.font", viewFont, // [3577901] Aqua HIG says "default font of text in lists and tables" should be 12 point (vm).621"List.background", white,622"List.foreground", black,623"List.selectionBackground", selectionBackground,624"List.selectionForeground", selectionForeground,625"List.selectionInactiveBackground", selectionInactiveBackground,626"List.selectionInactiveForeground", selectionInactiveForeground,627"List.focusCellHighlightBorder", focusCellHighlightBorder,628"List.border", null,629"List.cellRenderer", listCellRendererActiveValue,630631"List.sourceListBackgroundPainter",(LazyValue) t -> AquaListUI.getSourceListBackgroundPainter(),632"List.sourceListSelectionBackgroundPainter",(LazyValue) t -> AquaListUI.getSourceListSelectionBackgroundPainter(),633"List.sourceListFocusedSelectionBackgroundPainter",(LazyValue) t -> AquaListUI.getSourceListFocusedSelectionBackgroundPainter(),634"List.evenRowBackgroundPainter",(LazyValue) t -> AquaListUI.getListEvenBackgroundPainter(),635"List.oddRowBackgroundPainter",(LazyValue) t -> AquaListUI.getListOddBackgroundPainter(),636637// <rdar://Problem/3743210> The modifier for the Mac is meta, not control.638"List.focusInputMap", aquaKeyBindings.getListInputMap(),639640//"List.scrollPaneBorder", listBoxBorder, // Not used in Swing1.1641//"ListItem.border", ThemeMenu.listItemBorder(), // for inset calculation642643// *** Menus644"Menu.font", menuFont,645"Menu.acceleratorFont", menuFont,646"Menu.background", menuBackgroundColor,647"Menu.foreground", menuForegroundColor,648"Menu.selectionBackground", menuSelectedBackgroundColor,649"Menu.selectionForeground", menuSelectedForegroundColor,650"Menu.disabledBackground", menuDisabledBackgroundColor,651"Menu.disabledForeground", menuDisabledForegroundColor,652"Menu.acceleratorForeground", menuAccelForegroundColor,653"Menu.acceleratorSelectionForeground", menuAccelSelectionForegroundColor,654//"Menu.border", ThemeMenu.menuItemBorder(), // for inset calculation655"Menu.border", menuBorder,656"Menu.borderPainted", Boolean.FALSE,657"Menu.margin", menuItemMargin,658//"Menu.checkIcon", emptyCheckIcon, // A non-drawing GlyphIcon to make the spacing consistent659"Menu.arrowIcon",(LazyValue) t -> AquaImageFactory.getMenuArrowIcon(),660"Menu.consumesTabs", Boolean.TRUE,661"Menu.menuPopupOffsetY", Integer.valueOf(1),662"Menu.submenuPopupOffsetY", Integer.valueOf(-4),663664"MenuBar.font", menuFont,665"MenuBar.background", menuBackgroundColor, // not a menu item, not selected666"MenuBar.foreground", menuForegroundColor,667"MenuBar.border", new AquaMenuBarBorder(), // sja make lazy!668"MenuBar.margin", new InsetsUIResource(0, 8, 0, 8), // sja make lazy!669"MenuBar.selectionBackground", menuSelectedBackgroundColor, // not a menu item, is selected670"MenuBar.selectionForeground", menuSelectedForegroundColor,671"MenuBar.disabledBackground", menuDisabledBackgroundColor, //ThemeBrush.GetThemeBrushForMenu(false, false), // not a menu item, not selected672"MenuBar.disabledForeground", menuDisabledForegroundColor,673"MenuBar.backgroundPainter",(LazyValue) t -> AquaMenuPainter.getMenuBarPainter(),674"MenuBar.selectedBackgroundPainter",(LazyValue) t -> AquaMenuPainter.getSelectedMenuBarItemPainter(),675676"MenuItem.font", menuFont,677"MenuItem.acceleratorFont", menuFont,678"MenuItem.background", menuBackgroundColor,679"MenuItem.foreground", menuForegroundColor,680"MenuItem.selectionBackground", menuSelectedBackgroundColor,681"MenuItem.selectionForeground", menuSelectedForegroundColor,682"MenuItem.disabledBackground", menuDisabledBackgroundColor,683"MenuItem.disabledForeground", menuDisabledForegroundColor,684"MenuItem.acceleratorForeground", menuAccelForegroundColor,685"MenuItem.acceleratorSelectionForeground", menuAccelSelectionForegroundColor,686"MenuItem.acceleratorDelimiter", "",687"MenuItem.border", menuBorder,688"MenuItem.margin", menuItemMargin,689"MenuItem.borderPainted", Boolean.TRUE,690//"MenuItem.checkIcon", emptyCheckIcon, // A non-drawing GlyphIcon to make the spacing consistent691//"MenuItem.arrowIcon", null,692"MenuItem.selectedBackgroundPainter",(LazyValue) t -> AquaMenuPainter.getSelectedMenuItemPainter(),693694// *** OptionPane695// You can additionaly define OptionPane.messageFont which will696// dictate the fonts used for the message, and697// OptionPane.buttonFont, which defines the font for the buttons.698"OptionPane.font", alertHeaderFont,699"OptionPane.messageFont", controlFont,700"OptionPane.buttonFont", controlFont,701"OptionPane.background", windowBackgroundColor,702"OptionPane.foreground", black,703"OptionPane.messageForeground", black,704"OptionPane.border", new BorderUIResource.EmptyBorderUIResource(12, 21, 17, 21),705"OptionPane.messageAreaBorder", zeroBorder,706"OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(13, 0, 0, 0),707"OptionPane.minimumSize", new DimensionUIResource(262, 90),708709"OptionPane.errorIcon", stopIcon,710"OptionPane.informationIcon", confirmIcon,711"OptionPane.warningIcon", cautionIcon,712"OptionPane.questionIcon", confirmIcon,713"_SecurityDecisionIcon", securityIcon,714"OptionPane.windowBindings", new Object[]{"ESCAPE", "close"},715// OptionPane Auditory Cue Mappings716"OptionPane.errorSound", null,717"OptionPane.informationSound", null, // Info and Plain718"OptionPane.questionSound", null,719"OptionPane.warningSound", null,720"OptionPane.buttonClickThreshhold", Integer.valueOf(500),721"OptionPane.yesButtonMnemonic", "",722"OptionPane.noButtonMnemonic", "",723"OptionPane.okButtonMnemonic", "",724"OptionPane.cancelButtonMnemonic", "",725726"Panel.font", controlFont,727"Panel.background", panelBackgroundColor, //new ColorUIResource(0.5647f, 0.9957f, 0.5059f),728"Panel.foreground", black,729"Panel.opaque", useOpaqueComponents,730731"PasswordField.focusInputMap", aquaKeyBindings.getPasswordFieldInputMap(),732"PasswordField.font", controlFont,733"PasswordField.background", textBackground,734"PasswordField.foreground", textForeground,735"PasswordField.inactiveForeground", textInactiveText,736"PasswordField.inactiveBackground", textInactiveBackground,737"PasswordField.selectionBackground", textHighlight,738"PasswordField.selectionForeground", textHighlightText,739"PasswordField.caretForeground", textForeground,740"PasswordField.caretBlinkRate", textCaretBlinkRate,741"PasswordField.border", textFieldBorder,742"PasswordField.margin", zeroInsets,743"PasswordField.echoChar", Character.valueOf((char)0x25CF),744"PasswordField.capsLockIconColor", textPasswordFieldCapsLockIconColor,745746"PopupMenu.font", menuFont,747"PopupMenu.background", menuBackgroundColor,748// Fix for 7154516: make popups opaque749"PopupMenu.translucentBackground", white,750"PopupMenu.foreground", menuForegroundColor,751"PopupMenu.selectionBackground", menuSelectedBackgroundColor,752"PopupMenu.selectionForeground", menuSelectedForegroundColor,753"PopupMenu.border", menuBorder,754// "PopupMenu.margin",755756"ProgressBar.font", controlFont,757"ProgressBar.foreground", black,758"ProgressBar.background", controlBackgroundColor,759"ProgressBar.selectionForeground", black,760"ProgressBar.selectionBackground", white,761"ProgressBar.border", new BorderUIResource(BorderFactory.createEmptyBorder()),762"ProgressBar.repaintInterval", Integer.valueOf(20),763764"RadioButton.background", controlBackgroundColor,765"RadioButton.foreground", black,766"RadioButton.disabledText", disabled,767"RadioButton.select", selected,768"RadioButton.icon",(LazyValue) t -> AquaButtonRadioUI.getSizingRadioButtonIcon(),769"RadioButton.font", controlFont,770"RadioButton.border", AquaButtonBorder.getBevelButtonBorder(),771"RadioButton.margin", new InsetsUIResource(1, 1, 0, 1),772"RadioButton.focusInputMap", controlFocusInputMap,773774"RadioButtonMenuItem.font", menuFont,775"RadioButtonMenuItem.acceleratorFont", menuFont,776"RadioButtonMenuItem.background", menuBackgroundColor,777"RadioButtonMenuItem.foreground", menuForegroundColor,778"RadioButtonMenuItem.selectionBackground", menuSelectedBackgroundColor,779"RadioButtonMenuItem.selectionForeground", menuSelectedForegroundColor,780"RadioButtonMenuItem.disabledBackground", menuDisabledBackgroundColor,781"RadioButtonMenuItem.disabledForeground", menuDisabledForegroundColor,782"RadioButtonMenuItem.acceleratorForeground", menuAccelForegroundColor,783"RadioButtonMenuItem.acceleratorSelectionForeground", menuAccelSelectionForegroundColor,784"RadioButtonMenuItem.acceleratorDelimiter", "",785"RadioButtonMenuItem.border", menuBorder, // for inset calculation786"RadioButtonMenuItem.margin", menuItemMargin,787"RadioButtonMenuItem.borderPainted", Boolean.TRUE,788"RadioButtonMenuItem.checkIcon",(LazyValue) t -> AquaImageFactory.getMenuItemCheckIcon(),789"RadioButtonMenuItem.dashIcon",(LazyValue) t -> AquaImageFactory.getMenuItemDashIcon(),790//"RadioButtonMenuItem.arrowIcon", null,791792"Separator.background", null,793"Separator.foreground", new ColorUIResource(0xD4, 0xD4, 0xD4),794795"ScrollBar.border", null,796"ScrollBar.focusInputMap", aquaKeyBindings.getScrollBarInputMap(),797"ScrollBar.focusInputMap.RightToLeft", aquaKeyBindings.getScrollBarRightToLeftInputMap(),798"ScrollBar.width", Integer.valueOf(16),799"ScrollBar.background", white,800"ScrollBar.foreground", black,801802"ScrollPane.font", controlFont,803"ScrollPane.background", white,804"ScrollPane.foreground", black, //$805"ScrollPane.border", scollListBorder,806"ScrollPane.viewportBorder", null,807808"ScrollPane.ancestorInputMap", aquaKeyBindings.getScrollPaneInputMap(),809"ScrollPane.ancestorInputMap.RightToLeft", new UIDefaults.LazyInputMap(new Object[]{}),810811"Viewport.font", controlFont,812"Viewport.background", white, // The background for tables, lists, etc813"Viewport.foreground", black,814815// *** Slider816"Slider.foreground", black, "Slider.background", controlBackgroundColor,817"Slider.font", controlSmallFont,818//"Slider.highlight", table.get("controlLtHighlight"),819//"Slider.shadow", table.get("controlShadow"),820//"Slider.focus", table.get("controlDkShadow"),821"Slider.tickColor", new ColorUIResource(Color.GRAY),822"Slider.border", null,823"Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2),824"Slider.focusInputMap", aquaKeyBindings.getSliderInputMap(),825"Slider.focusInputMap.RightToLeft", aquaKeyBindings.getSliderRightToLeftInputMap(),826827// *** Spinner828"Spinner.font", controlFont,829"Spinner.background", controlBackgroundColor,830"Spinner.foreground", black,831"Spinner.border", null,832"Spinner.arrowButtonSize", new Dimension(16, 5),833"Spinner.ancestorInputMap", aquaKeyBindings.getSpinnerInputMap(),834"Spinner.editorBorderPainted", Boolean.TRUE,835"Spinner.editorAlignment", SwingConstants.TRAILING,836837// *** SplitPane838//"SplitPane.highlight", table.get("controlLtHighlight"),839//"SplitPane.shadow", table.get("controlShadow"),840"SplitPane.background", panelBackgroundColor,841"SplitPane.border", scollListBorder,842"SplitPane.dividerSize", Integer.valueOf(9), //$843"SplitPaneDivider.border", null, // AquaSplitPaneDividerUI draws it844"SplitPaneDivider.horizontalGradientVariant",(LazyValue) t -> AquaSplitPaneDividerUI.getHorizontalSplitDividerGradientVariant(),845846// *** TabbedPane847"TabbedPane.font", controlFont,848"TabbedPane.smallFont", controlSmallFont,849"TabbedPane.useSmallLayout", Boolean.FALSE,//sSmallTabs ? Boolean.TRUE : Boolean.FALSE,850"TabbedPane.background", tabBackgroundColor, // for bug [3398277] use a background color so that851// tabs on a custom pane get erased when they are removed.852"TabbedPane.foreground", black, //ThemeTextColor.GetThemeTextColor(AppearanceConstants.kThemeTextColorTabFrontActive),853//"TabbedPane.lightHighlight", table.get("controlLtHighlight"),854//"TabbedPane.highlight", table.get("controlHighlight"),855//"TabbedPane.shadow", table.get("controlShadow"),856//"TabbedPane.darkShadow", table.get("controlDkShadow"),857//"TabbedPane.focus", table.get("controlText"),858"TabbedPane.opaque", useOpaqueComponents,859"TabbedPane.textIconGap", Integer.valueOf(4),860"TabbedPane.tabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab (top, left, bottom, right)861//"TabbedPane.rightTabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab (top, left, bottom, right)862"TabbedPane.leftTabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab863"TabbedPane.rightTabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab864//"TabbedPane.tabAreaInsets", new InsetsUIResource(3, 9, -1, 9), // Tabs relative to edge of pane (negative value for overlapping)865"TabbedPane.tabAreaInsets", new InsetsUIResource(3, 9, -1, 9), // Tabs relative to edge of pane (negative value for overlapping)866// (top = side opposite pane, left = edge || to pane, bottom = side adjacent to pane, right = left) - see rotateInsets867"TabbedPane.contentBorderInsets", new InsetsUIResource(8, 0, 0, 0), // width of border868//"TabbedPane.selectedTabPadInsets", new InsetsUIResource(0, 0, 1, 0), // Really outsets, this is where we allow for overlap869"TabbedPane.selectedTabPadInsets", new InsetsUIResource(0, 0, 0, 0), // Really outsets, this is where we allow for overlap870"TabbedPane.tabsOverlapBorder", Boolean.TRUE,871"TabbedPane.selectedTabTitlePressedColor", selectedTabTitlePressedColor,872"TabbedPane.selectedTabTitleDisabledColor", selectedTabTitleDisabledColor,873"TabbedPane.selectedTabTitleNormalColor", JRSUIUtils.isMacOSXBigSurOrAbove() ? selectedControlTextColor : selectedTabTitleNormalColor,874"TabbedPane.selectedTabTitleShadowDisabledColor", selectedTabTitleShadowDisabledColor,875"TabbedPane.selectedTabTitleShadowNormalColor", selectedTabTitleShadowNormalColor,876"TabbedPane.nonSelectedTabTitleNormalColor", nonSelectedTabTitleNormalColor,877878// *** Table879"Table.font", viewFont, // [3577901] Aqua HIG says "default font of text in lists and tables" should be 12 point (vm).880"Table.foreground", black, // cell text color881"Table.background", white, // cell background color882"Table.selectionForeground", selectionForeground,883"Table.selectionBackground", selectionBackground,884"Table.selectionInactiveBackground", selectionInactiveBackground,885"Table.selectionInactiveForeground", selectionInactiveForeground,886"Table.gridColor", white, // grid line color887"Table.focusCellBackground", textHighlightText,888"Table.focusCellForeground", textHighlight,889"Table.focusCellHighlightBorder", focusCellHighlightBorder,890"Table.scrollPaneBorder", scollListBorder,891892"Table.ancestorInputMap", aquaKeyBindings.getTableInputMap(),893"Table.ancestorInputMap.RightToLeft", aquaKeyBindings.getTableRightToLeftInputMap(),894895"TableHeader.font", controlSmallFont,896"TableHeader.foreground", black,897"TableHeader.background", white, // header background898"TableHeader.cellBorder", listHeaderBorder,899900// *** Text901"TextArea.focusInputMap", aquaKeyBindings.getMultiLineTextInputMap(),902"TextArea.font", controlFont,903"TextArea.background", textBackground,904"TextArea.foreground", textForeground,905"TextArea.inactiveForeground", textInactiveText,906"TextArea.inactiveBackground", textInactiveBackground,907"TextArea.selectionBackground", textHighlight,908"TextArea.selectionForeground", textHighlightText,909"TextArea.caretForeground", textForeground,910"TextArea.caretBlinkRate", textCaretBlinkRate,911"TextArea.border", textAreaBorder,912"TextArea.margin", zeroInsets,913914"TextComponent.selectionBackgroundInactive", textHighlightInactive,915916"TextField.focusInputMap", aquaKeyBindings.getTextFieldInputMap(),917"TextField.font", controlFont,918"TextField.background", textBackground,919"TextField.foreground", textForeground,920"TextField.inactiveForeground", textInactiveText,921"TextField.inactiveBackground", textInactiveBackground,922"TextField.selectionBackground", textHighlight,923"TextField.selectionForeground", textHighlightText,924"TextField.caretForeground", textForeground,925"TextField.caretBlinkRate", textCaretBlinkRate,926"TextField.border", textFieldBorder,927"TextField.margin", zeroInsets,928929"TextPane.focusInputMap", aquaKeyBindings.getMultiLineTextInputMap(),930"TextPane.font", controlFont,931"TextPane.background", textBackground,932"TextPane.foreground", textForeground,933"TextPane.selectionBackground", textHighlight,934"TextPane.selectionForeground", textHighlightText,935"TextPane.caretForeground", textForeground,936"TextPane.caretBlinkRate", textCaretBlinkRate,937"TextPane.inactiveForeground", textInactiveText,938"TextPane.inactiveBackground", textInactiveBackground,939"TextPane.border", textAreaBorder,940"TextPane.margin", editorMargin,941942// *** ToggleButton943"ToggleButton.background", controlBackgroundColor,944"ToggleButton.foreground", black,945"ToggleButton.disabledText", disabled,946// we need to go through and find out if these are used, and if not what to set947// so that subclasses will get good aqua like colors.948// "ToggleButton.select", getControlShadow(),949// "ToggleButton.text", getControl(),950// "ToggleButton.disabledSelectedText", getControlDarkShadow(),951// "ToggleButton.disabledBackground", getControl(),952// "ToggleButton.disabledSelectedBackground", getControlShadow(),953//"ToggleButton.focus", getFocusColor(),954"ToggleButton.border",(LazyValue) t -> AquaButtonBorder.getDynamicButtonBorder(), // sja make this lazy!955"ToggleButton.font", controlFont,956"ToggleButton.focusInputMap", controlFocusInputMap,957"ToggleButton.margin", new InsetsUIResource(2, 2, 2, 2),958959// *** ToolBar960"ToolBar.font", controlFont,961"ToolBar.background", panelBackgroundColor,962"ToolBar.foreground", new ColorUIResource(Color.gray),963"ToolBar.dockingBackground", panelBackgroundColor,964"ToolBar.dockingForeground", selectionBackground,965"ToolBar.floatingBackground", panelBackgroundColor,966"ToolBar.floatingForeground", new ColorUIResource(Color.darkGray),967"ToolBar.border",(LazyValue) t -> AquaToolBarUI.getToolBarBorder(),968"ToolBar.borderHandleColor", toolbarDragHandleColor,969//"ToolBar.separatorSize", new DimensionUIResource( 10, 10 ),970"ToolBar.separatorSize", null,971972// *** ToolBarButton973"ToolBarButton.margin", new InsetsUIResource(3, 3, 3, 3),974"ToolBarButton.insets", new InsetsUIResource(1, 1, 1, 1),975976// *** ToolTips977"ToolTip.font", controlSmallFont,978//$ Tooltips - Same color as help balloons?979"ToolTip.background", toolTipBackground,980"ToolTip.foreground", black,981"ToolTip.border", toolTipBorder,982983// *** Tree984"Tree.font", viewFont, // [3577901] Aqua HIG says "default font of text in lists and tables" should be 12 point (vm).985"Tree.background", white,986"Tree.foreground", black,987// for now no lines988"Tree.hash", white, //disabled, // Line color989"Tree.line", white, //disabled, // Line color990"Tree.textForeground", black,991"Tree.textBackground", white,992"Tree.selectionForeground", selectionForeground,993"Tree.selectionBackground", selectionBackground,994"Tree.selectionInactiveBackground", selectionInactiveBackground,995"Tree.selectionInactiveForeground", selectionInactiveForeground,996"Tree.selectionBorderColor", selectionBackground, // match the background so it looks like we don't draw anything997"Tree.editorBorderSelectionColor", null, // The EditTextFrame provides its own border998// "Tree.editorBorder", textFieldBorder, // If you still have Sun bug 4376328 in DefaultTreeCellEditor, it has to have the same insets as TextField.border999"Tree.leftChildIndent", Integer.valueOf(7),//$1000"Tree.rightChildIndent", Integer.valueOf(13),//$1001"Tree.rowHeight", Integer.valueOf(19),// iconHeight + 3, to match finder - a zero would have the renderer decide, except that leaves the icons touching1002"Tree.scrollsOnExpand", Boolean.FALSE,1003"Tree.openIcon",(LazyValue) t -> AquaImageFactory.getTreeOpenFolderIcon(), // Open folder icon1004"Tree.closedIcon",(LazyValue) t -> AquaImageFactory.getTreeFolderIcon(), // Closed folder icon1005"Tree.leafIcon",(LazyValue) t -> AquaImageFactory.getTreeDocumentIcon(), // Document icon1006"Tree.expandedIcon",(LazyValue) t -> AquaImageFactory.getTreeExpandedIcon(),1007"Tree.collapsedIcon",(LazyValue) t -> AquaImageFactory.getTreeCollapsedIcon(),1008"Tree.rightToLeftCollapsedIcon",(LazyValue) t -> AquaImageFactory.getTreeRightToLeftCollapsedIcon(),1009"Tree.changeSelectionWithFocus", Boolean.TRUE,1010"Tree.drawsFocusBorderAroundIcon", Boolean.FALSE,10111012"Tree.focusInputMap", aquaKeyBindings.getTreeInputMap(),1013"Tree.focusInputMap.RightToLeft", aquaKeyBindings.getTreeRightToLeftInputMap(),1014"Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[]{"ESCAPE", "cancel"}),};10151016table.putDefaults(defaults);1017SwingUtilities2.putAATextInfo(true, table);1018}10191020protected void initSystemColorDefaults(final UIDefaults table) {1021// String[] defaultSystemColors = {1022// "desktop", "#005C5C", /* Color of the desktop background */1023// "activeCaption", "#000080", /* Color for captions (title bars) when they are active. */1024// "activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */1025// "activeCaptionBorder", "#C0C0C0", /* Border color for caption (title bar) window borders. */1026// "inactiveCaption", "#808080", /* Color for captions (title bars) when not active. */1027// "inactiveCaptionText", "#C0C0C0", /* Text color for text in inactive captions (title bars). */1028// "inactiveCaptionBorder", "#C0C0C0", /* Border color for inactive caption (title bar) window borders. */1029// "window", "#FFFFFF", /* Default color for the interior of windows */1030// "windowBorder", "#000000", /* ??? */1031// "windowText", "#000000", /* ??? */1032// "menu", "#C0C0C0", /* Background color for menus */1033// "menuText", "#000000", /* Text color for menus */1034// "text", "#C0C0C0", /* Text background color */1035// "textText", "#000000", /* Text foreground color */1036// "textHighlight", "#000080", /* Text background color when selected */1037// "textHighlightText", "#FFFFFF", /* Text color when selected */1038// "textInactiveText", "#808080", /* Text color when disabled */1039// "control", "#C0C0C0", /* Default color for controls (buttons, sliders, etc) */1040// "controlText", "#000000", /* Default color for text in controls */1041// "controlHighlight", "#C0C0C0", /* Specular highlight (opposite of the shadow) */1042// "controlLtHighlight", "#FFFFFF", /* Highlight color for controls */1043// "controlShadow", "#808080", /* Shadow color for controls */1044// "controlDkShadow", "#000000", /* Dark shadow color for controls */1045// "scrollbar", "#E0E0E0", /* Scrollbar background (usually the "track") */1046// "info", "#FFFFE1", /* ??? */1047// "infoText", "#000000" /* ??? */1048// };1049//1050// loadSystemColors(table, defaultSystemColors, isNativeLookAndFeel());1051}10521053/**1054* Initialize the uiClassID to AquaComponentUI mapping.1055* The JComponent classes define their own uiClassID constants1056* (see AbstractComponent.getUIClassID). This table must1057* map those constants to a BasicComponentUI class of the1058* appropriate type.1059*1060* @see #getDefaults1061*/1062protected void initClassDefaults(final UIDefaults table) {1063final String basicPackageName = "javax.swing.plaf.basic.";10641065final Object[] uiDefaults = {1066"ButtonUI", PKG_PREFIX + "AquaButtonUI",1067"CheckBoxUI", PKG_PREFIX + "AquaButtonCheckBoxUI",1068"CheckBoxMenuItemUI", PKG_PREFIX + "AquaMenuItemUI",1069"LabelUI", PKG_PREFIX + "AquaLabelUI",1070"ListUI", PKG_PREFIX + "AquaListUI",1071"MenuUI", PKG_PREFIX + "AquaMenuUI",1072"MenuItemUI", PKG_PREFIX + "AquaMenuItemUI",1073"OptionPaneUI", PKG_PREFIX + "AquaOptionPaneUI",1074"PanelUI", PKG_PREFIX + "AquaPanelUI",1075"RadioButtonMenuItemUI", PKG_PREFIX + "AquaMenuItemUI",1076"RadioButtonUI", PKG_PREFIX + "AquaButtonRadioUI",1077"ProgressBarUI", PKG_PREFIX + "AquaProgressBarUI",1078"RootPaneUI", PKG_PREFIX + "AquaRootPaneUI",1079"SliderUI", PKG_PREFIX + "AquaSliderUI",1080"ScrollBarUI", PKG_PREFIX + "AquaScrollBarUI",1081"TabbedPaneUI", PKG_PREFIX + (JRSUIUtils.TabbedPane.shouldUseTabbedPaneContrastUI() ? "AquaTabbedPaneContrastUI" : "AquaTabbedPaneUI"),1082"TableUI", PKG_PREFIX + "AquaTableUI",1083"ToggleButtonUI", PKG_PREFIX + "AquaButtonToggleUI",1084"ToolBarUI", PKG_PREFIX + "AquaToolBarUI",1085"ToolTipUI", PKG_PREFIX + "AquaToolTipUI",1086"TreeUI", PKG_PREFIX + "AquaTreeUI",10871088"InternalFrameUI", PKG_PREFIX + "AquaInternalFrameUI",1089"DesktopIconUI", PKG_PREFIX + "AquaInternalFrameDockIconUI",1090"DesktopPaneUI", PKG_PREFIX + "AquaInternalFramePaneUI",1091"EditorPaneUI", PKG_PREFIX + "AquaEditorPaneUI",1092"TextFieldUI", PKG_PREFIX + "AquaTextFieldUI",1093"TextPaneUI", PKG_PREFIX + "AquaTextPaneUI",1094"ComboBoxUI", PKG_PREFIX + "AquaComboBoxUI",1095"PopupMenuUI", PKG_PREFIX + "AquaPopupMenuUI",1096"TextAreaUI", PKG_PREFIX + "AquaTextAreaUI",1097"MenuBarUI", PKG_PREFIX + "AquaMenuBarUI",1098"FileChooserUI", PKG_PREFIX + "AquaFileChooserUI",1099"PasswordFieldUI", PKG_PREFIX + "AquaTextPasswordFieldUI",1100"TableHeaderUI", PKG_PREFIX + "AquaTableHeaderUI",11011102"FormattedTextFieldUI", PKG_PREFIX + "AquaTextFieldFormattedUI",11031104"SpinnerUI", PKG_PREFIX + "AquaSpinnerUI",1105"SplitPaneUI", PKG_PREFIX + "AquaSplitPaneUI",1106"ScrollPaneUI", PKG_PREFIX + "AquaScrollPaneUI",11071108"PopupMenuSeparatorUI", PKG_PREFIX + "AquaPopupMenuSeparatorUI",1109"SeparatorUI", PKG_PREFIX + "AquaPopupMenuSeparatorUI",1110"ToolBarSeparatorUI", PKG_PREFIX + "AquaToolBarSeparatorUI",11111112// as we implement aqua versions of the swing elements1113// we will aad the com.apple.laf.FooUI classes to this table.11141115"ColorChooserUI", basicPackageName + "BasicColorChooserUI",11161117// text UIs1118"ViewportUI", basicPackageName + "BasicViewportUI",1119};1120table.putDefaults(uiDefaults);1121}1122}112311241125