javax.swing.plaf.synth

Class SynthLookAndFeel

public class SynthLookAndFeel extends BasicLookAndFeel

A look and feel that can be customized either by providing a file to {@link #load} or by setting a {@link SynthStyleFactory} using {@link #setStyleFactory}.

Since: 1.5

Constructor Summary
SynthLookAndFeel()
Creates a new instance of SynthLookAndFeel.
Method Summary
static ComponentUIcreateUI(JComponent c)
Creates the Synth look and feel component UI instance for the given component.
UIDefaultsgetDefaults()
Returns the UI defaults of this look and feel.
StringgetDescription()
Returns a textual description of the Synth look and feel.
StringgetID()
Returns the ID of the Synth look and feel.
StringgetName()
Returns the name of the Synth look and feel.
static RegiongetRegion(JComponent c)
Returns the region for a given Swing component.
static SynthStylegetStyle(JComponent c, Region r)
Returns the style for the specified component and region.
static SynthStyleFactorygetStyleFactory()
Returns the current style factory that the UI classes of Synth will use to load their sets of styles.
voidinitialize()
Initializes this look and feel.
booleanisNativeLookAndFeel()
Returns false since the Synth look and feel is not a native look and feel.
booleanisSupportedLookAndFeel()
Returns true since the Synth look and feel is always a supported look and feel.
voidload(InputStream in, Class<?> resourceBase)
Loads a set of {@link SynthStyle}s that are used for the look and feel of the components.
static voidsetStyleFactory(SynthStyleFactory sf)
Sets the style factory that the UI classes of Synth will use to load their sets of styles.
booleanshouldUpdateStyleOnAncestorChanged()
FIXME: DOCUMENT ME!
voiduninitialize()
Uninitializes the look and feel.
static voidupdateStyles(Component c)
Updates all style information of the component and it's children.

Constructor Detail

SynthLookAndFeel

public SynthLookAndFeel()
Creates a new instance of SynthLookAndFeel. In order to use the Synth look and feel you either need to call {@link #load} to load a set of styles from an XML file, or you need to call {@link #setStyleFactory} to provide your own style factory.

Method Detail

createUI

public static ComponentUI createUI(JComponent c)
Creates the Synth look and feel component UI instance for the given component.

Parameters: c the component for which to create a UI instance

Returns: the Synth look and feel component UI instance for the given component

getDefaults

public UIDefaults getDefaults()
Returns the UI defaults of this look and feel.

Returns: the UI defaults of this look and feel

getDescription

public String getDescription()
Returns a textual description of the Synth look and feel. This returns "Synth look and feel".

Returns: a textual description of the Synth look and feel

getID

public String getID()
Returns the ID of the Synth look and feel. This returns "Synth".

Returns: the ID of the Synth look and feel

getName

public String getName()
Returns the name of the Synth look and feel. This returns "Synth look and feel".

Returns: the name of the Synth look and feel

getRegion

public static Region getRegion(JComponent c)
Returns the region for a given Swing component.

Parameters: c the Swing component for which to fetch the region

Returns: the region for a given Swing component

getStyle

public static SynthStyle getStyle(JComponent c, Region r)
Returns the style for the specified component and region.

Parameters: c the component for which to return the style r the region of the component for which to return the style

Returns: the style for the specified component and region

getStyleFactory

public static SynthStyleFactory getStyleFactory()
Returns the current style factory that the UI classes of Synth will use to load their sets of styles.

Returns: the current style factory

initialize

public void initialize()
Initializes this look and feel.

isNativeLookAndFeel

public boolean isNativeLookAndFeel()
Returns false since the Synth look and feel is not a native look and feel.

Returns: false

isSupportedLookAndFeel

public boolean isSupportedLookAndFeel()
Returns true since the Synth look and feel is always a supported look and feel.

Returns: true

load

public void load(InputStream in, Class<?> resourceBase)
Loads a set of {@link SynthStyle}s that are used for the look and feel of the components. The resourceBase parameter is used to resolve references against, like icons and other files.

Parameters: in the input stream from where to load the styles resourceBase the base against which references are resolved.

Throws: ParseException if the input stream cannot be parsed IllegalArgumentException if one of the parameters is null

setStyleFactory

public static void setStyleFactory(SynthStyleFactory sf)
Sets the style factory that the UI classes of Synth will use to load their sets of styles.

Parameters: sf the style factory to set

shouldUpdateStyleOnAncestorChanged

public boolean shouldUpdateStyleOnAncestorChanged()
FIXME: DOCUMENT ME!

Returns: FIXME

uninitialize

public void uninitialize()
Uninitializes the look and feel.

updateStyles

public static void updateStyles(Component c)
Updates all style information of the component and it's children.

Parameters: c the componenent for which to update the style