Beyond the constructor a subclass should override the addTo
and clone methods, these are used when the Styles are being
merged into a resulting style.
| Modifier and Type | Class and Description |
|---|---|
| public static class | DefaultSynthStyle.
StateInfo represents Style information specific to the state of a component. |
| Modifier and Type | Field and Description |
|---|---|
| private Map | data
User specific data. |
| private Font | font
Font to use if there is no matching StateInfo, or the StateInfo doesn't define one. |
| private Insets | insets
Insets. |
| private boolean | opaque
Should the component be opaque? |
| private SynthPainter | painter
Painter to use if the StateInfo doesn't have one. |
| private static final Object | |
| private DefaultSynthStyle. | states
Information specific to ComponentState. |
| private SynthGraphicsUtils | synthGraphics
SynthGraphics, may be null. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | DefaultSynthStyle(DefaultSynthStyle
Style to duplicate style)Creates a new DefaultSynthStyle that is a copy of the passed in style. |
| public | DefaultSynthStyle(Insets
Insets for the Style insets, boolean Whether or not the background is completely painted in
an opaque color opaque, DefaultSynthStyle.StateInfos describing properties per state states,Style specific data. data)Creates a new DefaultSynthStyle. |
| Modifier and Type | Method and Description |
|---|---|
| public DefaultSynthStyle | Returns: Merged style.Style to add our styles to style)Merges the contents of this Style with that of the passed in Style, returning the resulting merged style. |
| public Object | |
| public Object | Returns: Value of the named propertySynthContext identifying requestor state, Object Property being requested. key)Overrides javax. Getter for a region specific style property. |
| public Color | getColor(SynthContext context, ColorType type)
Overrides javax. Returns the color for the specified state. |
| public Color | |
| protected Color | getColorForState(SynthContext context, ColorType type)
Implements abstract javax. Returns the color for the specified state. |
| protected Color | Returns: Color to render withJComponent the style is associated with c, Region Region identifier id, int State of the region. state, ColorType Type of color being requested. type)Returns the color for the specified state. |
| public Map | |
| public Object | Returns: Value of the named propertySynthContext identifying requestor context, Object Property being requested. key)Returns the default value for a particular property. |
| public Font | getFont(SynthContext state)
Overrides javax. Returns the Font for the specified state. |
| public Font | |
| protected Font | Returns: Font to render withJComponent the style is associated with c, Region Region identifier id, int State of the region. state)Returns the font for the specified state. |
| protected Font | getFontForState(SynthContext context)
Implements abstract javax. Returns the font for the specified state. |
| public SynthGraphicsUtils | Returns: SynthGraphicsUtilsSynthContext identifying requestor context)Overrides javax. Returns a SynthGraphicsUtils. |
| public Insets | Returns: Insets.SynthContext identifying requestor state, Insets Where to place Insets to)Overrides javax. Returns the Insets. |
| private Object | |
| public SynthPainter | Returns: Painter for the borderSynthContext identifying requestor ss)Overrides javax. Returns the Painter for the passed in Component. |
| public DefaultSynthStyle. | Returns: Array of StateInfos.Returns the array of StateInfo's that that are used to specify properties specific to a particular style. |
| public DefaultSynthStyle. | Returns: Best matching StateInfo, or nullComponent state. state)Returns the best matching StateInfo for a particular state. |
| public boolean | Returns: opaque Whether or not the JComponent is opaque.SynthContext identifying requestor ss)Overrides javax. Returns the value to initialize the opacity property of the Component to. |
| public void | |
| public void | |
| public void | setGraphicsUtils(SynthGraphicsUtils
SynthGraphics graphics)Sets the SynthGraphicsUtils that will be used for rendering. |
| public void | |
| public void | setOpaque(boolean
Whether or not the JComponent should be opaque. opaque)Sets whether or not the JComponent should be opaque. |
| public void | |
| public void | setStateInfo(DefaultSynthStyle.
StateInfos statesSets the array of StateInfo's which are used to specify properties specific to a particular style. |
| public String |
| data | back to summary |
|---|---|
| private Map<Object, Object> data User specific data. | |
| font | back to summary |
|---|---|
| private Font font Font to use if there is no matching StateInfo, or the StateInfo doesn't define one. | |
| insets | back to summary |
|---|---|
| private Insets insets Insets. | |
| opaque | back to summary |
|---|---|
| private boolean opaque Should the component be opaque? | |
| painter | back to summary |
|---|---|
| private SynthPainter painter Painter to use if the StateInfo doesn't have one. | |
| PENDING | back to summary |
|---|---|
| private static final Object PENDING | |
| states | back to summary |
|---|---|
| private DefaultSynthStyle. Information specific to ComponentState. | |
| synthGraphics | back to summary |
|---|---|
| private SynthGraphicsUtils synthGraphics SynthGraphics, may be null. | |
| DefaultSynthStyle | back to summary |
|---|---|
| public DefaultSynthStyle() Nullary constructor, intended for subclassers. | |
| DefaultSynthStyle | back to summary |
|---|---|
| public DefaultSynthStyle(DefaultSynthStyle style) Creates a new DefaultSynthStyle that is a copy of the passed in style. Any StateInfo's of the passed in style are cloned as well.
| |
| DefaultSynthStyle | back to summary |
|---|---|
| public DefaultSynthStyle(Insets insets, boolean opaque, DefaultSynthStyle. Creates a new DefaultSynthStyle. | |
| addTo | back to summary |
|---|---|
| public DefaultSynthStyle addTo(DefaultSynthStyle style) Merges the contents of this Style with that of the passed in Style,
returning the resulting merged style. Properties of this
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Creates a clone of this style.
| |
| get | back to summary |
|---|---|
| public Object get(SynthContext state, Object key) Overrides javax. Getter for a region specific style property.
| |
| getColor | back to summary |
|---|---|
| public Color getColor(SynthContext context, ColorType type) Overrides javax. Doc from javax. Returns the color for the specified state. This gives precedence to
foreground and background of the | |
| getColor | back to summary |
|---|---|
| public Color getColor(JComponent c, Region id, int state, ColorType type) | |
| getColorForState | back to summary |
|---|---|
| protected Color getColorForState(SynthContext context, ColorType type) Implements abstract javax. Doc from javax. Returns the color for the specified state. This should NOT call any
methods on the | |
| getColorForState | back to summary |
|---|---|
| protected Color getColorForState(JComponent c, Region id, int state, ColorType type) Returns the color for the specified state.
| |
| getData | back to summary |
|---|---|
| public Map Returns the style specific data. | |
| getDefaultValue | back to summary |
|---|---|
| public Object getDefaultValue(SynthContext context, Object key) Returns the default value for a particular property. This is only
invoked if this style doesn't define a property for
| |
| getFont | back to summary |
|---|---|
| public Font getFont(SynthContext state) Overrides javax. Doc from javax. Returns the Font for the specified state. This redirects to the
| |
| getFont | back to summary |
|---|---|
| public Font getFont(JComponent c, Region id, int state) | |
| getFontForState | back to summary |
|---|---|
| protected Font getFontForState(JComponent c, Region id, int state) Returns the font for the specified state. This should NOT callback to the JComponent.
| |
| getFontForState | back to summary |
|---|---|
| protected Font getFontForState(SynthContext context) Implements abstract javax. Doc from javax. Returns the font for the specified state. This should NOT call any
method on the | |
| getGraphicsUtils | back to summary |
|---|---|
| public SynthGraphicsUtils getGraphicsUtils(SynthContext context) Overrides javax. Returns a SynthGraphicsUtils.
| |
| getInsets | back to summary |
|---|---|
| public Insets getInsets(SynthContext state, Insets to) Overrides javax. Returns the Insets. If
| |
| getKeyFromData | back to summary |
|---|---|
| private Object getKeyFromData(Map<Object, Object> stateData, Object key) | |
| getPainter | back to summary |
|---|---|
| public SynthPainter getPainter(SynthContext ss) Overrides javax. Returns the Painter for the passed in Component. This may return null.
| |
| getStateInfo | back to summary |
|---|---|
| public DefaultSynthStyle. Returns the array of StateInfo's that that are used to specify properties specific to a particular style.
| |
| getStateInfo | back to summary |
|---|---|
| public DefaultSynthStyle. Returns the best matching StateInfo for a particular state.
| |
| isOpaque | back to summary |
|---|---|
| public boolean isOpaque(SynthContext ss) Overrides javax. Returns the value to initialize the opacity property of the Component to. A Style should NOT assume the opacity will remain this value, the developer may reset it or override it.
| |
| setData | back to summary |
|---|---|
| public void setData(Map<Object, Object> data) Sets style specific values. This does NOT copy the data, it assigns it directly to this Style. | |
| setFont | back to summary |
|---|---|
| public void setFont(Font font) Sets the font that is used if there is no matching StateInfo, or it does not define a font.
| |
| setGraphicsUtils | back to summary |
|---|---|
| public void setGraphicsUtils(SynthGraphicsUtils graphics) Sets the SynthGraphicsUtils that will be used for rendering.
| |
| setInsets | back to summary |
|---|---|
| public void setInsets(Insets insets) Sets the insets.
| |
| setOpaque | back to summary |
|---|---|
| public void setOpaque(boolean opaque) Sets whether or not the JComponent should be opaque.
| |
| setPainter | back to summary |
|---|---|
| public void setPainter(SynthPainter painter) Sets the Painter to use for the border.
| |
| setStateInfo | back to summary |
|---|---|
| public void setStateInfo(DefaultSynthStyle. Sets the array of StateInfo's which are used to specify properties specific to a particular style.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| private Color[] | |
| private Map | |
| private Font | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | StateInfo(DefaultSynthStyle.
StateInfo to copy. infoCreates a new StateInfo that is a copy of the passed in StateInfo. |
| Modifier and Type | Method and Description |
|---|---|
| public DefaultSynthStyle. | Returns: Merged StateInfo.StateInfo to add our styles to infoMerges the contents of this StateInfo with that of the passed in StateInfo, returning the resulting merged StateInfo. |
| public Object | Returns: Copy of this StateInfo.Overrides java. Creates and returns a copy of this StateInfo. |
| public Color | |
| public Color[] | |
| public int | |
| public Map | |
| public Font | |
| public void | |
| public void | |
| public void | |
| public void | |
| public String |
| colors | back to summary |
|---|---|
| private Color[] colors | |
| data | back to summary |
|---|---|
| private Map<Object, Object> data | |
| font | back to summary |
|---|---|
| private Font font | |
| state | back to summary |
|---|---|
| private int state | |
| StateInfo | back to summary |
|---|---|
| public StateInfo() Creates a new StateInfo. | |
| StateInfo | back to summary |
|---|---|
| public StateInfo(int state, Font font, Color[] colors) Creates a new StateInfo with the specified properties | |
| StateInfo | back to summary |
|---|---|
| public StateInfo(DefaultSynthStyle. Creates a new StateInfo that is a copy of the passed in StateInfo.
| |
| addTo | back to summary |
|---|---|
| public DefaultSynthStyle. Merges the contents of this StateInfo with that of the passed in
StateInfo, returning the resulting merged StateInfo. Properties of
this
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Creates and returns a copy of this StateInfo.
| |
| getColor | back to summary |
|---|---|
| public Color getColor(ColorType type) Returns the Color to used for the specified ColorType.
| |
| getColors | back to summary |
|---|---|
| public Color[] getColors() Returns the array of colors to use for rendering this state. This
is indexed by
| |
| getComponentState | back to summary |
|---|---|
| public int getComponentState() Returns the state this StateInfo corresponds to.
| |
| getData | back to summary |
|---|---|
| public Map | |
| getFont | back to summary |
|---|---|
| public Font getFont() Returns the font for this state.
| |
| setColors | back to summary |
|---|---|
| public void setColors(Color[] colors) Sets the array of colors to use for rendering this state. This
is indexed by
| |
| setComponentState | back to summary |
|---|---|
| public void setComponentState(int state) Sets the state this StateInfo corresponds to.
| |
| setData | back to summary |
|---|---|
| public void setData(Map<Object, Object> data) | |
| setFont | back to summary |
|---|---|
| public void setFont(Font font) Sets the font for this state.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |