1 |
/* DefaultMetalTheme.java -- |
/* DefaultMetalTheme.java -- |
2 |
Copyright (C) 2004 Free Software Foundation, Inc. |
Copyright (C) 2004, 2005 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
43 |
import javax.swing.plaf.ColorUIResource; |
import javax.swing.plaf.ColorUIResource; |
44 |
import javax.swing.plaf.FontUIResource; |
import javax.swing.plaf.FontUIResource; |
45 |
|
|
46 |
|
/** |
47 |
|
* The default theme for the {@link MetalLookAndFeel}. |
48 |
|
* |
49 |
|
* @see MetalLookAndFeel#setCurrentTheme(MetalTheme) |
50 |
|
*/ |
51 |
public class DefaultMetalTheme extends MetalTheme |
public class DefaultMetalTheme extends MetalTheme |
52 |
{ |
{ |
53 |
private static final ColorUIResource PRIMARY1 = |
private static final ColorUIResource PRIMARY1 = |
76 |
private static final FontUIResource WINDOW_TITLE_FONT = |
private static final FontUIResource WINDOW_TITLE_FONT = |
77 |
new FontUIResource("Dialog", Font.BOLD, 12); |
new FontUIResource("Dialog", Font.BOLD, 12); |
78 |
|
|
79 |
|
/** |
80 |
|
* Creates a new instance of this theme. |
81 |
|
*/ |
82 |
public DefaultMetalTheme() |
public DefaultMetalTheme() |
83 |
{ |
{ |
84 |
// Do nothing here. |
// Do nothing here. |
85 |
} |
} |
86 |
|
|
87 |
|
/** |
88 |
|
* Returns the name of the theme. |
89 |
|
* |
90 |
|
* @return <code>"Steel"</code>. |
91 |
|
*/ |
92 |
public String getName() |
public String getName() |
93 |
{ |
{ |
94 |
return "Steel"; |
return "Steel"; |
95 |
} |
} |
96 |
|
|
97 |
|
/** |
98 |
|
* Returns the first primary color for this theme. |
99 |
|
* |
100 |
|
* @return The first primary color. |
101 |
|
*/ |
102 |
protected ColorUIResource getPrimary1() |
protected ColorUIResource getPrimary1() |
103 |
{ |
{ |
104 |
return PRIMARY1; |
return PRIMARY1; |
105 |
} |
} |
106 |
|
|
107 |
|
/** |
108 |
|
* Returns the second primary color for this theme. |
109 |
|
* |
110 |
|
* @return The second primary color. |
111 |
|
*/ |
112 |
protected ColorUIResource getPrimary2() |
protected ColorUIResource getPrimary2() |
113 |
{ |
{ |
114 |
return PRIMARY2; |
return PRIMARY2; |
115 |
} |
} |
116 |
|
|
117 |
|
/** |
118 |
|
* Returns the third primary color for this theme. |
119 |
|
* |
120 |
|
* @return The third primary color. |
121 |
|
*/ |
122 |
protected ColorUIResource getPrimary3() |
protected ColorUIResource getPrimary3() |
123 |
{ |
{ |
124 |
return PRIMARY3; |
return PRIMARY3; |
125 |
} |
} |
126 |
|
|
127 |
|
/** |
128 |
|
* Returns the first secondary color for this theme. |
129 |
|
* |
130 |
|
* @return The first secondary color. |
131 |
|
*/ |
132 |
protected ColorUIResource getSecondary1() |
protected ColorUIResource getSecondary1() |
133 |
{ |
{ |
134 |
return SECONDARY1; |
return SECONDARY1; |
135 |
} |
} |
136 |
|
|
137 |
|
/** |
138 |
|
* Returns the second secondary color for this theme. |
139 |
|
* |
140 |
|
* @return The second secondary color. |
141 |
|
*/ |
142 |
protected ColorUIResource getSecondary2() |
protected ColorUIResource getSecondary2() |
143 |
{ |
{ |
144 |
return SECONDARY2; |
return SECONDARY2; |
145 |
} |
} |
146 |
|
|
147 |
|
/** |
148 |
|
* Returns the third secondary color for this theme. |
149 |
|
* |
150 |
|
* @return The third secondary color. |
151 |
|
*/ |
152 |
protected ColorUIResource getSecondary3() |
protected ColorUIResource getSecondary3() |
153 |
{ |
{ |
154 |
return SECONDARY3; |
return SECONDARY3; |
155 |
} |
} |
156 |
|
|
157 |
|
/** |
158 |
|
* Returns the font used for text on controls. In this case, the font is |
159 |
|
* <code>FontUIResource("Dialog", Font.BOLD, 12)</code>. |
160 |
|
* |
161 |
|
* @return The font. |
162 |
|
*/ |
163 |
public FontUIResource getControlTextFont() |
public FontUIResource getControlTextFont() |
164 |
{ |
{ |
165 |
return CONTROL_TEXT_FONT; |
return CONTROL_TEXT_FONT; |
166 |
} |
} |
167 |
|
/** |
168 |
|
* Returns the font used for text in menus. In this case, the font is |
169 |
|
* <code>FontUIResource("Dialog", Font.BOLD, 12)</code>. |
170 |
|
* |
171 |
|
* @return The font used for text in menus. |
172 |
|
*/ |
173 |
public FontUIResource getMenuTextFont() |
public FontUIResource getMenuTextFont() |
174 |
{ |
{ |
175 |
return MENU_TEXT_FONT; |
return MENU_TEXT_FONT; |
176 |
} |
} |
177 |
|
|
178 |
|
/** |
179 |
|
* Returns the font used for sub text. In this case, the font is |
180 |
|
* <code>FontUIResource("Dialog", Font.PLAIN, 10)</code>. |
181 |
|
* |
182 |
|
* @return The font used for sub text. |
183 |
|
*/ |
184 |
public FontUIResource getSubTextFont() |
public FontUIResource getSubTextFont() |
185 |
{ |
{ |
186 |
return SUB_TEXT_FONT; |
return SUB_TEXT_FONT; |
187 |
} |
} |
188 |
|
|
189 |
|
/** |
190 |
|
* Returns the font used for system text. In this case, the font is |
191 |
|
* <code>FontUIResource("Dialog", Font.PLAIN, 12)</code>. |
192 |
|
* |
193 |
|
* @return The font used for system text. |
194 |
|
*/ |
195 |
public FontUIResource getSystemTextFont() |
public FontUIResource getSystemTextFont() |
196 |
{ |
{ |
197 |
return SYSTEM_TEXT_FONT; |
return SYSTEM_TEXT_FONT; |
198 |
} |
} |
199 |
|
|
200 |
|
/** |
201 |
|
* Returns the font used for user text. In this case, the font is |
202 |
|
* <code>FontUIResource("Dialog", Font.PLAIN, 12)</code>. |
203 |
|
* |
204 |
|
* @return The font used for user text. |
205 |
|
*/ |
206 |
public FontUIResource getUserTextFont() |
public FontUIResource getUserTextFont() |
207 |
{ |
{ |
208 |
return USER_TEXT_FONT; |
return USER_TEXT_FONT; |
209 |
} |
} |
210 |
|
|
211 |
|
/** |
212 |
|
* Returns the font used for window titles. In this case, the font is |
213 |
|
* <code>FontUIResource("Dialog", Font.BOLD, 12)</code>. |
214 |
|
* |
215 |
|
* @return The font used for window titles. |
216 |
|
*/ |
217 |
public FontUIResource getWindowTitleFont() |
public FontUIResource getWindowTitleFont() |
218 |
{ |
{ |
219 |
return WINDOW_TITLE_FONT; |
return WINDOW_TITLE_FONT; |