com.alee.extended.checkbox
Class TristateCheckIcon

java.lang.Object
  extended by com.alee.laf.checkbox.CheckIcon
      extended by com.alee.laf.checkbox.SimpleCheckIcon
          extended by com.alee.extended.checkbox.TristateCheckIcon

public class TristateCheckIcon
extends SimpleCheckIcon

Check icon for tristate checkbox.

Author:
Mikle Garin

Field Summary
protected  java.lang.ref.WeakReference<WebTristateCheckBox> checkBox
          Tristate checkbox which uses this icon.
protected  int checkStep
          Current check step.
protected static java.awt.Color[] colors
           
protected static java.awt.Color[] disabledColors
           
protected static float[] fractions
          Painting constants.
protected  int mixedStep
          Current mixed step.
 
Fields inherited from class com.alee.laf.checkbox.SimpleCheckIcon
CHECK_STATES, DISABLED_CHECK_STATES, step
 
Fields inherited from class com.alee.laf.checkbox.CheckIcon
enabled, nextState, state
 
Constructor Summary
TristateCheckIcon(WebTristateCheckBox checkBox)
          Constructs new tristate check icon.
 
Method Summary
 void doStep()
          Displays next step toward the next active state.
 boolean isTransitionCompleted()
          Returns whether current transition has reached its end or not.
 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.
 void resetStep()
          Resets steps according to currently set state and next state.
 void setNextState(CheckState nextState)
          Sets next active state.
 
Methods inherited from class com.alee.laf.checkbox.SimpleCheckIcon
finishTransition, getIconHeight, getIconWidth
 
Methods inherited from class com.alee.laf.checkbox.CheckIcon
getNextState, getState, isEnabled, setEnabled, setState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fractions

protected static final float[] fractions
Painting constants.


colors

protected static final java.awt.Color[] colors

disabledColors

protected static final java.awt.Color[] disabledColors

checkBox

protected java.lang.ref.WeakReference<WebTristateCheckBox> checkBox
Tristate checkbox which uses this icon.


checkStep

protected int checkStep
Current check step.


mixedStep

protected int mixedStep
Current mixed step.

Constructor Detail

TristateCheckIcon

public TristateCheckIcon(WebTristateCheckBox checkBox)
Constructs new tristate check icon.

Parameters:
checkBox - tristate checkbox which uses this icon
Method Detail

setNextState

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

Overrides:
setNextState in class CheckIcon
Parameters:
nextState - next active state

doStep

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

Overrides:
doStep in class SimpleCheckIcon

resetStep

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

Overrides:
resetStep in class SimpleCheckIcon

isTransitionCompleted

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

Overrides:
isTransitionCompleted in class SimpleCheckIcon
Returns:
true if current transition has reached its end, false otherwise

paintIcon

public 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.

Overrides:
paintIcon in class SimpleCheckIcon
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