com.alee.laf.checkbox
Class CheckIcon

java.lang.Object
  extended by com.alee.laf.checkbox.CheckIcon
Direct Known Subclasses:
SimpleCheckIcon

public abstract class CheckIcon
extends java.lang.Object

Special class that represents checkbox icon. It can be used to render checkbox component icon.

Author:
Mikle Garin

Field Summary
protected  boolean enabled
          Whether should paint enabled check icon or not.
protected  CheckState nextState
          Next active state.
protected  CheckState state
          Currently active state.
 
Constructor Summary
CheckIcon()
           
 
Method Summary
abstract  void doStep()
          Displays next step toward the next active state.
abstract  void finishTransition()
          Finishes transition.
abstract  int getIconHeight()
          Returns check icon height.
abstract  int getIconWidth()
          Returns check icon width.
 CheckState getNextState()
          Returns next active state.
 CheckState getState()
          Returns currently active state.
 boolean isEnabled()
          Returns whether should paint enabled check icon or not.
abstract  boolean isTransitionCompleted()
          Returns whether current transition has reached its end or not.
abstract  void paintIcon(java.awt.Component c, java.awt.Graphics2D g2d, int x, int y, int w, int h)
          Paints check icon in the specified bounds.
abstract  void resetStep()
          Resets steps according to currently set state and next state.
 void setEnabled(boolean enabled)
          Sets whether should paint enabled check icon or not.
 void setNextState(CheckState nextState)
          Sets next active state.
 void setState(CheckState state)
          Sets currently active check state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enabled

protected boolean enabled
Whether should paint enabled check icon or not.


state

protected CheckState state
Currently active state.


nextState

protected CheckState nextState
Next active state. Not null only while transition is in progress.

Constructor Detail

CheckIcon

public CheckIcon()
Method Detail

isEnabled

public boolean isEnabled()
Returns whether should paint enabled check icon or not.

Returns:
true if should paint enabled check icon, false otherwise

setEnabled

public void setEnabled(boolean enabled)
Sets whether should paint enabled check icon or not.

Parameters:
enabled - whether should paint enabled check icon or not

getState

public CheckState getState()
Returns currently active state.

Returns:
currently active state

setState

public void setState(CheckState state)
Sets currently active check state.

Parameters:
state - new active check state

getNextState

public CheckState getNextState()
Returns next active state.

Returns:
next active state

setNextState

public void setNextState(CheckState nextState)
Sets next active state.

Parameters:
nextState - next active state

doStep

public abstract void doStep()
Displays next step toward the next active state.


resetStep

public abstract void resetStep()
Resets steps according to currently set state and next state.


isTransitionCompleted

public abstract boolean isTransitionCompleted()
Returns whether current transition has reached its end or not.

Returns:
true if current transition has reached its end, false otherwise

finishTransition

public abstract void finishTransition()
Finishes transition.


getIconWidth

public abstract int getIconWidth()
Returns check icon width.

Returns:
check icon width

getIconHeight

public abstract int getIconHeight()
Returns check icon height.

Returns:
check icon height

paintIcon

public abstract void paintIcon(java.awt.Component c,
                               java.awt.Graphics2D g2d,
                               int x,
                               int y,
                               int w,
                               int h)
Paints check icon in the specified bounds.

Parameters:
c - component to paint check icon onto
g2d - graphics context
x - icon X coordinate
y - icon Y coordinate
w - icon width
h - icon height