javax.swing
public class UIDefaults extends Hashtable<Object,Object>
Nested Class Summary | |
---|---|
static interface | UIDefaults.ActiveValue
Used for lazy instantiation of UIDefaults values so that they are not
all loaded when a Swing application starts up, but only the values that
are really needed. |
static class | UIDefaults.LazyInputMap |
static interface | UIDefaults.LazyValue
Used for lazy instantiation of UIDefaults values so that they are not
all loaded when a Swing application starts up, but only the values that
are really needed. |
static class | UIDefaults.ProxyLazyValue |
Constructor Summary | |
---|---|
UIDefaults()
Constructs a new empty UIDefaults instance. | |
UIDefaults(Object[] entries)
Constructs a new UIDefaults instance and loads the specified entries.
|
Method Summary | |
---|---|
void | addPropertyChangeListener(PropertyChangeListener listener)
Adds a {@link PropertyChangeListener} to this UIDefaults map.
|
void | addResourceBundle(String name)
Adds a ResourceBundle for localized values.
|
protected void | firePropertyChange(String property, Object oldValue, Object newValue)
Fires a PropertyChangeEvent.
|
Object | get(Object key)
Returns the entry for the specified key in the default
locale.
|
Object | get(Object key, Locale loc)
Returns the entry for the specified key in the Locale
loc .
|
boolean | getBoolean(Object key)
Returns a boolean entry for the default locale.
|
boolean | getBoolean(Object key, Locale locale)
Returns a boolean entry for a specic locale.
|
Border | getBorder(Object key)
Returns a border entry for the default locale.
|
Border | getBorder(Object key, Locale locale)
Returns a border entry for a specic locale.
|
Color | getColor(Object key)
Returns a color entry for the default locale.
|
Color | getColor(Object key, Locale locale)
Returns a color entry for a specic locale.
|
Locale | getDefaultLocale()
Returns the current default locale.
|
Dimension | getDimension(Object key)
Returns a dimension entry for the default locale.
|
Dimension | getDimension(Object key, Locale locale)
Returns a dimension entry for a specic locale.
|
Font | getFont(Object key)
Returns a font entry for the default locale.
|
Font | getFont(Object key, Locale locale)
Returns a font entry for a specic locale.
|
Icon | getIcon(Object key)
Returns an icon entry for the default locale.
|
Icon | getIcon(Object key, Locale locale)
Returns an icon entry for a specic locale.
|
Insets | getInsets(Object key)
Returns an insets entry for the default locale.
|
Insets | getInsets(Object key, Locale locale)
Returns an insets entry for a specic locale.
|
int | getInt(Object key)
Returns an integer entry for the default locale.
|
int | getInt(Object key, Locale locale)
Returns an integer entry for a specic locale.
|
PropertyChangeListener[] | getPropertyChangeListeners()
Returns an array of all registered PropertyChangeListeners.
|
String | getString(Object key)
Returns a string entry for the default locale.
|
String | getString(Object key, Locale locale)
Returns a string entry for a specic locale.
|
ComponentUI | getUI(JComponent target)
Returns the {@link ComponentUI} for the specified {@link JComponent}.
|
Class<? extends ComponentUI> | getUIClass(String id, ClassLoader loader)
Returns the ComponentUI class that renders a component. |
Class<? extends ComponentUI> | getUIClass(String id)
Returns the ComponentUI class that renders a component. |
protected void | getUIError(String msg)
If a key is requested in #get(key) that has no value, this method
is called before returning null .
|
Object | put(Object key, Object value)
Puts a key and value into this UIDefaults object. In contrast to {@link java.util.Hashtable}s null -values are accepted
here and treated like #remove(key).
|
void | putDefaults(Object[] entries)
Puts a set of key-value pairs into the map.
|
void | removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from this UIDefaults map.
|
void | removeResourceBundle(String name)
Removes a ResourceBundle.
|
void | setDefaultLocale(Locale loc)
Sets the current locale to loc .
|
entries[0]
is a key, entries[1]
is a value,
entries[2]
a key and so forth.
Parameters: entries the entries to initialize the UIDefaults instance with
Parameters: listener the PropertyChangeListener to add
Parameters: name the name of the ResourceBundle to add
Parameters: property the property name oldValue the old value newValue the new value
key
in the default
locale.
Returns: the entry for the specified key
key
in the Locale
loc
.
Parameters: key the key for which we return the value loc the locale
Parameters: key the key to the requested entry
Returns: The boolean entry for key
or false
if no
such entry exists.
Parameters: key the key to the requested entry locale the locale to the requested entry
Returns: the boolean entry for key
or null if no such entry
exists
Parameters: key the key to the requested entry
Returns: the border entry for key
or null if no such entry
exists
Parameters: key the key to the requested entry locale the locale to the requested entry
Returns: the border entry for key
or null if no such entry
exists
Parameters: key the key to the requested entry
Returns: the color entry for key
or null if no such entry
exists
Parameters: key the key to the requested entry locale the locale to the requested entry
Returns: the color entry for key
or null if no such entry
exists
Returns: the current default locale
Parameters: key the key to the requested entry
Returns: the dimension entry for key
or null if no such entry
exists
Parameters: key the key to the requested entry locale the locale to the requested entry
Returns: the boolean entry for key
or null if no such entry
exists
Parameters: key the key to the requested entry
Returns: the font entry for key
or null if no such entry
exists
Parameters: key the key to the requested entry locale the locale to the requested entry
Returns: the font entry for key
or null if no such entry
exists
Parameters: key the key to the requested entry
Returns: the icon entry for key
or null if no such entry
exists
Parameters: key the key to the requested entry locale the locale to the requested entry
Returns: the icon entry for key
or null if no such entry
exists
Parameters: key the key to the requested entry
Returns: the insets entry for key
or null if no such entry
exists
Parameters: key the key to the requested entry locale the locale to the requested entry
Returns: the boolean entry for key
or null if no such entry
exists
Parameters: key the key to the requested entry
Returns: the integer entry for key
or null if no such entry
exists
Parameters: key the key to the requested entry locale the locale to the requested entry
Returns: the integer entry for key
or null if no such entry
exists
Returns: all registered PropertyChangeListeners
Parameters: key the key to the requested entry
Returns: the string entry for key
or null if no such entry
exists
Parameters: key the key to the requested entry locale the locale to the requested entry
Returns: the string entry for key
or null if no such entry
exists
Parameters: target the component for which the ComponentUI is requested
Returns: the {@link ComponentUI} for the specified {@link JComponent}
id
is the ID for which the String value of the classname is stored in
this UIDefaults map.
Parameters: id the ID of the UI class loader the ClassLoader to use
Returns: the UI class for id
id
is the ID for which the String value of the classname is stored in
this UIDefaults map.
Parameters: id the ID of the UI class
Returns: the UI class for id
null
.
Parameters: msg the error message
null
-values are accepted
here and treated like #remove(key).
Parameters: key the key to put into the map value the value to put into the map
Returns: the old value for key or null
if key
had no value assigned
entries[0]
is a key, entries[1]
is a value,
entries[2]
a key and so forth.
null
it is treated like #remove(key).
'UIDefaults'
as name and null
for
old and new value.
Parameters: entries the entries to be put into the map
Parameters: listener the PropertyChangeListener to remove
Parameters: name the name of the ResourceBundle to remove
loc
.
Parameters: loc the Locale to be set