001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: /**
019: * @author Sergey Burlak
020: * @version $Revision$
021: */package javax.swing.plaf.metal;
022:
023: import javax.swing.UIDefaults;
024: import javax.swing.plaf.ColorUIResource;
025: import javax.swing.plaf.FontUIResource;
026:
027: public abstract class MetalTheme {
028:
029: private static final ColorUIResource blackColor = new ColorUIResource(
030: 0, 0, 0);
031: private static final ColorUIResource whiteColor = new ColorUIResource(
032: 255, 255, 255);
033:
034: /**
035: */
036: public MetalTheme() {
037: }
038:
039: /**
040: * Return the theme name
041: * @return String name
042: */
043: public abstract String getName();
044:
045: /**
046: * Return window title font
047: * @return FontUIResource result
048: */
049: public abstract FontUIResource getWindowTitleFont();
050:
051: /**
052: * Return user text font
053: * @return FontUIResource result
054: */
055: public abstract FontUIResource getUserTextFont();
056:
057: /**
058: * Return system text font
059: * @return FontUIResource result
060: */
061: public abstract FontUIResource getSystemTextFont();
062:
063: /**
064: * Return sub text font
065: * @return FontUIResource result
066: */
067: public abstract FontUIResource getSubTextFont();
068:
069: /**
070: * Return menu text font
071: * @return FontUIResource result
072: */
073: public abstract FontUIResource getMenuTextFont();
074:
075: /**
076: * Return control text font
077: * @return FontUIResource result
078: */
079: public abstract FontUIResource getControlTextFont();
080:
081: protected abstract ColorUIResource getPrimary3();
082:
083: protected abstract ColorUIResource getPrimary2();
084:
085: protected abstract ColorUIResource getPrimary1();
086:
087: protected abstract ColorUIResource getSecondary3();
088:
089: protected abstract ColorUIResource getSecondary2();
090:
091: protected abstract ColorUIResource getSecondary1();
092:
093: /**
094: * Return window title inactive foreground color
095: * @return ColorUIResource result
096: */
097: public ColorUIResource getWindowTitleInactiveForeground() {
098: return getBlack();
099: }
100:
101: /**
102: * Return window title inactive background color
103: * @return ColorUIResource result
104: */
105: public ColorUIResource getWindowTitleInactiveBackground() {
106: return getSecondary3();
107: }
108:
109: /**
110: * Return window title foreground color
111: * @return ColorUIResource result
112: */
113: public ColorUIResource getWindowTitleForeground() {
114: return getBlack();
115: }
116:
117: /**
118: * Return window title background color
119: * @return ColorUIResource result
120: */
121: public ColorUIResource getWindowTitleBackground() {
122: return getPrimary3();
123: }
124:
125: /**
126: * Return window background color
127: * @return ColorUIResource result
128: */
129: public ColorUIResource getWindowBackground() {
130: return getWhite();
131: }
132:
133: /**
134: * Return white color
135: * @return ColorUIResource result
136: */
137: protected ColorUIResource getWhite() {
138: return whiteColor;
139: }
140:
141: /**
142: * Return user text color
143: * @return ColorUIResource result
144: */
145: public ColorUIResource getUserTextColor() {
146: return getBlack();
147: }
148:
149: /**
150: * Return user text color
151: * @return ColorUIResource result
152: */
153: public ColorUIResource getTextHighlightColor() {
154: return getPrimary3();
155: }
156:
157: /**
158: * Return system text color
159: * @return ColorUIResource result
160: */
161: public ColorUIResource getSystemTextColor() {
162: return getBlack();
163: }
164:
165: /**
166: * Return separator foreground color
167: * @return ColorUIResource result
168: */
169: public ColorUIResource getSeparatorForeground() {
170: return getPrimary1();
171: }
172:
173: /**
174: * Return separator background color
175: * @return ColorUIResource result
176: */
177: public ColorUIResource getSeparatorBackground() {
178: return getWhite();
179: }
180:
181: /**
182: * Return primary control shadow color
183: * @return ColorUIResource result
184: */
185: public ColorUIResource getPrimaryControlShadow() {
186: return getPrimary2();
187: }
188:
189: /**
190: * Return primary control info color
191: * @return ColorUIResource result
192: */
193: public ColorUIResource getPrimaryControlInfo() {
194: return getBlack();
195: }
196:
197: /**
198: * Return primary control highlight color
199: * @return ColorUIResource result
200: */
201: public ColorUIResource getPrimaryControlHighlight() {
202: return getWhite();
203: }
204:
205: /**
206: * Return primary control dark shadow color
207: * @return ColorUIResource result
208: */
209: public ColorUIResource getPrimaryControlDarkShadow() {
210: return getPrimary1();
211: }
212:
213: /**
214: * Return primary control color
215: * @return ColorUIResource result
216: */
217: public ColorUIResource getPrimaryControl() {
218: return getPrimary3();
219: }
220:
221: /**
222: * Return menu selected foreground color
223: * @return ColorUIResource result
224: */
225: public ColorUIResource getMenuSelectedForeground() {
226: return getBlack();
227: }
228:
229: /**
230: * Return menu selected background color
231: * @return ColorUIResource result
232: */
233: public ColorUIResource getMenuSelectedBackground() {
234: return getPrimary2();
235: }
236:
237: /**
238: * Return menu foreground color
239: * @return ColorUIResource result
240: */
241: public ColorUIResource getMenuForeground() {
242: return getBlack();
243: }
244:
245: /**
246: * Return menu disabled foreground color
247: * @return ColorUIResource result
248: */
249: public ColorUIResource getMenuDisabledForeground() {
250: return getSecondary2();
251: }
252:
253: /**
254: * Return menu background color
255: * @return ColorUIResource result
256: */
257: public ColorUIResource getMenuBackground() {
258: return getSecondary3();
259: }
260:
261: /**
262: * Return inactive system text color
263: * @return ColorUIResource result
264: */
265: public ColorUIResource getInactiveSystemTextColor() {
266: return getSecondary2();
267: }
268:
269: /**
270: * Return inactive control text color
271: * @return ColorUIResource result
272: */
273: public ColorUIResource getInactiveControlTextColor() {
274: return getSecondary2();
275: }
276:
277: /**
278: * Return highlighted text color
279: * @return ColorUIResource result
280: */
281: public ColorUIResource getHighlightedTextColor() {
282: return getBlack();
283: }
284:
285: /**
286: * Return focus color
287: * @return ColorUIResource result
288: */
289: public ColorUIResource getFocusColor() {
290: return getPrimary2();
291: }
292:
293: /**
294: * Return desktop color
295: * @return ColorUIResource result
296: */
297: public ColorUIResource getDesktopColor() {
298: return getPrimary2();
299: }
300:
301: /**
302: * Return control text color
303: * @return ColorUIResource result
304: */
305: public ColorUIResource getControlTextColor() {
306: return getBlack();
307: }
308:
309: /**
310: * Return control shadow color
311: * @return ColorUIResource result
312: */
313: public ColorUIResource getControlShadow() {
314: return getSecondary2();
315: }
316:
317: /**
318: * Return control info color
319: * @return ColorUIResource result
320: */
321: public ColorUIResource getControlInfo() {
322: return getBlack();
323: }
324:
325: /**
326: * Return control highlight color
327: * @return ColorUIResource result
328: */
329: public ColorUIResource getControlHighlight() {
330: return getWhite();
331: }
332:
333: /**
334: * Return control disabled color
335: * @return ColorUIResource result
336: */
337: public ColorUIResource getControlDisabled() {
338: return getSecondary2();
339: }
340:
341: /**
342: * Return control dark shadow color
343: * @return ColorUIResource result
344: */
345: public ColorUIResource getControlDarkShadow() {
346: return getSecondary1();
347: }
348:
349: /**
350: * Return control color
351: * @return ColorUIResource result
352: */
353: public ColorUIResource getControl() {
354: return getSecondary3();
355: }
356:
357: /**
358: * Return black color
359: * @return ColorUIResource result
360: */
361: protected ColorUIResource getBlack() {
362: return blackColor;
363: }
364:
365: /**
366: * Return selected accelerator color
367: * @return ColorUIResource result
368: */
369: public ColorUIResource getAcceleratorSelectedForeground() {
370: return getBlack();
371: }
372:
373: /**
374: * Return accelerator foreground color
375: * @return ColorUIResource result
376: */
377: public ColorUIResource getAcceleratorForeground() {
378: return getPrimary1();
379: }
380:
381: /**
382: * Add custom entries to the defaults table
383: * @param uiDefs defaults table
384: */
385: public void addCustomEntriesToTable(final UIDefaults uiDefs) {
386: }
387: }
|