public abstract class SynthStyle extends Object
SynthStyle is a set of style properties. Each
SynthUI references at least one
SynthStyle that is obtained using a
SynthStyleFactory. You typically don't need to interact with this class directly, rather you will load a
Synth File Format file into
SynthLookAndFeel that will create a set of SynthStyles.
SynthLookAndFeel,
SynthStyleFactory
| Constructor and Description |
|---|
SynthStyle()
Constructs a SynthStyle.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
get(SynthContext
Getter for a region specific style property.
|
boolean |
getBoolean(SynthContext
Convenience method to get a specific style property whose value is an Boolean.
|
Color |
getColor(SynthContext
Returns the color for the specified state.
|
protected abstract Color |
getColorForState(SynthContext
Returns the color for the specified state.
|
Font |
getFont(SynthContext
Returns the Font for the specified state.
|
protected abstract Font |
getFontForState(SynthContext
Returns the font for the specified state.
|
SynthGraphicsUtils |
getGraphicsUtils(SynthContext
Returns the
SynthGraphicUtils for the specified context.
|
Icon |
getIcon(SynthContext
Convenience method to get a specific style property whose value is an Icon.
|
Insets |
getInsets(SynthContext
Returns the Insets that are used to calculate sizing information.
|
int |
getInt(SynthContext
Convenience method to get a specific style property whose value is a
Number.
|
SynthPainter |
getPainter(SynthContext
Returns the
SynthPainter that will be used for painting.
|
String |
getString(SynthContext
Convenience method to get a specific style property whose value is a String.
|
void |
installDefaults(SynthContext
Installs the necessary state from this Style on the
JComponent from
context.
|
boolean |
isOpaque(SynthContext
Returns true if the region is opaque.
|
void |
uninstallDefaults(SynthContext
Uninstalls any state that this style installed on the
JComponent from
context.
|
public SynthGraphicsUtilsgetGraphicsUtils(SynthContext context)
SynthGraphicUtils for the specified context.
context - SynthContext identifying requester
public ColorgetColor(SynthContext context, ColorType type)
JComponent. If the
Color from the
JComponent is not appropriate, or not used, this will invoke
getColorForState. Subclasses should generally not have to override this, instead override
getColorForState(javax.swing.plaf.synth.SynthContext, javax.swing.plaf.synth.ColorType).
context - SynthContext identifying requester
type - Type of color being requested.
protected abstract ColorgetColorForState(SynthContext context, ColorType type)
JComponent.
context - SynthContext identifying requester
type - Type of color being requested.
public FontgetFont(SynthContext context)
JComponent from the
context as necessary. If this does not redirect to the JComponent
getFontForState(javax.swing.plaf.synth.SynthContext) is invoked.
context - SynthContext identifying requester
protected abstract FontgetFontForState(SynthContext context)
JComponent.
context - SynthContext identifying requester
public InsetsgetInsets(SynthContext context, Insets insets)
context - SynthContext identifying requester
insets - Insets to place return value in.
public SynthPaintergetPainter(SynthContext context)
SynthPainter that will be used for painting. This may return null.
context - SynthContext identifying requester
public boolean isOpaque(SynthContextcontext)
context - SynthContext identifying requester
public Objectget(SynthContext context, Object key)
context - SynthContext identifying requester
key - Property being requested.
public void installDefaults(SynthContextcontext)
JComponent from
context.
context - SynthContext identifying component to install properties to.
public void uninstallDefaults(SynthContextcontext)
JComponent from
context.
Styles should NOT depend upon this being called, in certain cases it may never be called.
context - SynthContext identifying component to install properties to.
public int getInt(SynthContextcontext, Object key, int defaultValue)
Number. If the value is a
Number,
intValue is returned, otherwise
defaultValue is returned.
context - SynthContext identifying requester
key - Property being requested.
defaultValue - Value to return if the property has not been specified, or is not a Number
public boolean getBoolean(SynthContextcontext, Object key, boolean defaultValue)
context - SynthContext identifying requester
key - Property being requested.
defaultValue - Value to return if the property has not been specified, or is not a Boolean
public IcongetIcon(SynthContext context, Object key)
context - SynthContext identifying requester
key - Property being requested.
public StringgetString(SynthContext context, Object key, String defaultValue)
context - SynthContext identifying requester
key - Property being requested.
defaultValue - Value to return if the property has not been specified, or is not a String