public static class

DefaultSynthStyle.StateInfo

extends Object
java.lang.Object
   ↳ sun.swing.plaf.synth.DefaultSynthStyle.StateInfo

Class Overview

StateInfo represents Style information specific to the state of a component.

Summary

Public Constructors
DefaultSynthStyle.StateInfo()
Creates a new StateInfo.
DefaultSynthStyle.StateInfo(int state, Font font, Color[] colors)
Creates a new StateInfo with the specified properties
DefaultSynthStyle.StateInfo(DefaultSynthStyle.StateInfo info)
Creates a new StateInfo that is a copy of the passed in StateInfo.
Public Methods
DefaultSynthStyle.StateInfo addTo(DefaultSynthStyle.StateInfo info)
Merges the contents of this StateInfo with that of the passed in StateInfo, returning the resulting merged StateInfo.
Object clone()
Creates and returns a copy of this StateInfo.
Color getColor(ColorType type)
Returns the Color to used for the specified ColorType.
Color[] getColors()
Returns the array of colors to use for rendering this state.
int getComponentState()
Returns the state this StateInfo corresponds to.
Map getData()
Font getFont()
Returns the font for this state.
void setColors(Color[] colors)
Sets the array of colors to use for rendering this state.
void setComponentState(int state)
Sets the state this StateInfo corresponds to.
void setData(Map data)
void setFont(Font font)
Sets the font for this state.
String toString()
Returns a string representation of the object.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public DefaultSynthStyle.StateInfo ()

Creates a new StateInfo.

public DefaultSynthStyle.StateInfo (int state, Font font, Color[] colors)

Creates a new StateInfo with the specified properties

Parameters
state Component state(s) that this StateInfo should be used for
font Font for this state
colors Colors for this state

public DefaultSynthStyle.StateInfo (DefaultSynthStyle.StateInfo info)

Creates a new StateInfo that is a copy of the passed in StateInfo.

Parameters
info StateInfo to copy.

Public Methods

public DefaultSynthStyle.StateInfo addTo (DefaultSynthStyle.StateInfo info)

Merges the contents of this StateInfo with that of the passed in StateInfo, returning the resulting merged StateInfo. Properties of this StateInfo will take precedence over those of the passed in StateInfo. For example, if this StateInfo specifics a non-null font, the returned StateInfo will have its font so to that regardless of the StateInfo's font.

Parameters
info StateInfo to add our styles to
Returns
  • Merged StateInfo.

public Object clone ()

Creates and returns a copy of this StateInfo.

Returns
  • Copy of this StateInfo.

public Color getColor (ColorType type)

Returns the Color to used for the specified ColorType.

Returns
  • Color.

public Color[] getColors ()

Returns the array of colors to use for rendering this state. This is indexed by ColorType.getID().

Returns
  • Array of colors

public int getComponentState ()

Returns the state this StateInfo corresponds to.

Returns
  • state info.
See Also

public Map getData ()

public Font getFont ()

Returns the font for this state.

Returns
  • Returns the font to use for rendering this state

public void setColors (Color[] colors)

Sets the array of colors to use for rendering this state. This is indexed by ColorType.getID().

Parameters
colors Array of colors

public void setComponentState (int state)

Sets the state this StateInfo corresponds to.

Parameters
state info.
See Also

public void setData (Map data)

public void setFont (Font font)

Sets the font for this state.

Parameters
font Font to use for rendering

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
  • a string representation of the object.