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
| Modifier and Type | Field and Description |
|---|---|
| private static Map | DEFAULT_VALUES
Contains the default values for certain properties. |
| private static final SynthGraphicsUtils | SYNTH_GRAPHICS
Shared SynthGraphics. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | Returns: Value of the named propertySynthContext identifying requester context, Object Property being requested. key)Getter for a region specific style property. |
| public boolean | Returns: Value of the named propertySynthContext identifying requester context, Object Property being requested. key, boolean Value to return if the property has not been
specified, or is not a Boolean defaultValue)Convenience method to get a specific style property whose value is an Boolean. |
| public Color | Returns: ColorSynthContext identifying requester context, ColorType Type of color being requested. type)Returns the color for the specified state. |
| protected abstract Color | Returns: Color to render withSynthContext identifying requester context, ColorType Type of color being requested. type)Returns the color for the specified state. |
| private static Object | getDefaultValue(Object key)
Returns the default value for the specified property, or null if there is no default for the specified value. |
| public Font | Returns: Font to render withSynthContext identifying requester context)Returns the Font for the specified state. |
| protected abstract Font | Returns: Font to render withSynthContext identifying requester context)Returns the font for the specified state. |
| public SynthGraphicsUtils | Returns: SynthGraphicsUtilsSynthContext identifying requester context)Returns the |
| public Icon | Returns: Value of the named property, or null if not specifiedSynthContext identifying requester context, Object Property being requested. key)Convenience method to get a specific style property whose value is an Icon. |
| public Insets | Returns: Sizing Insets.SynthContext identifying requester context, Insets Insets to place return value in. insets)Returns the Insets that are used to calculate sizing information. |
| public int | Returns: Value of the named propertySynthContext identifying requester context, Object Property being requested. key, int Value to return if the property has not been
specified, or is not a Number defaultValue)Convenience method to get a specific style property whose value is
a |
| public SynthPainter | Returns: SynthPainter to useSynthContext identifying requester context)Returns the |
| public String | Returns: Value of the named propertySynthContext identifying requester context, Object Property being requested. key, String Value to return if the property has not been
specified, or is not a String defaultValue)Convenience method to get a specific style property whose value is a String. |
| pack-priv void | |
| public void | installDefaults(SynthContext
SynthContext identifying component to install properties
to. context)Installs the necessary state from this Style on the
|
| public boolean | Returns: true if region is opaque.SynthContext identifying requester context)Returns true if the region is opaque. |
| private static void | |
| public void | uninstallDefaults(SynthContext
SynthContext identifying component to install properties
to. context)Uninstalls any state that this style installed on
the |
| DEFAULT_VALUES | back to summary |
|---|---|
| private static Map<Object, Object> DEFAULT_VALUES Contains the default values for certain properties. | |
| SYNTH_GRAPHICS | back to summary |
|---|---|
| private static final SynthGraphicsUtils SYNTH_GRAPHICS Shared SynthGraphics. | |
| SynthStyle | back to summary |
|---|---|
| public SynthStyle() Constructs a SynthStyle. | |
| get | back to summary |
|---|---|
| public Object get(SynthContext context, Object key) Getter for a region specific style property.
| |
| getBoolean | back to summary |
|---|---|
| public boolean getBoolean(SynthContext context, Object key, boolean defaultValue) Convenience method to get a specific style property whose value is an Boolean.
| |
| getColor | back to summary |
|---|---|
| public Color getColor(SynthContext context, ColorType type) Returns the color for the specified state. This gives precedence to
foreground and background of the
| |
| getColorForState | back to summary |
|---|---|
| protected abstract Color getColorForState(SynthContext context, ColorType type) Returns the color for the specified state. This should NOT call any
methods on the
| |
| getDefaultValue | back to summary |
|---|---|
| private static Object getDefaultValue(Object key) Returns the default value for the specified property, or null if there is no default for the specified value. | |
| getFont | back to summary |
|---|---|
| public Font getFont(SynthContext context) Returns the Font for the specified state. This redirects to the
| |
| getFontForState | back to summary |
|---|---|
| protected abstract Font getFontForState(SynthContext context) Returns the font for the specified state. This should NOT call any
method on the
| |
| getGraphicsUtils | back to summary |
|---|---|
| public SynthGraphicsUtils getGraphicsUtils(SynthContext context) Returns the
| |
| getIcon | back to summary |
|---|---|
| public Icon getIcon(SynthContext context, Object key) Convenience method to get a specific style property whose value is an Icon.
| |
| getInsets | back to summary |
|---|---|
| public Insets getInsets(SynthContext context, Insets insets) Returns the Insets that are used to calculate sizing information.
| |
| getInt | back to summary |
|---|---|
| public int getInt(SynthContext context, Object key, int defaultValue) Convenience method to get a specific style property whose value is
a
| |
| getPainter | back to summary |
|---|---|
| public SynthPainter getPainter(SynthContext context) Returns the
| |
| getString | back to summary |
|---|---|
| public String getString(SynthContext context, Object key, String defaultValue) Convenience method to get a specific style property whose value is a String.
| |
| installDefaults | back to summary |
|---|---|
| pack-priv void installDefaults(SynthContext context, SynthUI ui) | |
| installDefaults | back to summary |
|---|---|
| public void installDefaults(SynthContext context) Installs the necessary state from this Style on the
| |
| isOpaque | back to summary |
|---|---|
| public boolean isOpaque(SynthContext context) Returns true if the region is opaque.
| |
| populateDefaultValues | back to summary |
|---|---|
| private static void populateDefaultValues() Adds the default values that we know about to DEFAULT_VALUES. | |
| uninstallDefaults | back to summary |
|---|---|
| public void uninstallDefaults(SynthContext context) Uninstalls any state that this style installed on
the Styles should NOT depend upon this being called, in certain cases it may never be called.
| |