javax.swing
Class MultiUIDefaults
java.lang.Object
java.util.Dictionary
java.util.Hashtable
javax.swing.UIDefaults
javax.swing.MultiUIDefaults
- All Implemented Interfaces:
- Cloneable, Map, Serializable
- class MultiUIDefaults
- extends UIDefaults
- Author:
- Hans Muller
Nested classes inherited from class java.util.Hashtable |
|
Fields inherited from class javax.swing.UIDefaults |
|
Fields inherited from class java.util.Hashtable |
|
Method Summary |
void |
clear()
Clears this hashtable so that it contains no keys. |
Enumeration |
elements()
Returns an enumeration of the values in this hashtable.
|
Object |
get(Object key)
Returns the value for key. |
Object |
get(Object key,
Locale l)
Returns the value for key associated with the given locale.
|
boolean |
isEmpty()
Tests if this hashtable maps no keys to values. |
Enumeration |
keys()
Returns an enumeration of the keys in this hashtable. |
Object |
remove(Object key)
Removes the key (and its corresponding value) from this
hashtable. |
int |
size()
Returns the number of keys in this hashtable. |
Methods inherited from class javax.swing.UIDefaults |
addPropertyChangeListener, addResourceBundle, firePropertyChange, getBoolean, getBoolean, getBorder, getBorder, getColor, getColor, getDefaultLocale, getDimension, getDimension, getFont, getFont, getIcon, getIcon, getInsets, getInsets, getInt, getInt, getPropertyChangeListeners, getString, getString, getUI, getUIClass, getUIClass, getUIError, put, putDefaults, removePropertyChangeListener, removeResourceBundle, setDefaultLocale |
Methods inherited from class java.util.Hashtable |
clone, contains, containsKey, containsValue, entrySet, equals, hashCode, keySet, putAll, rehash, toString, values |
tables
private UIDefaults[] tables
MultiUIDefaults
public MultiUIDefaults(UIDefaults[] defaults)
MultiUIDefaults
public MultiUIDefaults()
get
public Object get(Object key)
- Description copied from class:
UIDefaults
- Returns the value for key. If the value is a
UIDefaults.LazyValue
then the real
value is computed with LazyValue.createValue()
,
the table entry is replaced, and the real value is returned.
If the value is an UIDefaults.ActiveValue
the table entry is not replaced - the value is computed
with ActiveValue.createValue()
for each
get()
call.
If the key is not found in the table then it is searched for in the list
of resource bundles maintained by this object. The resource bundles are
searched most recently added first using the locale returned by
getDefaultLocale
. LazyValues
and
ActiveValues
are not supported in the resource bundles.
- Specified by:
get
in interface Map
- Overrides:
get
in class UIDefaults
- Parameters:
key
- the desired key
- Returns:
- the value for
key
- See Also:
UIDefaults.LazyValue
,
UIDefaults.ActiveValue
,
Hashtable.get(java.lang.Object)
,
UIDefaults.getDefaultLocale()
,
UIDefaults.addResourceBundle(java.lang.String)
get
public Object get(Object key,
Locale l)
- Description copied from class:
UIDefaults
- Returns the value for key associated with the given locale.
If the value is a
UIDefaults.LazyValue
then the real
value is computed with LazyValue.createValue()
,
the table entry is replaced, and the real value is returned.
If the value is an UIDefaults.ActiveValue
the table entry is not replaced - the value is computed
with ActiveValue.createValue()
for each
get()
call.
If the key is not found in the table then it is searched for in the list
of resource bundles maintained by this object. The resource bundles are
searched most recently added first using the given locale.
LazyValues
and ActiveValues
are not supported
in the resource bundles.
- Overrides:
get
in class UIDefaults
- Parameters:
key
- the desired keyl
- the desired locale
- Returns:
- the value for
key
- See Also:
UIDefaults.LazyValue
,
UIDefaults.ActiveValue
,
Hashtable.get(java.lang.Object)
,
UIDefaults.addResourceBundle(java.lang.String)
size
public int size()
- Description copied from class:
Hashtable
- Returns the number of keys in this hashtable.
- Specified by:
size
in interface Map
- Overrides:
size
in class Hashtable
- Returns:
- the number of keys in this hashtable.
isEmpty
public boolean isEmpty()
- Description copied from class:
Hashtable
- Tests if this hashtable maps no keys to values.
- Specified by:
isEmpty
in interface Map
- Overrides:
isEmpty
in class Hashtable
- Returns:
true
if this hashtable maps no keys to values;
false
otherwise.
keys
public Enumeration keys()
- Description copied from class:
Hashtable
- Returns an enumeration of the keys in this hashtable.
- Overrides:
keys
in class Hashtable
- Returns:
- an enumeration of the keys in this hashtable.
- See Also:
Enumeration
,
Hashtable.elements()
,
Hashtable.keySet()
,
Map
elements
public Enumeration elements()
- Description copied from class:
Hashtable
- Returns an enumeration of the values in this hashtable.
Use the Enumeration methods on the returned object to fetch the elements
sequentially.
- Overrides:
elements
in class Hashtable
- Returns:
- an enumeration of the values in this hashtable.
- See Also:
Enumeration
,
Hashtable.keys()
,
Hashtable.values()
,
Map
remove
public Object remove(Object key)
- Description copied from class:
Hashtable
- Removes the key (and its corresponding value) from this
hashtable. This method does nothing if the key is not in the hashtable.
- Specified by:
remove
in interface Map
- Overrides:
remove
in class Hashtable
- Parameters:
key
- the key that needs to be removed.
- Returns:
- the value to which the key had been mapped in this hashtable,
or
null
if the key did not have a mapping.
clear
public void clear()
- Description copied from class:
Hashtable
- Clears this hashtable so that it contains no keys.
- Specified by:
clear
in interface Map
- Overrides:
clear
in class Hashtable