javax.swing.plaf.synth

Class SynthStyle

public abstract class SynthStyle extends Object

A set of style properties that can be installed on a component.

Since: 1.5

Constructor Summary
SynthStyle()
Creates a new SynthStyle object.
Method Summary
Objectget(SynthContext ctx, Object key)
booleangetBoolean(SynthContext ctx, Object key, boolean defaultValue)
A convenience method to fetch an integer property.
ColorgetColor(SynthContext ctx, ColorType type)
protected abstract ColorgetColorForState(SynthContext ctx, ColorType type)
FontgetFont(SynthContext ctx)
protected abstract FontgetFontForState(SynthContext ctx)
SynthGraphicsUtilsgetGraphicsUtils(SynthContext ctx)
IcongetIcon(SynthContext ctx, Object key)
A convenience method to fetch an Icon-valued property.
InsetsgetInsets(SynthContext ctx, Insets result)
intgetInt(SynthContext ctx, Object key, int defaultValue)
A convenience method to fetch an integer property.
SynthPaintergetPainter(SynthContext ctx)
StringgetString(SynthContext ctx, Object key, String defaultValue)
A convenience method to fetch a String property.
voidinstallDefaults(SynthContext ctx)
booleanisOpaque(SynthContext ctx)
voiduninstallDefaults(SynthContext ctx)

Constructor Detail

SynthStyle

public SynthStyle()
Creates a new SynthStyle object.

Method Detail

get

public Object get(SynthContext ctx, Object key)

getBoolean

public boolean getBoolean(SynthContext ctx, Object key, boolean defaultValue)
A convenience method to fetch an integer property. If the property's value is a {@link Boolean}, then the value is returned. Otherwise, the default value is returned.

Parameters: ctx the context key the key to fetch defaultValue the default value

Returns: the boolean value of the property, or the default value

getColor

public Color getColor(SynthContext ctx, ColorType type)

getColorForState

protected abstract Color getColorForState(SynthContext ctx, ColorType type)

getFont

public Font getFont(SynthContext ctx)

getFontForState

protected abstract Font getFontForState(SynthContext ctx)

getGraphicsUtils

public SynthGraphicsUtils getGraphicsUtils(SynthContext ctx)

getIcon

public Icon getIcon(SynthContext ctx, Object key)
A convenience method to fetch an Icon-valued property. If the property's value is an {@link Icon}, then the value is returned. Otherwise, null is returned.

Parameters: ctx the context key the key to fetch

Returns: the icon, or null

getInsets

public Insets getInsets(SynthContext ctx, Insets result)

getInt

public int getInt(SynthContext ctx, Object key, int defaultValue)
A convenience method to fetch an integer property. If the property's value is a {@link Number}, then the integer value is returned. Otherwise, the default value is returned.

Parameters: ctx the context key the key to fetch defaultValue the default value

Returns: the integer value of the property, or the default value

getPainter

public SynthPainter getPainter(SynthContext ctx)

getString

public String getString(SynthContext ctx, Object key, String defaultValue)
A convenience method to fetch a String property. If the property's value is a {@link String}, then the value is returned. Otherwise, the default value is returned.

Parameters: ctx the context key the key to fetch defaultValue the default value

Returns: the String value of the property, or the default value

installDefaults

public void installDefaults(SynthContext ctx)

isOpaque

public boolean isOpaque(SynthContext ctx)

uninstallDefaults

public void uninstallDefaults(SynthContext ctx)