Methods Summary |
---|
protected java.lang.Object | configureValue(java.lang.Object value)Configures the value as appropriate for a defaults property in
the UIDefaults table.
if (value != null) {
if (value instanceof Color) {
return new ColorUIResource((Color)value);
}
else if (value instanceof Font) {
return new FontUIResource((Font)value);
}
else if (value instanceof UIDefaults.LazyValue) {
value = ((UIDefaults.LazyValue)value).createValue(null);
}
else if (value instanceof UIDefaults.ActiveValue) {
value = ((UIDefaults.ActiveValue)value).createValue(null);
}
}
return value;
|
public java.lang.Object | createValue(javax.swing.UIDefaults table)UIManager.LazyValue method, returns the value from the desktop
or the fallback value if the desktop value is null.
if (value == null) {
value = configureValue(getValueFromDesktop());
if (value == null) {
value = configureValue(getDefaultValue());
}
}
return value;
|
static void | flushUnreferencedProperties()Cleans up any lingering state held by unrefeernced
DesktopProperties.
queue = new ReferenceQueue();
WeakPCL pcl;
while ((pcl = (WeakPCL)queue.poll()) != null) {
pcl.dispose();
}
|
protected java.lang.Object | getDefaultValue()Returns the value to use if the desktop property is null.
return fallback;
|
protected java.lang.String | getKey()Returns the key used to lookup the desktop properties value.
return key;
|
protected java.lang.Object | getValueFromDesktop()Returns the value from the desktop.
if (this.toolkit == null) {
this.toolkit = Toolkit.getDefaultToolkit();
}
Object value = toolkit.getDesktopProperty(getKey());
pcl = new WeakPCL(this, toolkit, getKey(), UIManager.getLookAndFeel());
toolkit.addPropertyChangeListener(getKey(), pcl);
return value;
|
public void | invalidate(javax.swing.LookAndFeel laf)Invalidates the current value.
invalidate();
|
public void | invalidate()Invalides the current value so that the next invocation of
createValue will ask for the property again.
if (pcl != null) {
toolkit.removePropertyChangeListener(getKey(), pcl);
toolkit = null;
pcl = null;
value = null;
}
|
private static synchronized boolean | isUpdatePending()Returns true if a UI update is pending.
return updatePending;
|
private static synchronized void | setUpdatePending(boolean update)Sets whether or not an updateUI call is pending.
updatePending = update;
|
private static void | updateAllUIs()Updates the UIs of all the known Frames.
// Check if the current UI is WindowsLookAndfeel and flush the XP style map.
// Note: Change the package test if this class is moved to a different package.
Class uiClass = UIManager.getLookAndFeel().getClass();
if (uiClass.getPackage().equals(DesktopProperty.class.getPackage())) {
XPStyle.invalidateStyle();
}
Frame appFrames[] = Frame.getFrames();
for (int j=0; j < appFrames.length; j++) {
updateWindowUI(appFrames[j]);
}
|
protected void | updateUI()Requests that all components in the GUI hierarchy be updated
to reflect dynamic changes in this look&feel. This update occurs
by uninstalling and re-installing the UI objects. Requests are
batched and collapsed into a single update pass because often
many desktop properties will change at once.
if (!isUpdatePending()) {
setUpdatePending(true);
Runnable uiUpdater = new Runnable() {
public void run() {
updateAllUIs();
setUpdatePending(false);
}
};
SwingUtilities.invokeLater(uiUpdater);
}
|
private static void | updateWindowUI(java.awt.Window window)Updates the UI of the passed in window and all its children.
SwingUtilities.updateComponentTreeUI(window);
Window ownedWins[] = window.getOwnedWindows();
for (int i=0; i < ownedWins.length; i++) {
updateWindowUI(ownedWins[i]);
}
|