87 |
// Do nothing here. |
// Do nothing here. |
88 |
} |
} |
89 |
|
|
90 |
|
/** |
91 |
|
* Add a <code>PropertyChangeListener</code> to the listener list. |
92 |
|
* |
93 |
|
* @param listener the listener to add |
94 |
|
*/ |
95 |
public static void addPropertyChangeListener (PropertyChangeListener listener) |
public static void addPropertyChangeListener (PropertyChangeListener listener) |
96 |
{ |
{ |
97 |
// FIXME |
// FIXME |
98 |
} |
} |
99 |
|
|
100 |
|
/** |
101 |
|
* Remove a <code>PropertyChangeListener</code> from the listener list. |
102 |
|
* |
103 |
|
* @param listener the listener to remove |
104 |
|
*/ |
105 |
public static void removePropertyChangeListener (PropertyChangeListener listener) |
public static void removePropertyChangeListener (PropertyChangeListener listener) |
|
// Remove a PropertyChangeListener from the listener list. |
|
106 |
{ |
{ |
107 |
// FIXME |
// FIXME |
108 |
} |
} |
109 |
|
|
110 |
/** |
/** |
111 |
|
* Returns an array of all added <code>PropertyChangeListener</code> objects. |
112 |
|
* |
113 |
|
* @return an array of listeners |
114 |
|
* |
115 |
* @since 1.4 |
* @since 1.4 |
116 |
*/ |
*/ |
117 |
public static PropertyChangeListener[] getPropertyChangeListeners () |
public static PropertyChangeListener[] getPropertyChangeListeners () |
120 |
throw new Error ("Not implemented"); |
throw new Error ("Not implemented"); |
121 |
} |
} |
122 |
|
|
123 |
|
/** |
124 |
|
* Add a LookAndFeel to the list of auxiliary look and feels. |
125 |
|
*/ |
126 |
public static void addAuxiliaryLookAndFeel (LookAndFeel l) |
public static void addAuxiliaryLookAndFeel (LookAndFeel l) |
127 |
{ |
{ |
|
// Add a LookAndFeel to the list of auxiliary look and feels. |
|
128 |
if (aux_installed == null) |
if (aux_installed == null) |
129 |
{ |
{ |
130 |
aux_installed = new LookAndFeel[1]; |
aux_installed = new LookAndFeel[1]; |
216 |
return (Font) getLookAndFeel().getDefaults().get(key); |
return (Font) getLookAndFeel().getDefaults().get(key); |
217 |
} |
} |
218 |
|
|
219 |
|
/** |
220 |
|
* Returns an Icon from the defaults table. |
221 |
|
*/ |
222 |
public static Icon getIcon(Object key) |
public static Icon getIcon(Object key) |
|
// Returns an Icon from the defaults table. |
|
223 |
{ |
{ |
224 |
return (Icon) getLookAndFeel().getDefaults().get(key); |
return (Icon) getLookAndFeel().getDefaults().get(key); |
225 |
} |
} |
226 |
|
|
227 |
|
/** |
228 |
|
* Returns an Insets object from the defaults table. |
229 |
|
*/ |
230 |
public static Insets getInsets(Object key) |
public static Insets getInsets(Object key) |
|
// Returns an Insets object from the defaults table. |
|
231 |
{ |
{ |
232 |
return (Insets) getLookAndFeel().getDefaults().getInsets(key); |
return (Insets) getLookAndFeel().getDefaults().getInsets(key); |
233 |
} |
} |
259 |
return getLookAndFeel().getDefaults(); |
return getLookAndFeel().getDefaults(); |
260 |
} |
} |
261 |
|
|
262 |
|
/** |
263 |
|
* Returns a string from the defaults table. |
264 |
|
*/ |
265 |
public static String getString(Object key) |
public static String getString(Object key) |
|
// Returns a string from the defaults table. |
|
266 |
{ |
{ |
267 |
return (String) getLookAndFeel().getDefaults().get(key); |
return (String) getLookAndFeel().getDefaults().get(key); |
268 |
} |
} |
269 |
|
|
270 |
|
/** |
271 |
|
* Returns the name of the LookAndFeel class that implements the |
272 |
|
* native systems look and feel if there is one, otherwise the name |
273 |
|
* of the default cross platform LookAndFeel class. |
274 |
|
*/ |
275 |
public static String getSystemLookAndFeelClassName() |
public static String getSystemLookAndFeelClassName() |
|
// Returns the name of the LookAndFeel class that implements the native systems look and feel if there is one, otherwise the name of the default cross platform LookAndFeel class. |
|
276 |
{ |
{ |
277 |
return getCrossPlatformLookAndFeelClassName(); |
return getCrossPlatformLookAndFeelClassName(); |
278 |
} |
} |
279 |
|
|
280 |
|
/** |
281 |
|
* Returns the L&F object that renders the target component. |
282 |
|
*/ |
283 |
public static ComponentUI getUI(JComponent target) |
public static ComponentUI getUI(JComponent target) |
|
// Returns the Look and Feel object that renders the target component. |
|
284 |
{ |
{ |
285 |
ComponentUI ui = getDefaults().getUI(target); |
return getDefaults().getUI(target); |
|
//System.out.println("GET-UI-> " + ui + ", for " + target); |
|
|
return ui; |
|
286 |
} |
} |
287 |
|
|
288 |
|
/** |
289 |
|
* Creates a new look and feel and adds it to the current array. |
290 |
|
*/ |
291 |
public static void installLookAndFeel(String name, String className) |
public static void installLookAndFeel(String name, String className) |
|
// Creates a new look and feel and adds it to the current array. |
|
292 |
{ |
{ |
293 |
} |
} |
294 |
|
|
295 |
|
/** |
296 |
|
* Adds the specified look and feel to the current array and then calls |
297 |
|
* setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]). |
298 |
|
*/ |
299 |
public static void installLookAndFeel(LookAndFeelInfo info) |
public static void installLookAndFeel(LookAndFeelInfo info) |
|
// Adds the specified look and feel to the current array and then calls setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]). |
|
300 |
{ |
{ |
301 |
} |
} |
302 |
|
|
303 |
|
/** |
304 |
|
* Stores an object in the defaults table. |
305 |
|
*/ |
306 |
public static Object put(Object key, Object value) |
public static Object put(Object key, Object value) |
|
// Stores an object in the defaults table. |
|
307 |
{ |
{ |
308 |
return getLookAndFeel().getDefaults().put(key,value); |
return getLookAndFeel().getDefaults().put(key,value); |
309 |
} |
} |
310 |
|
|
311 |
|
/** |
312 |
|
* Replaces the current array of installed LookAndFeelInfos. |
313 |
|
*/ |
314 |
public static void setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos) |
public static void setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos) |
|
// Replaces the current array of installed LookAndFeelInfos. |
|
315 |
{ |
{ |
316 |
} |
} |
317 |
|
|
318 |
|
/** |
319 |
|
* Set the current default look. |
320 |
|
*/ |
321 |
public static void setLookAndFeel(LookAndFeel newLookAndFeel) |
public static void setLookAndFeel(LookAndFeel newLookAndFeel) |
322 |
|
throws UnsupportedLookAndFeelException |
323 |
{ |
{ |
324 |
|
if (! newLookAndFeel.isSupportedLookAndFeel()) |
325 |
|
throw new UnsupportedLookAndFeelException(newLookAndFeel.getName()); |
326 |
|
|
327 |
if (look_and_feel != null) |
if (look_and_feel != null) |
328 |
look_and_feel.uninitialize(); |
look_and_feel.uninitialize(); |
329 |
|
|
335 |
//repaint(); |
//repaint(); |
336 |
} |
} |
337 |
|
|
338 |
|
/** |
339 |
|
* Set the current default look and feel using a class name. |
340 |
|
*/ |
341 |
public static void setLookAndFeel (String className) |
public static void setLookAndFeel (String className) |
342 |
throws ClassNotFoundException, InstantiationException, IllegalAccessException, |
throws ClassNotFoundException, InstantiationException, IllegalAccessException, |
343 |
UnsupportedLookAndFeelException |
UnsupportedLookAndFeelException |
344 |
{ |
{ |
|
// Set the current default look and feel using a class name. |
|
345 |
Class c = Class.forName(className); |
Class c = Class.forName(className); |
346 |
LookAndFeel a = (LookAndFeel) c.newInstance(); // throws class-cast-exception |
LookAndFeel a = (LookAndFeel) c.newInstance(); // throws class-cast-exception |
347 |
setLookAndFeel(a); |
setLookAndFeel(a); |