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