1 30 31 package com.jgoodies.looks.plastic.theme; 32 33 import java.awt.Color ; 34 import java.awt.Font ; 35 36 import javax.swing.UIDefaults ; 37 import javax.swing.plaf.ColorUIResource ; 38 import javax.swing.plaf.FontUIResource ; 39 40 import com.jgoodies.looks.FontSizeHints; 41 import com.jgoodies.looks.plastic.PlasticLookAndFeel; 42 import com.jgoodies.looks.plastic.PlasticTheme; 43 44 51 public abstract class InvertedColorTheme extends PlasticTheme { 52 53 private final ColorUIResource softWhite = 54 new ColorUIResource (154, 154, 154); 55 56 private final ColorUIResource primary1 = new ColorUIResource (83, 83, 61); 57 59 private final ColorUIResource primary2 = new ColorUIResource (115, 107, 82); 60 62 private final ColorUIResource primary3 = new ColorUIResource (156, 156, 123); 63 65 private final ColorUIResource secondary1 = new ColorUIResource (32, 32, 32); 66 68 private final ColorUIResource secondary2 = new ColorUIResource (96, 96, 96); 69 71 private final ColorUIResource secondary3 = new ColorUIResource (84, 84, 84); 72 74 public ColorUIResource getSimpleInternalFrameBackground() { 75 return getWhite(); 76 } 77 78 public void addCustomEntriesToTable(UIDefaults table) { 79 super.addCustomEntriesToTable(table); 80 Object [] uiDefaults = 81 { 82 "jgoodies.useControlGradient", 83 Boolean.TRUE, 84 "TextField.ineditableForeground", 85 getSoftWhite(), 86 "Plastic.brightenStop", 88 new Color (255, 255, 255, 20), 89 "Plastic.ltBrightenStop", 90 new Color (255, 255, 255, 16), 91 }; 92 table.putDefaults(uiDefaults); 93 } 94 95 protected FontUIResource getFont() { 96 if (null == controlFont) 97 controlFont = new FontUIResource (getFont0()); 98 99 return controlFont; 100 } 101 102 protected Font getFont0() { 103 FontSizeHints sizeHints = PlasticLookAndFeel.getFontSizeHints(); 104 return getFont0(sizeHints.controlFontSize()); 105 } 106 107 protected Font getFont0(int size) { 108 return new Font ("Tahoma", Font.PLAIN, size); 109 } 110 111 public FontUIResource getSubTextFont() { 112 if (null == smallFont) { 113 smallFont = new FontUIResource (getFont0(10)); 114 } 115 return smallFont; 116 } 117 118 public ColorUIResource getControlDisabled() { 119 return getSoftWhite(); 120 } 121 122 public ColorUIResource getControlHighlight() { 123 return getSoftWhite(); 124 } 125 126 public ColorUIResource getControlInfo() { 127 return getWhite(); 128 } 129 130 public ColorUIResource getInactiveSystemTextColor() { 131 return getSoftWhite(); 132 } 133 134 public ColorUIResource getMenuDisabledForeground() { 135 return getSoftWhite(); 136 } 137 138 public ColorUIResource getMenuItemSelectedBackground() { 139 return getPrimary3(); 140 } 141 142 public ColorUIResource getMenuItemSelectedForeground() { 143 return getBlack(); 144 } 145 146 public ColorUIResource getMenuSelectedBackground() { 147 return getPrimary2(); 148 } 149 150 public ColorUIResource getMenuSelectedForeground() { 151 return getWhite(); 152 } 153 154 protected ColorUIResource getPrimary1() { 155 return primary1; 156 } 157 158 protected ColorUIResource getPrimary2() { 159 return primary2; 160 } 161 162 protected ColorUIResource getPrimary3() { 163 return primary3; 164 } 165 public ColorUIResource getPrimaryControlHighlight() { 166 return getSoftWhite(); 167 } 168 169 protected ColorUIResource getSecondary1() { 170 return secondary1; 171 } 172 173 protected ColorUIResource getSecondary2() { 174 return secondary2; 175 } 176 177 protected ColorUIResource getSecondary3() { 178 return secondary3; 179 } 180 181 public ColorUIResource getSeparatorBackground() { 182 return getSoftWhite(); 183 } 184 185 protected ColorUIResource getSoftWhite() { 186 return softWhite; 187 } 188 189 public ColorUIResource getTitleTextColor() { 190 return getControlInfo(); 191 } 192 193 public ColorUIResource getToggleButtonCheckColor() { 194 return getWhite(); 195 } 196 197 public ColorUIResource getFocusColor() { 198 return Colors.GRAY_FOCUS; 199 } 200 201 221 } 222 | Popular Tags |