KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > swingwtx > swing > plaf > metal > DefaultMetalTheme


1 /*
2    SwingWT
3    Copyright(c)2003-2004, R. Rawson-Tetley
4
5    For more information on distributing and using this program, please
6    see the accompanying "COPYING" file.
7
8    Contact me by electronic mail: bobintetley@users.sourceforge.net
9
10    $Log: DefaultMetalTheme.java,v $
11    Revision 1.1 2004/01/26 08:11:14 bobintetley
12    Many bugfixes and addition of SwingSet
13
14
15 */

16
17 package swingwtx.swing.plaf.metal;
18
19 import swingwt.awt.Font;
20 import swingwtx.swing.plaf.ColorUIResource;
21 import swingwtx.swing.plaf.FontUIResource;
22
23 public class DefaultMetalTheme extends MetalTheme {
24     
25     private static final String JavaDoc[] fontNames = {
26         "Dialog", "Dialog", "Dialog", "Dialog", "Dialog", "Dialog"
27     };
28     
29     private static final int[] fontStyles = {
30         Font.BOLD, Font.PLAIN, Font.PLAIN, Font.BOLD, Font.BOLD, Font.PLAIN
31     };
32     
33     private static final int[] fontSizes = {
34         12, 12, 12, 12, 12, 10
35     };
36     private static final String JavaDoc[] defaultNames = {
37         "swing.plaf.metal.controlFont",
38         "swing.plaf.metal.systemFont",
39         "swing.plaf.metal.userFont",
40         "swing.plaf.metal.controlFont",
41         "swing.plaf.metal.controlFont",
42         "swing.plaf.metal.smallFont"
43     };
44     
45     static String JavaDoc getDefaultFontName(int key) {
46         return fontNames[key];
47     }
48     static int getDefaultFontSize(int key) {
49         return fontSizes[key];
50     }
51     static int getDefaultFontStyle(int key) {
52         return fontStyles[key];
53     }
54     static String JavaDoc getDefaultPropertyName(int key) {
55         return defaultNames[key];
56     }
57     private static final ColorUIResource primary1 = new ColorUIResource(
58     102, 102, 153);
59     private static final ColorUIResource primary2 = new ColorUIResource(153,
60     153, 204);
61     private static final ColorUIResource primary3 = new ColorUIResource(
62     204, 204, 255);
63     private static final ColorUIResource secondary1 = new ColorUIResource(
64     102, 102, 102);
65     private static final ColorUIResource secondary2 = new ColorUIResource(
66     153, 153, 153);
67     private static final ColorUIResource secondary3 = new ColorUIResource(
68     204, 204, 204);
69
70     public String JavaDoc getName() { return "Steel"; }
71     
72     public DefaultMetalTheme() {
73         install();
74     }
75     protected ColorUIResource getPrimary1() { return primary1; }
76     protected ColorUIResource getPrimary2() { return primary2; }
77     protected ColorUIResource getPrimary3() { return primary3; }
78     protected ColorUIResource getSecondary1() { return secondary1; }
79     protected ColorUIResource getSecondary2() { return secondary2; }
80     protected ColorUIResource getSecondary3() { return secondary3; }
81     
82     
83     public FontUIResource getControlTextFont() {
84         return getFont(CONTROL_TEXT_FONT);
85     }
86     
87     public FontUIResource getSystemTextFont() {
88         return getFont(SYSTEM_TEXT_FONT);
89     }
90     
91     public FontUIResource getUserTextFont() {
92         return getFont(USER_TEXT_FONT);
93     }
94     
95     public FontUIResource getMenuTextFont() {
96         return getFont(MENU_TEXT_FONT);
97     }
98     
99     public FontUIResource getWindowTitleFont() {
100         return getFont(WINDOW_TITLE_FONT);
101     }
102     
103     public FontUIResource getSubTextFont() {
104         return getFont(SUB_TEXT_FONT);
105     }
106     
107     private FontUIResource getFont(int key) {
108         return null;
109     }
110     
111     void install() {
112     }
113     boolean isSystemTheme() {
114         return (getClass() == DefaultMetalTheme.class);
115     }
116 }
117
Popular Tags