1. /*
  2. * @(#)MotifLookAndFeel.java 1.132 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package com.sun.java.swing.plaf.motif;
  11. import java.awt.Toolkit;
  12. import java.awt.Color;
  13. import java.awt.Font;
  14. import java.awt.Insets;
  15. import java.awt.event.KeyEvent;
  16. import java.awt.event.InputEvent;
  17. import java.util.*;
  18. import java.lang.reflect.*;
  19. import javax.swing.*;
  20. import javax.swing.plaf.*;
  21. import javax.swing.border.*;
  22. import javax.swing.text.JTextComponent;
  23. import javax.swing.text.DefaultEditorKit;
  24. import javax.swing.plaf.basic.BasicLookAndFeel;
  25. import javax.swing.plaf.basic.BasicBorders;
  26. import javax.swing.plaf.basic.BasicComboBoxRenderer;
  27. import javax.swing.plaf.basic.BasicComboBoxEditor;
  28. /**
  29. * Implements the Motif Look and Feel.
  30. * UI classes not implemented specifically for Motif will
  31. * default to those implemented in Basic.
  32. * <p>
  33. * For the keyboard keys defined for each component in this Look and
  34. * Feel (L&F), see
  35. * <a href="../../../../../../javax/swing/doc-files/Key-Motif.html">Component Keystroke Actions for the Motif L&F</a>.
  36. * <p>
  37. * <strong>Warning:</strong>
  38. * Serialized objects of this class will not be compatible with
  39. * future Swing releases. The current serialization support is appropriate
  40. * for short term storage or RMI between applications running the same
  41. * version of Swing. A future release of Swing will provide support for
  42. * long term persistence.
  43. *
  44. * @version 1.132 02/02/00
  45. * @author unattributed
  46. */
  47. public class MotifLookAndFeel extends BasicLookAndFeel
  48. {
  49. public String getName() {
  50. return "CDE/Motif";
  51. }
  52. public String getID() {
  53. return "Motif";
  54. }
  55. public String getDescription() {
  56. return "The CDE/Motif Look and Feel";
  57. }
  58. public boolean isNativeLookAndFeel() {
  59. String osName = System.getProperty("os.name");
  60. return (osName != null) && (osName.indexOf("Solaris") != -1);
  61. }
  62. public boolean isSupportedLookAndFeel() {
  63. return true;
  64. }
  65. /**
  66. * Load the SystemColors into the defaults table. The keys
  67. * for SystemColor defaults are the same as the names of
  68. * the public fields in SystemColor. If the table is being
  69. * created on a native Motif platform we use the SystemColor
  70. * values, otherwise we create color objects whose values match
  71. * the default CDE/Motif colors.
  72. */
  73. protected void initSystemColorDefaults(UIDefaults table)
  74. {
  75. String[] defaultSystemColors = {
  76. "desktop", "#005C5C", /* Color of the desktop background */
  77. "activeCaption", "#000080", /* Color for captions (title bars) when they are active. */
  78. "activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */
  79. "activeCaptionBorder", "#B24D7A", /* Border color for caption (title bar) window borders. */
  80. "inactiveCaption", "#AEB2C3", /* Color for captions (title bars) when not active. */
  81. "inactiveCaptionText", "#000000", /* Text color for text in inactive captions (title bars). */
  82. "inactiveCaptionBorder", "#AEB2C3", /* Border color for inactive caption (title bar) window borders. */
  83. "window", "#AEB2C3", /* Default color for the interior of windows */
  84. "windowBorder", "#AEB2C3", /* ??? */
  85. "windowText", "#000000", /* ??? */
  86. "menu", "#AEB2C3", /* ??? */
  87. "menuText", "#000000", /* ??? */
  88. "text", "#FFF7E9", /* Text background color */
  89. "textText", "#000000", /* Text foreground color */
  90. "textHighlight", "#000000", /* Text background color when selected */
  91. "textHighlightText", "#FFF7E9", /* Text color when selected */
  92. "textInactiveText", "#808080", /* Text color when disabled */
  93. "control", "#AEB2C3", /* Default color for controls (buttons, sliders, etc) */
  94. "controlText", "#000000", /* Default color for text in controls */
  95. "controlHighlight", "#DCDEE5", /* Highlight color for controls */
  96. "controlLtHighlight", "#DCDEE5", /* Light highlight color for controls */
  97. "controlShadow", "#63656F", /* Shadow color for controls */
  98. "controlLightShadow", "#9397A5", /* Shadow color for controls */
  99. "controlDkShadow", "#000000", /* Dark shadow color for controls */
  100. "scrollbar", "#AEB2C3", /* Scrollbar ??? color. PENDING(jeff) foreground? background? ?*/
  101. "info", "#FFF7E9", /* ??? */
  102. "infoText", "#000000" /* ??? */
  103. };
  104. // AWT SystemColors only for for CDE on JDK1.2
  105. loadSystemColors(table, defaultSystemColors, false/*is1dot2*/);
  106. }
  107. protected void initClassDefaults(UIDefaults table)
  108. {
  109. super.initClassDefaults(table);
  110. String motifPackageName = "com.sun.java.swing.plaf.motif.";
  111. Object[] uiDefaults = {
  112. "ButtonUI", motifPackageName + "MotifButtonUI",
  113. "CheckBoxUI", motifPackageName + "MotifCheckBoxUI",
  114. "DirectoryPaneUI", motifPackageName + "MotifDirectoryPaneUI",
  115. "FileChooserUI", motifPackageName + "MotifFileChooserUI",
  116. "LabelUI", motifPackageName + "MotifLabelUI",
  117. "MenuBarUI", motifPackageName + "MotifMenuBarUI",
  118. "MenuUI", motifPackageName + "MotifMenuUI",
  119. "MenuItemUI", motifPackageName + "MotifMenuItemUI",
  120. "CheckBoxMenuItemUI", motifPackageName + "MotifCheckBoxMenuItemUI",
  121. "RadioButtonMenuItemUI", motifPackageName + "MotifRadioButtonMenuItemUI",
  122. "RadioButtonUI", motifPackageName + "MotifRadioButtonUI",
  123. "ToggleButtonUI", motifPackageName + "MotifToggleButtonUI",
  124. "PopupMenuUI", motifPackageName + "MotifPopupMenuUI",
  125. "ProgressBarUI", motifPackageName + "MotifProgressBarUI",
  126. "ScrollBarUI", motifPackageName + "MotifScrollBarUI",
  127. "ScrollPaneUI", motifPackageName + "MotifScrollPaneUI",
  128. "SliderUI", motifPackageName + "MotifSliderUI",
  129. "SplitPaneUI", motifPackageName + "MotifSplitPaneUI",
  130. "TabbedPaneUI", motifPackageName + "MotifTabbedPaneUI",
  131. "TextAreaUI", motifPackageName + "MotifTextAreaUI",
  132. "TextFieldUI", motifPackageName + "MotifTextFieldUI",
  133. "PasswordFieldUI", motifPackageName + "MotifPasswordFieldUI",
  134. "TextPaneUI", motifPackageName + "MotifTextPaneUI",
  135. "EditorPaneUI", motifPackageName + "MotifEditorPaneUI",
  136. "TreeUI", motifPackageName + "MotifTreeUI",
  137. "InternalFrameUI", motifPackageName + "MotifInternalFrameUI",
  138. "DesktopPaneUI", motifPackageName + "MotifDesktopPaneUI",
  139. "SeparatorUI", motifPackageName + "MotifSeparatorUI",
  140. "PopupMenuSeparatorUI", motifPackageName + "MotifPopupMenuSeparatorUI",
  141. "OptionPaneUI", motifPackageName + "MotifOptionPaneUI",
  142. "ComboBoxUI", motifPackageName + "MotifComboBoxUI",
  143. "DesktopIconUI", motifPackageName + "MotifDesktopIconUI"
  144. };
  145. table.putDefaults(uiDefaults);
  146. }
  147. private void loadResourceBundle(UIDefaults table) {
  148. ResourceBundle bundle = ResourceBundle.getBundle("com.sun.java.swing.plaf.motif.resources.motif");
  149. Enumeration iter = bundle.getKeys();
  150. while(iter.hasMoreElements()) {
  151. String key = (String)iter.nextElement();
  152. //System.out.println("key :" +key+ " value: " + bundle.getObject(key));
  153. table.put( key, bundle.getObject(key) );
  154. }
  155. }
  156. protected void initComponentDefaults(UIDefaults table)
  157. {
  158. super.initComponentDefaults(table);
  159. loadResourceBundle(table);
  160. FontUIResource dialogPlain12 = new FontUIResource("Dialog",
  161. Font.PLAIN, 12);
  162. FontUIResource serifPlain12 = new FontUIResource("Serif",
  163. Font.PLAIN, 12);
  164. FontUIResource sansSerifPlain12 = new FontUIResource("SansSerif",
  165. Font.PLAIN, 12);
  166. FontUIResource monospacedPlain12 = new FontUIResource("Monospaced",
  167. Font.PLAIN, 12);
  168. ColorUIResource red = new ColorUIResource(Color.red);
  169. ColorUIResource black = new ColorUIResource(Color.black);
  170. ColorUIResource white = new ColorUIResource(Color.white);
  171. ColorUIResource lightGray = new ColorUIResource(Color.lightGray);
  172. ColorUIResource controlDarker = new ColorUIResource(147, 151, 165); // slate blue
  173. ColorUIResource scrollBarTrack = controlDarker;
  174. ColorUIResource menuItemPressedBackground = new ColorUIResource(165,165,165);
  175. ColorUIResource menuItemPressedForeground = new ColorUIResource(0,0,0);
  176. Border loweredBevelBorder = new MotifBorders.BevelBorder(false,
  177. table.getColor("controlShadow"),
  178. table.getColor("controlLtHighlight"));
  179. Border raisedBevelBorder = new MotifBorders.BevelBorder(true, table.getColor("controlShadow"),
  180. table.getColor("controlLtHighlight"));
  181. Border marginBorder = new BasicBorders.MarginBorder();
  182. Border focusBorder = new MotifBorders.FocusBorder(
  183. table.getColor("control"),
  184. table.getColor("activeCaptionBorder"));
  185. Border focusBevelBorder = new BorderUIResource.CompoundBorderUIResource(
  186. focusBorder,
  187. loweredBevelBorder);
  188. Border comboBoxBorder = new BorderUIResource.CompoundBorderUIResource(
  189. focusBorder,
  190. raisedBevelBorder);
  191. Border buttonBorder = new BorderUIResource.CompoundBorderUIResource(
  192. new MotifBorders.ButtonBorder(
  193. table.getColor("controlShadow"),
  194. table.getColor("controlHighlight"),
  195. table.getColor("controlDkShadow"),
  196. table.getColor("activeCaptionBorder")),
  197. marginBorder);
  198. Border toggleButtonBorder = new BorderUIResource.CompoundBorderUIResource(
  199. new MotifBorders.ToggleButtonBorder(
  200. table.getColor("controlShadow"),
  201. table.getColor("controlHighlight"),
  202. table.getColor("controlDkShadow"),
  203. table.getColor("activeCaptionBorder")), marginBorder);
  204. Border textFieldBorder = new BorderUIResource.CompoundBorderUIResource(
  205. focusBevelBorder,
  206. marginBorder);
  207. Border popupMenuBorder = new BorderUIResource.CompoundBorderUIResource(
  208. raisedBevelBorder,
  209. new MotifBorders.MotifPopupMenuBorder(
  210. table.getFont("PopupMenu.font"),
  211. table.getColor("PopupMenu.background"),
  212. table.getColor("PopupMenu.foreground"),
  213. table.getColor("controlShadow"),
  214. table.getColor("controlLtHighlight")
  215. ));
  216. Object menuItemCheckIcon = new UIDefaults.LazyValue() {
  217. public Object createValue(UIDefaults table) {
  218. return MotifIconFactory.getMenuItemCheckIcon();
  219. }
  220. };
  221. Object menuItemArrowIcon = new UIDefaults.LazyValue() {
  222. public Object createValue(UIDefaults table) {
  223. return MotifIconFactory.getMenuItemArrowIcon();
  224. }
  225. };
  226. Object menuArrowIcon = new UIDefaults.LazyValue() {
  227. public Object createValue(UIDefaults table) {
  228. return MotifIconFactory.getMenuArrowIcon();
  229. }
  230. };
  231. Object checkBoxIcon = new UIDefaults.LazyValue() {
  232. public Object createValue(UIDefaults table) {
  233. return MotifIconFactory.getCheckBoxIcon();
  234. }
  235. };
  236. Object radioButtonIcon = new UIDefaults.LazyValue() {
  237. public Object createValue(UIDefaults table) {
  238. return MotifIconFactory.getRadioButtonIcon();
  239. }
  240. };
  241. Object unselectedTabBackground = new UIDefaults.LazyValue() {
  242. public Object createValue(UIDefaults table) {
  243. Color c = (Color)table.getColor("control");
  244. return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
  245. Math.max((int)(c.getGreen()*.85),0),
  246. Math.max((int)(c.getBlue()*.85),0));
  247. }
  248. };
  249. Object unselectedTabForeground = new UIDefaults.LazyValue() {
  250. public Object createValue(UIDefaults table) {
  251. Color c = (Color)table.getColor("controlText");
  252. return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
  253. Math.max((int)(c.getGreen()*.85),0),
  254. Math.max((int)(c.getBlue()*.85),0));
  255. }
  256. };
  257. Object unselectedTabShadow = new UIDefaults.LazyValue() {
  258. public Object createValue(UIDefaults table) {
  259. Color c = (Color)table.getColor("control");
  260. Color base = new Color(Math.max((int)(c.getRed()*.85),0),
  261. Math.max((int)(c.getGreen()*.85),0),
  262. Math.max((int)(c.getBlue()*.85),0));
  263. return new ColorUIResource(base.darker());
  264. }
  265. };
  266. Object unselectedTabHighlight = new UIDefaults.LazyValue() {
  267. public Object createValue(UIDefaults table) {
  268. Color c = (Color)table.getColor("control");
  269. Color base = new Color(Math.max((int)(c.getRed()*.85),0),
  270. Math.max((int)(c.getGreen()*.85),0),
  271. Math.max((int)(c.getBlue()*.85),0));
  272. return new ColorUIResource(base.brighter());
  273. }
  274. };
  275. // *** Text
  276. Object fieldInputMap = new UIDefaults.LazyInputMap(new Object[] {
  277. "COPY", DefaultEditorKit.copyAction,
  278. "PASTE", DefaultEditorKit.pasteAction,
  279. "CUT", DefaultEditorKit.cutAction,
  280. "control INSERT", DefaultEditorKit.copyAction,
  281. "shift INSERT", DefaultEditorKit.pasteAction,
  282. "shift DELETE", DefaultEditorKit.cutAction,
  283. "control F", DefaultEditorKit.forwardAction,
  284. "control B", DefaultEditorKit.backwardAction,
  285. "control D", DefaultEditorKit.deleteNextCharAction,
  286. "typed \010", DefaultEditorKit.deletePrevCharAction,
  287. "DELETE", DefaultEditorKit.deleteNextCharAction,
  288. "RIGHT", DefaultEditorKit.forwardAction,
  289. "LEFT", DefaultEditorKit.backwardAction,
  290. "KP_RIGHT", DefaultEditorKit.forwardAction,
  291. "KP_LEFT", DefaultEditorKit.backwardAction,
  292. "shift LEFT", DefaultEditorKit.selectionBackwardAction,
  293. "shift RIGHT", DefaultEditorKit.selectionForwardAction,
  294. "control LEFT", DefaultEditorKit.previousWordAction,
  295. "control RIGHT", DefaultEditorKit.nextWordAction,
  296. "control shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
  297. "control shift RIGHT", DefaultEditorKit.selectionNextWordAction,
  298. "control SLASH", DefaultEditorKit.selectAllAction,
  299. "HOME", DefaultEditorKit.beginLineAction,
  300. "END", DefaultEditorKit.endLineAction,
  301. "shift HOME", DefaultEditorKit.selectionBeginLineAction,
  302. "shift END", DefaultEditorKit.selectionEndLineAction,
  303. "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
  304. "ENTER", JTextField.notifyAction
  305. });
  306. Object multilineInputMap = new UIDefaults.LazyInputMap(new Object[] {
  307. "COPY", DefaultEditorKit.copyAction,
  308. "PASTE", DefaultEditorKit.pasteAction,
  309. "CUT", DefaultEditorKit.cutAction,
  310. "control INSERT", DefaultEditorKit.copyAction,
  311. "shift INSERT", DefaultEditorKit.pasteAction,
  312. "shift DELETE", DefaultEditorKit.cutAction,
  313. "control F", DefaultEditorKit.forwardAction,
  314. "control B", DefaultEditorKit.backwardAction,
  315. "control D", DefaultEditorKit.deleteNextCharAction,
  316. "typed \010", DefaultEditorKit.deletePrevCharAction,
  317. "DELETE", DefaultEditorKit.deleteNextCharAction,
  318. "RIGHT", DefaultEditorKit.forwardAction,
  319. "LEFT", DefaultEditorKit.backwardAction,
  320. "KP_RIGHT", DefaultEditorKit.forwardAction,
  321. "KP_LEFT", DefaultEditorKit.backwardAction,
  322. "shift LEFT", DefaultEditorKit.selectionBackwardAction,
  323. "shift RIGHT", DefaultEditorKit.selectionForwardAction,
  324. "control LEFT", DefaultEditorKit.previousWordAction,
  325. "control RIGHT", DefaultEditorKit.nextWordAction,
  326. "control shift LEFT", DefaultEditorKit.selectionPreviousWordAction,
  327. "control shift RIGHT", DefaultEditorKit.selectionNextWordAction,
  328. "control SLASH", DefaultEditorKit.selectAllAction,
  329. "HOME", DefaultEditorKit.beginLineAction,
  330. "END", DefaultEditorKit.endLineAction,
  331. "shift HOME", DefaultEditorKit.selectionBeginLineAction,
  332. "shift END", DefaultEditorKit.selectionEndLineAction,
  333. "control N", DefaultEditorKit.downAction,
  334. "control P", DefaultEditorKit.upAction,
  335. "UP", DefaultEditorKit.upAction,
  336. "DOWN", DefaultEditorKit.downAction,
  337. "PAGE_UP", DefaultEditorKit.pageUpAction,
  338. "PAGE_DOWN", DefaultEditorKit.pageDownAction,
  339. "shift PAGE_UP", "selection-page-up",
  340. "shift PAGE_DOWN", "selection-page-down",
  341. "ctrl shift PAGE_UP", "selection-page-left",
  342. "ctrl shift PAGE_DOWN", "selection-page-right",
  343. "shift UP", DefaultEditorKit.selectionUpAction,
  344. "shift DOWN", DefaultEditorKit.selectionDownAction,
  345. "ENTER", DefaultEditorKit.insertBreakAction,
  346. "TAB", DefaultEditorKit.insertTabAction,
  347. "control BACK_SLASH", "unselect"/*DefaultEditorKit.unselectAction*/,
  348. "control HOME", DefaultEditorKit.beginAction,
  349. "control END", DefaultEditorKit.endAction,
  350. "control shift HOME", DefaultEditorKit.selectionBeginAction,
  351. "control shift END", DefaultEditorKit.selectionEndAction,
  352. "control T", "next-link-action",
  353. "control shift T", "previous-link-action",
  354. "control SPACE", "activate-link-action"
  355. });
  356. // *** Tree
  357. Object treeOpenIcon = LookAndFeel.makeIcon(getClass(),
  358. "icons/TreeOpen.gif");
  359. Object treeClosedIcon = LookAndFeel.makeIcon(getClass(),
  360. "icons/TreeClosed.gif");
  361. Object treeLeafIcon = new UIDefaults.LazyValue() {
  362. public Object createValue(UIDefaults table) {
  363. return MotifTreeCellRenderer.loadLeafIcon();
  364. }
  365. };
  366. Object treeExpandedIcon = new UIDefaults.LazyValue() {
  367. public Object createValue(UIDefaults table) {
  368. return MotifTreeUI.MotifExpandedIcon.createExpandedIcon();
  369. }
  370. };
  371. Object treeCollapsedIcon = new UIDefaults.LazyValue() {
  372. public Object createValue(UIDefaults table) {
  373. return MotifTreeUI.MotifCollapsedIcon.createCollapsedIcon();
  374. }
  375. };
  376. Border menuBarBorder = new MotifBorders.MenuBarBorder(
  377. table.getColor("controlShadow"),
  378. table.getColor("controlHighlight"),
  379. table.getColor("controlDkShadow"),
  380. table.getColor("activeCaptionBorder"));
  381. Border menuMarginBorder = new BorderUIResource.CompoundBorderUIResource(
  382. loweredBevelBorder,
  383. marginBorder);
  384. Border focusCellHighlightBorder = new BorderUIResource.LineBorderUIResource(
  385. table.getColor("activeCaptionBorder"));
  386. Object sliderFocusInsets = new InsetsUIResource( 0, 0, 0, 0 );
  387. // ** for tabbedpane
  388. Object tabbedPaneTabInsets = new InsetsUIResource(3, 4, 3, 4);
  389. Object tabbedPaneTabPadInsets = new InsetsUIResource(3, 0, 1, 0);
  390. Object tabbedPaneTabAreaInsets = new InsetsUIResource(4, 2, 0, 8);
  391. Object tabbedPaneContentBorderInsets = new InsetsUIResource(2, 2, 2, 2);
  392. // ** for optionpane
  393. Object optionPaneBorder = new BorderUIResource.EmptyBorderUIResource(10,0,10,0);
  394. Object optionPaneButtonAreaBorder = new BorderUIResource.EmptyBorderUIResource(10,10,12,10);
  395. Object optionPaneMessageAreaBorder = new BorderUIResource.EmptyBorderUIResource(0,10,12,10);
  396. Object[] defaults = {
  397. "Desktop.background", table.get("desktop"),
  398. "Desktop.ancestorInputMap",
  399. new UIDefaults.LazyInputMap(new Object[] {
  400. "ctrl F5", "restore",
  401. "ctrl F4", "close",
  402. "ctrl F7", "move",
  403. "ctrl F8", "resize",
  404. "RIGHT", "right",
  405. "KP_RIGHT", "right",
  406. "LEFT", "left",
  407. "KP_LEFT", "left",
  408. "UP", "up",
  409. "KP_UP", "up",
  410. "DOWN", "down",
  411. "KP_DOWN", "down",
  412. "ESCAPE", "escape",
  413. "ctrl F9", "minimize",
  414. "ctrl F10", "maximize",
  415. "ctrl F6", "selectNextFrame",
  416. "ctrl TAB", "selectNextFrame",
  417. "ctrl alt F6", "selectNextFrame",
  418. "shift ctrl alt F6", "selectPreviousFrame"
  419. }),
  420. "Panel.background", table.get("control"),
  421. "Panel.foreground", table.get("textText"),
  422. "Panel.font", dialogPlain12,
  423. "ProgressBar.font", dialogPlain12,
  424. "ProgressBar.foreground", controlDarker,
  425. "ProgressBar.background", table.get("control"),
  426. "ProgressBar.selectionForeground", table.get("control"),
  427. "ProgressBar.selectionBackground", table.get("controlText"),
  428. "ProgressBar.border", loweredBevelBorder,
  429. "ProgressBar.cellLength", new Integer(6),
  430. "ProgressBar.cellSpacing", new Integer(0),
  431. // Buttons
  432. "Button.margin", new InsetsUIResource(2, 4, 2, 4),
  433. "Button.border", buttonBorder,
  434. "Button.background", table.get("control"),
  435. "Button.foreground", table.get("controlText"),
  436. "Button.select", table.get("controlLightShadow"),
  437. "Button.font", dialogPlain12,
  438. "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
  439. "SPACE", "pressed",
  440. "released SPACE", "released"
  441. }),
  442. "CheckBox.textIconGap", new Integer(8),
  443. "CheckBox.margin", new InsetsUIResource(2, 2, 6, 2),
  444. "CheckBox.icon", checkBoxIcon,
  445. "CheckBox.focus", table.get("activeCaptionBorder"),
  446. "CheckBox.focusInputMap",
  447. new UIDefaults.LazyInputMap(new Object[] {
  448. "SPACE", "pressed",
  449. "released SPACE", "released"
  450. }),
  451. "RadioButton.margin", new InsetsUIResource(2, 2, 6, 2),
  452. "RadioButton.textIconGap", new Integer(8),
  453. "RadioButton.background", table.get("control"),
  454. "RadioButton.foreground", table.get("controlText"),
  455. "RadioButton.icon", radioButtonIcon,
  456. "RadioButton.focus", table.get("activeCaptionBorder"),
  457. "RadioButton.icon", radioButtonIcon,
  458. "RadioButton.focusInputMap",
  459. new UIDefaults.LazyInputMap(new Object[] {
  460. "SPACE", "pressed",
  461. "released SPACE", "released"
  462. }),
  463. "ToggleButton.border", toggleButtonBorder,
  464. "ToggleButton.background", table.get("control"),
  465. "ToggleButton.foreground", table.get("controlText"),
  466. "ToggleButton.focus", table.get("controlText"),
  467. "ToggleButton.select", table.get("controlLightShadow"),
  468. "ToggleButton.focusInputMap",
  469. new UIDefaults.LazyInputMap(new Object[] {
  470. "SPACE", "pressed",
  471. "released SPACE", "released"
  472. }),
  473. // Menus
  474. "Menu.border", menuMarginBorder,
  475. "Menu.font", dialogPlain12,
  476. "Menu.acceleratorFont", dialogPlain12,
  477. "Menu.foreground", table.get("menuText"),
  478. "Menu.background", table.get("menu"),
  479. "Menu.selectionForeground", menuItemPressedForeground,
  480. "Menu.selectionBackground", menuItemPressedBackground,
  481. "Menu.checkIcon", menuItemCheckIcon,
  482. "Menu.arrowIcon", menuArrowIcon,
  483. // These window InputMap bindings are used when the Menu is
  484. // selected.
  485. "Menu.selectedWindowInputMapBindings", new Object[] {
  486. "ESCAPE", "cancel",
  487. "DOWN", "selectNext",
  488. "KP_DOWN", "selectNext",
  489. "UP", "selectPrevious",
  490. "KP_UP", "selectPrevious",
  491. "LEFT", "selectParent",
  492. "KP_LEFT", "selectParent",
  493. "RIGHT", "selectChild",
  494. "KP_RIGHT", "selectChild",
  495. "ENTER", "return",
  496. "SPACE", "return"
  497. },
  498. "MenuBar.border", menuBarBorder,
  499. "MenuBar.background", table.get("menu"),
  500. "MenuBar.foreground", table.get("menuText"),
  501. "MenuBar.font", dialogPlain12,
  502. "MenuBar.windowBindings", new Object[] {
  503. "F10", "takeFocus" },
  504. "MenuItem.border", menuMarginBorder,
  505. "MenuItem.font", dialogPlain12,
  506. "MenuItem.acceleratorFont", dialogPlain12,
  507. "MenuItem.foreground", table.get("menuText"),
  508. "MenuItem.background", table.get("menu"),
  509. "MenuItem.selectionForeground", menuItemPressedForeground,
  510. "MenuItem.selectionBackground", menuItemPressedBackground,
  511. "MenuItem.checkIcon", menuItemCheckIcon,
  512. "MenuItem.arrowIcon", menuItemArrowIcon,
  513. "RadioButtonMenuItem.border", menuMarginBorder,
  514. "RadioButtonMenuItem.font", dialogPlain12,
  515. "RadioButtonMenuItem.acceleratorFont", dialogPlain12,
  516. "RadioButtonMenuItem.foreground", table.get("menuText"),
  517. "RadioButtonMenuItem.background", table.get("menu"),
  518. "RadioButtonMenuItem.selectionForeground", menuItemPressedForeground,
  519. "RadioButtonMenuItem.selectionBackground", menuItemPressedBackground,
  520. "RadioButtonMenuItem.checkIcon", radioButtonIcon,
  521. "RadioButtonMenuItem.arrowIcon", menuItemArrowIcon,
  522. "CheckBoxMenuItem.border", menuMarginBorder,
  523. "CheckBoxMenuItem.font", dialogPlain12,
  524. "CheckBoxMenuItem.acceleratorFont", dialogPlain12,
  525. "CheckBoxMenuItem.foreground", table.get("menuText"),
  526. "CheckBoxMenuItem.background", table.get("menu"),
  527. "CheckBoxMenuItem.selectionForeground", menuItemPressedForeground,
  528. "CheckBoxMenuItem.selectionBackground", menuItemPressedBackground,
  529. "CheckBoxMenuItem.checkIcon", checkBoxIcon,
  530. "CheckBoxMenuItem.arrowIcon", menuItemArrowIcon,
  531. "PopupMenu.background", table.get("menu"),
  532. "PopupMenu.border", popupMenuBorder,
  533. "PopupMenu.foreground", table.get("menuText"),
  534. "PopupMenu.font", dialogPlain12,
  535. "Label.font", dialogPlain12,
  536. "Label.background", table.get("control"),
  537. "Label.foreground", table.get("controlText"),
  538. "Separator.shadow", table.get("controlShadow"), // DEPRECATED - DO NOT USE!
  539. "Separator.highlight", table.get("controlLtHighlight"), // DEPRECATED - DO NOT USE!
  540. "Separator.background", table.get("controlLtHighlight"),
  541. "Separator.foreground", table.get("controlShadow"),
  542. "List.focusCellHighlightBorder", focusCellHighlightBorder,
  543. "List.focusInputMap",
  544. new UIDefaults.LazyInputMap(new Object[] {
  545. "UP", "selectPreviousRow",
  546. "KP_UP", "selectPreviousRow",
  547. "shift UP", "selectPreviousRowExtendSelection",
  548. "shift KP_UP", "selectPreviousRowExtendSelection",
  549. "DOWN", "selectNextRow",
  550. "KP_DOWN", "selectNextRow",
  551. "shift DOWN", "selectNextRowExtendSelection",
  552. "shift KP_DOWN", "selectNextRowExtendSelection",
  553. "ctrl SPACE", "selectNextRowExtendSelection",
  554. "HOME", "selectFirstRow",
  555. "shift HOME", "selectFirstRowExtendSelection",
  556. "END", "selectLastRow",
  557. "shift END", "selectLastRowExtendSelection",
  558. "PAGE_UP", "scrollUp",
  559. "shift PAGE_UP", "scrollUpExtendSelection",
  560. "PAGE_DOWN", "scrollDown",
  561. "shift PAGE_DOWN", "scrollDownExtendSelection",
  562. "ctrl A", "selectAll",
  563. "ctrl SLASH", "selectAll",
  564. "ctrl BACK_SLASH", "clearSelection"
  565. }),
  566. "DesktopIcon.icon", LookAndFeel.makeIcon(getClass(),
  567. "icons/DesktopIcon.gif"),
  568. "DesktopIcon.border", null,
  569. // These are a little odd, MotifInternalFrameUI isntalls em!
  570. "DesktopIcon.windowBindings", new Object[]
  571. { "ESCAPE", "hideSystemMenu" },
  572. "InternalFrame.windowBindings", new Object[] {
  573. "shift ESCAPE", "showSystemMenu",
  574. "ctrl SPACE", "showSystemMenu",
  575. "ESCAPE", "hideSystemMenu"
  576. },
  577. "ScrollBar.background", scrollBarTrack,
  578. "ScrollBar.foreground", table.get("control"),
  579. "ScrollBar.track", scrollBarTrack,
  580. "ScrollBar.trackHighlight", table.get("controlDkShadow"),
  581. "ScrollBar.thumb", table.get("control"),
  582. "ScrollBar.thumbHighlight", table.get("controlHighlight"),
  583. "ScrollBar.thumbDarkShadow", table.get("controlDkShadow"),
  584. "ScrollBar.thumbLightShadow", table.get("controlShadow"),
  585. "ScrollBar.border", loweredBevelBorder,
  586. "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE,
  587. "ScrollBar.focusInputMap",
  588. new UIDefaults.LazyInputMap(new Object[] {
  589. "RIGHT", "negativeUnitIncrement",
  590. "KP_RIGHT", "negativeUnitIncrement",
  591. "DOWN", "positiveUnitIncrement",
  592. "KP_DOWN", "positiveUnitIncrement",
  593. "PAGE_DOWN", "positiveBlockIncrement",
  594. "ctrl PAGE_DOWN", "positiveBlockIncrement",
  595. "LEFT", "positiveUnitIncrement",
  596. "KP_LEFT", "positiveUnitIncrement",
  597. "UP", "negativeUnitIncrement",
  598. "KP_UP", "negativeUnitIncrement",
  599. "PAGE_UP", "negativeBlockIncrement",
  600. "ctrl PAGE_UP", "negativeBlockIncrement",
  601. "HOME", "minScroll",
  602. "END", "maxScroll"
  603. }),
  604. "ScrollPane.font", dialogPlain12,
  605. "ScrollPane.background", table.get("control"),
  606. "ScrollPane.foreground", table.get("controlText"),
  607. "ScrollPane.border", null,
  608. "ScrollPane.viewportBorder", loweredBevelBorder,
  609. "ScrollPane.ancestorInputMap",
  610. new UIDefaults.LazyInputMap(new Object[] {
  611. "RIGHT", "unitScrollRight",
  612. "KP_RIGHT", "unitScrollRight",
  613. "DOWN", "unitScrollDown",
  614. "KP_DOWN", "unitScrollDown",
  615. "LEFT", "unitScrollLeft",
  616. "KP_LEFT", "unitScrollLeft",
  617. "UP", "unitScrollUp",
  618. "KP_UP", "unitScrollUp",
  619. "PAGE_UP", "scrollUp",
  620. "PAGE_DOWN", "scrollDown",
  621. "ctrl PAGE_UP", "scrollLeft",
  622. "ctrl PAGE_DOWN", "scrollRight",
  623. "ctrl HOME", "scrollHome",
  624. "ctrl END", "scrollEnd"
  625. }),
  626. "Slider.border", focusBevelBorder,
  627. "Slider.foreground", table.get("control"),
  628. "Slider.background", controlDarker,
  629. "Slider.highlight", table.get("controlHighlight"),
  630. "Slider.shadow", table.get("controlShadow"),
  631. "Slider.focus", table.get("controlDkShadow"),
  632. "Slider.focusInsets", sliderFocusInsets,
  633. "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
  634. "RIGHT", "positiveUnitIncrement",
  635. "KP_RIGHT", "positiveUnitIncrement",
  636. "DOWN", "negativeUnitIncrement",
  637. "KP_DOWN", "negativeUnitIncrement",
  638. "ctrl PAGE_DOWN", "negativeBlockIncrement",
  639. "LEFT", "negativeUnitIncrement",
  640. "KP_LEFT", "negativeUnitIncrement",
  641. "UP", "positiveUnitIncrement",
  642. "KP_UP", "positiveUnitIncrement",
  643. "ctrl PAGE_UP", "positiveBlockIncrement",
  644. "HOME", "minScroll",
  645. "END", "maxScroll"
  646. }),
  647. "SplitPane.background", table.get("control"),
  648. "SplitPane.highlight", table.get("controlHighlight"),
  649. "SplitPane.shadow", table.get("controlShadow"),
  650. "SplitPane.dividerSize", new Integer(20),
  651. "SplitPane.activeThumb", table.get("activeCaptionBorder"),
  652. "SplitPane.ancestorInputMap",
  653. new UIDefaults.LazyInputMap(new Object[] {
  654. "UP", "negativeIncrement",
  655. "DOWN", "positiveIncrement",
  656. "LEFT", "negativeIncrement",
  657. "RIGHT", "positiveIncrement",
  658. "KP_UP", "negativeIncrement",
  659. "KP_DOWN", "positiveIncrement",
  660. "KP_LEFT", "negativeIncrement",
  661. "KP_RIGHT", "positiveIncrement",
  662. "HOME", "selectMin",
  663. "END", "selectMax",
  664. "F8", "startResize",
  665. "F6", "toggleFocus"
  666. }),
  667. "TabbedPane.font", dialogPlain12,
  668. "TabbedPane.background", table.get("control"),
  669. "TabbedPane.foreground", table.get("controlText"),
  670. "TabbedPane.highlight", table.get("controlHighlight"),
  671. "TabbedPane.lightHighlight", table.get("controlLtHighlight"),
  672. "TabbedPane.shadow", table.get("controlShadow"),
  673. "TabbedPane.darkShadow", table.get("controlShadow"),
  674. "TabbedPane.unselectedTabBackground", unselectedTabBackground,
  675. "TabbedPane.unselectedTabForeground", unselectedTabForeground,
  676. "TabbedPane.unselectedTabHighlight", unselectedTabHighlight,
  677. "TabbedPane.unselectedTabShadow", unselectedTabShadow,
  678. "TabbedPane.focus", table.get("activeCaptionBorder"),
  679. "TabbedPane.tabInsets", tabbedPaneTabInsets,
  680. "TabbedPane.selectedTabPadInsets", tabbedPaneTabPadInsets,
  681. "TabbedPane.tabAreaInsets", tabbedPaneTabAreaInsets,
  682. "TabbedPane.contentBorderInsets", tabbedPaneContentBorderInsets,
  683. "TabbedPane.focusInputMap",
  684. new UIDefaults.LazyInputMap(new Object[] {
  685. "RIGHT", "navigateRight",
  686. "KP_RIGHT", "navigateRight",
  687. "LEFT", "navigateLeft",
  688. "KP_LEFT", "navigateLeft",
  689. "UP", "navigateUp",
  690. "KP_UP", "navigateUp",
  691. "DOWN", "navigateDown",
  692. "KP_DOWN", "navigateDown",
  693. "ctrl DOWN", "requestFocusForVisibleComponent",
  694. "ctrl KP_DOWN", "requestFocusForVisibleComponent",
  695. }),
  696. "TabbedPane.ancestorInputMap",
  697. new UIDefaults.LazyInputMap(new Object[] {
  698. "ctrl PAGE_DOWN", "navigatePageDown",
  699. "ctrl PAGE_UP", "navigatePageUp",
  700. "ctrl UP", "requestFocus",
  701. "ctrl KP_UP", "requestFocus",
  702. }),
  703. "Tree.background", controlDarker, // default: dark slate blue
  704. "Tree.hash", table.get("controlDkShadow"), // default: black
  705. "Tree.iconShadow", table.get("controlShadow"),
  706. "Tree.iconHighlight", table.get("controlHighlight"),
  707. "Tree.iconBackground", table.get("control"),
  708. "Tree.iconForeground", table.get("controlShadow"), // default: black
  709. "Tree.textBackground", controlDarker, // default: dark slate blue
  710. "Tree.textForeground", table.get("textText"), // default: black
  711. "Tree.selectionBackground", table.get("text"), // default: white
  712. "Tree.selectionForeground", table.get("textText"), // default: black
  713. "Tree.selectionBorderColor", table.get("activeCaptionBorder"), // default: maroon
  714. "Tree.openIcon", treeOpenIcon,
  715. "Tree.closedIcon", treeClosedIcon,
  716. "Tree.leafIcon", treeLeafIcon,
  717. "Tree.expandedIcon", treeExpandedIcon,
  718. "Tree.collapsedIcon", treeCollapsedIcon,
  719. "Tree.editorBorder", focusBorder,
  720. "Tree.editorBorderSelectionColor", table.get("activeCaptionBorder"),
  721. "Tree.rowHeight", new Integer(18),
  722. "Tree.drawsFocusBorderAroundIcon", Boolean.TRUE,
  723. "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
  724. "UP", "selectPreviousChangeLead",
  725. "KP_UP", "selectPreviousChangeLead",
  726. "shift UP", "selectPreviousExtendSelection",
  727. "shift KP_UP", "selectPreviousExtendSelection",
  728. "DOWN", "selectNextChangeLead",
  729. "KP_DOWN", "selectNextChangeLead",
  730. "shift DOWN", "selectNextExtendSelection",
  731. "shift KP_DOWN", "selectNextExtendSelection",
  732. "RIGHT", "selectChildChangeLead",
  733. "KP_RIGHT", "selectChildChangeLead",
  734. "LEFT", "selectParentChangeLead",
  735. "KP_LEFT", "selectParentChangeLead",
  736. "PAGE_UP", "scrollUpChangeLead",
  737. "shift PAGE_UP", "scrollUpExtendSelection",
  738. "PAGE_DOWN", "scrollDownChangeLead",
  739. "shift PAGE_DOWN", "scrollDownExtendSelection",
  740. "HOME", "selectFirstChangeLead",
  741. "shift HOME", "selectFirstExtendSelection",
  742. "END", "selectLastChangeLead",
  743. "shift END", "selectLastExtendSelection",
  744. "ENTER", "toggle",
  745. "F2", "startEditing",
  746. "ctrl A", "selectAll",
  747. "ctrl SLASH", "selectAll",
  748. "ctrl BACK_SLASH", "clearSelection",
  749. "ctrl SPACE", "selectItem",
  750. "shift SPACE", "extendSelection",
  751. "ctrl PAGE_DOWN", "scrollRightChangeLead",
  752. "ctrl PAGE_UP", "scrollLeftChangeLead",
  753. "ctrl shift PAGE_DOWN", "scrollRightExtendSelection",
  754. "ctrl shift PAGE_UP", "scrollLeftExtendSelection",
  755. "SPACE", "toggleSelection",
  756. }),
  757. "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
  758. "ESCAPE", "cancel" }),
  759. "Table.focusCellHighlightBorder", focusCellHighlightBorder,
  760. "Table.scrollPaneBorder", null,
  761. // "Table.background", white, // cell background color
  762. // "Table.focusCellBackground", white,
  763. "Table.ancestorInputMap",
  764. new UIDefaults.LazyInputMap(new Object[] {
  765. "RIGHT", "selectNextColumn",
  766. "KP_RIGHT", "selectNextColumn",
  767. "LEFT", "selectPreviousColumn",
  768. "KP_LEFT", "selectPreviousColumn",
  769. "DOWN", "selectNextRow",
  770. "KP_DOWN", "selectNextRow",
  771. "UP", "selectPreviousRow",
  772. "KP_UP", "selectPreviousRow",
  773. "shift RIGHT", "selectNextColumnExtendSelection",
  774. "shift KP_RIGHT", "selectNextColumnExtendSelection",
  775. "shift LEFT", "selectPreviousColumnExtendSelection",
  776. "shift KP_LEFT", "selectPreviousColumnExtendSelection",
  777. "shift DOWN", "selectNextRowExtendSelection",
  778. "shift KP_DOWN", "selectNextRowExtendSelection",
  779. "shift UP", "selectPreviousRowExtendSelection",
  780. "shift KP_UP", "selectPreviousRowExtendSelection",
  781. "PAGE_UP", "scrollUpChangeSelection",
  782. "PAGE_DOWN", "scrollDownChangeSelection",
  783. "HOME", "selectFirstColumn",
  784. "END", "selectLastColumn",
  785. "shift PAGE_UP", "scrollUpExtendSelection",
  786. "shift PAGE_DOWN", "scrollDownExtendSelection",
  787. "shift HOME", "selectFirstColumnExtendSelection",
  788. "shift END", "selectLastColumnExtendSelection",
  789. "ctrl PAGE_UP", "scrollLeftChangeSelection",
  790. "ctrl PAGE_DOWN", "scrollRightChangeSelection",
  791. "ctrl HOME", "selectFirstRow",
  792. "ctrl END", "selectLastRow",
  793. "ctrl shift PAGE_UP", "scrollRightExtendSelection",
  794. "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection",
  795. "ctrl shift HOME", "selectFirstRowExtendSelection",
  796. "ctrl shift END", "selectLastRowExtendSelection",
  797. "TAB", "selectNextColumnCell",
  798. "shift TAB", "selectPreviousColumnCell",
  799. "ENTER", "selectNextRowCell",
  800. "shift ENTER", "selectPreviousRowCell",
  801. "ctrl A", "selectAll",
  802. "ESCAPE", "cancel",
  803. "F2", "startEditing"
  804. }),
  805. // ToolBar.
  806. "ToolBar.ancestorInputMap",
  807. new UIDefaults.LazyInputMap(new Object[] {
  808. "UP", "navigateUp",
  809. "KP_UP", "navigateUp",
  810. "DOWN", "navigateDown",
  811. "KP_DOWN", "navigateDown",
  812. "LEFT", "navigateLeft",
  813. "KP_LEFT", "navigateLeft",
  814. "RIGHT", "navigateRight",
  815. "KP_RIGHT", "navigateRight"
  816. }),
  817. "ComboBox.control", table.get("control"),
  818. "ComboBox.controlForeground", black,
  819. "ComboBox.background", table.get("window"),
  820. "ComboBox.foreground", black,
  821. "ComboBox.border", comboBoxBorder,
  822. "ComboBox.selectionBackground", black,
  823. "ComboBox.selectionForeground", table.get("text"),
  824. "ComboBox.disabledBackground", table.get("control"),
  825. "ComboBox.disabledForeground", table.get("textInactiveText"),
  826. "ComboBox.font", dialogPlain12,
  827. "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] {
  828. "ESCAPE", "hidePopup",
  829. "PAGE_UP", "pageUpPassThrough",
  830. "PAGE_DOWN", "pageDownPassThrough",
  831. "HOME", "homePassThrough",
  832. "END", "endPassThrough",
  833. "DOWN", "selectNext",
  834. "KP_DOWN", "selectNext",
  835. "UP", "selectPrevious",
  836. "KP_UP", "selectPrevious"
  837. }),
  838. "TextField.caretForeground", black,
  839. "TextField.caretBlinkRate", new Integer(500),
  840. "TextField.inactiveForeground", table.get("textInactiveText"),
  841. "TextField.selectionBackground", table.get("textHighlight"),
  842. "TextField.selectionForeground", table.get("textHighlightText"),
  843. "TextField.background", table.get("window"),
  844. "TextField.foreground", table.get("textText"),
  845. "TextField.font", sansSerifPlain12,
  846. "TextField.border", textFieldBorder,
  847. "TextField.focusInputMap", fieldInputMap,
  848. "PasswordField.caretForeground", black,
  849. "PasswordField.caretBlinkRate", new Integer(500),
  850. "PasswordField.inactiveForeground", table.get("textInactiveText"),
  851. "PasswordField.selectionBackground", table.get("textHighlight"),
  852. "PasswordField.selectionForeground", table.get("textHighlightText"),
  853. "PasswordField.background", table.get("window"),
  854. "PasswordField.foreground", table.get("textText"),
  855. "PasswordField.font", monospacedPlain12,
  856. "PasswordField.border", textFieldBorder,
  857. "PasswordField.focusInputMap", fieldInputMap,
  858. "TextArea.caretForeground", black,
  859. "TextArea.caretBlinkRate", new Integer(500),
  860. "TextArea.inactiveForeground", table.get("textInactiveText"),
  861. "TextArea.selectionBackground", table.get("textHighlight"),
  862. "TextArea.selectionForeground", table.get("textHighlightText"),
  863. "TextArea.background", table.get("window"),
  864. "TextArea.foreground", table.get("textText"),
  865. "TextArea.font", monospacedPlain12,
  866. "TextArea.border", marginBorder,
  867. "TextArea.focusInputMap", multilineInputMap,
  868. "TextPane.caretForeground", black,
  869. "TextPane.caretBlinkRate", new Integer(500),
  870. "TextPane.inactiveForeground", table.get("textInactiveText"),
  871. "TextPane.selectionBackground", lightGray,
  872. "TextPane.selectionForeground", table.get("textHighlightText"),
  873. "TextPane.background", white,
  874. "TextPane.foreground", table.get("textText"),
  875. "TextPane.font", serifPlain12,
  876. "TextPane.border", marginBorder,
  877. "TextPane.focusInputMap", multilineInputMap,
  878. "EditorPane.caretForeground", red,
  879. "EditorPane.caretBlinkRate", new Integer(500),
  880. "EditorPane.inactiveForeground", table.get("textInactiveText"),
  881. "EditorPane.selectionBackground", lightGray,
  882. "EditorPane.selectionForeground", table.get("textHighlightText"),
  883. "EditorPane.background", white,
  884. "EditorPane.foreground", table.get("textText"),
  885. "EditorPane.font", serifPlain12,
  886. "EditorPane.border", marginBorder,
  887. "EditorPane.focusInputMap", multilineInputMap,
  888. "FileChooser.pathLabelMnemonic", new Integer(KeyEvent.VK_P), // 'p'
  889. "FileChooser.filterLabelMnemonic", new Integer (KeyEvent.VK_R), // 'r'
  890. "FileChooser.foldersLabelMnemonic", new Integer (KeyEvent.VK_O), // 'o'
  891. "FileChooser.filesLabelMnemonic", new Integer (KeyEvent.VK_I), // 'i'
  892. "FileChooser.enterFileNameLabelMnemonic", new Integer (KeyEvent.VK_N), // 'n'
  893. "FileChooser.ancestorInputMap",
  894. new UIDefaults.LazyInputMap(new Object[] {
  895. "ESCAPE", "cancelSelection"
  896. }),
  897. "ToolTip.border", raisedBevelBorder,
  898. "ToolTip.background", table.get("info"),
  899. "ToolTip.foreground", table.get("infoText"),
  900. "OptionPane.border", optionPaneBorder,
  901. "OptionPane.messageAreaBorder", optionPaneMessageAreaBorder,
  902. "OptionPane.buttonAreaBorder", optionPaneButtonAreaBorder,
  903. "OptionPane.errorIcon", LookAndFeel.makeIcon(getClass(),
  904. "icons/Error.gif"),
  905. "OptionPane.informationIcon", LookAndFeel.makeIcon(getClass(),
  906. "icons/Inform.gif"),
  907. "OptionPane.warningIcon", LookAndFeel.makeIcon(getClass(),
  908. "icons/Warn.gif"),
  909. "OptionPane.questionIcon", LookAndFeel.makeIcon(getClass(),
  910. "icons/Question.gif"),
  911. "OptionPane.windowBindings", new Object[] {
  912. "ESCAPE", "close" },
  913. // These bindings are only enabled when there is a default
  914. // button set on the rootpane.
  915. "RootPane.defaultButtonWindowKeyBindings", new Object[] {
  916. "ENTER", "press",
  917. "released ENTER", "release",
  918. "ctrl ENTER", "press",
  919. "ctrl released ENTER", "release"
  920. },
  921. };
  922. table.putDefaults(defaults);
  923. }
  924. /*
  925. * Returns whether this is being run on a JDK 1.2 or later VM.
  926. * This is a system-wide, rather than AppContext-wide, state.
  927. */
  928. /*package-private*/ static boolean is1dot2 = true;
  929. static {
  930. try {
  931. // Test if method introduced in 1.2 is available.
  932. Method m = Toolkit.class.getMethod("getMaximumCursorColors", null);
  933. is1dot2 = (m != null);
  934. } catch (NoSuchMethodException e) {
  935. is1dot2 = false;
  936. }
  937. }
  938. }