| Package | org.aswing.plaf |
| Interface | public interface UIResource |
| Implementors | ASColorUIResource, ASFontUIResource, BasicFrameTitleBarBG, CloseIcon, ComboBoxPopupBorder, DefaultEmptyDecoraterResource, DefaultResizer, EmptyLayoutUIResourse, GeneralTableCellFactoryUIResource, GeneralTreeCellFactoryUIResource, InsetsUIResource, JFrameTitleBar, TreeFolderIcon, TreeLeafIcon |
ComponentUI.installUI() and
ComponentUI.uninstallUI() methods can use this interface
to decide if a properties value has been overridden. For example, the
JPanel border property is initialized by BasicPanelUI.installUI(),
only if it's initial value is an UIResource instance:
if (panel.getBorder() is UIResource) {
panel.setBorder(UIManager.getBorder("Panel.border"));
}
At uninstallUI() time we will not reset the property, because it will
be replaced by next UI installing.
Some other type value like Numbers, Booleans, there will be method in the Component
indicated that if is it set by user or LAFs, for example:
if (!panel.isOpaqueSet()) {
panel.setOpaque(UIManager.getBoolean("Panel.opaque"));
panel.setOpaqueSet(false);
}
See also