1 19 20 package org.netbeans.swing.plaf.metal; 21 22 import org.netbeans.swing.plaf.LFCustoms; 23 import org.netbeans.swing.plaf.util.UIBootstrapValue; 24 25 import javax.swing.*; 26 import javax.swing.border.Border ; 27 import javax.swing.border.EmptyBorder ; 28 import java.awt.*; 29 import org.netbeans.swing.plaf.util.UIUtils; 30 31 34 public final class MetalLFCustoms extends LFCustoms { 35 36 37 38 public Object [] createLookAndFeelCustomizationKeysAndValues() { 39 int fontsize = 11; 40 Integer in = (Integer ) UIManager.get(CUSTOM_FONT_SIZE); if (in != null) { 42 fontsize = in.intValue(); 43 } 44 45 Font controlFont = new Font("Dialog", Font.PLAIN, fontsize); Object [] result = { 48 CONTROLFONT, controlFont, 50 SYSTEMFONT, controlFont, 51 USERFONT, controlFont, 52 MENUFONT, controlFont, 53 WINDOWTITLEFONT, controlFont, 54 LISTFONT, controlFont, 55 TREEFONT, controlFont, 56 PANELFONT, controlFont, 57 SUBFONT, new Font ("Dialog", Font.PLAIN, Math.min(fontsize - 1, 6)), 58 "textInactiveText", Color.GRAY, SPINNERFONT, controlFont, 62 EDITOR_ERRORSTRIPE_SCROLLBAR_INSETS, new Insets(16, 0, 16, 0), 63 }; 64 return result; 65 } 66 67 public Object [] createApplicationSpecificKeysAndValues () { 68 Border outerBorder = BorderFactory.createLineBorder(UIManager.getColor("controlShadow")); Object propertySheetColorings = new MetalPropertySheetColorings(); 70 Color unfocusedSelBg = UIManager.getColor("controlShadow"); 71 if (!Color.WHITE.equals(unfocusedSelBg.brighter())) { unfocusedSelBg = unfocusedSelBg.brighter(); 73 } 74 75 Object [] result = { 76 DESKTOP_BORDER, new EmptyBorder (1, 1, 1, 1), 77 SCROLLPANE_BORDER, new MetalScrollPaneBorder(), 78 EXPLORER_STATUS_BORDER, new StatusLineBorder(StatusLineBorder.TOP), 79 EDITOR_STATUS_LEFT_BORDER, new StatusLineBorder(StatusLineBorder.TOP | StatusLineBorder.RIGHT), 80 EDITOR_STATUS_RIGHT_BORDER, new StatusLineBorder(StatusLineBorder.TOP | StatusLineBorder.LEFT), 81 EDITOR_STATUS_INNER_BORDER, new StatusLineBorder(StatusLineBorder.TOP | StatusLineBorder.LEFT | StatusLineBorder.RIGHT), 82 EDITOR_STATUS_ONLYONEBORDER, new StatusLineBorder(StatusLineBorder.TOP), 83 EDITOR_TOOLBAR_BORDER, new EditorToolbarBorder(), 84 85 PROPERTYSHEET_BOOTSTRAP, propertySheetColorings, 86 87 EDITOR_TAB_DISPLAYER_UI, "org.netbeans.swing.tabcontrol.plaf.MetalEditorTabDisplayerUI", 89 VIEW_TAB_DISPLAYER_UI, "org.netbeans.swing.tabcontrol.plaf.MetalViewTabDisplayerUI", 90 SLIDING_BUTTON_UI, "org.netbeans.swing.tabcontrol.plaf.MetalSlidingButtonUI", 91 92 EDITOR_TAB_OUTER_BORDER, outerBorder, 93 VIEW_TAB_OUTER_BORDER, outerBorder, 94 95 EXPLORER_MINISTATUSBAR_BORDER, BorderFactory.createMatteBorder(1, 0, 0, 0, UIManager.getColor("controlShadow")), 96 97 "nb.explorer.unfocusedSelBg", unfocusedSelBg, 99 100 PROGRESS_CANCEL_BUTTON_ICON, UIUtils.loadImage("org/netbeans/swing/plaf/resources/cancel_task_win_linux_mac.png"), 101 102 103 "nbProgressBar.popupDynaText.foreground", new Color(115, 115, 115), 107 "nbProgressBar.popupText.foreground", UIManager.getColor("TextField.foreground"), 109 "nbProgressBar.popupText.selectBackground", UIManager.getColor("List.selectionBackground"), 110 "nbProgressBar.popupText.selectForeground", UIManager.getColor("List.selectionForeground"), 111 112 }; return result; 114 } 115 116 private class MetalPropertySheetColorings extends UIBootstrapValue.Lazy { 117 public MetalPropertySheetColorings () { 118 super (null); 119 } 120 121 public Object [] createKeysAndValues() { 122 return new Object [] { 123 PROPSHEET_SELECTION_BACKGROUND, new Color(204,204,255), 125 PROPSHEET_SELECTION_FOREGROUND, Color.BLACK, 126 PROPSHEET_SET_BACKGROUND, new Color(224,224,224), 127 PROPSHEET_SET_FOREGROUND, Color.BLACK, 128 PROPSHEET_SELECTED_SET_BACKGROUND, new Color(204,204,255), 129 PROPSHEET_SELECTED_SET_FOREGROUND, Color.BLACK, 130 PROPSHEET_DISABLED_FOREGROUND, new Color(153,153,153), 131 }; 132 } 133 } 134 135 } 136 | Popular Tags |