Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Dictionary | +--java.util.Hashtable | +--com.sun.java.swing.UIDefaults
Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Inner Class Summary | |
static | UIDefaults.ActiveValue
This class enables one to store an entry in the defaults table that's constructed each time it's looked up with one of the getXXX(key) methods. |
static | UIDefaults.LazyValue
This class enables one to store an entry in the defaults table that isn't constructed until the first time it's looked up with one of the getXXX(key) methods.
|
Constructor Summary | |
UIDefaults()
Create an empty defaults table. |
|
UIDefaults(java.lang.Object[] keyValueList)
Create a defaults table initialized with the specified key/value pairs. |
Method Summary | |
void | addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. |
void | firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Support for reporting bound property changes. |
Border | getBorder(java.lang.Object key)
If the value of key is a Border return it, otherwise
return null. |
java.awt.Color | getColor(java.lang.Object key)
If the value of key is a Color return it, otherwise
return null. |
java.awt.Font | getFont(java.lang.Object key)
If the value of key is a Font return it, otherwise
return null. |
Icon | getIcon(java.lang.Object key)
If the value of key is an Icon return it, otherwise
return null. |
java.lang.String | getString(java.lang.Object key)
If the value of key is a String return it, otherwise
return null. |
java.lang.Class | getUIClass(java.lang.String uiClassID)
The value of get(uidClassID) must be the String name of a class that implements the corresponding ComponentUI class. |
java.lang.Object | get(java.lang.Object key)
|
void | getUIError(java.lang.String msg)
If getUI() fails for any reason, it calls this method before returning null. |
com.sun.java.swing.plaf.ComponentUI | getUI(JComponent target)
Create an ComponentUI implementation for the specified component. |
void | putDefaults(java.lang.Object[] keyValueList)
Put all of the key/value pairs in the database and unconditionally generate one PropertyChangeEvent. |
java.lang.Object | put(java.lang.Object key,
java.lang.Object value)
Set the value of key to value .
|
void | removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. |
Methods inherited from class java.util.Hashtable | |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keySet, keys, putAll, put, rehash, remove, size, toString, values |
Methods inherited from class java.util.Dictionary | |
elements, get, isEmpty, keys, put, remove, size |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Constructor Detail |
public UIDefaults()
public UIDefaults(java.lang.Object[] keyValueList)
Object[] uiDefaults = { "Font", new Font("Dialog", Font.BOLD, 12), "Color", Color.red, "five", new Integer(5) } UIDefaults myDefaults = new UIDefaults(uiDefaults);
Method Detail |
public java.lang.Object get(java.lang.Object key)
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
key
to value
.
If key
is a string and the new value isn't
equal to the old one, fire a PropertyChangeEvent. If value
is null, the key is removed from the table.public void putDefaults(java.lang.Object[] keyValueList)
public java.awt.Font getFont(java.lang.Object key)
key
is a Font return it, otherwise
return null.public java.awt.Color getColor(java.lang.Object key)
key
is a Color return it, otherwise
return null.public Icon getIcon(java.lang.Object key)
key
is an Icon return it, otherwise
return null.public Border getBorder(java.lang.Object key)
key
is a Border return it, otherwise
return null.public java.lang.String getString(java.lang.Object key)
key
is a String return it, otherwise
return null.public java.lang.Class getUIClass(java.lang.String uiClassID)
classForName()
and returns it. If no
mapping for uiClassID exists or if the specified
class can't be found, return null.
This method is used by getUI
, it's usually
not neccessary to call it directly.
Class.forName(get(uidClassID))
.protected void getUIError(java.lang.String msg)
msg
- Message string to print.public com.sun.java.swing.plaf.ComponentUI getUI(JComponent target)
target
.
This is done in two steps:
createUI()
method to construct a look and feel delegate.
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
A PropertyChangeEvent will get fired whenever a default is changed.
listener
- The PropertyChangeListener to be addedpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener to be removedprotected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
propertyName
- The programmatic name of the property that was changed.
oldValue
- The old value of the property.
newValue
- The new value of the property.Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |