1. /*
  2. * @(#)BasicLookAndFeel.java 1.159 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 javax.swing.plaf.basic;
  11. import java.awt.Font;
  12. import java.awt.Color;
  13. import java.awt.SystemColor;
  14. import java.awt.event.KeyEvent;
  15. import java.awt.Insets;
  16. import java.net.URL;
  17. import java.io.Serializable;
  18. import java.awt.Dimension;
  19. import java.util.*;
  20. import java.lang.reflect.*;
  21. import javax.swing.LookAndFeel;
  22. import javax.swing.BorderFactory;
  23. import javax.swing.JComponent;
  24. import javax.swing.ImageIcon;
  25. import javax.swing.UIDefaults;
  26. import javax.swing.UIManager;
  27. import javax.swing.KeyStroke;
  28. import javax.swing.JTextField;
  29. import javax.swing.DefaultListCellRenderer;
  30. import javax.swing.border.*;
  31. import javax.swing.plaf.*;
  32. import javax.swing.text.JTextComponent;
  33. import javax.swing.text.DefaultEditorKit;
  34. /**
  35. * Implements the a standard base LookAndFeel class from which
  36. * standard desktop LookAndFeel classes (JLF, Mac, Windows, etc.)
  37. * can be derived. This class cannot be instantiated directly,
  38. * however the UI classes "Basic" defines can be.
  39. * <p>
  40. * <strong>Warning:</strong>
  41. * Serialized objects of this class will not be compatible with
  42. * future Swing releases. The current serialization support is appropriate
  43. * for short term storage or RMI between applications running the same
  44. * version of Swing. A future release of Swing will provide support for
  45. * long term persistence.
  46. *
  47. * @version 1.159 02/02/00
  48. * @author unattributed
  49. */
  50. public abstract class BasicLookAndFeel extends LookAndFeel implements Serializable
  51. {
  52. public UIDefaults getDefaults() {
  53. UIDefaults table = new UIDefaults();
  54. initClassDefaults(table);
  55. initSystemColorDefaults(table);
  56. initComponentDefaults(table);
  57. return table;
  58. }
  59. /**
  60. * Initialize the uiClassID to BasicComponentUI mapping.
  61. * The JComponent classes define their own uiClassID constants
  62. * (see AbstractComponent.getUIClassID). This table must
  63. * map those constants to a BasicComponentUI class of the
  64. * appropriate type.
  65. *
  66. * @see #getDefaults
  67. */
  68. protected void initClassDefaults(UIDefaults table)
  69. {
  70. String basicPackageName = "javax.swing.plaf.basic.";
  71. Object[] uiDefaults = {
  72. "ButtonUI", basicPackageName + "BasicButtonUI",
  73. "CheckBoxUI", basicPackageName + "BasicCheckBoxUI",
  74. "ColorChooserUI", basicPackageName + "BasicColorChooserUI",
  75. "MenuBarUI", basicPackageName + "BasicMenuBarUI",
  76. "MenuUI", basicPackageName + "BasicMenuUI",
  77. "MenuItemUI", basicPackageName + "BasicMenuItemUI",
  78. "CheckBoxMenuItemUI", basicPackageName + "BasicCheckBoxMenuItemUI",
  79. "RadioButtonMenuItemUI", basicPackageName + "BasicRadioButtonMenuItemUI",
  80. "RadioButtonUI", basicPackageName + "BasicRadioButtonUI",
  81. "ToggleButtonUI", basicPackageName + "BasicToggleButtonUI",
  82. "PopupMenuUI", basicPackageName + "BasicPopupMenuUI",
  83. "ProgressBarUI", basicPackageName + "BasicProgressBarUI",
  84. "ScrollBarUI", basicPackageName + "BasicScrollBarUI",
  85. "ScrollPaneUI", basicPackageName + "BasicScrollPaneUI",
  86. "SplitPaneUI", basicPackageName + "BasicSplitPaneUI",
  87. "SliderUI", basicPackageName + "BasicSliderUI",
  88. "SeparatorUI", basicPackageName + "BasicSeparatorUI",
  89. "ToolBarSeparatorUI", basicPackageName + "BasicToolBarSeparatorUI",
  90. "PopupMenuSeparatorUI", basicPackageName + "BasicPopupMenuSeparatorUI",
  91. "TabbedPaneUI", basicPackageName + "BasicTabbedPaneUI",
  92. "TextAreaUI", basicPackageName + "BasicTextAreaUI",
  93. "TextFieldUI", basicPackageName + "BasicTextFieldUI",
  94. "PasswordFieldUI", basicPackageName + "BasicPasswordFieldUI",
  95. "TextPaneUI", basicPackageName + "BasicTextPaneUI",
  96. "EditorPaneUI", basicPackageName + "BasicEditorPaneUI",
  97. "TreeUI", basicPackageName + "BasicTreeUI",
  98. "LabelUI", basicPackageName + "BasicLabelUI",
  99. "ListUI", basicPackageName + "BasicListUI",
  100. "ToolBarUI", basicPackageName + "BasicToolBarUI",
  101. "ToolTipUI", basicPackageName + "BasicToolTipUI",
  102. "ComboBoxUI", basicPackageName + "BasicComboBoxUI",
  103. "TableUI", basicPackageName + "BasicTableUI",
  104. "TableHeaderUI", basicPackageName + "BasicTableHeaderUI",
  105. "InternalFrameUI", basicPackageName + "BasicInternalFrameUI",
  106. "StandardDialogUI", basicPackageName + "BasicStandardDialogUI",
  107. "DesktopPaneUI", basicPackageName + "BasicDesktopPaneUI",
  108. "DesktopIconUI", basicPackageName + "BasicDesktopIconUI",
  109. "OptionPaneUI", basicPackageName + "BasicOptionPaneUI",
  110. "PanelUI", basicPackageName + "BasicPanelUI",
  111. "ViewportUI", basicPackageName + "BasicViewportUI",
  112. "RootPaneUI", basicPackageName + "BasicRootPaneUI",
  113. };
  114. table.putDefaults(uiDefaults);
  115. }
  116. /**
  117. * Load the SystemColors into the defaults table. The keys
  118. * for SystemColor defaults are the same as the names of
  119. * the public fields in SystemColor. If the table is being
  120. * created on a native Windows platform we use the SystemColor
  121. * values, otherwise we create color objects whose values match
  122. * the defaults Windows95 colors.
  123. */
  124. protected void initSystemColorDefaults(UIDefaults table)
  125. {
  126. String[] defaultSystemColors = {
  127. "desktop", "#005C5C", /* Color of the desktop background */
  128. "activeCaption", "#000080", /* Color for captions (title bars) when they are active. */
  129. "activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */
  130. "activeCaptionBorder", "#C0C0C0", /* Border color for caption (title bar) window borders. */
  131. "inactiveCaption", "#808080", /* Color for captions (title bars) when not active. */
  132. "inactiveCaptionText", "#C0C0C0", /* Text color for text in inactive captions (title bars). */
  133. "inactiveCaptionBorder", "#C0C0C0", /* Border color for inactive caption (title bar) window borders. */
  134. "window", "#FFFFFF", /* Default color for the interior of windows */
  135. "windowBorder", "#000000", /* ??? */
  136. "windowText", "#000000", /* ??? */
  137. "menu", "#C0C0C0", /* Background color for menus */
  138. "menuText", "#000000", /* Text color for menus */
  139. "text", "#C0C0C0", /* Text background color */
  140. "textText", "#000000", /* Text foreground color */
  141. "textHighlight", "#000080", /* Text background color when selected */
  142. "textHighlightText", "#FFFFFF", /* Text color when selected */
  143. "textInactiveText", "#808080", /* Text color when disabled */
  144. "control", "#C0C0C0", /* Default color for controls (buttons, sliders, etc) */
  145. "controlText", "#000000", /* Default color for text in controls */
  146. "controlHighlight", "#C0C0C0",
  147. /* "controlHighlight", "#E0E0E0",*/ /* Specular highlight (opposite of the shadow) */
  148. "controlLtHighlight", "#FFFFFF", /* Highlight color for controls */
  149. "controlShadow", "#808080", /* Shadow color for controls */
  150. "controlDkShadow", "#000000", /* Dark shadow color for controls */
  151. "scrollbar", "#E0E0E0", /* Scrollbar background (usually the "track") */
  152. "info", "#FFFFE1", /* ??? */
  153. "infoText", "#000000" /* ??? */
  154. };
  155. loadSystemColors(table, defaultSystemColors, isNativeLookAndFeel());
  156. }
  157. /**
  158. * If this is the native look and feel the initial values for the
  159. * system color properties are the same as the SystemColor constants.
  160. * If not we use the integer color values in the <code>systemColors</code>
  161. * argument.
  162. */
  163. protected void loadSystemColors(UIDefaults table, String[] systemColors, boolean useNative)
  164. {
  165. /* PENDING(hmuller) We don't load the system colors below because
  166. * they're not reliable. Hopefully we'll be able to do better in
  167. * a future version of AWT.
  168. */
  169. if (useNative) {
  170. for(int i = 0; i < systemColors.length; i += 2) {
  171. Color color = Color.black;
  172. try {
  173. String name = systemColors[i];
  174. color = (Color)(SystemColor.class.getField(name).get(null));
  175. } catch (Exception e) {
  176. }
  177. table.put(systemColors[i], new ColorUIResource(color));
  178. }
  179. } else {
  180. for(int i = 0; i < systemColors.length; i += 2) {
  181. Color color = Color.black;
  182. try {
  183. color = Color.decode(systemColors[i + 1]);
  184. }
  185. catch(NumberFormatException e) {
  186. e.printStackTrace();
  187. }
  188. table.put(systemColors[i], new ColorUIResource(color));
  189. }
  190. }
  191. }
  192. private void loadResourceBundle(UIDefaults table) {
  193. ResourceBundle bundle = ResourceBundle.getBundle("javax.swing.plaf.basic.resources.basic");
  194. Enumeration iter = bundle.getKeys();
  195. while(iter.hasMoreElements()) {
  196. String key = (String)iter.nextElement();
  197. //System.out.println("key :" +key+ " value: " + bundle.getObject(key));
  198. table.put( key, bundle.getObject(key) );
  199. }
  200. }
  201. protected void initComponentDefaults(UIDefaults table)
  202. {
  203. loadResourceBundle(table);
  204. // *** Shared Fonts
  205. Integer twelve = new Integer(12);
  206. Integer fontPlain = new Integer(Font.PLAIN);
  207. Integer fontBold = new Integer(Font.BOLD);
  208. Object dialogPlain12 = new UIDefaults.ProxyLazyValue(
  209. "javax.swing.plaf.FontUIResource",
  210. null,
  211. new Object[] {"Dialog", fontPlain, twelve});
  212. Object serifPlain12 = new UIDefaults.ProxyLazyValue(
  213. "javax.swing.plaf.FontUIResource",
  214. null,
  215. new Object[] {"Serif", fontPlain, twelve});
  216. Object sansSerifPlain12 = new UIDefaults.ProxyLazyValue(
  217. "javax.swing.plaf.FontUIResource",
  218. null,
  219. new Object[] {"SansSerif", fontPlain, twelve});
  220. Object monospacedPlain12 = new UIDefaults.ProxyLazyValue(
  221. "javax.swing.plaf.FontUIResource",
  222. null,
  223. new Object[] {"MonoSpaced", fontPlain, twelve});
  224. Object dialogBold12 = new UIDefaults.ProxyLazyValue(
  225. "javax.swing.plaf.FontUIResource",
  226. null,
  227. new Object[] {"Dialog", fontBold, twelve});
  228. // *** Shared Colors
  229. ColorUIResource red = new ColorUIResource(Color.red);
  230. ColorUIResource black = new ColorUIResource(Color.black);
  231. ColorUIResource white = new ColorUIResource(Color.white);
  232. ColorUIResource yellow = new ColorUIResource(Color.yellow);
  233. ColorUIResource gray = new ColorUIResource(Color.gray);
  234. ColorUIResource lightGray = new ColorUIResource(Color.lightGray);
  235. ColorUIResource darkGray = new ColorUIResource(Color.darkGray);
  236. ColorUIResource scrollBarTrack = new ColorUIResource(224, 224, 224);
  237. // *** Shared Insets
  238. InsetsUIResource zeroInsets = new InsetsUIResource(0,0,0,0);
  239. // *** Shared Borders
  240. Object marginBorder = new UIDefaults.ProxyLazyValue(
  241. "javax.swing.plaf.basic.BasicBorders$MarginBorder");
  242. Object etchedBorder = new UIDefaults.ProxyLazyValue(
  243. "javax.swing.plaf.BorderUIResource",
  244. "getEtchedBorderUIResource");
  245. Object loweredBevelBorder = new UIDefaults.ProxyLazyValue(
  246. "javax.swing.plaf.BorderUIResource",
  247. "getLoweredBevelBorderUIResource");
  248. Object raisedBevelBorder = new UIDefaults.ProxyLazyValue(
  249. "javax.swing.plaf.BorderUIResource",
  250. "getRaisedBevelBorderUIResource");
  251. Object blackLineBorder = new UIDefaults.ProxyLazyValue(
  252. "javax.swing.plaf.BorderUIResource",
  253. "getBlackLineBorderUIResource");
  254. Object focusCellHighlightBorder = new UIDefaults.ProxyLazyValue(
  255. "javax.swing.plaf.BorderUIResource$LineBorderUIResource",
  256. null,
  257. new Object[] {yellow});
  258. Object tableHeaderBorder = new UIDefaults.ProxyLazyValue(
  259. "javax.swing.plaf.BorderUIResource$BevelBorderUIResource",
  260. null,
  261. new Object[] { new Integer(BevelBorder.RAISED),
  262. table.getColor("controlLtHighlight"),
  263. table.getColor("control"),
  264. table.getColor("controlDkShadow"),
  265. table.getColor("controlShadow") });
  266. // *** Button value objects
  267. Object buttonBorder =
  268. new UIDefaults.ProxyLazyValue(
  269. "javax.swing.plaf.basic.BasicBorders",
  270. "getButtonBorder");
  271. Object buttonToggleBorder =
  272. new UIDefaults.ProxyLazyValue(
  273. "javax.swing.plaf.basic.BasicBorders",
  274. "getToggleButtonBorder");
  275. Object radioButtonBorder =
  276. new UIDefaults.ProxyLazyValue(
  277. "javax.swing.plaf.basic.BasicBorders",
  278. "getRadioButtonBorder");
  279. // *** FileChooser / FileView value objects
  280. Object newFolderIcon = LookAndFeel.makeIcon(getClass(), "icons/NewFolder.gif");
  281. Object upFolderIcon = LookAndFeel.makeIcon(getClass(), "icons/UpFolder.gif");
  282. Object homeFolderIcon = LookAndFeel.makeIcon(getClass(), "icons/HomeFolder.gif");
  283. Object detailsViewIcon = LookAndFeel.makeIcon(getClass(), "icons/DetailsView.gif");
  284. Object listViewIcon = LookAndFeel.makeIcon(getClass(), "icons/ListView.gif");
  285. Object directoryIcon = LookAndFeel.makeIcon(getClass(), "icons/Directory.gif");
  286. Object fileIcon = LookAndFeel.makeIcon(getClass(), "icons/File.gif");
  287. Object computerIcon = LookAndFeel.makeIcon(getClass(), "icons/Computer.gif");
  288. Object hardDriveIcon = LookAndFeel.makeIcon(getClass(), "icons/HardDrive.gif");
  289. Object floppyDriveIcon = LookAndFeel.makeIcon(getClass(), "icons/FloppyDrive.gif");
  290. // *** InternalFrame value objects
  291. Object internalFrameBorder = new UIDefaults.ProxyLazyValue(
  292. "javax.swing.plaf.basic.BasicBorders",
  293. "getInternalFrameBorder");
  294. // *** List value objects
  295. Object listCellRendererActiveValue = new UIDefaults.ActiveValue() {
  296. public Object createValue(UIDefaults table) {
  297. return new DefaultListCellRenderer.UIResource();
  298. }
  299. };
  300. // *** Menus value objects
  301. Object menuBarBorder =
  302. new UIDefaults.ProxyLazyValue(
  303. "javax.swing.plaf.basic.BasicBorders",
  304. "getMenuBarBorder");
  305. Object menuItemCheckIcon =
  306. new UIDefaults.ProxyLazyValue(
  307. "javax.swing.plaf.basic.BasicIconFactory",
  308. "getMenuItemCheckIcon");
  309. Object menuItemArrowIcon =
  310. new UIDefaults.ProxyLazyValue(
  311. "javax.swing.plaf.basic.BasicIconFactory",
  312. "getMenuItemArrowIcon");
  313. Object menuArrowIcon =
  314. new UIDefaults.ProxyLazyValue(
  315. "javax.swing.plaf.basic.BasicIconFactory",
  316. "getMenuArrowIcon");
  317. Object checkBoxIcon =
  318. new UIDefaults.ProxyLazyValue(
  319. "javax.swing.plaf.basic.BasicIconFactory",
  320. "getCheckBoxIcon");
  321. Object radioButtonIcon =
  322. new UIDefaults.ProxyLazyValue(
  323. "javax.swing.plaf.basic.BasicIconFactory",
  324. "getRadioButtonIcon");
  325. Object checkBoxMenuItemIcon =
  326. new UIDefaults.ProxyLazyValue(
  327. "javax.swing.plaf.basic.BasicIconFactory",
  328. "getCheckBoxMenuItemIcon");
  329. Object radioButtonMenuItemIcon =
  330. new UIDefaults.ProxyLazyValue(
  331. "javax.swing.plaf.basic.BasicIconFactory",
  332. "getRadioButtonMenuItemIcon");
  333. Object menuItemAcceleratorDelimiter = new String("+");
  334. // *** OptionPane value objects
  335. Object optionPaneMinimumSize = new DimensionUIResource(262, 90);
  336. Integer zero = new Integer(0);
  337. Object zeroBorder = new UIDefaults.ProxyLazyValue(
  338. "javax.swing.plaf.BorderUIResource$EmptyBorderUIResource",
  339. new Object[] {zero, zero, zero, zero});
  340. Integer ten = new Integer(10);
  341. Object optionPaneBorder = new UIDefaults.ProxyLazyValue(
  342. "javax.swing.plaf.BorderUIResource$EmptyBorderUIResource",
  343. new Object[] {ten, ten, twelve, ten});
  344. Object optionPaneButtonAreaBorder = new UIDefaults.ProxyLazyValue(
  345. "javax.swing.plaf.BorderUIResource$EmptyBorderUIResource",
  346. new Object[] {new Integer(6), zero, zero, zero});
  347. // *** ProgessBar value objects
  348. Object progressBarBorder =
  349. new UIDefaults.ProxyLazyValue(
  350. "javax.swing.plaf.basic.BasicBorders",
  351. "getProgressBarBorder");
  352. // ** ScrollBar value objects
  353. Object minimumThumbSize = new DimensionUIResource(8,8);
  354. Object maximumThumbSize = new DimensionUIResource(4096,4096);
  355. // ** Slider value objects
  356. Object sliderFocusInsets = new InsetsUIResource( 2, 2, 2, 2 );
  357. Object toolBarSeparatorSize = new DimensionUIResource( 10, 10 );
  358. // *** SplitPane value objects
  359. Object splitPaneBorder =
  360. new UIDefaults.ProxyLazyValue(
  361. "javax.swing.plaf.basic.BasicBorders",
  362. "getSplitPaneBorder");
  363. Object splitPaneDividerBorder =
  364. new UIDefaults.ProxyLazyValue(
  365. "javax.swing.plaf.basic.BasicBorders",
  366. "getSplitPaneDividerBorder");
  367. // ** TabbedBane value objects
  368. Object tabbedPaneTabInsets = new InsetsUIResource(0, 4, 1, 4);
  369. Object tabbedPaneTabPadInsets = new InsetsUIResource(2, 2, 2, 1);
  370. Object tabbedPaneTabAreaInsets = new InsetsUIResource(3, 2, 0, 2);
  371. Object tabbedPaneContentBorderInsets = new InsetsUIResource(2, 2, 3, 3);
  372. // *** Text value objects
  373. Object textFieldBorder =
  374. new UIDefaults.ProxyLazyValue(
  375. "javax.swing.plaf.basic.BasicBorders",
  376. "getTextFieldBorder");
  377. Object editorMargin = new InsetsUIResource(3,3,3,3);
  378. JTextComponent.KeyBinding[] fieldBindings = makeKeyBindings( new Object[]{
  379. "ENTER", JTextField.notifyAction
  380. });
  381. JTextComponent.KeyBinding[] multilineBindings = makeKeyBindings( new Object[]{
  382. "UP", DefaultEditorKit.upAction,
  383. "DOWN", DefaultEditorKit.downAction,
  384. "PAGE_UP", DefaultEditorKit.pageUpAction,
  385. "PAGE_DOWN", DefaultEditorKit.pageDownAction,
  386. "ENTER", DefaultEditorKit.insertBreakAction,
  387. "TAB", DefaultEditorKit.insertTabAction
  388. });
  389. Object caretBlinkRate = new Integer(500);
  390. Integer four = new Integer(4);
  391. // *** Component Defaults
  392. Object[] defaults = {
  393. // *** Buttons
  394. "Button.font", dialogPlain12,
  395. "Button.background", table.get("control"),
  396. "Button.foreground", table.get("controlText"),
  397. "Button.border", buttonBorder,
  398. "Button.margin", new InsetsUIResource(2, 14, 2, 14),
  399. "Button.textIconGap", four,
  400. "Button.textShiftOffset", zero,
  401. "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
  402. "SPACE", "pressed",
  403. "released SPACE", "released"
  404. }),
  405. "ToggleButton.font", dialogPlain12,
  406. "ToggleButton.background", table.get("control"),
  407. "ToggleButton.foreground", table.get("controlText"),
  408. "ToggleButton.border", buttonToggleBorder,
  409. "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14),
  410. "ToggleButton.textIconGap", four,
  411. "ToggleButton.textShiftOffset", zero,
  412. "ToggleButton.focusInputMap",
  413. new UIDefaults.LazyInputMap(new Object[] {
  414. "SPACE", "pressed",
  415. "released SPACE", "released"
  416. }),
  417. "RadioButton.font", dialogPlain12,
  418. "RadioButton.background", table.get("control"),
  419. "RadioButton.foreground", table.get("controlText"),
  420. "RadioButton.border", radioButtonBorder,
  421. "RadioButton.margin", new InsetsUIResource(2, 2, 2, 2),
  422. "RadioButton.textIconGap", four,
  423. "RadioButton.textShiftOffset", zero,
  424. "RadioButton.icon", radioButtonIcon,
  425. "RadioButton.focusInputMap",
  426. new UIDefaults.LazyInputMap(new Object[] {
  427. "SPACE", "pressed",
  428. "released SPACE", "released",
  429. "RETURN", "pressed"
  430. }),
  431. "CheckBox.font", dialogPlain12,
  432. "CheckBox.background", table.get("control"),
  433. "CheckBox.foreground", table.get("controlText"),
  434. "CheckBox.border", radioButtonBorder,
  435. "CheckBox.margin", new InsetsUIResource(2, 2, 2, 2),
  436. "CheckBox.textIconGap", four,
  437. "CheckBox.textShiftOffset", zero,
  438. "CheckBox.icon", checkBoxIcon,
  439. "CheckBox.focusInputMap",
  440. new UIDefaults.LazyInputMap(new Object[] {
  441. "SPACE", "pressed",
  442. "released SPACE", "released"
  443. }),
  444. // *** ColorChooser
  445. "ColorChooser.font", dialogPlain12,
  446. "ColorChooser.background", table.get("control"),
  447. "ColorChooser.foreground", table.get("controlText"),
  448. "ColorChooser.swatchesSwatchSize", new Dimension(10, 10),
  449. "ColorChooser.swatchesRecentSwatchSize", new Dimension(10, 10),
  450. "ColorChooser.swatchesDefaultRecentColor", table.get("control"),
  451. "ColorChooser.rgbRedMnemonic", new Integer(KeyEvent.VK_R),
  452. "ColorChooser.rgbGreenMnemonic", new Integer(KeyEvent.VK_G),
  453. "ColorChooser.rgbBlueMnemonic", new Integer(KeyEvent.VK_B),
  454. // *** ComboBox
  455. "ComboBox.font", sansSerifPlain12,
  456. "ComboBox.background", white/*table.get("text")*/,
  457. "ComboBox.foreground", black/*table.get("TextText")*/,
  458. "ComboBox.selectionBackground", table.get("textHighlight"),
  459. "ComboBox.selectionForeground", table.get("textHighlightText"),
  460. "ComboBox.disabledBackground", table.get("control"),
  461. "ComboBox.disabledForeground", table.get("textInactiveText"),
  462. "ComboBox.ancestorInputMap",
  463. new UIDefaults.LazyInputMap(new Object[] {
  464. "ESCAPE", "hidePopup",
  465. "PAGE_UP", "pageUpPassThrough",
  466. "PAGE_DOWN", "pageDownPassThrough",
  467. "HOME", "homePassThrough",
  468. "END", "endPassThrough"
  469. }),
  470. // *** FileChooser
  471. "FileChooser.cancelButtonMnemonic", new Integer(KeyEvent.VK_C),
  472. "FileChooser.saveButtonMnemonic", new Integer(KeyEvent.VK_S),
  473. "FileChooser.openButtonMnemonic", new Integer(KeyEvent.VK_O),
  474. "FileChooser.updateButtonMnemonic", new Integer(KeyEvent.VK_U),
  475. "FileChooser.helpButtonMnemonic", new Integer(KeyEvent.VK_H),
  476. "FileChooser.newFolderIcon", newFolderIcon,
  477. "FileChooser.upFolderIcon", upFolderIcon,
  478. "FileChooser.homeFolderIcon", homeFolderIcon,
  479. "FileChooser.detailsViewIcon", detailsViewIcon,
  480. "FileChooser.listViewIcon", listViewIcon,
  481. "FileChooser.ancestorInputMap",
  482. new UIDefaults.LazyInputMap(new Object[] {
  483. "ESCAPE", "cancelSelection"
  484. }),
  485. "FileView.directoryIcon", directoryIcon,
  486. "FileView.fileIcon", fileIcon,
  487. "FileView.computerIcon", computerIcon,
  488. "FileView.hardDriveIcon", hardDriveIcon,
  489. "FileView.floppyDriveIcon", floppyDriveIcon,
  490. // *** InternalFrame
  491. "InternalFrame.titleFont", dialogBold12,
  492. "InternalFrame.border", internalFrameBorder,
  493. "InternalFrame.icon", LookAndFeel.makeIcon(getClass(), "icons/JavaCup.gif"),
  494. /* Default frame icons are undefined for Basic. */
  495. "InternalFrame.maximizeIcon",
  496. new UIDefaults.ProxyLazyValue(
  497. "javax.swing.plaf.basic.BasicIconFactory",
  498. "createEmptyFrameIcon"),
  499. "InternalFrame.minimizeIcon",
  500. new UIDefaults.ProxyLazyValue(
  501. "javax.swing.plaf.basic.BasicIconFactory",
  502. "createEmptyFrameIcon"),
  503. "InternalFrame.iconifyIcon",
  504. new UIDefaults.ProxyLazyValue(
  505. "javax.swing.plaf.basic.BasicIconFactory",
  506. "createEmptyFrameIcon"),
  507. "InternalFrame.closeIcon",
  508. new UIDefaults.ProxyLazyValue(
  509. "javax.swing.plaf.basic.BasicIconFactory",
  510. "createEmptyFrameIcon"),
  511. "InternalFrame.activeTitleBackground", table.get("activeCaption"),
  512. "InternalFrame.activeTitleForeground", table.get("activeCaptionText"),
  513. "InternalFrame.inactiveTitleBackground", table.get("inactiveCaption"),
  514. "InternalFrame.inactiveTitleForeground", table.get("inactiveCaptionText"),
  515. "InternalFrame.windowBindings", new Object[] {
  516. "shift ESCAPE", "showSystemMenu",
  517. "ctrl SPACE", "showSystemMenu",
  518. "ESCAPE", "hideSystemMenu"},
  519. "DesktopIcon.border", internalFrameBorder,
  520. "Desktop.background", table.get("desktop"),
  521. "Desktop.ancestorInputMap",
  522. new UIDefaults.LazyInputMap(new Object[] {
  523. "ctrl F5", "restore",
  524. "ctrl F4", "close",
  525. "ctrl F7", "move",
  526. "ctrl F8", "resize",
  527. "RIGHT", "right",
  528. "KP_RIGHT", "right",
  529. "LEFT", "left",
  530. "KP_LEFT", "left",
  531. "UP", "up",
  532. "KP_UP", "up",
  533. "DOWN", "down",
  534. "KP_DOWN", "down",
  535. "ESCAPE", "escape",
  536. "ctrl F9", "minimize",
  537. "ctrl F10", "maximize",
  538. "ctrl F6", "selectNextFrame",
  539. "ctrl TAB", "selectNextFrame",
  540. "ctrl alt F6", "selectNextFrame",
  541. "shift ctrl alt F6", "selectPreviousFrame"
  542. }),
  543. // *** Label
  544. "Label.font", dialogPlain12,
  545. "Label.background", table.get("control"),
  546. "Label.foreground", table.get("controlText"),
  547. "Label.disabledForeground", white,
  548. "Label.disabledShadow", table.get("controlShadow"),
  549. "Label.border", null,
  550. // *** List
  551. "List.font", dialogPlain12,
  552. "List.background", table.get("window"),
  553. "List.foreground", table.get("textText"),
  554. "List.selectionBackground", table.get("textHighlight"),
  555. "List.selectionForeground", table.get("textHighlightText"),
  556. "List.focusCellHighlightBorder", focusCellHighlightBorder,
  557. "List.border", null,
  558. "List.cellRenderer", listCellRendererActiveValue,
  559. "List.focusInputMap",
  560. new UIDefaults.LazyInputMap(new Object[] {
  561. "UP", "selectPreviousRow",
  562. "KP_UP", "selectPreviousRow",
  563. "shift UP", "selectPreviousRowExtendSelection",
  564. "shift KP_UP", "selectPreviousRowExtendSelection",
  565. "DOWN", "selectNextRow",
  566. "KP_DOWN", "selectNextRow",
  567. "shift DOWN", "selectNextRowExtendSelection",
  568. "shift KP_DOWN", "selectNextRowExtendSelection",
  569. "ctrl SPACE", "selectNextRowExtendSelection",
  570. "HOME", "selectFirstRow",
  571. "shift HOME", "selectFirstRowExtendSelection",
  572. "END", "selectLastRow",
  573. "shift END", "selectLastRowExtendSelection",
  574. "PAGE_UP", "scrollUp",
  575. "shift PAGE_UP", "scrollUpExtendSelection",
  576. "PAGE_DOWN", "scrollDown",
  577. "shift PAGE_DOWN", "scrollDownExtendSelection",
  578. "ctrl A", "selectAll",
  579. "ctrl SLASH", "selectAll",
  580. "ctrl BACK_SLASH", "clearSelection"
  581. }),
  582. // *** Menus
  583. "MenuBar.font", dialogPlain12,
  584. "MenuBar.background", table.get("menu"),
  585. "MenuBar.foreground", table.get("menuText"),
  586. "MenuBar.border", menuBarBorder,
  587. "MenuBar.windowBindings", new Object[] {
  588. "F10", "takeFocus" },
  589. "MenuItem.font", dialogPlain12,
  590. "MenuItem.acceleratorFont", dialogPlain12,
  591. "MenuItem.background", table.get("menu"),
  592. "MenuItem.foreground", table.get("menuText"),
  593. "MenuItem.selectionForeground", table.get("textHighlightText"),
  594. "MenuItem.selectionBackground", table.get("textHighlight"),
  595. "MenuItem.disabledForeground", null,
  596. "MenuItem.acceleratorForeground", table.get("menuText"),
  597. "MenuItem.acceleratorSelectionForeground", table.get("textHighlightText"),
  598. "MenuItem.acceleratorDelimiter", menuItemAcceleratorDelimiter,
  599. "MenuItem.border", marginBorder,
  600. "MenuItem.borderPainted", Boolean.FALSE,
  601. "MenuItem.margin", new InsetsUIResource(2, 2, 2, 2),
  602. "MenuItem.checkIcon", menuItemCheckIcon,
  603. "MenuItem.arrowIcon", menuItemArrowIcon,
  604. "RadioButtonMenuItem.font", dialogPlain12,
  605. "RadioButtonMenuItem.acceleratorFont", dialogPlain12,
  606. "RadioButtonMenuItem.background", table.get("menu"),
  607. "RadioButtonMenuItem.foreground", table.get("menuText"),
  608. "RadioButtonMenuItem.selectionForeground", table.get("textHighlightText"),
  609. "RadioButtonMenuItem.selectionBackground", table.get("textHighlight"),
  610. "RadioButtonMenuItem.disabledForeground", null,
  611. "RadioButtonMenuItem.acceleratorForeground", table.get("menuText"),
  612. "RadioButtonMenuItem.acceleratorSelectionForeground", table.get("textHighlightText"),
  613. "RadioButtonMenuItem.border", marginBorder,
  614. "RadioButtonMenuItem.borderPainted", Boolean.FALSE,
  615. "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2),
  616. "RadioButtonMenuItem.checkIcon", radioButtonMenuItemIcon,
  617. "RadioButtonMenuItem.arrowIcon", menuItemArrowIcon,
  618. "CheckBoxMenuItem.font", dialogPlain12,
  619. "CheckBoxMenuItem.acceleratorFont", dialogPlain12,
  620. "CheckBoxMenuItem.background", table.get("menu"),
  621. "CheckBoxMenuItem.foreground", table.get("menuText"),
  622. "CheckBoxMenuItem.selectionForeground", table.get("textHighlightText"),
  623. "CheckBoxMenuItem.selectionBackground", table.get("textHighlight"),
  624. "CheckBoxMenuItem.disabledForeground", null,
  625. "CheckBoxMenuItem.acceleratorForeground", table.get("menuText"),
  626. "CheckBoxMenuItem.acceleratorSelectionForeground", table.get("textHighlightText"),
  627. "CheckBoxMenuItem.border", marginBorder,
  628. "CheckBoxMenuItem.borderPainted", Boolean.FALSE,
  629. "CheckBoxMenuItem.margin", new InsetsUIResource(2, 2, 2, 2),
  630. "CheckBoxMenuItem.checkIcon", checkBoxMenuItemIcon,
  631. "CheckBoxMenuItem.arrowIcon", menuItemArrowIcon,
  632. "Menu.font", dialogPlain12,
  633. "Menu.acceleratorFont", dialogPlain12,
  634. "Menu.background", table.get("menu"),
  635. "Menu.foreground", table.get("menuText"),
  636. "Menu.selectionForeground", table.get("textHighlightText"),
  637. "Menu.selectionBackground", table.get("textHighlight"),
  638. "Menu.disabledForeground", null,
  639. "Menu.acceleratorForeground", table.get("menuText"),
  640. "Menu.acceleratorSelectionForeground", table.get("textHighlightText"),
  641. "Menu.border", marginBorder,
  642. "Menu.borderPainted", Boolean.FALSE,
  643. "Menu.margin", new InsetsUIResource(2, 2, 2, 2),
  644. "Menu.checkIcon", menuItemCheckIcon,
  645. "Menu.arrowIcon", menuArrowIcon,
  646. "Menu.consumesTabs", Boolean.TRUE,
  647. // These window InputMap bindings are used when the Menu is
  648. // selected.
  649. "Menu.selectedWindowInputMapBindings", new Object[] {
  650. "ESCAPE", "cancel",
  651. "DOWN", "selectNext",
  652. "KP_DOWN", "selectNext",
  653. "UP", "selectPrevious",
  654. "KP_UP", "selectPrevious",
  655. "LEFT", "selectParent",
  656. "KP_LEFT", "selectParent",
  657. "RIGHT", "selectChild",
  658. "KP_RIGHT", "selectChild",
  659. "ENTER", "return",
  660. "SPACE", "return"
  661. },
  662. "PopupMenu.font", dialogPlain12,
  663. "PopupMenu.background", table.get("menu"),
  664. "PopupMenu.foreground", table.get("menuText"),
  665. "PopupMenu.border", raisedBevelBorder,
  666. // *** OptionPane
  667. "OptionPane.font", dialogPlain12,
  668. "OptionPane.background", table.get("control"),
  669. "OptionPane.foreground", table.get("controlText"),
  670. "OptionPane.messageForeground", table.get("controlText"),
  671. "OptionPane.border", optionPaneBorder,
  672. "OptionPane.messageAreaBorder", zeroBorder,
  673. "OptionPane.buttonAreaBorder", optionPaneButtonAreaBorder,
  674. "OptionPane.minimumSize", optionPaneMinimumSize,
  675. "OptionPane.errorIcon", LookAndFeel.makeIcon(getClass(), "icons/Error.gif"),
  676. "OptionPane.informationIcon", LookAndFeel.makeIcon(getClass(), "icons/Inform.gif"),
  677. "OptionPane.warningIcon", LookAndFeel.makeIcon(getClass(), "icons/Warn.gif"),
  678. "OptionPane.questionIcon", LookAndFeel.makeIcon(getClass(), "icons/Question.gif"),
  679. "OptionPane.windowBindings", new Object[] {
  680. "ESCAPE", "close" },
  681. // *** Panel
  682. "Panel.font", dialogPlain12,
  683. "Panel.background", table.get("control"),
  684. "Panel.foreground", table.get("textText"),
  685. // *** ProgressBar
  686. "ProgressBar.font", dialogPlain12,
  687. "ProgressBar.foreground", table.get("textHighlight"),
  688. "ProgressBar.background", table.get("control"),
  689. "ProgressBar.selectionForeground", table.get("control"),
  690. "ProgressBar.selectionBackground", table.get("textHighlight"),
  691. "ProgressBar.border", progressBarBorder,
  692. "ProgressBar.cellLength", new Integer(1),
  693. "ProgressBar.cellSpacing", zero,
  694. // *** Separator
  695. "Separator.shadow", table.get("controlShadow"), // DEPRECATED - DO NOT USE!
  696. "Separator.highlight", table.get("controlLtHighlight"), // DEPRECATED - DO NOT USE!
  697. "Separator.background", table.get("controlLtHighlight"),
  698. "Separator.foreground", table.get("controlShadow"),
  699. // *** ScrollBar/ScrollPane/Viewport
  700. "ScrollBar.background", scrollBarTrack,
  701. "ScrollBar.foreground", table.get("control"),
  702. "ScrollBar.track", table.get("scrollbar"),
  703. "ScrollBar.trackHighlight", table.get("controlDkShadow"),
  704. "ScrollBar.thumb", table.get("control"),
  705. "ScrollBar.thumbHighlight", table.get("controlLtHighlight"),
  706. "ScrollBar.thumbDarkShadow", table.get("controlDkShadow"),
  707. "ScrollBar.thumbLightShadow", table.get("controlShadow"),
  708. "ScrollBar.border", null,
  709. "ScrollBar.minimumThumbSize", minimumThumbSize,
  710. "ScrollBar.maximumThumbSize", maximumThumbSize,
  711. "ScrollBar.focusInputMap",
  712. new UIDefaults.LazyInputMap(new Object[] {
  713. "RIGHT", "negativeUnitIncrement",
  714. "KP_RIGHT", "negativeUnitIncrement",
  715. "DOWN", "positiveUnitIncrement",
  716. "KP_DOWN", "positiveUnitIncrement",
  717. "PAGE_DOWN", "positiveBlockIncrement",
  718. "LEFT", "positiveUnitIncrement",
  719. "KP_LEFT", "positiveUnitIncrement",
  720. "UP", "negativeUnitIncrement",
  721. "KP_UP", "negativeUnitIncrement",
  722. "PAGE_UP", "negativeBlockIncrement",
  723. "HOME", "minScroll",
  724. "END", "maxScroll"
  725. }),
  726. "ScrollPane.font", dialogPlain12,
  727. "ScrollPane.background", table.get("control"),
  728. "ScrollPane.foreground", table.get("controlText"),
  729. "ScrollPane.border", etchedBorder,
  730. "ScrollPane.viewportBorder", null,
  731. "ScrollPane.ancestorInputMap",
  732. new UIDefaults.LazyInputMap(new Object[] {
  733. "RIGHT", "unitScrollRight",
  734. "KP_RIGHT", "unitScrollRight",
  735. "DOWN", "unitScrollDown",
  736. "KP_DOWN", "unitScrollDown",
  737. "LEFT", "unitScrollLeft",
  738. "KP_LEFT", "unitScrollLeft",
  739. "UP", "unitScrollUp",
  740. "KP_UP", "unitScrollUp",
  741. "PAGE_UP", "scrollUp",
  742. "PAGE_DOWN", "scrollDown",
  743. "ctrl PAGE_UP", "scrollLeft",
  744. "ctrl PAGE_DOWN", "scrollRight",
  745. "ctrl HOME", "scrollHome",
  746. "ctrl END", "scrollEnd"
  747. }),
  748. "Viewport.font", dialogPlain12,
  749. "Viewport.background", table.get("control"),
  750. "Viewport.foreground", table.get("textText"),
  751. // *** Slider
  752. "Slider.foreground", table.get("control"),
  753. "Slider.background", table.get("control"),
  754. "Slider.highlight", table.get("controlLtHighlight"),
  755. "Slider.shadow", table.get("controlShadow"),
  756. "Slider.focus", table.get("controlDkShadow"),
  757. "Slider.border", null,
  758. "Slider.focusInsets", sliderFocusInsets,
  759. "Slider.focusInputMap",
  760. new UIDefaults.LazyInputMap(new Object[] {
  761. "RIGHT", "positiveUnitIncrement",
  762. "KP_RIGHT", "positiveUnitIncrement",
  763. "DOWN", "negativeUnitIncrement",
  764. "KP_DOWN", "negativeUnitIncrement",
  765. "PAGE_DOWN", "negativeBlockIncrement",
  766. "LEFT", "negativeUnitIncrement",
  767. "KP_LEFT", "negativeUnitIncrement",
  768. "UP", "positiveUnitIncrement",
  769. "KP_UP", "positiveUnitIncrement",
  770. "PAGE_UP", "positiveBlockIncrement",
  771. "HOME", "minScroll",
  772. "END", "maxScroll"
  773. }),
  774. // *** SplitPane
  775. "SplitPane.background", table.get("control"),
  776. "SplitPane.highlight", table.get("controlLtHighlight"),
  777. "SplitPane.shadow", table.get("controlShadow"),
  778. "SplitPane.border", splitPaneBorder,
  779. "SplitPane.dividerSize", new Integer(7),
  780. "SplitPaneDivider.border", splitPaneDividerBorder,
  781. "SplitPane.ancestorInputMap",
  782. new UIDefaults.LazyInputMap(new Object[] {
  783. "UP", "negativeIncrement",
  784. "DOWN", "positiveIncrement",
  785. "LEFT", "negativeIncrement",
  786. "RIGHT", "positiveIncrement",
  787. "KP_UP", "negativeIncrement",
  788. "KP_DOWN", "positiveIncrement",
  789. "KP_LEFT", "negativeIncrement",
  790. "KP_RIGHT", "positiveIncrement",
  791. "HOME", "selectMin",
  792. "END", "selectMax",
  793. "F8", "startResize",
  794. "F6", "toggleFocus"
  795. }),
  796. // *** TabbedPane
  797. "TabbedPane.font", dialogPlain12,
  798. "TabbedPane.background", table.get("control"),
  799. "TabbedPane.foreground", table.get("controlText"),
  800. "TabbedPane.lightHighlight", table.get("controlLtHighlight"),
  801. "TabbedPane.highlight", table.get("controlHighlight"),
  802. "TabbedPane.shadow", table.get("controlShadow"),
  803. "TabbedPane.darkShadow", table.get("controlDkShadow"),
  804. "TabbedPane.focus", table.get("controlText"),
  805. "TabbedPane.textIconGap", four,
  806. "TabbedPane.tabInsets", tabbedPaneTabInsets,
  807. "TabbedPane.selectedTabPadInsets", tabbedPaneTabPadInsets,
  808. "TabbedPane.tabAreaInsets", tabbedPaneTabAreaInsets,
  809. "TabbedPane.contentBorderInsets", tabbedPaneContentBorderInsets,
  810. "TabbedPane.tabRunOverlay", new Integer(2),
  811. "TabbedPane.focusInputMap",
  812. new UIDefaults.LazyInputMap(new Object[] {
  813. "RIGHT", "navigateRight",
  814. "KP_RIGHT", "navigateRight",
  815. "LEFT", "navigateLeft",
  816. "KP_LEFT", "navigateLeft",
  817. "UP", "navigateUp",
  818. "KP_UP", "navigateUp",
  819. "DOWN", "navigateDown",
  820. "KP_DOWN", "navigateDown",
  821. "ctrl DOWN", "requestFocusForVisibleComponent",
  822. "ctrl KP_DOWN", "requestFocusForVisibleComponent",
  823. }),
  824. "TabbedPane.ancestorInputMap",
  825. new UIDefaults.LazyInputMap(new Object[] {
  826. "ctrl PAGE_DOWN", "navigatePageDown",
  827. "ctrl PAGE_UP", "navigatePageUp",
  828. "ctrl UP", "requestFocus",
  829. "ctrl KP_UP", "requestFocus",
  830. }),
  831. // *** Table
  832. "Table.font", dialogPlain12,
  833. "Table.foreground", table.get("controlText"), // cell text color
  834. "Table.background", table.get("window"), // cell background color
  835. "Table.selectionForeground", table.get("textHighlightText"),
  836. "Table.selectionBackground", table.get("textHighlight"),
  837. "Table.gridColor", gray, // grid line color
  838. "Table.focusCellBackground", table.get("window"),
  839. "Table.focusCellForeground", table.get("controlText"),
  840. "Table.focusCellHighlightBorder", focusCellHighlightBorder,
  841. "Table.scrollPaneBorder", loweredBevelBorder,
  842. "Table.ancestorInputMap",
  843. new UIDefaults.LazyInputMap(new Object[] {
  844. "RIGHT", "selectNextColumn",
  845. "KP_RIGHT", "selectNextColumn",
  846. "LEFT", "selectPreviousColumn",
  847. "KP_LEFT", "selectPreviousColumn",
  848. "DOWN", "selectNextRow",
  849. "KP_DOWN", "selectNextRow",
  850. "UP", "selectPreviousRow",
  851. "KP_UP", "selectPreviousRow",
  852. "shift RIGHT", "selectNextColumnExtendSelection",
  853. "shift KP_RIGHT", "selectNextColumnExtendSelection",
  854. "shift LEFT", "selectPreviousColumnExtendSelection",
  855. "shift KP_LEFT", "selectPreviousColumnExtendSelection",
  856. "shift DOWN", "selectNextRowExtendSelection",
  857. "shift KP_DOWN", "selectNextRowExtendSelection",
  858. "shift UP", "selectPreviousRowExtendSelection",
  859. "shift KP_UP", "selectPreviousRowExtendSelection",
  860. "PAGE_UP", "scrollUpChangeSelection",
  861. "PAGE_DOWN", "scrollDownChangeSelection",
  862. "HOME", "selectFirstColumn",
  863. "END", "selectLastColumn",
  864. "shift PAGE_UP", "scrollUpExtendSelection",
  865. "shift PAGE_DOWN", "scrollDownExtendSelection",
  866. "shift HOME", "selectFirstColumnExtendSelection",
  867. "shift END", "selectLastColumnExtendSelection",
  868. "ctrl PAGE_UP", "scrollLeftChangeSelection",
  869. "ctrl PAGE_DOWN", "scrollRightChangeSelection",
  870. "ctrl HOME", "selectFirstRow",
  871. "ctrl END", "selectLastRow",
  872. "ctrl shift PAGE_UP", "scrollRightExtendSelection",
  873. "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection",
  874. "ctrl shift HOME", "selectFirstRowExtendSelection",
  875. "ctrl shift END", "selectLastRowExtendSelection",
  876. "TAB", "selectNextColumnCell",
  877. "shift TAB", "selectPreviousColumnCell",
  878. "ENTER", "selectNextRowCell",
  879. "shift ENTER", "selectPreviousRowCell",
  880. "ctrl A", "selectAll",
  881. "ESCAPE", "cancel",
  882. "F2", "startEditing"
  883. }),
  884. "TableHeader.font", dialogPlain12,
  885. "TableHeader.foreground", table.get("controlText"), // header text color
  886. "TableHeader.background", table.get("control"), // header background
  887. "TableHeader.cellBorder", tableHeaderBorder,
  888. // *** Text
  889. "TextField.font", sansSerifPlain12,
  890. "TextField.background", table.get("window"),
  891. "TextField.foreground", table.get("textText"),
  892. "TextField.inactiveForeground", table.get("textInactiveText"),
  893. "TextField.selectionBackground", table.get("textHighlight"),
  894. "TextField.selectionForeground", table.get("textHighlightText"),
  895. "TextField.caretForeground", table.get("textText"),
  896. "TextField.caretBlinkRate", caretBlinkRate,
  897. "TextField.border", textFieldBorder,
  898. "TextField.margin", zeroInsets,
  899. "TextField.keyBindings", fieldBindings,
  900. "PasswordField.font", monospacedPlain12,
  901. "PasswordField.background", table.get("window"),
  902. "PasswordField.foreground", table.get("textText"),
  903. "PasswordField.inactiveForeground", table.get("textInactiveText"),
  904. "PasswordField.selectionBackground", table.get("textHighlight"),
  905. "PasswordField.selectionForeground", table.get("textHighlightText"),
  906. "PasswordField.caretForeground", table.get("textText"),
  907. "PasswordField.caretBlinkRate", caretBlinkRate,
  908. "PasswordField.border", textFieldBorder,
  909. "PasswordField.margin", zeroInsets,
  910. "PasswordField.keyBindings", fieldBindings,
  911. "TextArea.font", monospacedPlain12,
  912. "TextArea.background", table.get("window"),
  913. "TextArea.foreground", table.get("textText"),
  914. "TextArea.inactiveForeground", table.get("textInactiveText"),
  915. "TextArea.selectionBackground", table.get("textHighlight"),
  916. "TextArea.selectionForeground", table.get("textHighlightText"),
  917. "TextArea.caretForeground", table.get("textText"),
  918. "TextArea.caretBlinkRate", caretBlinkRate,
  919. "TextArea.border", marginBorder,
  920. "TextArea.margin", zeroInsets,
  921. "TextArea.keyBindings", multilineBindings,
  922. "TextPane.font", serifPlain12,
  923. "TextPane.background", white,
  924. "TextPane.foreground", table.get("textText"),
  925. "TextPane.selectionBackground", lightGray,
  926. "TextPane.selectionForeground", table.get("textHighlightText"),
  927. "TextPane.caretForeground", table.get("textText"),
  928. "TextPane.caretBlinkRate", caretBlinkRate,
  929. "TextPane.inactiveForeground", table.get("textInactiveText"),
  930. "TextPane.border", marginBorder,
  931. "TextPane.margin", editorMargin,
  932. "TextPane.keyBindings", multilineBindings,
  933. "EditorPane.font", serifPlain12,
  934. "EditorPane.background", white,
  935. "EditorPane.foreground", table.get("textText"),
  936. "EditorPane.selectionBackground", lightGray,
  937. "EditorPane.selectionForeground", table.get("textHighlightText"),
  938. "EditorPane.caretForeground", red,
  939. "EditorPane.caretBlinkRate", caretBlinkRate,
  940. "EditorPane.inactiveForeground", table.get("textInactiveText"),
  941. "EditorPane.border", marginBorder,
  942. "EditorPane.margin", editorMargin,
  943. "EditorPane.keyBindings", multilineBindings,
  944. // *** TitledBorder
  945. "TitledBorder.font", dialogPlain12,
  946. "TitledBorder.titleColor", table.get("controlText"),
  947. "TitledBorder.border", etchedBorder,
  948. // *** ToolBar
  949. "ToolBar.font", dialogPlain12,
  950. "ToolBar.background", table.get("control"),
  951. "ToolBar.foreground", table.get("controlText"),
  952. "ToolBar.dockingBackground", table.get("control"),
  953. "ToolBar.dockingForeground", red,
  954. "ToolBar.floatingBackground", table.get("control"),
  955. "ToolBar.floatingForeground", darkGray,
  956. "ToolBar.border", etchedBorder,
  957. "ToolBar.separatorSize", toolBarSeparatorSize,
  958. "ToolBar.ancestorInputMap",
  959. new UIDefaults.LazyInputMap(new Object[] {
  960. "UP", "navigateUp",
  961. "KP_UP", "navigateUp",
  962. "DOWN", "navigateDown",
  963. "KP_DOWN", "navigateDown",
  964. "LEFT", "navigateLeft",
  965. "KP_LEFT", "navigateLeft",
  966. "RIGHT", "navigateRight",
  967. "KP_RIGHT", "navigateRight"
  968. }),
  969. // *** ToolTips
  970. "ToolTip.font", sansSerifPlain12,
  971. "ToolTip.background", table.get("info"),
  972. "ToolTip.foreground", table.get("infoText"),
  973. "ToolTip.border", blackLineBorder,
  974. // *** Tree
  975. "Tree.font", dialogPlain12,
  976. "Tree.background", table.get("window"),
  977. "Tree.foreground", table.get("textText"),
  978. "Tree.hash", gray,
  979. "Tree.textForeground", table.get("textText"),
  980. "Tree.textBackground", table.get("text"),
  981. "Tree.selectionForeground", table.get("textHighlightText"),
  982. "Tree.selectionBackground", table.get("textHighlight"),
  983. "Tree.selectionBorderColor", black,
  984. "Tree.editorBorder", blackLineBorder,
  985. "Tree.leftChildIndent", new Integer(7),
  986. "Tree.rightChildIndent", new Integer(13),
  987. "Tree.rowHeight", new Integer(16),
  988. "Tree.scrollsOnExpand", Boolean.TRUE,
  989. "Tree.openIcon", LookAndFeel.makeIcon(getClass(), "icons/TreeOpen.gif"),
  990. "Tree.closedIcon", LookAndFeel.makeIcon(getClass(), "icons/TreeClosed.gif"),
  991. "Tree.leafIcon", LookAndFeel.makeIcon(getClass(), "icons/TreeLeaf.gif"),
  992. "Tree.expandedIcon", null,
  993. "Tree.collapsedIcon", null,
  994. "Tree.changeSelectionWithFocus", Boolean.TRUE,
  995. "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE,
  996. "Tree.focusInputMap",
  997. new UIDefaults.LazyInputMap(new Object[] {
  998. "UP", "selectPrevious",
  999. "KP_UP", "selectPrevious",
  1000. "shift UP", "selectPreviousExtendSelection",
  1001. "shift KP_UP", "selectPreviousExtendSelection",
  1002. "DOWN", "selectNext",
  1003. "KP_DOWN", "selectNext",
  1004. "shift DOWN", "selectNextExtendSelection",
  1005. "shift KP_DOWN", "selectNextExtendSelection",
  1006. "RIGHT", "selectChild",
  1007. "KP_RIGHT", "selectChild",
  1008. "LEFT", "selectParent",
  1009. "KP_LEFT", "selectParent",
  1010. "PAGE_UP", "scrollUpChangeSelection",
  1011. "shift PAGE_UP", "scrollUpExtendSelection",
  1012. "PAGE_DOWN", "scrollDownChangeSelection",
  1013. "shift PAGE_DOWN", "scrollDownExtendSelection",
  1014. "HOME", "selectFirst",
  1015. "shift HOME", "selectFirstExtendSelection",
  1016. "END", "selectLast",
  1017. "shift END", "selectLastExtendSelection",
  1018. "ENTER", "toggle",
  1019. "F2", "startEditing",
  1020. "ctrl A", "selectAll",
  1021. "ctrl SLASH", "selectAll",
  1022. "ctrl BACK_SLASH", "clearSelection",
  1023. "ctrl SPACE", "toggleSelectionPreserveAnchor",
  1024. "shift SPACE", "extendSelection",
  1025. "ctrl HOME", "selectFirstChangeLead",
  1026. "ctrl END", "selectLastChangeLead",
  1027. "ctrl UP", "selectPreviousChangeLead",
  1028. "ctrl KP_UP", "selectPreviousChangeLead",
  1029. "ctrl DOWN", "selectNextChangeLead",
  1030. "ctrl KP_DOWN", "selectNextChangeLead",
  1031. "ctrl PAGE_DOWN", "scrollDownChangeLead",
  1032. "ctrl shift PAGE_DOWN", "scrollDownExtendSelection",
  1033. "ctrl PAGE_UP", "scrollUpChangeLead",
  1034. "ctrl shift PAGE_UP", "scrollUpExtendSelection",
  1035. "ctrl LEFT", "scrollLeft",
  1036. "ctrl KP_LEFT", "scrollLeft",
  1037. "ctrl RIGHT", "scrollRight",
  1038. "ctrl KP_RIGHT", "scrollRight",
  1039. "SPACE", "toggleSelectionPreserveAnchor",
  1040. }),
  1041. "Tree.ancestorInputMap",
  1042. new UIDefaults.LazyInputMap(new Object[] {
  1043. "ESCAPE", "cancel"
  1044. }),
  1045. // These bindings are only enabled when there is a default
  1046. // button set on the rootpane.
  1047. "RootPane.defaultButtonWindowKeyBindings", new Object[] {
  1048. "ENTER", "press",
  1049. "released ENTER", "release",
  1050. "ctrl ENTER", "press",
  1051. "ctrl released ENTER", "release"
  1052. },
  1053. };
  1054. table.putDefaults(defaults);
  1055. }
  1056. }