1 /* 2 * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package com.apple.laf; 27 28 import java.awt.*; 29 import java.security.PrivilegedAction; 30 import java.util.*; 31 32 import javax.swing.*; 33 import javax.swing.border.Border; 34 import javax.swing.plaf.*; 35 import javax.swing.plaf.basic.BasicBorders; 36 import javax.swing.plaf.basic.BasicLookAndFeel; 37 import static javax.swing.UIDefaults.LazyValue; 38 import sun.swing.*; 39 import apple.laf.*; 40 41 @SuppressWarnings("serial") // Superclass is not serializable across versions 42 public class AquaLookAndFeel extends BasicLookAndFeel { 43 static final String sOldPropertyPrefix = "com.apple.macos."; // old prefix for things like 'useScreenMenuBar' 44 static final String sPropertyPrefix = "apple.laf."; // new prefix for things like 'useScreenMenuBar' 45 46 // for lazy initalizers. Following the pattern from metal. 47 private static final String PKG_PREFIX = "com.apple.laf."; 48 49 /** 50 * Return a short string that identifies this look and feel, e.g. 51 * "CDE/Motif". This string should be appropriate for a menu item. 52 * Distinct look and feels should have different names, e.g. 53 * a subclass of MotifLookAndFeel that changes the way a few components 54 * are rendered should be called "CDE/Motif My Way"; something 55 * that would be useful to a user trying to select a L&F from a list 56 * of names. 57 */ 58 public String getName() { 59 return "Mac OS X"; 60 } 61 62 /** 63 * Return a string that identifies this look and feel. This string 64 * will be used by applications/services that want to recognize 65 * well known look and feel implementations. Presently 66 * the well known names are "Motif", "Windows", "Mac", "Metal". Note 67 * that a LookAndFeel derived from a well known superclass 68 * that doesn't make any fundamental changes to the look or feel 69 * shouldn't override this method. 70 */ 71 public String getID() { 72 return "Aqua"; 73 } 74 75 /** 76 * Return a one line description of this look and feel implementation, 77 * e.g. "The CDE/Motif Look and Feel". This string is intended for 78 * the user, e.g. in the title of a window or in a ToolTip message. 79 */ 80 public String getDescription() { 81 return "Aqua Look and Feel for Mac OS X"; 82 } 83 84 /** 85 * Returns true if the {@code LookAndFeel} returned 86 * {@code RootPaneUI} instances support providing Window decorations 87 * in a {@code JRootPane}. 88 * <p> 89 * The default implementation returns false, subclasses that support 90 * Window decorations should override this and return true. 91 * 92 * @return True if the RootPaneUI instances created support client side 93 * decorations 94 * @see JDialog#setDefaultLookAndFeelDecorated 95 * @see JFrame#setDefaultLookAndFeelDecorated 96 * @see JRootPane#setWindowDecorationStyle 97 * @since 1.4 98 */ 99 public boolean getSupportsWindowDecorations() { 100 return false; 101 } 102 103 /** 104 * If the underlying platform has a "native" look and feel, and this 105 * is an implementation of it, return true. 106 */ 107 public boolean isNativeLookAndFeel() { 108 return true; 109 } 110 111 /** 112 * Return true if the underlying platform supports and or permits 113 * this look and feel. This method returns false if the look 114 * and feel depends on special resources or legal agreements that 115 * aren't defined for the current platform. 116 * 117 * @see UIManager#setLookAndFeel 118 */ 119 public boolean isSupportedLookAndFeel() { 120 return true; 121 } 122 123 /** 124 * UIManager.setLookAndFeel calls this method before the first 125 * call (and typically the only call) to getDefaults(). Subclasses 126 * should do any one-time setup they need here, rather than 127 * in a static initializer, because look and feel class objects 128 * may be loaded just to discover that isSupportedLookAndFeel() 129 * returns false. 130 * 131 * @see #uninitialize 132 * @see UIManager#setLookAndFeel 133 */ 134 public void initialize() { 135 jdk.internal.access.SharedSecrets.getJavaLangAccess().loadLibrary("osxui"); 136 137 java.security.AccessController.doPrivileged(new PrivilegedAction<Void>(){ 138 @Override 139 public Void run() { 140 JRSUIControl.initJRSUI(); 141 return null; 142 } 143 }); 144 145 super.initialize(); 146 final ScreenPopupFactory spf = new ScreenPopupFactory(); 147 spf.setActive(true); 148 PopupFactory.setSharedInstance(spf); 149 150 KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventPostProcessor(AquaMnemonicHandler.getInstance()); 151 } 152 153 /** 154 * UIManager.setLookAndFeel calls this method just before we're 155 * replaced by a new default look and feel. Subclasses may 156 * choose to free up some resources here. 157 * 158 * @see #initialize 159 */ 160 public void uninitialize() { 161 KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventPostProcessor(AquaMnemonicHandler.getInstance()); 162 163 final PopupFactory popupFactory = PopupFactory.getSharedInstance(); 164 if (popupFactory != null && popupFactory instanceof ScreenPopupFactory) { 165 ((ScreenPopupFactory)popupFactory).setActive(false); 166 } 167 168 super.uninitialize(); 169 } 170 171 /** 172 * Returns an {@code ActionMap}. 173 * <P> 174 * This {@code ActionMap} contains {@code Actions} that 175 * embody the ability to render an auditory cue. These auditory 176 * cues map onto user and system activities that may be useful 177 * for an end user to know about (such as a dialog box appearing). 178 * <P> 179 * At the appropriate time in a {@code JComponent} UI's lifecycle, 180 * the ComponentUI is responsible for getting the appropriate 181 * {@code Action} out of the {@code ActionMap} and passing 182 * it on to {@code playSound}. 183 * <P> 184 * The {@code Actions} in this {@code ActionMap} are 185 * created by the {@code createAudioAction} method. 186 * 187 * @return an ActionMap containing Actions 188 * responsible for rendering auditory cues 189 * @see #createAudioAction 190 * @see #playSound(Action) 191 * @since 1.4 192 */ 193 protected ActionMap getAudioActionMap() { 194 ActionMap audioActionMap = (ActionMap)UIManager.get("AuditoryCues.actionMap"); 195 if (audioActionMap != null) return audioActionMap; 196 197 final Object[] acList = (Object[])UIManager.get("AuditoryCues.cueList"); 198 if (acList != null) { 199 audioActionMap = new ActionMapUIResource(); 200 for (int counter = acList.length - 1; counter >= 0; counter--) { 201 audioActionMap.put(acList[counter], createAudioAction(acList[counter])); 202 } 203 } 204 UIManager.getLookAndFeelDefaults().put("AuditoryCues.actionMap", audioActionMap); 205 206 return audioActionMap; 207 } 208 209 /** 210 * We override getDefaults() so we can install our own debug defaults 211 * if needed for testing 212 */ 213 public UIDefaults getDefaults() { 214 final UIDefaults table = new UIDefaults(); 215 // use debug defaults if you want to see every query into the defaults object. 216 //UIDefaults table = new DebugDefaults(); 217 try { 218 // PopupFactory.getSharedInstance().setPopupType(2); 219 initClassDefaults(table); 220 221 // Here we install all the Basic defaults in case we missed some in our System color 222 // or component defaults that follow. Eventually we will take this out. 223 // This is a big negative to performance so we want to get it out as soon 224 // as we are comfortable with the Aqua defaults. 225 super.initSystemColorDefaults(table); 226 super.initComponentDefaults(table); 227 228 // Because the last elements added win in precedence we add all of our aqua elements here. 229 initSystemColorDefaults(table); 230 initComponentDefaults(table); 231 } catch(final Exception e) { 232 e.printStackTrace(); 233 } 234 return table; 235 } 236 237 /** 238 * Initialize the defaults table with the name of the ResourceBundle 239 * used for getting localized defaults. Also initialize the default 240 * locale used when no locale is passed into UIDefaults.get(). The 241 * default locale should generally not be relied upon. It is here for 242 * compatibility with releases prior to 1.4. 243 */ 244 private void initResourceBundle(final UIDefaults table) { 245 table.setDefaultLocale(Locale.getDefault()); 246 SwingAccessor.getUIDefaultsAccessor().addInternalBundle(table, 247 PKG_PREFIX + "resources.aqua"); 248 try { 249 final ResourceBundle aquaProperties = ResourceBundle.getBundle(PKG_PREFIX + "resources.aqua"); 250 final Enumeration<String> propertyKeys = aquaProperties.getKeys(); 251 252 while (propertyKeys.hasMoreElements()) { 253 final String key = propertyKeys.nextElement(); 254 table.put(key, aquaProperties.getString(key)); 255 } 256 } catch (final Exception e) { 257 } 258 } 259 260 /** 261 * This is the last step in the getDefaults routine usually called from our superclass 262 */ 263 protected void initComponentDefaults(final UIDefaults table) { 264 initResourceBundle(table); 265 266 final InsetsUIResource zeroInsets = new InsetsUIResource(0, 0, 0, 0); 267 final InsetsUIResource menuItemMargin = zeroInsets; 268 269 // <rdar://problem/5189013> Entire Java application window refreshes when moving off Shortcut menu item 270 final Boolean useOpaqueComponents = Boolean.TRUE; 271 272 final Boolean buttonShouldBeOpaque = Boolean.FALSE; 273 274 // *** List value objects 275 final Object listCellRendererActiveValue = new UIDefaults.ActiveValue(){ 276 public Object createValue(UIDefaults defaultsTable) { 277 return new DefaultListCellRenderer.UIResource(); 278 } 279 }; 280 281 // SJA - I'm basing this on what is in the MetalLookAndFeel class, but 282 // without being based on BasicLookAndFeel. We want more flexibility. 283 // The key to doing this well is to use Lazy initializing classes as 284 // much as possible. 285 286 // Here I want to go to native and get all the values we'd need for colors etc. 287 final Border toolTipBorder = new BorderUIResource.EmptyBorderUIResource(2, 0, 2, 0); 288 final ColorUIResource toolTipBackground = new ColorUIResource(255, 255, (int)(255.0 * 0.80)); 289 final ColorUIResource black = new ColorUIResource(Color.black); 290 final ColorUIResource white = new ColorUIResource(Color.white); 291 final ColorUIResource smokyGlass = new ColorUIResource(new Color(0, 0, 0, 152)); 292 final ColorUIResource dockIconRim = new ColorUIResource(new Color(192, 192, 192, 192)); 293 final ColorUIResource mediumTranslucentBlack = new ColorUIResource(new Color(0, 0, 0, 100)); 294 final ColorUIResource translucentWhite = new ColorUIResource(new Color(255, 255, 255, 254)); 295 // final ColorUIResource lightGray = new ColorUIResource(232, 232, 232); 296 final ColorUIResource disabled = new ColorUIResource(0.5f, 0.5f, 0.5f); 297 final ColorUIResource disabledShadow = new ColorUIResource(0.25f, 0.25f, 0.25f); 298 final ColorUIResource selected = new ColorUIResource(1.0f, 0.4f, 0.4f); 299 300 // Contrast tab UI colors 301 302 final ColorUIResource selectedTabTitlePressedColor = new ColorUIResource(240, 240, 240); 303 final ColorUIResource selectedTabTitleDisabledColor = new ColorUIResource(new Color(1, 1, 1, 0.55f)); 304 final ColorUIResource selectedTabTitleNormalColor = white; 305 final ColorUIResource selectedTabTitleShadowDisabledColor = new ColorUIResource(new Color(0, 0, 0, 0.25f)); 306 final ColorUIResource selectedTabTitleShadowNormalColor = mediumTranslucentBlack; 307 final ColorUIResource nonSelectedTabTitleNormalColor = black; 308 309 final ColorUIResource toolbarDragHandleColor = new ColorUIResource(140, 140, 140); 310 311 // sja todo Make these lazy values so we only get them when required - if we deem it necessary 312 // it may be the case that we think the overhead of a proxy lazy value is not worth delaying 313 // creating the object if we think that most swing apps will use this. 314 // the lazy value is useful for delaying initialization until this default value is actually 315 // accessed by the LAF instead of at init time, so making it lazy should speed up 316 // our launch times of Swing apps. 317 318 // *** Text value objects 319 final LazyValue marginBorder = t -> new BasicBorders.MarginBorder(); 320 321 final int zero = 0; 322 final Object editorMargin = zeroInsets; // this is not correct - look at TextEdit to determine the right margin 323 final int textCaretBlinkRate = 500; 324 final LazyValue textFieldBorder = t -> 325 AquaTextFieldBorder.getTextFieldBorder(); 326 final Object textAreaBorder = marginBorder; // text areas have no real border - radar 311073 327 328 final LazyValue scollListBorder = t -> 329 AquaScrollRegionBorder.getScrollRegionBorder(); 330 final LazyValue aquaTitledBorder = t -> 331 AquaGroupBorder.getBorderForTitledBorder(); 332 final LazyValue aquaInsetBorder = t -> 333 AquaGroupBorder.getTitlelessBorder(); 334 335 final Border listHeaderBorder = AquaTableHeaderBorder.getListHeaderBorder(); 336 final Border zeroBorder = new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0); 337 338 // we can't seem to proxy Colors 339 final Color selectionBackground = AquaImageFactory.getSelectionBackgroundColorUIResource(); 340 final Color selectionForeground = AquaImageFactory.getSelectionForegroundColorUIResource(); 341 final Color selectionInactiveBackground = AquaImageFactory.getSelectionInactiveBackgroundColorUIResource(); 342 final Color selectionInactiveForeground = AquaImageFactory.getSelectionInactiveForegroundColorUIResource(); 343 344 final Color textHighlightText = AquaImageFactory.getTextSelectionForegroundColorUIResource(); 345 final Color textHighlight = AquaImageFactory.getTextSelectionBackgroundColorUIResource(); 346 final Color textHighlightInactive = new ColorUIResource(212, 212, 212); 347 348 final Color textInactiveText = disabled; 349 final Color textForeground = black; 350 final Color textBackground = white; 351 final Color textInactiveBackground = white; 352 353 final Color textPasswordFieldCapsLockIconColor = mediumTranslucentBlack; 354 355 final LazyValue internalFrameBorder = t -> 356 BasicBorders.getInternalFrameBorder(); 357 final Color desktopBackgroundColor = new ColorUIResource(new Color(65, 105, 170));//SystemColor.desktop 358 359 final Color focusRingColor = AquaImageFactory.getFocusRingColorUIResource(); 360 final Border focusCellHighlightBorder = new BorderUIResource.LineBorderUIResource(focusRingColor); 361 362 final Color windowBackgroundColor = AquaImageFactory.getWindowBackgroundColorUIResource(); 363 final Color panelBackgroundColor = windowBackgroundColor; 364 final Color tabBackgroundColor = windowBackgroundColor; 365 final Color controlBackgroundColor = windowBackgroundColor; 366 367 final LazyValue controlFont = t -> AquaFonts.getControlTextFont(); 368 final LazyValue controlSmallFont = t -> 369 AquaFonts.getControlTextSmallFont(); 370 final LazyValue alertHeaderFont = t -> AquaFonts.getAlertHeaderFont(); 371 final LazyValue menuFont = t -> AquaFonts.getMenuFont(); 372 final LazyValue viewFont = t -> AquaFonts.getViewFont(); 373 374 final Color menuBackgroundColor = new ColorUIResource(Color.white); 375 final Color menuForegroundColor = black; 376 377 final Color menuSelectedForegroundColor = white; 378 final Color menuSelectedBackgroundColor = focusRingColor; 379 380 final Color menuDisabledBackgroundColor = menuBackgroundColor; 381 final Color menuDisabledForegroundColor = disabled; 382 383 final Color menuAccelForegroundColor = black; 384 final Color menuAccelSelectionForegroundColor = black; 385 386 final Border menuBorder = new AquaMenuBorder(); 387 388 final UIDefaults.LazyInputMap controlFocusInputMap = new UIDefaults.LazyInputMap(new Object[]{ 389 "SPACE", "pressed", 390 "released SPACE", "released" 391 }); 392 393 // sja testing 394 final LazyValue confirmIcon = t -> 395 AquaImageFactory.getConfirmImageIcon(); 396 final LazyValue cautionIcon = t -> 397 AquaImageFactory.getCautionImageIcon(); 398 final LazyValue stopIcon = t -> 399 AquaImageFactory.getStopImageIcon(); 400 final LazyValue securityIcon = t -> 401 AquaImageFactory.getLockImageIcon(); 402 403 final AquaKeyBindings aquaKeyBindings = AquaKeyBindings.instance(); 404 405 final Object[] defaults = { 406 "control", windowBackgroundColor, /* Default color for controls (buttons, sliders, etc) */ 407 408 // Buttons 409 "Button.background", controlBackgroundColor, 410 "Button.foreground", black, 411 "Button.disabledText", disabled, 412 "Button.select", selected, 413 "Button.border",(LazyValue) t -> AquaButtonBorder.getDynamicButtonBorder(), 414 "Button.font", controlFont, 415 "Button.textIconGap", Integer.valueOf(4), 416 "Button.textShiftOffset", zero, // radar 3308129 - aqua doesn't move images when pressed. 417 "Button.focusInputMap", controlFocusInputMap, 418 "Button.margin", new InsetsUIResource(0, 2, 0, 2), 419 "Button.opaque", buttonShouldBeOpaque, 420 421 "CheckBox.background", controlBackgroundColor, 422 "CheckBox.foreground", black, 423 "CheckBox.disabledText", disabled, 424 "CheckBox.select", selected, 425 "CheckBox.icon",(LazyValue) t -> AquaButtonCheckBoxUI.getSizingCheckBoxIcon(), 426 "CheckBox.font", controlFont, 427 "CheckBox.border", AquaButtonBorder.getBevelButtonBorder(), 428 "CheckBox.margin", new InsetsUIResource(1, 1, 0, 1), 429 // radar 3583849. This property never gets 430 // used. The border for the Checkbox gets overridden 431 // by AquaRadiButtonUI.setThemeBorder(). Needs refactoring. (vm) 432 // why is button focus commented out? 433 //"CheckBox.focus", getFocusColor(), 434 "CheckBox.focusInputMap", controlFocusInputMap, 435 436 "CheckBoxMenuItem.font", menuFont, 437 "CheckBoxMenuItem.acceleratorFont", menuFont, 438 "CheckBoxMenuItem.background", menuBackgroundColor, 439 "CheckBoxMenuItem.foreground", menuForegroundColor, 440 "CheckBoxMenuItem.selectionBackground", menuSelectedBackgroundColor, 441 "CheckBoxMenuItem.selectionForeground", menuSelectedForegroundColor, 442 "CheckBoxMenuItem.disabledBackground", menuDisabledBackgroundColor, 443 "CheckBoxMenuItem.disabledForeground", menuDisabledForegroundColor, 444 "CheckBoxMenuItem.acceleratorForeground", menuAccelForegroundColor, 445 "CheckBoxMenuItem.acceleratorSelectionForeground", menuAccelSelectionForegroundColor, 446 "CheckBoxMenuItem.acceleratorDelimiter", "", 447 "CheckBoxMenuItem.border", menuBorder, // for inset calculation 448 "CheckBoxMenuItem.margin", menuItemMargin, 449 "CheckBoxMenuItem.borderPainted", Boolean.TRUE, 450 "CheckBoxMenuItem.checkIcon",(LazyValue) t -> AquaImageFactory.getMenuItemCheckIcon(), 451 "CheckBoxMenuItem.dashIcon",(LazyValue) t -> AquaImageFactory.getMenuItemDashIcon(), 452 //"CheckBoxMenuItem.arrowIcon", null, 453 454 "ColorChooser.background", panelBackgroundColor, 455 456 // *** ComboBox 457 "ComboBox.font", controlFont, 458 "ComboBox.background", controlBackgroundColor, //menuBackgroundColor, // "menu" when it has no scrollbar, "listView" when it does 459 "ComboBox.foreground", menuForegroundColor, 460 "ComboBox.selectionBackground", menuSelectedBackgroundColor, 461 "ComboBox.selectionForeground", menuSelectedForegroundColor, 462 "ComboBox.disabledBackground", menuDisabledBackgroundColor, 463 "ComboBox.disabledForeground", menuDisabledForegroundColor, 464 "ComboBox.ancestorInputMap", aquaKeyBindings.getComboBoxInputMap(), 465 466 "DesktopIcon.border", internalFrameBorder, 467 "DesktopIcon.borderColor", smokyGlass, 468 "DesktopIcon.borderRimColor", dockIconRim, 469 "DesktopIcon.labelBackground", mediumTranslucentBlack, 470 "Desktop.background", desktopBackgroundColor, 471 472 "EditorPane.focusInputMap", aquaKeyBindings.getMultiLineTextInputMap(), 473 "EditorPane.font", controlFont, 474 "EditorPane.background", textBackground, 475 "EditorPane.foreground", textForeground, 476 "EditorPane.selectionBackground", textHighlight, 477 "EditorPane.selectionForeground", textHighlightText, 478 "EditorPane.caretForeground", textForeground, 479 "EditorPane.caretBlinkRate", textCaretBlinkRate, 480 "EditorPane.inactiveForeground", textInactiveText, 481 "EditorPane.inactiveBackground", textInactiveBackground, 482 "EditorPane.border", textAreaBorder, 483 "EditorPane.margin", editorMargin, 484 485 "FileChooser.newFolderIcon", AquaIcon.SystemIcon.getFolderIconUIResource(), 486 "FileChooser.upFolderIcon", AquaIcon.SystemIcon.getFolderIconUIResource(), 487 "FileChooser.homeFolderIcon", AquaIcon.SystemIcon.getDesktopIconUIResource(), 488 "FileChooser.detailsViewIcon", AquaIcon.SystemIcon.getComputerIconUIResource(), 489 "FileChooser.listViewIcon", AquaIcon.SystemIcon.getComputerIconUIResource(), 490 491 "FileView.directoryIcon", AquaIcon.SystemIcon.getFolderIconUIResource(), 492 "FileView.fileIcon", AquaIcon.SystemIcon.getDocumentIconUIResource(), 493 "FileView.computerIcon", AquaIcon.SystemIcon.getDesktopIconUIResource(), 494 "FileView.hardDriveIcon", AquaIcon.SystemIcon.getHardDriveIconUIResource(), 495 "FileView.floppyDriveIcon", AquaIcon.SystemIcon.getFloppyIconUIResource(), 496 497 // File View 498 "FileChooser.cancelButtonMnemonic", zero, 499 "FileChooser.saveButtonMnemonic", zero, 500 "FileChooser.openButtonMnemonic", zero, 501 "FileChooser.updateButtonMnemonic", zero, 502 "FileChooser.helpButtonMnemonic", zero, 503 "FileChooser.directoryOpenButtonMnemonic", zero, 504 505 "FileChooser.lookInLabelMnemonic", zero, 506 "FileChooser.fileNameLabelMnemonic", zero, 507 "FileChooser.filesOfTypeLabelMnemonic", zero, 508 509 "Focus.color", focusRingColor, 510 511 "FormattedTextField.focusInputMap", aquaKeyBindings.getFormattedTextFieldInputMap(), 512 "FormattedTextField.font", controlFont, 513 "FormattedTextField.background", textBackground, 514 "FormattedTextField.foreground", textForeground, 515 "FormattedTextField.inactiveForeground", textInactiveText, 516 "FormattedTextField.inactiveBackground", textInactiveBackground, 517 "FormattedTextField.selectionBackground", textHighlight, 518 "FormattedTextField.selectionForeground", textHighlightText, 519 "FormattedTextField.caretForeground", textForeground, 520 "FormattedTextField.caretBlinkRate", textCaretBlinkRate, 521 "FormattedTextField.border", textFieldBorder, 522 "FormattedTextField.margin", zeroInsets, 523 524 "IconButton.font", controlSmallFont, 525 526 "InternalFrame.titleFont", menuFont, 527 "InternalFrame.background", windowBackgroundColor, 528 "InternalFrame.borderColor", windowBackgroundColor, 529 "InternalFrame.borderShadow", Color.red, 530 "InternalFrame.borderDarkShadow", Color.green, 531 "InternalFrame.borderHighlight", Color.blue, 532 "InternalFrame.borderLight", Color.yellow, 533 "InternalFrame.opaque", Boolean.FALSE, 534 "InternalFrame.border", null, //internalFrameBorder, 535 "InternalFrame.icon", null, 536 537 "InternalFrame.paletteBorder", null,//internalFrameBorder, 538 "InternalFrame.paletteTitleFont", menuFont, 539 "InternalFrame.paletteBackground", windowBackgroundColor, 540 541 "InternalFrame.optionDialogBorder", null,//internalFrameBorder, 542 "InternalFrame.optionDialogTitleFont", menuFont, 543 "InternalFrame.optionDialogBackground", windowBackgroundColor, 544 545 /* Default frame icons are undefined for Basic. */ 546 547 "InternalFrame.closeIcon",(LazyValue) t -> AquaInternalFrameUI.exportCloseIcon(), 548 "InternalFrame.maximizeIcon",(LazyValue) t -> AquaInternalFrameUI.exportZoomIcon(), 549 "InternalFrame.iconifyIcon",(LazyValue) t -> AquaInternalFrameUI.exportMinimizeIcon(), 550 "InternalFrame.minimizeIcon",(LazyValue) t -> AquaInternalFrameUI.exportMinimizeIcon(), 551 // this could be either grow or icon 552 // we decided to make it icon so that anyone who uses 553 // these for ui will have different icons for max and min 554 // these icons are pretty crappy to use in Mac OS X since 555 // they really are interactive but we have to return a static 556 // icon for now. 557 558 // InternalFrame Auditory Cue Mappings 559 "InternalFrame.closeSound", null, 560 "InternalFrame.maximizeSound", null, 561 "InternalFrame.minimizeSound", null, 562 "InternalFrame.restoreDownSound", null, 563 "InternalFrame.restoreUpSound", null, 564 565 "InternalFrame.activeTitleBackground", windowBackgroundColor, 566 "InternalFrame.activeTitleForeground", textForeground, 567 "InternalFrame.inactiveTitleBackground", windowBackgroundColor, 568 "InternalFrame.inactiveTitleForeground", textInactiveText, 569 "InternalFrame.windowBindings", new Object[]{ 570 "shift ESCAPE", "showSystemMenu", 571 "ctrl SPACE", "showSystemMenu", 572 "ESCAPE", "hideSystemMenu" 573 }, 574 575 // Radar [3543438]. We now define the TitledBorder properties for font and color. 576 // Aqua HIG doesn't define TitledBorders as Swing does. Eventually, we might want to 577 // re-think TitledBorder to behave more like a Box (NSBox). (vm) 578 "TitledBorder.font", controlFont, 579 "TitledBorder.titleColor", black, 580 // "TitledBorder.border", -- we inherit this property from BasicLookAndFeel (etched border) 581 "TitledBorder.aquaVariant", aquaTitledBorder, // this is the border that matches what aqua really looks like 582 "InsetBorder.aquaVariant", aquaInsetBorder, // this is the title-less variant 583 584 // *** Label 585 "Label.font", controlFont, // themeLabelFont is for small things like ToolbarButtons 586 "Label.background", controlBackgroundColor, 587 "Label.foreground", black, 588 "Label.disabledForeground", disabled, 589 "Label.disabledShadow", disabledShadow, 590 "Label.opaque", useOpaqueComponents, 591 "Label.border", null, 592 593 "List.font", viewFont, // [3577901] Aqua HIG says "default font of text in lists and tables" should be 12 point (vm). 594 "List.background", white, 595 "List.foreground", black, 596 "List.selectionBackground", selectionBackground, 597 "List.selectionForeground", selectionForeground, 598 "List.selectionInactiveBackground", selectionInactiveBackground, 599 "List.selectionInactiveForeground", selectionInactiveForeground, 600 "List.focusCellHighlightBorder", focusCellHighlightBorder, 601 "List.border", null, 602 "List.cellRenderer", listCellRendererActiveValue, 603 604 "List.sourceListBackgroundPainter",(LazyValue) t -> AquaListUI.getSourceListBackgroundPainter(), 605 "List.sourceListSelectionBackgroundPainter",(LazyValue) t -> AquaListUI.getSourceListSelectionBackgroundPainter(), 606 "List.sourceListFocusedSelectionBackgroundPainter",(LazyValue) t -> AquaListUI.getSourceListFocusedSelectionBackgroundPainter(), 607 "List.evenRowBackgroundPainter",(LazyValue) t -> AquaListUI.getListEvenBackgroundPainter(), 608 "List.oddRowBackgroundPainter",(LazyValue) t -> AquaListUI.getListOddBackgroundPainter(), 609 610 // <rdar://Problem/3743210> The modifier for the Mac is meta, not control. 611 "List.focusInputMap", aquaKeyBindings.getListInputMap(), 612 613 //"List.scrollPaneBorder", listBoxBorder, // Not used in Swing1.1 614 //"ListItem.border", ThemeMenu.listItemBorder(), // for inset calculation 615 616 // *** Menus 617 "Menu.font", menuFont, 618 "Menu.acceleratorFont", menuFont, 619 "Menu.background", menuBackgroundColor, 620 "Menu.foreground", menuForegroundColor, 621 "Menu.selectionBackground", menuSelectedBackgroundColor, 622 "Menu.selectionForeground", menuSelectedForegroundColor, 623 "Menu.disabledBackground", menuDisabledBackgroundColor, 624 "Menu.disabledForeground", menuDisabledForegroundColor, 625 "Menu.acceleratorForeground", menuAccelForegroundColor, 626 "Menu.acceleratorSelectionForeground", menuAccelSelectionForegroundColor, 627 //"Menu.border", ThemeMenu.menuItemBorder(), // for inset calculation 628 "Menu.border", menuBorder, 629 "Menu.borderPainted", Boolean.FALSE, 630 "Menu.margin", menuItemMargin, 631 //"Menu.checkIcon", emptyCheckIcon, // A non-drawing GlyphIcon to make the spacing consistent 632 "Menu.arrowIcon",(LazyValue) t -> AquaImageFactory.getMenuArrowIcon(), 633 "Menu.consumesTabs", Boolean.TRUE, 634 "Menu.menuPopupOffsetY", Integer.valueOf(1), 635 "Menu.submenuPopupOffsetY", Integer.valueOf(-4), 636 637 "MenuBar.font", menuFont, 638 "MenuBar.background", menuBackgroundColor, // not a menu item, not selected 639 "MenuBar.foreground", menuForegroundColor, 640 "MenuBar.border", new AquaMenuBarBorder(), // sja make lazy! 641 "MenuBar.margin", new InsetsUIResource(0, 8, 0, 8), // sja make lazy! 642 "MenuBar.selectionBackground", menuSelectedBackgroundColor, // not a menu item, is selected 643 "MenuBar.selectionForeground", menuSelectedForegroundColor, 644 "MenuBar.disabledBackground", menuDisabledBackgroundColor, //ThemeBrush.GetThemeBrushForMenu(false, false), // not a menu item, not selected 645 "MenuBar.disabledForeground", menuDisabledForegroundColor, 646 "MenuBar.backgroundPainter",(LazyValue) t -> AquaMenuPainter.getMenuBarPainter(), 647 "MenuBar.selectedBackgroundPainter",(LazyValue) t -> AquaMenuPainter.getSelectedMenuBarItemPainter(), 648 649 "MenuItem.font", menuFont, 650 "MenuItem.acceleratorFont", menuFont, 651 "MenuItem.background", menuBackgroundColor, 652 "MenuItem.foreground", menuForegroundColor, 653 "MenuItem.selectionBackground", menuSelectedBackgroundColor, 654 "MenuItem.selectionForeground", menuSelectedForegroundColor, 655 "MenuItem.disabledBackground", menuDisabledBackgroundColor, 656 "MenuItem.disabledForeground", menuDisabledForegroundColor, 657 "MenuItem.acceleratorForeground", menuAccelForegroundColor, 658 "MenuItem.acceleratorSelectionForeground", menuAccelSelectionForegroundColor, 659 "MenuItem.acceleratorDelimiter", "", 660 "MenuItem.border", menuBorder, 661 "MenuItem.margin", menuItemMargin, 662 "MenuItem.borderPainted", Boolean.TRUE, 663 //"MenuItem.checkIcon", emptyCheckIcon, // A non-drawing GlyphIcon to make the spacing consistent 664 //"MenuItem.arrowIcon", null, 665 "MenuItem.selectedBackgroundPainter",(LazyValue) t -> AquaMenuPainter.getSelectedMenuItemPainter(), 666 667 // *** OptionPane 668 // You can additionaly define OptionPane.messageFont which will 669 // dictate the fonts used for the message, and 670 // OptionPane.buttonFont, which defines the font for the buttons. 671 "OptionPane.font", alertHeaderFont, 672 "OptionPane.messageFont", controlFont, 673 "OptionPane.buttonFont", controlFont, 674 "OptionPane.background", windowBackgroundColor, 675 "OptionPane.foreground", black, 676 "OptionPane.messageForeground", black, 677 "OptionPane.border", new BorderUIResource.EmptyBorderUIResource(12, 21, 17, 21), 678 "OptionPane.messageAreaBorder", zeroBorder, 679 "OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(13, 0, 0, 0), 680 "OptionPane.minimumSize", new DimensionUIResource(262, 90), 681 682 "OptionPane.errorIcon", stopIcon, 683 "OptionPane.informationIcon", confirmIcon, 684 "OptionPane.warningIcon", cautionIcon, 685 "OptionPane.questionIcon", confirmIcon, 686 "_SecurityDecisionIcon", securityIcon, 687 "OptionPane.windowBindings", new Object[]{"ESCAPE", "close"}, 688 // OptionPane Auditory Cue Mappings 689 "OptionPane.errorSound", null, 690 "OptionPane.informationSound", null, // Info and Plain 691 "OptionPane.questionSound", null, 692 "OptionPane.warningSound", null, 693 "OptionPane.buttonClickThreshhold", Integer.valueOf(500), 694 "OptionPane.yesButtonMnemonic", "", 695 "OptionPane.noButtonMnemonic", "", 696 "OptionPane.okButtonMnemonic", "", 697 "OptionPane.cancelButtonMnemonic", "", 698 699 "Panel.font", controlFont, 700 "Panel.background", panelBackgroundColor, //new ColorUIResource(0.5647f, 0.9957f, 0.5059f), 701 "Panel.foreground", black, 702 "Panel.opaque", useOpaqueComponents, 703 704 "PasswordField.focusInputMap", aquaKeyBindings.getPasswordFieldInputMap(), 705 "PasswordField.font", controlFont, 706 "PasswordField.background", textBackground, 707 "PasswordField.foreground", textForeground, 708 "PasswordField.inactiveForeground", textInactiveText, 709 "PasswordField.inactiveBackground", textInactiveBackground, 710 "PasswordField.selectionBackground", textHighlight, 711 "PasswordField.selectionForeground", textHighlightText, 712 "PasswordField.caretForeground", textForeground, 713 "PasswordField.caretBlinkRate", textCaretBlinkRate, 714 "PasswordField.border", textFieldBorder, 715 "PasswordField.margin", zeroInsets, 716 "PasswordField.echoChar", Character.valueOf((char)0x25CF), 717 "PasswordField.capsLockIconColor", textPasswordFieldCapsLockIconColor, 718 719 "PopupMenu.font", menuFont, 720 "PopupMenu.background", menuBackgroundColor, 721 // Fix for 7154516: make popups opaque 722 "PopupMenu.translucentBackground", white, 723 "PopupMenu.foreground", menuForegroundColor, 724 "PopupMenu.selectionBackground", menuSelectedBackgroundColor, 725 "PopupMenu.selectionForeground", menuSelectedForegroundColor, 726 "PopupMenu.border", menuBorder, 727 // "PopupMenu.margin", 728 729 "ProgressBar.font", controlFont, 730 "ProgressBar.foreground", black, 731 "ProgressBar.background", controlBackgroundColor, 732 "ProgressBar.selectionForeground", black, 733 "ProgressBar.selectionBackground", white, 734 "ProgressBar.border", new BorderUIResource(BorderFactory.createEmptyBorder()), 735 "ProgressBar.repaintInterval", Integer.valueOf(20), 736 737 "RadioButton.background", controlBackgroundColor, 738 "RadioButton.foreground", black, 739 "RadioButton.disabledText", disabled, 740 "RadioButton.select", selected, 741 "RadioButton.icon",(LazyValue) t -> AquaButtonRadioUI.getSizingRadioButtonIcon(), 742 "RadioButton.font", controlFont, 743 "RadioButton.border", AquaButtonBorder.getBevelButtonBorder(), 744 "RadioButton.margin", new InsetsUIResource(1, 1, 0, 1), 745 "RadioButton.focusInputMap", controlFocusInputMap, 746 747 "RadioButtonMenuItem.font", menuFont, 748 "RadioButtonMenuItem.acceleratorFont", menuFont, 749 "RadioButtonMenuItem.background", menuBackgroundColor, 750 "RadioButtonMenuItem.foreground", menuForegroundColor, 751 "RadioButtonMenuItem.selectionBackground", menuSelectedBackgroundColor, 752 "RadioButtonMenuItem.selectionForeground", menuSelectedForegroundColor, 753 "RadioButtonMenuItem.disabledBackground", menuDisabledBackgroundColor, 754 "RadioButtonMenuItem.disabledForeground", menuDisabledForegroundColor, 755 "RadioButtonMenuItem.acceleratorForeground", menuAccelForegroundColor, 756 "RadioButtonMenuItem.acceleratorSelectionForeground", menuAccelSelectionForegroundColor, 757 "RadioButtonMenuItem.acceleratorDelimiter", "", 758 "RadioButtonMenuItem.border", menuBorder, // for inset calculation 759 "RadioButtonMenuItem.margin", menuItemMargin, 760 "RadioButtonMenuItem.borderPainted", Boolean.TRUE, 761 "RadioButtonMenuItem.checkIcon",(LazyValue) t -> AquaImageFactory.getMenuItemCheckIcon(), 762 "RadioButtonMenuItem.dashIcon",(LazyValue) t -> AquaImageFactory.getMenuItemDashIcon(), 763 //"RadioButtonMenuItem.arrowIcon", null, 764 765 "Separator.background", null, 766 "Separator.foreground", new ColorUIResource(0xD4, 0xD4, 0xD4), 767 768 "ScrollBar.border", null, 769 "ScrollBar.focusInputMap", aquaKeyBindings.getScrollBarInputMap(), 770 "ScrollBar.focusInputMap.RightToLeft", aquaKeyBindings.getScrollBarRightToLeftInputMap(), 771 "ScrollBar.width", Integer.valueOf(16), 772 "ScrollBar.background", white, 773 "ScrollBar.foreground", black, 774 775 "ScrollPane.font", controlFont, 776 "ScrollPane.background", white, 777 "ScrollPane.foreground", black, //$ 778 "ScrollPane.border", scollListBorder, 779 "ScrollPane.viewportBorder", null, 780 781 "ScrollPane.ancestorInputMap", aquaKeyBindings.getScrollPaneInputMap(), 782 "ScrollPane.ancestorInputMap.RightToLeft", new UIDefaults.LazyInputMap(new Object[]{}), 783 784 "Viewport.font", controlFont, 785 "Viewport.background", white, // The background for tables, lists, etc 786 "Viewport.foreground", black, 787 788 // *** Slider 789 "Slider.foreground", black, "Slider.background", controlBackgroundColor, 790 "Slider.font", controlSmallFont, 791 //"Slider.highlight", table.get("controlLtHighlight"), 792 //"Slider.shadow", table.get("controlShadow"), 793 //"Slider.focus", table.get("controlDkShadow"), 794 "Slider.tickColor", new ColorUIResource(Color.GRAY), 795 "Slider.border", null, 796 "Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2), 797 "Slider.focusInputMap", aquaKeyBindings.getSliderInputMap(), 798 "Slider.focusInputMap.RightToLeft", aquaKeyBindings.getSliderRightToLeftInputMap(), 799 800 // *** Spinner 801 "Spinner.font", controlFont, 802 "Spinner.background", controlBackgroundColor, 803 "Spinner.foreground", black, 804 "Spinner.border", null, 805 "Spinner.arrowButtonSize", new Dimension(16, 5), 806 "Spinner.ancestorInputMap", aquaKeyBindings.getSpinnerInputMap(), 807 "Spinner.editorBorderPainted", Boolean.TRUE, 808 "Spinner.editorAlignment", SwingConstants.TRAILING, 809 810 // *** SplitPane 811 //"SplitPane.highlight", table.get("controlLtHighlight"), 812 //"SplitPane.shadow", table.get("controlShadow"), 813 "SplitPane.background", panelBackgroundColor, 814 "SplitPane.border", scollListBorder, 815 "SplitPane.dividerSize", Integer.valueOf(9), //$ 816 "SplitPaneDivider.border", null, // AquaSplitPaneDividerUI draws it 817 "SplitPaneDivider.horizontalGradientVariant",(LazyValue) t -> AquaSplitPaneDividerUI.getHorizontalSplitDividerGradientVariant(), 818 819 // *** TabbedPane 820 "TabbedPane.font", controlFont, 821 "TabbedPane.smallFont", controlSmallFont, 822 "TabbedPane.useSmallLayout", Boolean.FALSE,//sSmallTabs ? Boolean.TRUE : Boolean.FALSE, 823 "TabbedPane.background", tabBackgroundColor, // for bug [3398277] use a background color so that 824 // tabs on a custom pane get erased when they are removed. 825 "TabbedPane.foreground", black, //ThemeTextColor.GetThemeTextColor(AppearanceConstants.kThemeTextColorTabFrontActive), 826 //"TabbedPane.lightHighlight", table.get("controlLtHighlight"), 827 //"TabbedPane.highlight", table.get("controlHighlight"), 828 //"TabbedPane.shadow", table.get("controlShadow"), 829 //"TabbedPane.darkShadow", table.get("controlDkShadow"), 830 //"TabbedPane.focus", table.get("controlText"), 831 "TabbedPane.opaque", useOpaqueComponents, 832 "TabbedPane.textIconGap", Integer.valueOf(4), 833 "TabbedPane.tabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab (top, left, bottom, right) 834 //"TabbedPane.rightTabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab (top, left, bottom, right) 835 "TabbedPane.leftTabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab 836 "TabbedPane.rightTabInsets", new InsetsUIResource(0, 10, 3, 10), // Label within tab 837 //"TabbedPane.tabAreaInsets", new InsetsUIResource(3, 9, -1, 9), // Tabs relative to edge of pane (negative value for overlapping) 838 "TabbedPane.tabAreaInsets", new InsetsUIResource(3, 9, -1, 9), // Tabs relative to edge of pane (negative value for overlapping) 839 // (top = side opposite pane, left = edge || to pane, bottom = side adjacent to pane, right = left) - see rotateInsets 840 "TabbedPane.contentBorderInsets", new InsetsUIResource(8, 0, 0, 0), // width of border 841 //"TabbedPane.selectedTabPadInsets", new InsetsUIResource(0, 0, 1, 0), // Really outsets, this is where we allow for overlap 842 "TabbedPane.selectedTabPadInsets", new InsetsUIResource(0, 0, 0, 0), // Really outsets, this is where we allow for overlap 843 "TabbedPane.tabsOverlapBorder", Boolean.TRUE, 844 "TabbedPane.selectedTabTitlePressedColor", selectedTabTitlePressedColor, 845 "TabbedPane.selectedTabTitleDisabledColor", selectedTabTitleDisabledColor, 846 "TabbedPane.selectedTabTitleNormalColor", selectedTabTitleNormalColor, 847 "TabbedPane.selectedTabTitleShadowDisabledColor", selectedTabTitleShadowDisabledColor, 848 "TabbedPane.selectedTabTitleShadowNormalColor", selectedTabTitleShadowNormalColor, 849 "TabbedPane.nonSelectedTabTitleNormalColor", nonSelectedTabTitleNormalColor, 850 851 // *** Table 852 "Table.font", viewFont, // [3577901] Aqua HIG says "default font of text in lists and tables" should be 12 point (vm). 853 "Table.foreground", black, // cell text color 854 "Table.background", white, // cell background color 855 "Table.selectionForeground", selectionForeground, 856 "Table.selectionBackground", selectionBackground, 857 "Table.selectionInactiveBackground", selectionInactiveBackground, 858 "Table.selectionInactiveForeground", selectionInactiveForeground, 859 "Table.gridColor", white, // grid line color 860 "Table.focusCellBackground", textHighlightText, 861 "Table.focusCellForeground", textHighlight, 862 "Table.focusCellHighlightBorder", focusCellHighlightBorder, 863 "Table.scrollPaneBorder", scollListBorder, 864 865 "Table.ancestorInputMap", aquaKeyBindings.getTableInputMap(), 866 "Table.ancestorInputMap.RightToLeft", aquaKeyBindings.getTableRightToLeftInputMap(), 867 868 "TableHeader.font", controlSmallFont, 869 "TableHeader.foreground", black, 870 "TableHeader.background", white, // header background 871 "TableHeader.cellBorder", listHeaderBorder, 872 873 // *** Text 874 "TextArea.focusInputMap", aquaKeyBindings.getMultiLineTextInputMap(), 875 "TextArea.font", controlFont, 876 "TextArea.background", textBackground, 877 "TextArea.foreground", textForeground, 878 "TextArea.inactiveForeground", textInactiveText, 879 "TextArea.inactiveBackground", textInactiveBackground, 880 "TextArea.selectionBackground", textHighlight, 881 "TextArea.selectionForeground", textHighlightText, 882 "TextArea.caretForeground", textForeground, 883 "TextArea.caretBlinkRate", textCaretBlinkRate, 884 "TextArea.border", textAreaBorder, 885 "TextArea.margin", zeroInsets, 886 887 "TextComponent.selectionBackgroundInactive", textHighlightInactive, 888 889 "TextField.focusInputMap", aquaKeyBindings.getTextFieldInputMap(), 890 "TextField.font", controlFont, 891 "TextField.background", textBackground, 892 "TextField.foreground", textForeground, 893 "TextField.inactiveForeground", textInactiveText, 894 "TextField.inactiveBackground", textInactiveBackground, 895 "TextField.selectionBackground", textHighlight, 896 "TextField.selectionForeground", textHighlightText, 897 "TextField.caretForeground", textForeground, 898 "TextField.caretBlinkRate", textCaretBlinkRate, 899 "TextField.border", textFieldBorder, 900 "TextField.margin", zeroInsets, 901 902 "TextPane.focusInputMap", aquaKeyBindings.getMultiLineTextInputMap(), 903 "TextPane.font", controlFont, 904 "TextPane.background", textBackground, 905 "TextPane.foreground", textForeground, 906 "TextPane.selectionBackground", textHighlight, 907 "TextPane.selectionForeground", textHighlightText, 908 "TextPane.caretForeground", textForeground, 909 "TextPane.caretBlinkRate", textCaretBlinkRate, 910 "TextPane.inactiveForeground", textInactiveText, 911 "TextPane.inactiveBackground", textInactiveBackground, 912 "TextPane.border", textAreaBorder, 913 "TextPane.margin", editorMargin, 914 915 // *** ToggleButton 916 "ToggleButton.background", controlBackgroundColor, 917 "ToggleButton.foreground", black, 918 "ToggleButton.disabledText", disabled, 919 // we need to go through and find out if these are used, and if not what to set 920 // so that subclasses will get good aqua like colors. 921 // "ToggleButton.select", getControlShadow(), 922 // "ToggleButton.text", getControl(), 923 // "ToggleButton.disabledSelectedText", getControlDarkShadow(), 924 // "ToggleButton.disabledBackground", getControl(), 925 // "ToggleButton.disabledSelectedBackground", getControlShadow(), 926 //"ToggleButton.focus", getFocusColor(), 927 "ToggleButton.border",(LazyValue) t -> AquaButtonBorder.getDynamicButtonBorder(), // sja make this lazy! 928 "ToggleButton.font", controlFont, 929 "ToggleButton.focusInputMap", controlFocusInputMap, 930 "ToggleButton.margin", new InsetsUIResource(2, 2, 2, 2), 931 932 // *** ToolBar 933 "ToolBar.font", controlFont, 934 "ToolBar.background", panelBackgroundColor, 935 "ToolBar.foreground", new ColorUIResource(Color.gray), 936 "ToolBar.dockingBackground", panelBackgroundColor, 937 "ToolBar.dockingForeground", selectionBackground, 938 "ToolBar.floatingBackground", panelBackgroundColor, 939 "ToolBar.floatingForeground", new ColorUIResource(Color.darkGray), 940 "ToolBar.border",(LazyValue) t -> AquaToolBarUI.getToolBarBorder(), 941 "ToolBar.borderHandleColor", toolbarDragHandleColor, 942 //"ToolBar.separatorSize", new DimensionUIResource( 10, 10 ), 943 "ToolBar.separatorSize", null, 944 945 // *** ToolBarButton 946 "ToolBarButton.margin", new InsetsUIResource(3, 3, 3, 3), 947 "ToolBarButton.insets", new InsetsUIResource(1, 1, 1, 1), 948 949 // *** ToolTips 950 "ToolTip.font", controlSmallFont, 951 //$ Tooltips - Same color as help balloons? 952 "ToolTip.background", toolTipBackground, 953 "ToolTip.foreground", black, 954 "ToolTip.border", toolTipBorder, 955 956 // *** Tree 957 "Tree.font", viewFont, // [3577901] Aqua HIG says "default font of text in lists and tables" should be 12 point (vm). 958 "Tree.background", white, 959 "Tree.foreground", black, 960 // for now no lines 961 "Tree.hash", white, //disabled, // Line color 962 "Tree.line", white, //disabled, // Line color 963 "Tree.textForeground", black, 964 "Tree.textBackground", white, 965 "Tree.selectionForeground", selectionForeground, 966 "Tree.selectionBackground", selectionBackground, 967 "Tree.selectionInactiveBackground", selectionInactiveBackground, 968 "Tree.selectionInactiveForeground", selectionInactiveForeground, 969 "Tree.selectionBorderColor", selectionBackground, // match the background so it looks like we don't draw anything 970 "Tree.editorBorderSelectionColor", null, // The EditTextFrame provides its own border 971 // "Tree.editorBorder", textFieldBorder, // If you still have Sun bug 4376328 in DefaultTreeCellEditor, it has to have the same insets as TextField.border 972 "Tree.leftChildIndent", Integer.valueOf(7),//$ 973 "Tree.rightChildIndent", Integer.valueOf(13),//$ 974 "Tree.rowHeight", Integer.valueOf(19),// iconHeight + 3, to match finder - a zero would have the renderer decide, except that leaves the icons touching 975 "Tree.scrollsOnExpand", Boolean.FALSE, 976 "Tree.openIcon",(LazyValue) t -> AquaImageFactory.getTreeOpenFolderIcon(), // Open folder icon 977 "Tree.closedIcon",(LazyValue) t -> AquaImageFactory.getTreeFolderIcon(), // Closed folder icon 978 "Tree.leafIcon",(LazyValue) t -> AquaImageFactory.getTreeDocumentIcon(), // Document icon 979 "Tree.expandedIcon",(LazyValue) t -> AquaImageFactory.getTreeExpandedIcon(), 980 "Tree.collapsedIcon",(LazyValue) t -> AquaImageFactory.getTreeCollapsedIcon(), 981 "Tree.rightToLeftCollapsedIcon",(LazyValue) t -> AquaImageFactory.getTreeRightToLeftCollapsedIcon(), 982 "Tree.changeSelectionWithFocus", Boolean.TRUE, 983 "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE, 984 985 "Tree.focusInputMap", aquaKeyBindings.getTreeInputMap(), 986 "Tree.focusInputMap.RightToLeft", aquaKeyBindings.getTreeRightToLeftInputMap(), 987 "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[]{"ESCAPE", "cancel"}),}; 988 989 table.putDefaults(defaults); 990 SwingUtilities2.putAATextInfo(true, table); 991 } 992 993 protected void initSystemColorDefaults(final UIDefaults table) { 994 // String[] defaultSystemColors = { 995 // "desktop", "#005C5C", /* Color of the desktop background */ 996 // "activeCaption", "#000080", /* Color for captions (title bars) when they are active. */ 997 // "activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */ 998 // "activeCaptionBorder", "#C0C0C0", /* Border color for caption (title bar) window borders. */ 999 // "inactiveCaption", "#808080", /* Color for captions (title bars) when not active. */ 1000 // "inactiveCaptionText", "#C0C0C0", /* Text color for text in inactive captions (title bars). */ 1001 // "inactiveCaptionBorder", "#C0C0C0", /* Border color for inactive caption (title bar) window borders. */ 1002 // "window", "#FFFFFF", /* Default color for the interior of windows */ 1003 // "windowBorder", "#000000", /* ??? */ 1004 // "windowText", "#000000", /* ??? */ 1005 // "menu", "#C0C0C0", /* Background color for menus */ 1006 // "menuText", "#000000", /* Text color for menus */ 1007 // "text", "#C0C0C0", /* Text background color */ 1008 // "textText", "#000000", /* Text foreground color */ 1009 // "textHighlight", "#000080", /* Text background color when selected */ 1010 // "textHighlightText", "#FFFFFF", /* Text color when selected */ 1011 // "textInactiveText", "#808080", /* Text color when disabled */ 1012 // "control", "#C0C0C0", /* Default color for controls (buttons, sliders, etc) */ 1013 // "controlText", "#000000", /* Default color for text in controls */ 1014 // "controlHighlight", "#C0C0C0", /* Specular highlight (opposite of the shadow) */ 1015 // "controlLtHighlight", "#FFFFFF", /* Highlight color for controls */ 1016 // "controlShadow", "#808080", /* Shadow color for controls */ 1017 // "controlDkShadow", "#000000", /* Dark shadow color for controls */ 1018 // "scrollbar", "#E0E0E0", /* Scrollbar background (usually the "track") */ 1019 // "info", "#FFFFE1", /* ??? */ 1020 // "infoText", "#000000" /* ??? */ 1021 // }; 1022 // 1023 // loadSystemColors(table, defaultSystemColors, isNativeLookAndFeel()); 1024 } 1025 1026 /** 1027 * Initialize the uiClassID to AquaComponentUI mapping. 1028 * The JComponent classes define their own uiClassID constants 1029 * (see AbstractComponent.getUIClassID). This table must 1030 * map those constants to a BasicComponentUI class of the 1031 * appropriate type. 1032 * 1033 * @see #getDefaults 1034 */ 1035 protected void initClassDefaults(final UIDefaults table) { 1036 final String basicPackageName = "javax.swing.plaf.basic."; 1037 1038 final Object[] uiDefaults = { 1039 "ButtonUI", PKG_PREFIX + "AquaButtonUI", 1040 "CheckBoxUI", PKG_PREFIX + "AquaButtonCheckBoxUI", 1041 "CheckBoxMenuItemUI", PKG_PREFIX + "AquaMenuItemUI", 1042 "LabelUI", PKG_PREFIX + "AquaLabelUI", 1043 "ListUI", PKG_PREFIX + "AquaListUI", 1044 "MenuUI", PKG_PREFIX + "AquaMenuUI", 1045 "MenuItemUI", PKG_PREFIX + "AquaMenuItemUI", 1046 "OptionPaneUI", PKG_PREFIX + "AquaOptionPaneUI", 1047 "PanelUI", PKG_PREFIX + "AquaPanelUI", 1048 "RadioButtonMenuItemUI", PKG_PREFIX + "AquaMenuItemUI", 1049 "RadioButtonUI", PKG_PREFIX + "AquaButtonRadioUI", 1050 "ProgressBarUI", PKG_PREFIX + "AquaProgressBarUI", 1051 "RootPaneUI", PKG_PREFIX + "AquaRootPaneUI", 1052 "SliderUI", PKG_PREFIX + "AquaSliderUI", 1053 "ScrollBarUI", PKG_PREFIX + "AquaScrollBarUI", 1054 "TabbedPaneUI", PKG_PREFIX + (JRSUIUtils.TabbedPane.shouldUseTabbedPaneContrastUI() ? "AquaTabbedPaneContrastUI" : "AquaTabbedPaneUI"), 1055 "TableUI", PKG_PREFIX + "AquaTableUI", 1056 "ToggleButtonUI", PKG_PREFIX + "AquaButtonToggleUI", 1057 "ToolBarUI", PKG_PREFIX + "AquaToolBarUI", 1058 "ToolTipUI", PKG_PREFIX + "AquaToolTipUI", 1059 "TreeUI", PKG_PREFIX + "AquaTreeUI", 1060 1061 "InternalFrameUI", PKG_PREFIX + "AquaInternalFrameUI", 1062 "DesktopIconUI", PKG_PREFIX + "AquaInternalFrameDockIconUI", 1063 "DesktopPaneUI", PKG_PREFIX + "AquaInternalFramePaneUI", 1064 "EditorPaneUI", PKG_PREFIX + "AquaEditorPaneUI", 1065 "TextFieldUI", PKG_PREFIX + "AquaTextFieldUI", 1066 "TextPaneUI", PKG_PREFIX + "AquaTextPaneUI", 1067 "ComboBoxUI", PKG_PREFIX + "AquaComboBoxUI", 1068 "PopupMenuUI", PKG_PREFIX + "AquaPopupMenuUI", 1069 "TextAreaUI", PKG_PREFIX + "AquaTextAreaUI", 1070 "MenuBarUI", PKG_PREFIX + "AquaMenuBarUI", 1071 "FileChooserUI", PKG_PREFIX + "AquaFileChooserUI", 1072 "PasswordFieldUI", PKG_PREFIX + "AquaTextPasswordFieldUI", 1073 "TableHeaderUI", PKG_PREFIX + "AquaTableHeaderUI", 1074 1075 "FormattedTextFieldUI", PKG_PREFIX + "AquaTextFieldFormattedUI", 1076 1077 "SpinnerUI", PKG_PREFIX + "AquaSpinnerUI", 1078 "SplitPaneUI", PKG_PREFIX + "AquaSplitPaneUI", 1079 "ScrollPaneUI", PKG_PREFIX + "AquaScrollPaneUI", 1080 1081 "PopupMenuSeparatorUI", PKG_PREFIX + "AquaPopupMenuSeparatorUI", 1082 "SeparatorUI", PKG_PREFIX + "AquaPopupMenuSeparatorUI", 1083 "ToolBarSeparatorUI", PKG_PREFIX + "AquaToolBarSeparatorUI", 1084 1085 // as we implement aqua versions of the swing elements 1086 // we will aad the com.apple.laf.FooUI classes to this table. 1087 1088 "ColorChooserUI", basicPackageName + "BasicColorChooserUI", 1089 1090 // text UIs 1091 "ViewportUI", basicPackageName + "BasicViewportUI", 1092 }; 1093 table.putDefaults(uiDefaults); 1094 } 1095 }