44 |
import java.awt.Insets; |
import java.awt.Insets; |
45 |
import java.beans.PropertyChangeListener; |
import java.beans.PropertyChangeListener; |
46 |
import java.io.Serializable; |
import java.io.Serializable; |
47 |
|
import java.util.Locale; |
48 |
import javax.swing.border.Border; |
import javax.swing.border.Border; |
49 |
import javax.swing.plaf.ComponentUI; |
import javax.swing.plaf.ComponentUI; |
50 |
import javax.swing.plaf.metal.MetalLookAndFeel; |
import javax.swing.plaf.metal.MetalLookAndFeel; |
159 |
} |
} |
160 |
|
|
161 |
public static LookAndFeel[] getAuxiliaryLookAndFeels() |
public static LookAndFeel[] getAuxiliaryLookAndFeels() |
162 |
{ return aux_installed; } |
{ |
163 |
|
return aux_installed; |
164 |
|
} |
165 |
|
|
166 |
public static Object get(Object key) |
public static Object get(Object key) |
167 |
{ return getLookAndFeel().getDefaults().get(key); } |
{ |
168 |
|
return getLookAndFeel().getDefaults().get(key); |
169 |
|
} |
170 |
|
|
171 |
|
public static Object get(Object key, Locale locale) |
172 |
|
{ |
173 |
|
return getLookAndFeel().getDefaults().get(key ,locale); |
174 |
|
} |
175 |
|
|
176 |
|
/** |
177 |
|
* Returns a boolean value from the defaults table, |
178 |
|
* <code>false</code> if key is not present. |
179 |
|
* |
180 |
|
* @since 1.4 |
181 |
|
*/ |
182 |
|
public static boolean getBoolean(Object key) |
183 |
|
{ |
184 |
|
Boolean value = (Boolean) getLookAndFeel().getDefaults().get(key); |
185 |
|
return value != null ? value.booleanValue() : false; |
186 |
|
} |
187 |
|
|
188 |
|
/** |
189 |
|
* Returns a boolean value from the defaults table, |
190 |
|
* <code>false</code> if key is not present. |
191 |
|
* |
192 |
|
* @since 1.4 |
193 |
|
*/ |
194 |
|
public static boolean getBoolean(Object key, Locale locale) |
195 |
|
{ |
196 |
|
Boolean value = (Boolean) getLookAndFeel().getDefaults().get(key, locale); |
197 |
|
return value != null ? value.booleanValue() : false; |
198 |
|
} |
199 |
|
|
200 |
/** |
/** |
201 |
* Returns a border from the defaults table. |
* Returns a border from the defaults table. |
206 |
} |
} |
207 |
|
|
208 |
/** |
/** |
209 |
|
* Returns a border from the defaults table. |
210 |
|
* |
211 |
|
* @since 1.4 |
212 |
|
*/ |
213 |
|
public static Border getBorder(Object key, Locale locale) |
214 |
|
{ |
215 |
|
return (Border) getLookAndFeel().getDefaults().get(key, locale); |
216 |
|
} |
217 |
|
|
218 |
|
/** |
219 |
* Returns a drawing color from the defaults table. |
* Returns a drawing color from the defaults table. |
220 |
*/ |
*/ |
221 |
public static Color getColor(Object key) |
public static Color getColor(Object key) |
224 |
} |
} |
225 |
|
|
226 |
/** |
/** |
227 |
|
* Returns a drawing color from the defaults table. |
228 |
|
*/ |
229 |
|
public static Color getColor(Object key, Locale locale) |
230 |
|
{ |
231 |
|
return (Color) getLookAndFeel().getDefaults().get(key); |
232 |
|
} |
233 |
|
|
234 |
|
/** |
235 |
* this string can be passed to Class.forName() |
* this string can be passed to Class.forName() |
236 |
*/ |
*/ |
237 |
public static String getCrossPlatformLookAndFeelClassName() |
public static String getCrossPlatformLookAndFeelClassName() |
256 |
} |
} |
257 |
|
|
258 |
/** |
/** |
259 |
|
* Returns a dimension from the defaults table. |
260 |
|
*/ |
261 |
|
public static Dimension getDimension(Object key, Locale locale) |
262 |
|
{ |
263 |
|
return (Dimension) getLookAndFeel().getDefaults().get(key, locale); |
264 |
|
} |
265 |
|
|
266 |
|
/** |
267 |
* Retrieves a font from the defaults table of the current |
* Retrieves a font from the defaults table of the current |
268 |
* LookAndFeel. |
* LookAndFeel. |
269 |
* |
* |
277 |
} |
} |
278 |
|
|
279 |
/** |
/** |
280 |
|
* Retrieves a font from the defaults table of the current |
281 |
|
* LookAndFeel. |
282 |
|
* |
283 |
|
* @param key an Object that specifies the font. Typically, |
284 |
|
* this is a String such as |
285 |
|
* <code>TitledBorder.font</code>. |
286 |
|
*/ |
287 |
|
public static Font getFont(Object key, Locale locale) |
288 |
|
{ |
289 |
|
return (Font) getLookAndFeel().getDefaults().get(key ,locale); |
290 |
|
} |
291 |
|
|
292 |
|
/** |
293 |
* Returns an Icon from the defaults table. |
* Returns an Icon from the defaults table. |
294 |
*/ |
*/ |
295 |
public static Icon getIcon(Object key) |
public static Icon getIcon(Object key) |
298 |
} |
} |
299 |
|
|
300 |
/** |
/** |
301 |
|
* Returns an Icon from the defaults table. |
302 |
|
*/ |
303 |
|
public static Icon getIcon(Object key, Locale locale) |
304 |
|
{ |
305 |
|
return (Icon) getLookAndFeel().getDefaults().get(key, locale); |
306 |
|
} |
307 |
|
|
308 |
|
/** |
309 |
* Returns an Insets object from the defaults table. |
* Returns an Insets object from the defaults table. |
310 |
*/ |
*/ |
311 |
public static Insets getInsets(Object key) |
public static Insets getInsets(Object key) |
313 |
return (Insets) getLookAndFeel().getDefaults().getInsets(key); |
return (Insets) getLookAndFeel().getDefaults().getInsets(key); |
314 |
} |
} |
315 |
|
|
316 |
|
/** |
317 |
|
* Returns an Insets object from the defaults table. |
318 |
|
*/ |
319 |
|
public static Insets getInsets(Object key, Locale locale) |
320 |
|
{ |
321 |
|
return (Insets) getLookAndFeel().getDefaults().getInsets(key, locale); |
322 |
|
} |
323 |
|
|
324 |
public static LookAndFeelInfo[] getInstalledLookAndFeels() |
public static LookAndFeelInfo[] getInstalledLookAndFeels() |
325 |
{ |
{ |
326 |
return installed; |
return installed; |
334 |
return x.intValue(); |
return x.intValue(); |
335 |
} |
} |
336 |
|
|
337 |
|
public static int getInt(Object key, Locale locale) |
338 |
|
{ |
339 |
|
Integer x = (Integer) getLookAndFeel().getDefaults().get(key, locale); |
340 |
|
if (x == null) |
341 |
|
return 0; |
342 |
|
return x.intValue(); |
343 |
|
} |
344 |
|
|
345 |
public static LookAndFeel getLookAndFeel() |
public static LookAndFeel getLookAndFeel() |
346 |
{ |
{ |
347 |
return look_and_feel; |
return look_and_feel; |
365 |
} |
} |
366 |
|
|
367 |
/** |
/** |
368 |
|
* Returns a string from the defaults table. |
369 |
|
*/ |
370 |
|
public static String getString(Object key, Locale locale) |
371 |
|
{ |
372 |
|
return (String) getLookAndFeel().getDefaults().get(key, locale); |
373 |
|
} |
374 |
|
|
375 |
|
/** |
376 |
* Returns the name of the LookAndFeel class that implements the |
* Returns the name of the LookAndFeel class that implements the |
377 |
* native systems look and feel if there is one, otherwise the name |
* native systems look and feel if there is one, otherwise the name |
378 |
* of the default cross platform LookAndFeel class. |
* of the default cross platform LookAndFeel class. |