1 /* 2 * Copyright (c) 1997, 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.sun.java.swing.plaf.motif; 27 28 import java.awt.Color; 29 import java.awt.Font; 30 import java.awt.Insets; 31 import java.awt.event.KeyEvent; 32 import java.awt.event.InputEvent; 33 import java.util.*; 34 35 import javax.swing.*; 36 import javax.swing.plaf.*; 37 import javax.swing.border.*; 38 import javax.swing.text.JTextComponent; 39 import javax.swing.text.DefaultEditorKit; 40 41 import javax.swing.plaf.basic.BasicLookAndFeel; 42 import javax.swing.plaf.basic.BasicBorders; 43 import javax.swing.plaf.basic.BasicComboBoxRenderer; 44 import javax.swing.plaf.basic.BasicComboBoxEditor; 45 46 import sun.swing.SwingUtilities2; 47 import sun.awt.OSInfo; 48 49 /** 50 * Implements the Motif Look and Feel. 51 * UI classes not implemented specifically for Motif will 52 * default to those implemented in Basic. 53 * <p> 54 * <strong>Warning:</strong> 55 * Serialized objects of this class will not be compatible with 56 * future Swing releases. The current serialization support is appropriate 57 * for short term storage or RMI between applications running the same 58 * version of Swing. A future release of Swing will provide support for 59 * long term persistence. 60 * 61 * @author unattributed 62 */ 63 @SuppressWarnings("serial") // Superclass is not serializable across versions 64 public class MotifLookAndFeel extends BasicLookAndFeel 65 { 66 public String getName() { 67 return "CDE/Motif"; 68 } 69 70 public String getID() { 71 return "Motif"; 72 } 73 74 public String getDescription() { 75 return "The CDE/Motif Look and Feel"; 76 } 77 78 79 public boolean isNativeLookAndFeel() { 80 return OSInfo.getOSType() == OSInfo.OSType.SOLARIS; 81 } 82 83 84 public boolean isSupportedLookAndFeel() { 85 return true; 86 } 87 88 89 /** 90 * Load the SystemColors into the defaults table. The keys 91 * for SystemColor defaults are the same as the names of 92 * the public fields in SystemColor. If the table is being 93 * created on a native Motif platform we use the SystemColor 94 * values, otherwise we create color objects whose values match 95 * the default CDE/Motif colors. 96 */ 97 protected void initSystemColorDefaults(UIDefaults table) 98 { 99 String[] defaultSystemColors = { 100 "desktop", "#005C5C", /* Color of the desktop background */ 101 "activeCaption", "#000080", /* Color for captions (title bars) when they are active. */ 102 "activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */ 103 "activeCaptionBorder", "#B24D7A", /* Border color for caption (title bar) window borders. */ 104 "inactiveCaption", "#AEB2C3", /* Color for captions (title bars) when not active. */ 105 "inactiveCaptionText", "#000000", /* Text color for text in inactive captions (title bars). */ 106 "inactiveCaptionBorder", "#AEB2C3", /* Border color for inactive caption (title bar) window borders. */ 107 "window", "#AEB2C3", /* Default color for the interior of windows */ 108 "windowBorder", "#AEB2C3", /* ??? */ 109 "windowText", "#000000", /* ??? */ 110 "menu", "#AEB2C3", /* ??? */ 111 "menuText", "#000000", /* ??? */ 112 "text", "#FFF7E9", /* Text background color */ 113 "textText", "#000000", /* Text foreground color */ 114 "textHighlight", "#000000", /* Text background color when selected */ 115 "textHighlightText", "#FFF7E9", /* Text color when selected */ 116 "textInactiveText", "#808080", /* Text color when disabled */ 117 "control", "#AEB2C3", /* Default color for controls (buttons, sliders, etc) */ 118 "controlText", "#000000", /* Default color for text in controls */ 119 "controlHighlight", "#DCDEE5", /* Highlight color for controls */ 120 "controlLtHighlight", "#DCDEE5", /* Light highlight color for controls */ 121 "controlShadow", "#63656F", /* Shadow color for controls */ 122 "controlLightShadow", "#9397A5", /* Shadow color for controls */ 123 "controlDkShadow", "#000000", /* Dark shadow color for controls */ 124 "scrollbar", "#AEB2C3", /* Scrollbar ??? color. PENDING(jeff) foreground? background? ?*/ 125 "info", "#FFF7E9", /* ??? */ 126 "infoText", "#000000" /* ??? */ 127 }; 128 129 loadSystemColors(table, defaultSystemColors, false); 130 } 131 132 133 protected void initClassDefaults(UIDefaults table) 134 { 135 super.initClassDefaults(table); 136 String motifPackageName = "com.sun.java.swing.plaf.motif."; 137 138 Object[] uiDefaults = { 139 "ButtonUI", motifPackageName + "MotifButtonUI", 140 "CheckBoxUI", motifPackageName + "MotifCheckBoxUI", 141 "DirectoryPaneUI", motifPackageName + "MotifDirectoryPaneUI", 142 "FileChooserUI", motifPackageName + "MotifFileChooserUI", 143 "LabelUI", motifPackageName + "MotifLabelUI", 144 "MenuBarUI", motifPackageName + "MotifMenuBarUI", 145 "MenuUI", motifPackageName + "MotifMenuUI", 146 "MenuItemUI", motifPackageName + "MotifMenuItemUI", 147 "CheckBoxMenuItemUI", motifPackageName + "MotifCheckBoxMenuItemUI", 148 "RadioButtonMenuItemUI", motifPackageName + "MotifRadioButtonMenuItemUI", 149 "RadioButtonUI", motifPackageName + "MotifRadioButtonUI", 150 "ToggleButtonUI", motifPackageName + "MotifToggleButtonUI", 151 "PopupMenuUI", motifPackageName + "MotifPopupMenuUI", 152 "ProgressBarUI", motifPackageName + "MotifProgressBarUI", 153 "ScrollBarUI", motifPackageName + "MotifScrollBarUI", 154 "ScrollPaneUI", motifPackageName + "MotifScrollPaneUI", 155 "SliderUI", motifPackageName + "MotifSliderUI", 156 "SplitPaneUI", motifPackageName + "MotifSplitPaneUI", 157 "TabbedPaneUI", motifPackageName + "MotifTabbedPaneUI", 158 "TextAreaUI", motifPackageName + "MotifTextAreaUI", 159 "TextFieldUI", motifPackageName + "MotifTextFieldUI", 160 "PasswordFieldUI", motifPackageName + "MotifPasswordFieldUI", 161 "TextPaneUI", motifPackageName + "MotifTextPaneUI", 162 "EditorPaneUI", motifPackageName + "MotifEditorPaneUI", 163 "TreeUI", motifPackageName + "MotifTreeUI", 164 "InternalFrameUI", motifPackageName + "MotifInternalFrameUI", 165 "DesktopPaneUI", motifPackageName + "MotifDesktopPaneUI", 166 "SeparatorUI", motifPackageName + "MotifSeparatorUI", 167 "PopupMenuSeparatorUI", motifPackageName + "MotifPopupMenuSeparatorUI", 168 "OptionPaneUI", motifPackageName + "MotifOptionPaneUI", 169 "ComboBoxUI", motifPackageName + "MotifComboBoxUI", 170 "DesktopIconUI", motifPackageName + "MotifDesktopIconUI" 171 }; 172 173 table.putDefaults(uiDefaults); 174 } 175 176 177 /** 178 * Initialize the defaults table with the name of the ResourceBundle 179 * used for getting localized defaults. 180 */ 181 private void initResourceBundle(UIDefaults table) { 182 table.addResourceBundle( "com.sun.java.swing.plaf.motif.resources.motif" ); 183 } 184 185 186 protected void initComponentDefaults(UIDefaults table) 187 { 188 super.initComponentDefaults(table); 189 190 initResourceBundle(table); 191 192 FontUIResource dialogPlain12 = new FontUIResource(Font.DIALOG, 193 Font.PLAIN, 12); 194 FontUIResource serifPlain12 = new FontUIResource(Font.SERIF, 195 Font.PLAIN, 12); 196 FontUIResource sansSerifPlain12 = new FontUIResource(Font.SANS_SERIF, 197 Font.PLAIN, 12); 198 FontUIResource monospacedPlain12 = new FontUIResource(Font.MONOSPACED, 199 Font.PLAIN, 12); 200 ColorUIResource red = new ColorUIResource(Color.red); 201 ColorUIResource black = new ColorUIResource(Color.black); 202 ColorUIResource white = new ColorUIResource(Color.white); 203 ColorUIResource lightGray = new ColorUIResource(Color.lightGray); 204 ColorUIResource controlDarker = new ColorUIResource(147, 151, 165); // slate blue 205 ColorUIResource scrollBarTrack = controlDarker; 206 ColorUIResource menuItemPressedBackground = new ColorUIResource(165,165,165); 207 ColorUIResource menuItemPressedForeground = new ColorUIResource(0,0,0); 208 209 210 Border loweredBevelBorder = new MotifBorders.BevelBorder(false, 211 table.getColor("controlShadow"), 212 table.getColor("controlLtHighlight")); 213 214 Border raisedBevelBorder = new MotifBorders.BevelBorder(true, table.getColor("controlShadow"), 215 table.getColor("controlLtHighlight")); 216 217 Border marginBorder = new BasicBorders.MarginBorder(); 218 219 Border focusBorder = new MotifBorders.FocusBorder( 220 table.getColor("control"), 221 table.getColor("activeCaptionBorder")); 222 223 224 Border focusBevelBorder = new BorderUIResource.CompoundBorderUIResource( 225 focusBorder, 226 loweredBevelBorder); 227 228 Border comboBoxBorder = new BorderUIResource.CompoundBorderUIResource( 229 focusBorder, 230 raisedBevelBorder); 231 232 233 Border buttonBorder = new BorderUIResource.CompoundBorderUIResource( 234 new MotifBorders.ButtonBorder( 235 table.getColor("Button.shadow"), 236 table.getColor("Button.highlight"), 237 table.getColor("Button.darkShadow"), 238 table.getColor("activeCaptionBorder")), 239 marginBorder); 240 241 Border toggleButtonBorder = new BorderUIResource.CompoundBorderUIResource( 242 new MotifBorders.ToggleButtonBorder( 243 table.getColor("ToggleButton.shadow"), 244 table.getColor("ToggleButton.highlight"), 245 table.getColor("ToggleButton.darkShadow"), 246 table.getColor("activeCaptionBorder")), marginBorder); 247 248 Border textFieldBorder = new BorderUIResource.CompoundBorderUIResource( 249 focusBevelBorder, 250 marginBorder); 251 252 Border popupMenuBorder = new BorderUIResource.CompoundBorderUIResource( 253 raisedBevelBorder, 254 new MotifBorders.MotifPopupMenuBorder( 255 table.getFont("PopupMenu.font"), 256 table.getColor("PopupMenu.background"), 257 table.getColor("PopupMenu.foreground"), 258 table.getColor("controlShadow"), 259 table.getColor("controlLtHighlight") 260 )); 261 262 Object menuItemCheckIcon = new UIDefaults.LazyValue() { 263 public Object createValue(UIDefaults table) { 264 return MotifIconFactory.getMenuItemCheckIcon(); 265 } 266 }; 267 268 Object menuItemArrowIcon = new UIDefaults.LazyValue() { 269 public Object createValue(UIDefaults table) { 270 return MotifIconFactory.getMenuItemArrowIcon(); 271 } 272 }; 273 274 Object menuArrowIcon = new UIDefaults.LazyValue() { 275 public Object createValue(UIDefaults table) { 276 return MotifIconFactory.getMenuArrowIcon(); 277 } 278 }; 279 280 Object checkBoxIcon = new UIDefaults.LazyValue() { 281 public Object createValue(UIDefaults table) { 282 return MotifIconFactory.getCheckBoxIcon(); 283 } 284 }; 285 286 Object radioButtonIcon = new UIDefaults.LazyValue() { 287 public Object createValue(UIDefaults table) { 288 return MotifIconFactory.getRadioButtonIcon(); 289 } 290 }; 291 292 Object unselectedTabBackground = new UIDefaults.LazyValue() { 293 public Object createValue(UIDefaults table) { 294 Color c = table.getColor("control"); 295 return new ColorUIResource(Math.max((int)(c.getRed()*.85),0), 296 Math.max((int)(c.getGreen()*.85),0), 297 Math.max((int)(c.getBlue()*.85),0)); 298 } 299 }; 300 301 Object unselectedTabForeground = new UIDefaults.LazyValue() { 302 public Object createValue(UIDefaults table) { 303 Color c = table.getColor("controlText"); 304 return new ColorUIResource(Math.max((int)(c.getRed()*.85),0), 305 Math.max((int)(c.getGreen()*.85),0), 306 Math.max((int)(c.getBlue()*.85),0)); 307 } 308 }; 309 310 Object unselectedTabShadow = new UIDefaults.LazyValue() { 311 public Object createValue(UIDefaults table) { 312 Color c = table.getColor("control"); 313 Color base = new Color(Math.max((int)(c.getRed()*.85),0), 314 Math.max((int)(c.getGreen()*.85),0), 315 Math.max((int)(c.getBlue()*.85),0)); 316 return new ColorUIResource(base.darker()); 317 } 318 }; 319 320 Object unselectedTabHighlight = new UIDefaults.LazyValue() { 321 public Object createValue(UIDefaults table) { 322 Color c = table.getColor("control"); 323 Color base = new Color(Math.max((int)(c.getRed()*.85),0), 324 Math.max((int)(c.getGreen()*.85),0), 325 Math.max((int)(c.getBlue()*.85),0)); 326 return new ColorUIResource(base.brighter()); 327 } 328 }; 329 330 // *** Text 331 332 Object fieldInputMap = new UIDefaults.LazyInputMap(new Object[] { 333 "COPY", DefaultEditorKit.copyAction, 334 "PASTE", DefaultEditorKit.pasteAction, 335 "CUT", DefaultEditorKit.cutAction, 336 "control INSERT", DefaultEditorKit.copyAction, 337 "shift INSERT", DefaultEditorKit.pasteAction, 338 "shift DELETE", DefaultEditorKit.cutAction, 339 "control F", DefaultEditorKit.forwardAction, 340 "control B", DefaultEditorKit.backwardAction, 341 "control D", DefaultEditorKit.deleteNextCharAction, 342 "BACK_SPACE", DefaultEditorKit.deletePrevCharAction, 343 "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction, 344 "ctrl H", DefaultEditorKit.deletePrevCharAction, 345 "DELETE", DefaultEditorKit.deleteNextCharAction, 346 "ctrl DELETE", DefaultEditorKit.deleteNextWordAction, 347 "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction, 348 "RIGHT", DefaultEditorKit.forwardAction, 349 "LEFT", DefaultEditorKit.backwardAction, 350 "KP_RIGHT", DefaultEditorKit.forwardAction, 351 "KP_LEFT", DefaultEditorKit.backwardAction, 352 "shift LEFT", DefaultEditorKit.selectionBackwardAction, 353 "shift RIGHT", DefaultEditorKit.selectionForwardAction, 354 "control LEFT", DefaultEditorKit.previousWordAction, 355 "control RIGHT", DefaultEditorKit.nextWordAction, 356 "control shift LEFT", DefaultEditorKit.selectionPreviousWordAction, 357 "control shift RIGHT", DefaultEditorKit.selectionNextWordAction, 358 "control SLASH", DefaultEditorKit.selectAllAction, 359 "HOME", DefaultEditorKit.beginLineAction, 360 "END", DefaultEditorKit.endLineAction, 361 "shift HOME", DefaultEditorKit.selectionBeginLineAction, 362 "shift END", DefaultEditorKit.selectionEndLineAction, 363 "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/, 364 "ENTER", JTextField.notifyAction, 365 "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/ 366 }); 367 368 Object passwordInputMap = new UIDefaults.LazyInputMap(new Object[] { 369 "COPY", DefaultEditorKit.copyAction, 370 "PASTE", DefaultEditorKit.pasteAction, 371 "CUT", DefaultEditorKit.cutAction, 372 "control INSERT", DefaultEditorKit.copyAction, 373 "shift INSERT", DefaultEditorKit.pasteAction, 374 "shift DELETE", DefaultEditorKit.cutAction, 375 "control F", DefaultEditorKit.forwardAction, 376 "control B", DefaultEditorKit.backwardAction, 377 "control D", DefaultEditorKit.deleteNextCharAction, 378 "BACK_SPACE", DefaultEditorKit.deletePrevCharAction, 379 "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction, 380 "ctrl H", DefaultEditorKit.deletePrevCharAction, 381 "DELETE", DefaultEditorKit.deleteNextCharAction, 382 "RIGHT", DefaultEditorKit.forwardAction, 383 "LEFT", DefaultEditorKit.backwardAction, 384 "KP_RIGHT", DefaultEditorKit.forwardAction, 385 "KP_LEFT", DefaultEditorKit.backwardAction, 386 "shift LEFT", DefaultEditorKit.selectionBackwardAction, 387 "shift RIGHT", DefaultEditorKit.selectionForwardAction, 388 "control LEFT", DefaultEditorKit.beginLineAction, 389 "control RIGHT", DefaultEditorKit.endLineAction, 390 "control shift LEFT", DefaultEditorKit.selectionBeginLineAction, 391 "control shift RIGHT", DefaultEditorKit.selectionEndLineAction, 392 "control SLASH", DefaultEditorKit.selectAllAction, 393 "HOME", DefaultEditorKit.beginLineAction, 394 "END", DefaultEditorKit.endLineAction, 395 "shift HOME", DefaultEditorKit.selectionBeginLineAction, 396 "shift END", DefaultEditorKit.selectionEndLineAction, 397 "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/, 398 "ENTER", JTextField.notifyAction, 399 "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/ 400 }); 401 402 Object multilineInputMap = new UIDefaults.LazyInputMap(new Object[] { 403 "COPY", DefaultEditorKit.copyAction, 404 "PASTE", DefaultEditorKit.pasteAction, 405 "CUT", DefaultEditorKit.cutAction, 406 "control INSERT", DefaultEditorKit.copyAction, 407 "shift INSERT", DefaultEditorKit.pasteAction, 408 "shift DELETE", DefaultEditorKit.cutAction, 409 "control F", DefaultEditorKit.forwardAction, 410 "control B", DefaultEditorKit.backwardAction, 411 "control D", DefaultEditorKit.deleteNextCharAction, 412 "BACK_SPACE", DefaultEditorKit.deletePrevCharAction, 413 "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction, 414 "ctrl H", DefaultEditorKit.deletePrevCharAction, 415 "DELETE", DefaultEditorKit.deleteNextCharAction, 416 "ctrl DELETE", DefaultEditorKit.deleteNextWordAction, 417 "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction, 418 "RIGHT", DefaultEditorKit.forwardAction, 419 "LEFT", DefaultEditorKit.backwardAction, 420 "KP_RIGHT", DefaultEditorKit.forwardAction, 421 "KP_LEFT", DefaultEditorKit.backwardAction, 422 "shift LEFT", DefaultEditorKit.selectionBackwardAction, 423 "shift RIGHT", DefaultEditorKit.selectionForwardAction, 424 "control LEFT", DefaultEditorKit.previousWordAction, 425 "control RIGHT", DefaultEditorKit.nextWordAction, 426 "control shift LEFT", DefaultEditorKit.selectionPreviousWordAction, 427 "control shift RIGHT", DefaultEditorKit.selectionNextWordAction, 428 "control SLASH", DefaultEditorKit.selectAllAction, 429 "HOME", DefaultEditorKit.beginLineAction, 430 "END", DefaultEditorKit.endLineAction, 431 "shift HOME", DefaultEditorKit.selectionBeginLineAction, 432 "shift END", DefaultEditorKit.selectionEndLineAction, 433 434 "control N", DefaultEditorKit.downAction, 435 "control P", DefaultEditorKit.upAction, 436 "UP", DefaultEditorKit.upAction, 437 "DOWN", DefaultEditorKit.downAction, 438 "PAGE_UP", DefaultEditorKit.pageUpAction, 439 "PAGE_DOWN", DefaultEditorKit.pageDownAction, 440 "shift PAGE_UP", "selection-page-up", 441 "shift PAGE_DOWN", "selection-page-down", 442 "ctrl shift PAGE_UP", "selection-page-left", 443 "ctrl shift PAGE_DOWN", "selection-page-right", 444 "shift UP", DefaultEditorKit.selectionUpAction, 445 "shift DOWN", DefaultEditorKit.selectionDownAction, 446 "ENTER", DefaultEditorKit.insertBreakAction, 447 "TAB", DefaultEditorKit.insertTabAction, 448 "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/, 449 "control HOME", DefaultEditorKit.beginAction, 450 "control END", DefaultEditorKit.endAction, 451 "control shift HOME", DefaultEditorKit.selectionBeginAction, 452 "control shift END", DefaultEditorKit.selectionEndAction, 453 "control T", "next-link-action", 454 "control shift T", "previous-link-action", 455 "control SPACE", "activate-link-action", 456 "control shift O", "toggle-componentOrientation"/*DefaultEditorKit.toggleComponentOrientation*/ 457 }); 458 459 // *** Tree 460 461 Object treeOpenIcon = SwingUtilities2.makeIcon(getClass(), 462 MotifLookAndFeel.class, 463 "icons/TreeOpen.gif"); 464 465 Object treeClosedIcon = SwingUtilities2.makeIcon(getClass(), 466 MotifLookAndFeel.class, 467 "icons/TreeClosed.gif"); 468 469 Object treeLeafIcon = new UIDefaults.LazyValue() { 470 public Object createValue(UIDefaults table) { 471 return MotifTreeCellRenderer.loadLeafIcon(); 472 } 473 }; 474 475 Object treeExpandedIcon = new UIDefaults.LazyValue() { 476 public Object createValue(UIDefaults table) { 477 return MotifTreeUI.MotifExpandedIcon.createExpandedIcon(); 478 } 479 }; 480 481 Object treeCollapsedIcon = new UIDefaults.LazyValue() { 482 public Object createValue(UIDefaults table) { 483 return MotifTreeUI.MotifCollapsedIcon.createCollapsedIcon(); 484 } 485 }; 486 487 Border menuBarBorder = new MotifBorders.MenuBarBorder( 488 table.getColor("MenuBar.shadow"), 489 table.getColor("MenuBar.highlight"), 490 table.getColor("MenuBar.darkShadow"), 491 table.getColor("activeCaptionBorder")); 492 493 494 Border menuMarginBorder = new BorderUIResource.CompoundBorderUIResource( 495 loweredBevelBorder, 496 marginBorder); 497 498 499 Border focusCellHighlightBorder = new BorderUIResource.LineBorderUIResource( 500 table.getColor("activeCaptionBorder")); 501 502 Object sliderFocusInsets = new InsetsUIResource( 0, 0, 0, 0 ); 503 504 // ** for tabbedpane 505 506 Object tabbedPaneTabInsets = new InsetsUIResource(3, 4, 3, 4); 507 508 Object tabbedPaneTabPadInsets = new InsetsUIResource(3, 0, 1, 0); 509 510 Object tabbedPaneTabAreaInsets = new InsetsUIResource(4, 2, 0, 8); 511 512 Object tabbedPaneContentBorderInsets = new InsetsUIResource(2, 2, 2, 2); 513 514 515 // ** for optionpane 516 517 Object optionPaneBorder = new BorderUIResource.EmptyBorderUIResource(10,0,0,0); 518 519 Object optionPaneButtonAreaBorder = new BorderUIResource.EmptyBorderUIResource(10,10,10,10); 520 521 Object optionPaneMessageAreaBorder = new BorderUIResource.EmptyBorderUIResource(10,10,12,10); 522 523 524 Object[] defaults = { 525 526 "Desktop.background", table.get("desktop"), 527 "Desktop.ancestorInputMap", 528 new UIDefaults.LazyInputMap(new Object[] { 529 "ctrl F5", "restore", 530 "ctrl F4", "close", 531 "ctrl F7", "move", 532 "ctrl F8", "resize", 533 "RIGHT", "right", 534 "KP_RIGHT", "right", 535 "shift RIGHT", "shrinkRight", 536 "shift KP_RIGHT", "shrinkRight", 537 "LEFT", "left", 538 "KP_LEFT", "left", 539 "shift LEFT", "shrinkLeft", 540 "shift KP_LEFT", "shrinkLeft", 541 "UP", "up", 542 "KP_UP", "up", 543 "shift UP", "shrinkUp", 544 "shift KP_UP", "shrinkUp", 545 "DOWN", "down", 546 "KP_DOWN", "down", 547 "shift DOWN", "shrinkDown", 548 "shift KP_DOWN", "shrinkDown", 549 "ESCAPE", "escape", 550 "ctrl F9", "minimize", 551 "ctrl F10", "maximize", 552 "ctrl F6", "selectNextFrame", 553 "ctrl TAB", "selectNextFrame", 554 "ctrl alt F6", "selectNextFrame", 555 "shift ctrl alt F6", "selectPreviousFrame", 556 "ctrl F12", "navigateNext", 557 "shift ctrl F12", "navigatePrevious" 558 }), 559 560 "Panel.background", table.get("control"), 561 "Panel.foreground", table.get("textText"), 562 "Panel.font", dialogPlain12, 563 564 "ProgressBar.font", dialogPlain12, 565 "ProgressBar.foreground", controlDarker, 566 "ProgressBar.background", table.get("control"), 567 "ProgressBar.selectionForeground", table.get("control"), 568 "ProgressBar.selectionBackground", table.get("controlText"), 569 "ProgressBar.border", loweredBevelBorder, 570 "ProgressBar.cellLength", new Integer(6), 571 "ProgressBar.cellSpacing", Integer.valueOf(0), 572 573 // Buttons 574 "Button.margin", new InsetsUIResource(2, 4, 2, 4), 575 "Button.border", buttonBorder, 576 "Button.background", table.get("control"), 577 "Button.foreground", table.get("controlText"), 578 "Button.select", table.get("controlLightShadow"), 579 "Button.font", dialogPlain12, 580 "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { 581 "SPACE", "pressed", 582 "released SPACE", "released" 583 }), 584 585 "CheckBox.textIconGap", new Integer(8), 586 "CheckBox.margin", new InsetsUIResource(4, 2, 4, 2), 587 "CheckBox.icon", checkBoxIcon, 588 "CheckBox.focus", table.get("activeCaptionBorder"), 589 "CheckBox.focusInputMap", 590 new UIDefaults.LazyInputMap(new Object[] { 591 "SPACE", "pressed", 592 "released SPACE", "released" 593 }), 594 595 "RadioButton.margin", new InsetsUIResource(4, 2, 4, 2), 596 "RadioButton.textIconGap", new Integer(8), 597 "RadioButton.background", table.get("control"), 598 "RadioButton.foreground", table.get("controlText"), 599 "RadioButton.icon", radioButtonIcon, 600 "RadioButton.focus", table.get("activeCaptionBorder"), 601 "RadioButton.icon", radioButtonIcon, 602 "RadioButton.focusInputMap", 603 new UIDefaults.LazyInputMap(new Object[] { 604 "SPACE", "pressed", 605 "released SPACE", "released" 606 }), 607 608 "ToggleButton.border", toggleButtonBorder, 609 "ToggleButton.background", table.get("control"), 610 "ToggleButton.foreground", table.get("controlText"), 611 "ToggleButton.focus", table.get("controlText"), 612 "ToggleButton.select", table.get("controlLightShadow"), 613 "ToggleButton.focusInputMap", 614 new UIDefaults.LazyInputMap(new Object[] { 615 "SPACE", "pressed", 616 "released SPACE", "released" 617 }), 618 619 // Menus 620 "Menu.border", menuMarginBorder, 621 "Menu.font", dialogPlain12, 622 "Menu.acceleratorFont", dialogPlain12, 623 "Menu.acceleratorSelectionForeground", menuItemPressedForeground, 624 "Menu.foreground", table.get("menuText"), 625 "Menu.background", table.get("menu"), 626 "Menu.selectionForeground", menuItemPressedForeground, 627 "Menu.selectionBackground", menuItemPressedBackground, 628 "Menu.checkIcon", menuItemCheckIcon, 629 "Menu.arrowIcon", menuArrowIcon, 630 "Menu.menuPopupOffsetX", new Integer(0), 631 "Menu.menuPopupOffsetY", new Integer(0), 632 "Menu.submenuPopupOffsetX", new Integer(-2), 633 "Menu.submenuPopupOffsetY", new Integer(3), 634 "Menu.shortcutKeys", new int[]{ 635 SwingUtilities2.getSystemMnemonicKeyMask(), 636 KeyEvent.META_MASK 637 }, 638 "Menu.cancelMode", "hideMenuTree", 639 640 "MenuBar.border", menuBarBorder, 641 "MenuBar.background", table.get("menu"), 642 "MenuBar.foreground", table.get("menuText"), 643 "MenuBar.font", dialogPlain12, 644 "MenuBar.windowBindings", new Object[] { 645 "F10", "takeFocus" }, 646 647 "MenuItem.border", menuMarginBorder, 648 "MenuItem.font", dialogPlain12, 649 "MenuItem.acceleratorFont", dialogPlain12, 650 "MenuItem.acceleratorSelectionForeground", menuItemPressedForeground, 651 "MenuItem.foreground", table.get("menuText"), 652 "MenuItem.background", table.get("menu"), 653 "MenuItem.selectionForeground", menuItemPressedForeground, 654 "MenuItem.selectionBackground", menuItemPressedBackground, 655 "MenuItem.checkIcon", menuItemCheckIcon, 656 "MenuItem.arrowIcon", menuItemArrowIcon, 657 658 "RadioButtonMenuItem.border", menuMarginBorder, 659 "RadioButtonMenuItem.font", dialogPlain12, 660 "RadioButtonMenuItem.acceleratorFont", dialogPlain12, 661 "RadioButtonMenuItem.acceleratorSelectionForeground", menuItemPressedForeground, 662 "RadioButtonMenuItem.foreground", table.get("menuText"), 663 "RadioButtonMenuItem.background", table.get("menu"), 664 "RadioButtonMenuItem.selectionForeground", menuItemPressedForeground, 665 "RadioButtonMenuItem.selectionBackground", menuItemPressedBackground, 666 "RadioButtonMenuItem.checkIcon", radioButtonIcon, 667 "RadioButtonMenuItem.arrowIcon", menuItemArrowIcon, 668 669 "CheckBoxMenuItem.border", menuMarginBorder, 670 "CheckBoxMenuItem.font", dialogPlain12, 671 "CheckBoxMenuItem.acceleratorFont", dialogPlain12, 672 "CheckBoxMenuItem.acceleratorSelectionForeground", menuItemPressedForeground, 673 "CheckBoxMenuItem.foreground", table.get("menuText"), 674 "CheckBoxMenuItem.background", table.get("menu"), 675 "CheckBoxMenuItem.selectionForeground", menuItemPressedForeground, 676 "CheckBoxMenuItem.selectionBackground", menuItemPressedBackground, 677 "CheckBoxMenuItem.checkIcon", checkBoxIcon, 678 "CheckBoxMenuItem.arrowIcon", menuItemArrowIcon, 679 680 "PopupMenu.background", table.get("menu"), 681 "PopupMenu.border", popupMenuBorder, 682 "PopupMenu.foreground", table.get("menuText"), 683 "PopupMenu.font", dialogPlain12, 684 "PopupMenu.consumeEventOnClose", Boolean.TRUE, 685 686 "Label.font", dialogPlain12, 687 "Label.background", table.get("control"), 688 "Label.foreground", table.get("controlText"), 689 690 "Separator.shadow", table.get("controlShadow"), // DEPRECATED - DO NOT USE! 691 "Separator.highlight", table.get("controlLtHighlight"), // DEPRECATED - DO NOT USE! 692 693 "Separator.background", table.get("controlLtHighlight"), 694 "Separator.foreground", table.get("controlShadow"), 695 696 "List.focusCellHighlightBorder", focusCellHighlightBorder, 697 "List.focusInputMap", 698 new UIDefaults.LazyInputMap(new Object[] { 699 "COPY", "copy", 700 "PASTE", "paste", 701 "CUT", "cut", 702 "control INSERT", "copy", 703 "shift INSERT", "paste", 704 "shift DELETE", "cut", 705 "UP", "selectPreviousRow", 706 "KP_UP", "selectPreviousRow", 707 "shift UP", "selectPreviousRowExtendSelection", 708 "shift KP_UP", "selectPreviousRowExtendSelection", 709 "ctrl shift UP", "selectPreviousRowExtendSelection", 710 "ctrl shift KP_UP", "selectPreviousRowExtendSelection", 711 "ctrl UP", "selectPreviousRowChangeLead", 712 "ctrl KP_UP", "selectPreviousRowChangeLead", 713 "DOWN", "selectNextRow", 714 "KP_DOWN", "selectNextRow", 715 "shift DOWN", "selectNextRowExtendSelection", 716 "shift KP_DOWN", "selectNextRowExtendSelection", 717 "ctrl shift DOWN", "selectNextRowExtendSelection", 718 "ctrl shift KP_DOWN", "selectNextRowExtendSelection", 719 "ctrl DOWN", "selectNextRowChangeLead", 720 "ctrl KP_DOWN", "selectNextRowChangeLead", 721 "LEFT", "selectPreviousColumn", 722 "KP_LEFT", "selectPreviousColumn", 723 "shift LEFT", "selectPreviousColumnExtendSelection", 724 "shift KP_LEFT", "selectPreviousColumnExtendSelection", 725 "ctrl shift LEFT", "selectPreviousColumnExtendSelection", 726 "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection", 727 "ctrl LEFT", "selectPreviousColumnChangeLead", 728 "ctrl KP_LEFT", "selectPreviousColumnChangeLead", 729 "RIGHT", "selectNextColumn", 730 "KP_RIGHT", "selectNextColumn", 731 "shift RIGHT", "selectNextColumnExtendSelection", 732 "shift KP_RIGHT", "selectNextColumnExtendSelection", 733 "ctrl shift RIGHT", "selectNextColumnExtendSelection", 734 "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection", 735 "ctrl RIGHT", "selectNextColumnChangeLead", 736 "ctrl KP_RIGHT", "selectNextColumnChangeLead", 737 "HOME", "selectFirstRow", 738 "shift HOME", "selectFirstRowExtendSelection", 739 "ctrl shift HOME", "selectFirstRowExtendSelection", 740 "ctrl HOME", "selectFirstRowChangeLead", 741 "END", "selectLastRow", 742 "shift END", "selectLastRowExtendSelection", 743 "ctrl shift END", "selectLastRowExtendSelection", 744 "ctrl END", "selectLastRowChangeLead", 745 "PAGE_UP", "scrollUp", 746 "shift PAGE_UP", "scrollUpExtendSelection", 747 "ctrl shift PAGE_UP", "scrollUpExtendSelection", 748 "ctrl PAGE_UP", "scrollUpChangeLead", 749 "PAGE_DOWN", "scrollDown", 750 "shift PAGE_DOWN", "scrollDownExtendSelection", 751 "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", 752 "ctrl PAGE_DOWN", "scrollDownChangeLead", 753 "ctrl A", "selectAll", 754 "ctrl SLASH", "selectAll", 755 "ctrl BACK_SLASH", "clearSelection", 756 "SPACE", "addToSelection", 757 "ctrl SPACE", "toggleAndAnchor", 758 "shift SPACE", "extendTo", 759 "ctrl shift SPACE", "moveSelectionTo" 760 }), 761 762 "DesktopIcon.icon", SwingUtilities2.makeIcon(getClass(), 763 MotifLookAndFeel.class, 764 "icons/DesktopIcon.gif"), 765 "DesktopIcon.border", null, 766 // These are a little odd, MotifInternalFrameUI isntalls em! 767 "DesktopIcon.windowBindings", new Object[] 768 { "ESCAPE", "hideSystemMenu" }, 769 770 "InternalFrame.activeTitleBackground", table.get("activeCaptionBorder"), 771 "InternalFrame.inactiveTitleBackground", table.get("inactiveCaptionBorder"), 772 "InternalFrame.windowBindings", new Object[] { 773 "shift ESCAPE", "showSystemMenu", 774 "ctrl SPACE", "showSystemMenu", 775 "ESCAPE", "hideSystemMenu" 776 }, 777 778 "ScrollBar.background", scrollBarTrack, 779 "ScrollBar.foreground", table.get("control"), 780 "ScrollBar.track", scrollBarTrack, 781 "ScrollBar.trackHighlight", table.get("controlDkShadow"), 782 "ScrollBar.thumb", table.get("control"), 783 "ScrollBar.thumbHighlight", table.get("controlHighlight"), 784 "ScrollBar.thumbDarkShadow", table.get("controlDkShadow"), 785 "ScrollBar.thumbShadow", table.get("controlShadow"), 786 "ScrollBar.border", loweredBevelBorder, 787 "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE, 788 "ScrollBar.ancestorInputMap", 789 new UIDefaults.LazyInputMap(new Object[] { 790 "RIGHT", "positiveUnitIncrement", 791 "KP_RIGHT", "positiveUnitIncrement", 792 "DOWN", "positiveUnitIncrement", 793 "KP_DOWN", "positiveUnitIncrement", 794 "PAGE_DOWN", "positiveBlockIncrement", 795 "ctrl PAGE_DOWN", "positiveBlockIncrement", 796 "LEFT", "negativeUnitIncrement", 797 "KP_LEFT", "negativeUnitIncrement", 798 "UP", "negativeUnitIncrement", 799 "KP_UP", "negativeUnitIncrement", 800 "PAGE_UP", "negativeBlockIncrement", 801 "ctrl PAGE_UP", "negativeBlockIncrement", 802 "HOME", "minScroll", 803 "END", "maxScroll" 804 }), 805 806 "ScrollPane.font", dialogPlain12, 807 "ScrollPane.background", table.get("control"), 808 "ScrollPane.foreground", table.get("controlText"), 809 "ScrollPane.border", null, 810 "ScrollPane.viewportBorder", loweredBevelBorder, 811 "ScrollPane.ancestorInputMap", 812 new UIDefaults.LazyInputMap(new Object[] { 813 "RIGHT", "unitScrollRight", 814 "KP_RIGHT", "unitScrollRight", 815 "DOWN", "unitScrollDown", 816 "KP_DOWN", "unitScrollDown", 817 "LEFT", "unitScrollLeft", 818 "KP_LEFT", "unitScrollLeft", 819 "UP", "unitScrollUp", 820 "KP_UP", "unitScrollUp", 821 "PAGE_UP", "scrollUp", 822 "PAGE_DOWN", "scrollDown", 823 "ctrl PAGE_UP", "scrollLeft", 824 "ctrl PAGE_DOWN", "scrollRight", 825 "ctrl HOME", "scrollHome", 826 "ctrl END", "scrollEnd" 827 }), 828 829 "Slider.font", dialogPlain12, 830 "Slider.border", focusBevelBorder, 831 "Slider.foreground", table.get("control"), 832 "Slider.background", controlDarker, 833 "Slider.highlight", table.get("controlHighlight"), 834 "Slider.shadow", table.get("controlShadow"), 835 "Slider.focus", table.get("controlDkShadow"), 836 "Slider.focusInsets", sliderFocusInsets, 837 "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { 838 "RIGHT", "positiveUnitIncrement", 839 "KP_RIGHT", "positiveUnitIncrement", 840 "DOWN", "negativeUnitIncrement", 841 "KP_DOWN", "negativeUnitIncrement", 842 "ctrl PAGE_DOWN", "negativeBlockIncrement", 843 "LEFT", "negativeUnitIncrement", 844 "KP_LEFT", "negativeUnitIncrement", 845 "UP", "positiveUnitIncrement", 846 "KP_UP", "positiveUnitIncrement", 847 "ctrl PAGE_UP", "positiveBlockIncrement", 848 "HOME", "minScroll", 849 "END", "maxScroll" 850 }), 851 852 // Spinner 853 "Spinner.ancestorInputMap", 854 new UIDefaults.LazyInputMap(new Object[] { 855 "UP", "increment", 856 "KP_UP", "increment", 857 "DOWN", "decrement", 858 "KP_DOWN", "decrement", 859 }), 860 "Spinner.border", textFieldBorder, 861 862 "SplitPane.background", table.get("control"), 863 "SplitPane.highlight", table.get("controlHighlight"), 864 "SplitPane.shadow", table.get("controlShadow"), 865 "SplitPane.dividerSize", Integer.valueOf(20), 866 "SplitPane.activeThumb", table.get("activeCaptionBorder"), 867 "SplitPane.ancestorInputMap", 868 new UIDefaults.LazyInputMap(new Object[] { 869 "UP", "negativeIncrement", 870 "DOWN", "positiveIncrement", 871 "LEFT", "negativeIncrement", 872 "RIGHT", "positiveIncrement", 873 "KP_UP", "negativeIncrement", 874 "KP_DOWN", "positiveIncrement", 875 "KP_LEFT", "negativeIncrement", 876 "KP_RIGHT", "positiveIncrement", 877 "HOME", "selectMin", 878 "END", "selectMax", 879 "F8", "startResize", 880 "F6", "toggleFocus", 881 "ctrl TAB", "focusOutForward", 882 "ctrl shift TAB", "focusOutBackward" 883 }), 884 885 "TabbedPane.font", dialogPlain12, 886 "TabbedPane.background", table.get("control"), 887 "TabbedPane.foreground", table.get("controlText"), 888 "TabbedPane.light", table.get("controlHighlight"), 889 "TabbedPane.highlight", table.get("controlLtHighlight"), 890 "TabbedPane.shadow", table.get("controlShadow"), 891 "TabbedPane.darkShadow", table.get("controlShadow"), 892 "TabbedPane.unselectedTabBackground", unselectedTabBackground, 893 "TabbedPane.unselectedTabForeground", unselectedTabForeground, 894 "TabbedPane.unselectedTabHighlight", unselectedTabHighlight, 895 "TabbedPane.unselectedTabShadow", unselectedTabShadow, 896 "TabbedPane.focus", table.get("activeCaptionBorder"), 897 "TabbedPane.tabInsets", tabbedPaneTabInsets, 898 "TabbedPane.selectedTabPadInsets", tabbedPaneTabPadInsets, 899 "TabbedPane.tabAreaInsets", tabbedPaneTabAreaInsets, 900 "TabbedPane.contentBorderInsets", tabbedPaneContentBorderInsets, 901 "TabbedPane.focusInputMap", 902 new UIDefaults.LazyInputMap(new Object[] { 903 "RIGHT", "navigateRight", 904 "KP_RIGHT", "navigateRight", 905 "LEFT", "navigateLeft", 906 "KP_LEFT", "navigateLeft", 907 "UP", "navigateUp", 908 "KP_UP", "navigateUp", 909 "DOWN", "navigateDown", 910 "KP_DOWN", "navigateDown", 911 "ctrl DOWN", "requestFocusForVisibleComponent", 912 "ctrl KP_DOWN", "requestFocusForVisibleComponent", 913 }), 914 "TabbedPane.ancestorInputMap", 915 new UIDefaults.LazyInputMap(new Object[] { 916 "ctrl PAGE_DOWN", "navigatePageDown", 917 "ctrl PAGE_UP", "navigatePageUp", 918 "ctrl UP", "requestFocus", 919 "ctrl KP_UP", "requestFocus", 920 }), 921 922 923 "Tree.background", controlDarker, // default: dark slate blue 924 "Tree.hash", table.get("controlDkShadow"), // default: black 925 "Tree.iconShadow", table.get("controlShadow"), 926 "Tree.iconHighlight", table.get("controlHighlight"), 927 "Tree.iconBackground", table.get("control"), 928 "Tree.iconForeground", table.get("controlShadow"), // default: black 929 "Tree.textBackground", controlDarker, // default: dark slate blue 930 "Tree.textForeground", table.get("textText"), // default: black 931 "Tree.selectionBackground", table.get("text"), // default: white 932 "Tree.selectionForeground", table.get("textText"), // default: black 933 "Tree.selectionBorderColor", table.get("activeCaptionBorder"), // default: maroon 934 "Tree.openIcon", treeOpenIcon, 935 "Tree.closedIcon", treeClosedIcon, 936 "Tree.leafIcon", treeLeafIcon, 937 "Tree.expandedIcon", treeExpandedIcon, 938 "Tree.collapsedIcon", treeCollapsedIcon, 939 "Tree.editorBorder", focusBorder, 940 "Tree.editorBorderSelectionColor", table.get("activeCaptionBorder"), 941 "Tree.rowHeight", new Integer(18), 942 "Tree.drawsFocusBorderAroundIcon", Boolean.TRUE, 943 "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { 944 "COPY", "copy", 945 "PASTE", "paste", 946 "CUT", "cut", 947 "control INSERT", "copy", 948 "shift INSERT", "paste", 949 "shift DELETE", "cut", 950 "UP", "selectPrevious", 951 "KP_UP", "selectPrevious", 952 "shift UP", "selectPreviousExtendSelection", 953 "shift KP_UP", "selectPreviousExtendSelection", 954 "ctrl shift UP", "selectPreviousExtendSelection", 955 "ctrl shift KP_UP", "selectPreviousExtendSelection", 956 "ctrl UP", "selectPreviousChangeLead", 957 "ctrl KP_UP", "selectPreviousChangeLead", 958 "DOWN", "selectNext", 959 "KP_DOWN", "selectNext", 960 "shift DOWN", "selectNextExtendSelection", 961 "shift KP_DOWN", "selectNextExtendSelection", 962 "ctrl shift DOWN", "selectNextExtendSelection", 963 "ctrl shift KP_DOWN", "selectNextExtendSelection", 964 "ctrl DOWN", "selectNextChangeLead", 965 "ctrl KP_DOWN", "selectNextChangeLead", 966 "RIGHT", "selectChild", 967 "KP_RIGHT", "selectChild", 968 "LEFT", "selectParent", 969 "KP_LEFT", "selectParent", 970 "PAGE_UP", "scrollUpChangeSelection", 971 "shift PAGE_UP", "scrollUpExtendSelection", 972 "ctrl shift PAGE_UP", "scrollUpExtendSelection", 973 "ctrl PAGE_UP", "scrollUpChangeLead", 974 "PAGE_DOWN", "scrollDownChangeSelection", 975 "shift PAGE_DOWN", "scrollDownExtendSelection", 976 "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", 977 "ctrl PAGE_DOWN", "scrollDownChangeLead", 978 "HOME", "selectFirst", 979 "shift HOME", "selectFirstExtendSelection", 980 "ctrl shift HOME", "selectFirstExtendSelection", 981 "ctrl HOME", "selectFirstChangeLead", 982 "END", "selectLast", 983 "shift END", "selectLastExtendSelection", 984 "ctrl shift END", "selectLastExtendSelection", 985 "ctrl END", "selectLastChangeLead", 986 "F2", "startEditing", 987 "ctrl A", "selectAll", 988 "ctrl SLASH", "selectAll", 989 "ctrl BACK_SLASH", "clearSelection", 990 "ctrl LEFT", "scrollLeft", 991 "ctrl KP_LEFT", "scrollLeft", 992 "ctrl RIGHT", "scrollRight", 993 "ctrl KP_RIGHT", "scrollRight", 994 "SPACE", "addToSelection", 995 "ctrl SPACE", "toggleAndAnchor", 996 "shift SPACE", "extendTo", 997 "ctrl shift SPACE", "moveSelectionTo" 998 }), 999 "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { 1000 "ESCAPE", "cancel" }), 1001 1002 "Table.focusCellHighlightBorder", focusCellHighlightBorder, 1003 "Table.scrollPaneBorder", null, 1004 "Table.dropLineShortColor", table.get("activeCaptionBorder"), 1005 1006 // "Table.background", white, // cell background color 1007 "Table.ancestorInputMap", 1008 new UIDefaults.LazyInputMap(new Object[] { 1009 "COPY", "copy", 1010 "PASTE", "paste", 1011 "CUT", "cut", 1012 "control INSERT", "copy", 1013 "shift INSERT", "paste", 1014 "shift DELETE", "cut", 1015 "RIGHT", "selectNextColumn", 1016 "KP_RIGHT", "selectNextColumn", 1017 "shift RIGHT", "selectNextColumnExtendSelection", 1018 "shift KP_RIGHT", "selectNextColumnExtendSelection", 1019 "ctrl shift RIGHT", "selectNextColumnExtendSelection", 1020 "ctrl shift KP_RIGHT", "selectNextColumnExtendSelection", 1021 "ctrl RIGHT", "selectNextColumnChangeLead", 1022 "ctrl KP_RIGHT", "selectNextColumnChangeLead", 1023 "LEFT", "selectPreviousColumn", 1024 "KP_LEFT", "selectPreviousColumn", 1025 "shift LEFT", "selectPreviousColumnExtendSelection", 1026 "shift KP_LEFT", "selectPreviousColumnExtendSelection", 1027 "ctrl shift LEFT", "selectPreviousColumnExtendSelection", 1028 "ctrl shift KP_LEFT", "selectPreviousColumnExtendSelection", 1029 "ctrl LEFT", "selectPreviousColumnChangeLead", 1030 "ctrl KP_LEFT", "selectPreviousColumnChangeLead", 1031 "DOWN", "selectNextRow", 1032 "KP_DOWN", "selectNextRow", 1033 "shift DOWN", "selectNextRowExtendSelection", 1034 "shift KP_DOWN", "selectNextRowExtendSelection", 1035 "ctrl shift DOWN", "selectNextRowExtendSelection", 1036 "ctrl shift KP_DOWN", "selectNextRowExtendSelection", 1037 "ctrl DOWN", "selectNextRowChangeLead", 1038 "ctrl KP_DOWN", "selectNextRowChangeLead", 1039 "UP", "selectPreviousRow", 1040 "KP_UP", "selectPreviousRow", 1041 "shift UP", "selectPreviousRowExtendSelection", 1042 "shift KP_UP", "selectPreviousRowExtendSelection", 1043 "ctrl shift UP", "selectPreviousRowExtendSelection", 1044 "ctrl shift KP_UP", "selectPreviousRowExtendSelection", 1045 "ctrl UP", "selectPreviousRowChangeLead", 1046 "ctrl KP_UP", "selectPreviousRowChangeLead", 1047 "HOME", "selectFirstColumn", 1048 "shift HOME", "selectFirstColumnExtendSelection", 1049 "ctrl shift HOME", "selectFirstRowExtendSelection", 1050 "ctrl HOME", "selectFirstRow", 1051 "END", "selectLastColumn", 1052 "shift END", "selectLastColumnExtendSelection", 1053 "ctrl shift END", "selectLastRowExtendSelection", 1054 "ctrl END", "selectLastRow", 1055 "PAGE_UP", "scrollUpChangeSelection", 1056 "shift PAGE_UP", "scrollUpExtendSelection", 1057 "ctrl shift PAGE_UP", "scrollLeftExtendSelection", 1058 "ctrl PAGE_UP", "scrollLeftChangeSelection", 1059 "PAGE_DOWN", "scrollDownChangeSelection", 1060 "shift PAGE_DOWN", "scrollDownExtendSelection", 1061 "ctrl shift PAGE_DOWN", "scrollRightExtendSelection", 1062 "ctrl PAGE_DOWN", "scrollRightChangeSelection", 1063 "TAB", "selectNextColumnCell", 1064 "shift TAB", "selectPreviousColumnCell", 1065 "ENTER", "selectNextRowCell", 1066 "shift ENTER", "selectPreviousRowCell", 1067 "ctrl A", "selectAll", 1068 "ctrl SLASH", "selectAll", 1069 "ctrl BACK_SLASH", "clearSelection", 1070 "ESCAPE", "cancel", 1071 "F2", "startEditing", 1072 "SPACE", "addToSelection", 1073 "ctrl SPACE", "toggleAndAnchor", 1074 "shift SPACE", "extendTo", 1075 "ctrl shift SPACE", "moveSelectionTo", 1076 "F8", "focusHeader" 1077 }), 1078 1079 1080 "FormattedTextField.focusInputMap", 1081 new UIDefaults.LazyInputMap(new Object[] { 1082 "ctrl C", DefaultEditorKit.copyAction, 1083 "ctrl V", DefaultEditorKit.pasteAction, 1084 "ctrl X", DefaultEditorKit.cutAction, 1085 "COPY", DefaultEditorKit.copyAction, 1086 "PASTE", DefaultEditorKit.pasteAction, 1087 "CUT", DefaultEditorKit.cutAction, 1088 "shift LEFT", DefaultEditorKit.selectionBackwardAction, 1089 "shift KP_LEFT", DefaultEditorKit.selectionBackwardAction, 1090 "shift RIGHT", DefaultEditorKit.selectionForwardAction, 1091 "shift KP_RIGHT", DefaultEditorKit.selectionForwardAction, 1092 "ctrl LEFT", DefaultEditorKit.previousWordAction, 1093 "ctrl KP_LEFT", DefaultEditorKit.previousWordAction, 1094 "ctrl RIGHT", DefaultEditorKit.nextWordAction, 1095 "ctrl KP_RIGHT", DefaultEditorKit.nextWordAction, 1096 "ctrl shift LEFT", DefaultEditorKit.selectionPreviousWordAction, 1097 "ctrl shift KP_LEFT", DefaultEditorKit.selectionPreviousWordAction, 1098 "ctrl shift RIGHT", DefaultEditorKit.selectionNextWordAction, 1099 "ctrl shift KP_RIGHT", DefaultEditorKit.selectionNextWordAction, 1100 "ctrl A", DefaultEditorKit.selectAllAction, 1101 "HOME", DefaultEditorKit.beginLineAction, 1102 "END", DefaultEditorKit.endLineAction, 1103 "shift HOME", DefaultEditorKit.selectionBeginLineAction, 1104 "shift END", DefaultEditorKit.selectionEndLineAction, 1105 "BACK_SPACE", DefaultEditorKit.deletePrevCharAction, 1106 "shift BACK_SPACE", DefaultEditorKit.deletePrevCharAction, 1107 "ctrl H", DefaultEditorKit.deletePrevCharAction, 1108 "DELETE", DefaultEditorKit.deleteNextCharAction, 1109 "ctrl DELETE", DefaultEditorKit.deleteNextWordAction, 1110 "ctrl BACK_SPACE", DefaultEditorKit.deletePrevWordAction, 1111 "RIGHT", DefaultEditorKit.forwardAction, 1112 "LEFT", DefaultEditorKit.backwardAction, 1113 "KP_RIGHT", DefaultEditorKit.forwardAction, 1114 "KP_LEFT", DefaultEditorKit.backwardAction, 1115 "ENTER", JTextField.notifyAction, 1116 "ctrl BACK_SLASH", "unselect", 1117 "control shift O", "toggle-componentOrientation", 1118 "ESCAPE", "reset-field-edit", 1119 "UP", "increment", 1120 "KP_UP", "increment", 1121 "DOWN", "decrement", 1122 "KP_DOWN", "decrement", 1123 }), 1124 1125 // ToolBar. 1126 "ToolBar.ancestorInputMap", 1127 new UIDefaults.LazyInputMap(new Object[] { 1128 "UP", "navigateUp", 1129 "KP_UP", "navigateUp", 1130 "DOWN", "navigateDown", 1131 "KP_DOWN", "navigateDown", 1132 "LEFT", "navigateLeft", 1133 "KP_LEFT", "navigateLeft", 1134 "RIGHT", "navigateRight", 1135 "KP_RIGHT", "navigateRight" 1136 }), 1137 1138 1139 1140 "ComboBox.control", table.get("control"), 1141 "ComboBox.controlForeground", black, 1142 "ComboBox.background", table.get("window"), 1143 "ComboBox.foreground", black, 1144 "ComboBox.border", comboBoxBorder, 1145 "ComboBox.selectionBackground", black, 1146 "ComboBox.selectionForeground", table.get("text"), 1147 "ComboBox.disabledBackground", table.get("control"), 1148 "ComboBox.disabledForeground", table.get("textInactiveText"), 1149 "ComboBox.font", dialogPlain12, 1150 "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { 1151 "ESCAPE", "hidePopup", 1152 "PAGE_UP", "pageUpPassThrough", 1153 "PAGE_DOWN", "pageDownPassThrough", 1154 "HOME", "homePassThrough", 1155 "END", "endPassThrough", 1156 "DOWN", "selectNext", 1157 "KP_DOWN", "selectNext", 1158 "UP", "selectPrevious", 1159 "KP_UP", "selectPrevious", 1160 "SPACE", "spacePopup", 1161 "ENTER", "enterPressed" 1162 1163 }), 1164 1165 "TextField.caretForeground", black, 1166 "TextField.caretBlinkRate", Integer.valueOf(500), 1167 "TextField.inactiveForeground", table.get("textInactiveText"), 1168 "TextField.selectionBackground", table.get("textHighlight"), 1169 "TextField.selectionForeground", table.get("textHighlightText"), 1170 "TextField.background", table.get("window"), 1171 "TextField.foreground", table.get("textText"), 1172 "TextField.font", sansSerifPlain12, 1173 "TextField.border", textFieldBorder, 1174 "TextField.focusInputMap", fieldInputMap, 1175 1176 "PasswordField.caretForeground", black, 1177 "PasswordField.caretBlinkRate", Integer.valueOf(500), 1178 "PasswordField.inactiveForeground", table.get("textInactiveText"), 1179 "PasswordField.selectionBackground", table.get("textHighlight"), 1180 "PasswordField.selectionForeground", table.get("textHighlightText"), 1181 "PasswordField.background", table.get("window"), 1182 "PasswordField.foreground", table.get("textText"), 1183 "PasswordField.font", monospacedPlain12, 1184 "PasswordField.border", textFieldBorder, 1185 "PasswordField.focusInputMap", passwordInputMap, 1186 1187 "TextArea.caretForeground", black, 1188 "TextArea.caretBlinkRate", Integer.valueOf(500), 1189 "TextArea.inactiveForeground", table.get("textInactiveText"), 1190 "TextArea.selectionBackground", table.get("textHighlight"), 1191 "TextArea.selectionForeground", table.get("textHighlightText"), 1192 "TextArea.background", table.get("window"), 1193 "TextArea.foreground", table.get("textText"), 1194 "TextArea.font", monospacedPlain12, 1195 "TextArea.border", marginBorder, 1196 "TextArea.focusInputMap", multilineInputMap, 1197 1198 "TextPane.caretForeground", black, 1199 "TextPane.caretBlinkRate", Integer.valueOf(500), 1200 "TextPane.inactiveForeground", table.get("textInactiveText"), 1201 "TextPane.selectionBackground", lightGray, 1202 "TextPane.selectionForeground", table.get("textHighlightText"), 1203 "TextPane.background", white, 1204 "TextPane.foreground", table.get("textText"), 1205 "TextPane.font", serifPlain12, 1206 "TextPane.border", marginBorder, 1207 "TextPane.focusInputMap", multilineInputMap, 1208 1209 "EditorPane.caretForeground", red, 1210 "EditorPane.caretBlinkRate", Integer.valueOf(500), 1211 "EditorPane.inactiveForeground", table.get("textInactiveText"), 1212 "EditorPane.selectionBackground", lightGray, 1213 "EditorPane.selectionForeground", table.get("textHighlightText"), 1214 "EditorPane.background", white, 1215 "EditorPane.foreground", table.get("textText"), 1216 "EditorPane.font", serifPlain12, 1217 "EditorPane.border", marginBorder, 1218 "EditorPane.focusInputMap", multilineInputMap, 1219 1220 1221 "FileChooser.ancestorInputMap", 1222 new UIDefaults.LazyInputMap(new Object[] { 1223 "ESCAPE", "cancelSelection" 1224 }), 1225 1226 1227 "ToolTip.border", raisedBevelBorder, 1228 "ToolTip.background", table.get("info"), 1229 "ToolTip.foreground", table.get("infoText"), 1230 1231 // These window InputMap bindings are used when the Menu is 1232 // selected. 1233 "PopupMenu.selectedWindowInputMapBindings", new Object[] { 1234 "ESCAPE", "cancel", 1235 "TAB", "cancel", 1236 "shift TAB", "cancel", 1237 "DOWN", "selectNext", 1238 "KP_DOWN", "selectNext", 1239 "UP", "selectPrevious", 1240 "KP_UP", "selectPrevious", 1241 "LEFT", "selectParent", 1242 "KP_LEFT", "selectParent", 1243 "RIGHT", "selectChild", 1244 "KP_RIGHT", "selectChild", 1245 "ENTER", "return", 1246 "SPACE", "return" 1247 }, 1248 1249 1250 "OptionPane.border", optionPaneBorder, 1251 "OptionPane.messageAreaBorder", optionPaneMessageAreaBorder, 1252 "OptionPane.buttonAreaBorder", optionPaneButtonAreaBorder, 1253 "OptionPane.errorIcon", SwingUtilities2.makeIcon(getClass(), 1254 MotifLookAndFeel.class, 1255 "icons/Error.gif"), 1256 "OptionPane.informationIcon", SwingUtilities2.makeIcon(getClass(), 1257 MotifLookAndFeel.class, 1258 "icons/Inform.gif"), 1259 "OptionPane.warningIcon", SwingUtilities2.makeIcon(getClass(), 1260 MotifLookAndFeel.class, 1261 "icons/Warn.gif"), 1262 "OptionPane.questionIcon", SwingUtilities2.makeIcon(getClass(), 1263 MotifLookAndFeel.class, 1264 "icons/Question.gif"), 1265 "OptionPane.windowBindings", new Object[] { 1266 "ESCAPE", "close" }, 1267 1268 // These bindings are only enabled when there is a default 1269 // button set on the rootpane. 1270 "RootPane.defaultButtonWindowKeyBindings", new Object[] { 1271 "ENTER", "press", 1272 "released ENTER", "release", 1273 "ctrl ENTER", "press", 1274 "ctrl released ENTER", "release" 1275 }, 1276 }; 1277 1278 table.putDefaults(defaults); 1279 } 1280 1281 }