1:
37:
38: package ;
39:
40: import ;
41: import ;
42: import ;
43:
44: import ;
45: import ;
46: import ;
47:
48:
54: public class OceanTheme extends DefaultMetalTheme
55: {
56:
59: static final ColorUIResource BLACK = new ColorUIResource(51, 51, 51);
60:
61:
64: static final ColorUIResource PRIMARY1 = new ColorUIResource(99, 130, 191);
65:
66:
69: static final ColorUIResource PRIMARY2 = new ColorUIResource(163, 184, 204);
70:
71:
74: static final ColorUIResource PRIMARY3 = new ColorUIResource(184, 207, 229);
75:
76:
79: static final ColorUIResource SECONDARY1 = new ColorUIResource(122, 138, 153);
80:
81:
84: static final ColorUIResource SECONDARY2 = new ColorUIResource(184, 207, 229);
85:
86:
89: static final ColorUIResource SECONDARY3 = new ColorUIResource(238, 238, 238);
90:
91:
94: static final ColorUIResource INACTIVE_CONTROL_TEXT =
95: new ColorUIResource(153, 153, 153);
96:
97:
100: public String getName()
101: {
102: return "Ocean";
103: }
104:
105:
109: public ColorUIResource getControlTextColor()
110: {
111: return getBlack();
112: }
113:
114:
117: public ColorUIResource getDesktopColor()
118: {
119: return getWhite();
120: }
121:
122:
126: public ColorUIResource getInactiveControlTextColor()
127: {
128: return INACTIVE_CONTROL_TEXT;
129: }
130:
131:
135: public ColorUIResource getMenuDisabledForeground()
136: {
137: return INACTIVE_CONTROL_TEXT;
138: }
139:
140:
141:
147: protected ColorUIResource getBlack()
148: {
149: return BLACK;
150: }
151:
152:
156: protected ColorUIResource getPrimary1()
157: {
158: return PRIMARY1;
159: }
160:
161:
165: protected ColorUIResource getPrimary2()
166: {
167: return PRIMARY2;
168: }
169:
170:
174: protected ColorUIResource getPrimary3()
175: {
176: return PRIMARY3;
177: }
178:
179:
183: protected ColorUIResource getSecondary1()
184: {
185: return SECONDARY1;
186: }
187:
188:
192: protected ColorUIResource getSecondary2()
193: {
194: return SECONDARY2;
195: }
196:
200: protected ColorUIResource getSecondary3()
201: {
202: return SECONDARY3;
203: }
204:
205:
210: public void addCustomEntriesToTable(UIDefaults defaults)
211: {
212:
213: defaults.put("Button.gradient", Arrays.asList(new Object[]
214: {new Float(0.3), new Float(0.0), new ColorUIResource(221, 232, 243),
215: new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)}));
216: defaults.put("CheckBox.gradient", Arrays.asList(new Object[]
217: {new Float(0.3), new Float(0.0), new ColorUIResource(221, 232, 243),
218: new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)}));
219: defaults.put("CheckBoxMenuItem.gradient", Arrays.asList(new Object[]
220: {new Float(0.3), new Float(0.0), new ColorUIResource(221, 232, 243),
221: new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)}));
222: defaults.put("MenuBar.gradient", Arrays.asList(new Object[]
223: {new Float(1.0), new Float(0.0), new ColorUIResource(Color.WHITE),
224: new ColorUIResource(218, 218, 218), new ColorUIResource(218, 218, 218)}));
225: defaults.put("RadioButton.gradient", Arrays.asList(new Object[]
226: {new Float(0.3), new Float(0.0), new ColorUIResource(221, 232, 243),
227: new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)}));
228: defaults.put("RadioButtonMenuItem.gradient", Arrays.asList(new Object[]
229: {new Float(0.3), new Float(0.0), new ColorUIResource(221, 232, 243),
230: new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)}));
231: defaults.put("ScrollBar.gradient", Arrays.asList(new Object[]
232: {new Float(0.3), new Float(0.0), new ColorUIResource(221, 232, 243),
233: new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)}));
234: defaults.put("Slider.gradient", Arrays.asList(new Object[]
235: {new Float(0.3), new Float(0.2), new ColorUIResource(200, 221, 242),
236: new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)}));
237: defaults.put("Slider.focusGradient", Arrays.asList(new Object[]
238: {new Float(0.3), new Float(0.2), new ColorUIResource(200, 221, 242),
239: new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)}));
240: defaults.put("ToggleButton.gradient", Arrays.asList(new Object[]
241: {new Float(0.3), new Float(0.0), new ColorUIResource(221, 232, 243),
242: new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)}));
243: defaults.put("InternalFrame.activeTitleGradient", Arrays.asList(new Object[]
244: {new Float(0.3), new Float(0.0), new ColorUIResource(221, 232, 243),
245: new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)}));
246:
247:
248: ColorUIResource c1 = new ColorUIResource(200, 221, 242);
249: ColorUIResource c2 = new ColorUIResource(153, 153, 153);
250: ColorUIResource c3 = new ColorUIResource(204, 204, 204);
251: ColorUIResource c4 = new ColorUIResource(210, 226, 239);
252: ColorUIResource c5 = new ColorUIResource(218, 218, 218);
253: defaults.put("Button.disabledToolBarBorderBackground", c3);
254: defaults.put("Button.toolBarBorderBackground", c2);
255: defaults.put("Label.disabledForeground", c2);
256: defaults.put("MenuBar.borderColor", c3);
257: defaults.put("Slider.altTrackColor", c4);
258: defaults.put("SplitPane.dividerFocusColor", c1);
259: defaults.put("TabbedPane.contentAreaColor", c1);
260: defaults.put("TabbedPane.borderHightlightColor", PRIMARY1);
261: defaults.put("TabbedPane.selected", c1);
262: defaults.put("TabbedPane.tabAreaBackground", c5);
263: defaults.put("TabbedPane.unselectedBackground", SECONDARY3);
264: defaults.put("Table.gridColor", SECONDARY1);
265: defaults.put("ToolBar.borderColor", c3);
266: defaults.put("Tree.selectionBorderColor", PRIMARY1);
267:
268:
269: defaults.put("List.focusCellHighlightBorder",
270: new LineBorderUIResource(getPrimary1()));
271: defaults.put("Table.focusCellHighlightBorder",
272: new LineBorderUIResource(getPrimary1()));
273:
274:
275: defaults.put("TabbedPane.contentBorderInsets", new Insets(4, 2, 3, 3));
276: defaults.put("TabbedPane.tabAreaInsets", new Insets(2, 2, 0, 6));
277:
278:
279: defaults.put("SplitPane.oneTouchButtonsOpaque", Boolean.FALSE);
280: defaults.put("Menu.opaque", Boolean.FALSE);
281: defaults.put("ToolBar.isRollover", Boolean.TRUE);
282: defaults.put("RadioButton.rollover", Boolean.TRUE);
283: defaults.put("CheckBox.rollover", Boolean.TRUE);
284: defaults.put("Button.rollover", Boolean.TRUE);
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313: defaults.put("MenuBarUI", "javax.swing.plaf.metal.MetalMenuBarUI");
314:
315:
316: defaults.put("Button.rolloverIconType", "ocean");
317: }
318: }