All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.UIFactory

java.lang.Object
   |
   +----com.sun.java.swing.UIFactory

public abstract class UIFactory
extends Object
implements Serializable
The UI Factory is responsible for managing the interaction between a pluggable look-and-feel and its Component clients.


Constructor Index

 o UIFactory()

Method Index

 o changeTopUI(Container)
Walk though a Container's child Component hierarchy, replacing all UI objects with ones created by this UI factory.
 o changeUI(Container)
Change the UI object of this Container and all of its children.
 o getFactoryName()
Returns the name of the current UI Factory, if any.
 o getFont(String, String)
Get a default Font property from this UI factory.
 o getImage(String, String)
Get a default Image property from this UI factory.
 o getPropertiesFile()
Returns the name of the properties file used to define this UI factory.
 o getProperty(String, String)
Returns a property definition from this UI Factory.
 o getResourceDirectory()
Returns the subdirectory which contains file resources used by this UI factory, such as graphics files.
 o getUI(String, String, JComponent)
Create a UI object.
 o initialize()
Initialize a UI factory after it is loaded.

Constructors

 o UIFactory
 public UIFactory()

Methods

 o initialize
 protected void initialize() throws Exception
Initialize a UI factory after it is loaded.

Throws: Exception
if any problems occur reading the UIFactory's property file.
 o getProperty
 public String getProperty(String name,
                           String defaultName)
Returns a property definition from this UI Factory. If it doesn't have a definition for a requested property, the defaultName is returned.

Parameters:
name - the name of the property
defaultName - the String to return if the property isn't defined by this factory.
 o changeTopUI
 public void changeTopUI(Container c)
Walk though a Container's child Component hierarchy, replacing all UI objects with ones created by this UI factory.

Parameters:
c - the Container to update.
 o changeUI
 public void changeUI(Container c)
Change the UI object of this Container and all of its children.

Parameters:
c - the Container to update.
 o getFactoryName
 public abstract String getFactoryName()
Returns the name of the current UI Factory, if any.

 o getPropertiesFile
 public abstract String getPropertiesFile()
Returns the name of the properties file used to define this UI factory.

 o getResourceDirectory
 public abstract String getResourceDirectory()
Returns the subdirectory which contains file resources used by this UI factory, such as graphics files.

 o getFont
 public Font getFont(String name,
                     String defaultName)
Get a default Font property from this UI factory.

Parameters:
name - the name of the property.
defaultName - the name of the Font to return if no default is defined by this UI factory.
 o getImage
 public Image getImage(String name,
                       String defaultName)
Get a default Image property from this UI factory.

Parameters:
name - the name of the property.
defaultName - the name of the Image to return if no default is defined by this UI factory.
 o getUI
 public ComponentUI getUI(String widgetName,
                          String defaultClassName,
                          JComponent target)
Create a UI object.

Parameters:
widgetName - the name of the UI object to create.
defaultClassName - the name of the class to create the UI object, if the UIFactory does not have the specified widget name.
target - the JComponent which will use this returned UI object.
Returns:
the requested UI object. Note: this UI object may or may not be unique, as some factories may choose to share UI objects between JComponents.

All Packages  Class Hierarchy  This Package  Previous  Next  Index