com.alee.extended.checkbox
Class WebTristateCheckBox

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.AbstractButton
                  extended by javax.swing.JToggleButton
                      extended by javax.swing.JCheckBox
                          extended by com.alee.laf.checkbox.WebCheckBox
                              extended by com.alee.extended.checkbox.WebTristateCheckBox
All Implemented Interfaces:
LanguageMethods, SettingsMethods, ShapeProvider, FontMethods<WebCheckBox>, SizeMethods<WebCheckBox>, SwingMethods, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.SwingConstants

public class WebTristateCheckBox
extends WebCheckBox

This WebCheckBox extension class provides additional third selection state - mixed state.

Author:
Mikle Garin
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JCheckBox
javax.swing.JCheckBox.AccessibleJCheckBox
 
Nested classes/interfaces inherited from class javax.swing.JToggleButton
javax.swing.JToggleButton.AccessibleJToggleButton, javax.swing.JToggleButton.ToggleButtonModel
 
Nested classes/interfaces inherited from class javax.swing.AbstractButton
javax.swing.AbstractButton.AccessibleAbstractButton, javax.swing.AbstractButton.ButtonChangeListener
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JCheckBox
BORDER_PAINTED_FLAT_CHANGED_PROPERTY
 
Fields inherited from class javax.swing.AbstractButton
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
WebTristateCheckBox()
          Constructs new tristate checkbox.
WebTristateCheckBox(javax.swing.Action action)
          Constructs new tristate checkbox.
WebTristateCheckBox(boolean checked)
          Constructs new tristate checkbox.
WebTristateCheckBox(CheckState state)
          Constructs new tristate checkbox.
WebTristateCheckBox(javax.swing.Icon icon)
          Constructs new tristate checkbox.
WebTristateCheckBox(javax.swing.Icon icon, boolean checked)
          Constructs new tristate checkbox.
WebTristateCheckBox(javax.swing.Icon icon, CheckState state)
          Constructs new tristate checkbox.
WebTristateCheckBox(java.lang.String text)
          Constructs new tristate checkbox.
WebTristateCheckBox(java.lang.String text, boolean checked)
          Constructs new tristate checkbox.
WebTristateCheckBox(java.lang.String text, CheckState state)
          Constructs new tristate checkbox.
WebTristateCheckBox(java.lang.String text, javax.swing.Icon icon)
          Constructs new tristate checkbox.
WebTristateCheckBox(java.lang.String text, javax.swing.Icon icon, boolean checked)
          Constructs new tristate checkbox.
WebTristateCheckBox(java.lang.String text, javax.swing.Icon icon, CheckState state)
          Constructs new tristate checkbox.
 
Method Summary
 TristateCheckBoxModel getActualModel()
          Returns actual tristate checkbox model.
 CheckState getNextState(CheckState checkState)
          Returns next check state for toggle action.
 CheckState getState()
          Returns tristate checkbox check state.
 java.lang.String getUIClassID()
          
 WebTristateCheckBoxUI getWebUI()
          Returns Web-UI applied to this class.
protected  void init(java.lang.String text, javax.swing.Icon icon)
          Initializes checkbox settings.
 boolean isChecked()
          Returns whether checkbox is checked or not.
 boolean isCheckMixedOnToggle()
          Returns whether partially checked tristate checkbox should be checked or unchecked on toggle.
 boolean isMixed()
          Returns whether checkbox is in mixed state or not.
 boolean isUnchecked()
          Returns whether checkbox is unchecked or not.
 void setChecked()
          Forces checked state.
 void setCheckMixedOnToggle(boolean checkMixedOnToggle)
          Sets whether partially checked tristate checkbox should be checked or unchecked on toggle
 void setMixed()
          Forces mixed state.
 void setState(CheckState state)
          Sets tristate checkbox check state.
 void setUnchecked()
          Forces unchecked state.
 void updateUI()
          Installs a Web-UI into this component.
 
Methods inherited from class com.alee.laf.checkbox.WebCheckBox
addHotkey, addHotkey, addHotkey, addHotkey, addHotkey, addHotkey, addHotkey, addHotkey, changeFontSize, getBorderColor, getBottomBgColor, getBottomSelectedBgColor, getDarkBorderColor, getDisabledBorderColor, getFontName, getFontSize, getHotkeys, getIconHeight, getIconWidth, getMargin, getMinimumHeight, getMinimumWidth, getPreferredHeight, getPreferredSize, getPreferredWidth, getRound, getShadeWidth, getTopBgColor, getTopSelectedBgColor, isAnimated, isBoldFont, isItalicFont, isLanguageSet, isPlainFont, isRolloverDarkBorderOnly, loadSettings, provideShape, registerSettings, registerSettings, registerSettings, registerSettings, registerSettings, registerSettings, registerSettings, registerSettings, registerSettings, registerSettings, registerSettings, registerSettings, removeHotkey, removeHotkeys, removeLanguage, removeLanguageUpdater, saveSettings, setAnimated, setBoldFont, setBoldFont, setBorderColor, setBottomBgColor, setBottomSelectedBgColor, setDarkBorderColor, setDisabledBorderColor, setFontName, setFontSize, setFontSizeAndStyle, setFontSizeAndStyle, setFontStyle, setFontStyle, setIconHeight, setIconWidth, setItalicFont, setItalicFont, setLanguage, setLanguageUpdater, setMargin, setMargin, setMargin, setMinimumHeight, setMinimumWidth, setPlainFont, setPlainFont, setPreferredHeight, setPreferredWidth, setRolloverDarkBorderOnly, setRound, setSelected, setSelected, setShadeWidth, setTopBgColor, setTopSelectedBgColor, unregisterSettings, updateLanguage, updateLanguage
 
Methods inherited from class javax.swing.JCheckBox
getAccessibleContext, isBorderPaintedFlat, paramString, setBorderPaintedFlat
 
Methods inherited from class javax.swing.AbstractButton
actionPropertyChanged, addActionListener, addChangeListener, addImpl, addItemListener, checkHorizontalKey, checkVerticalKey, configurePropertiesFromAction, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHideActionText, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, removeNotify, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setEnabled, setFocusPainted, setHideActionText, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabel, setLayout, setMnemonic, setMnemonic, setModel, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WebTristateCheckBox

public WebTristateCheckBox()
Constructs new tristate checkbox.


WebTristateCheckBox

public WebTristateCheckBox(boolean checked)
Constructs new tristate checkbox.

Parameters:
checked - whether checkbox should be checked or not

WebTristateCheckBox

public WebTristateCheckBox(CheckState state)
Constructs new tristate checkbox.

Parameters:
state - initial check state

WebTristateCheckBox

public WebTristateCheckBox(javax.swing.Icon icon)
Constructs new tristate checkbox.

Parameters:
icon - checkbox icon

WebTristateCheckBox

public WebTristateCheckBox(javax.swing.Icon icon,
                           boolean checked)
Constructs new tristate checkbox.

Parameters:
icon - checkbox icon
checked - whether checkbox should be checked or not

WebTristateCheckBox

public WebTristateCheckBox(javax.swing.Icon icon,
                           CheckState state)
Constructs new tristate checkbox.

Parameters:
icon - checkbox icon
state - initial check state

WebTristateCheckBox

public WebTristateCheckBox(java.lang.String text)
Constructs new tristate checkbox.

Parameters:
text - checkbox text

WebTristateCheckBox

public WebTristateCheckBox(java.lang.String text,
                           boolean checked)
Constructs new tristate checkbox.

Parameters:
text - checkbox text
checked - whether checkbox should be checked or not

WebTristateCheckBox

public WebTristateCheckBox(java.lang.String text,
                           CheckState state)
Constructs new tristate checkbox.

Parameters:
text - checkbox text
state - initial check state

WebTristateCheckBox

public WebTristateCheckBox(java.lang.String text,
                           javax.swing.Icon icon)
Constructs new tristate checkbox.

Parameters:
text - checkbox text
icon - checkbox icon

WebTristateCheckBox

public WebTristateCheckBox(java.lang.String text,
                           javax.swing.Icon icon,
                           boolean checked)
Constructs new tristate checkbox.

Parameters:
text - checkbox text
icon - checkbox icon
checked - whether checkbox should be checked or not

WebTristateCheckBox

public WebTristateCheckBox(java.lang.String text,
                           javax.swing.Icon icon,
                           CheckState state)
Constructs new tristate checkbox.

Parameters:
text - checkbox text
icon - checkbox icon
state - initial check state

WebTristateCheckBox

public WebTristateCheckBox(javax.swing.Action action)
Constructs new tristate checkbox.

Parameters:
action - checkbox action
Method Detail

init

protected void init(java.lang.String text,
                    javax.swing.Icon icon)
Initializes checkbox settings.

Overrides:
init in class javax.swing.AbstractButton
Parameters:
text - initial text
icon - initial icon

getActualModel

public TristateCheckBoxModel getActualModel()
Returns actual tristate checkbox model.

Returns:
actual tristate checkbox model

isCheckMixedOnToggle

public boolean isCheckMixedOnToggle()
Returns whether partially checked tristate checkbox should be checked or unchecked on toggle.

Returns:
true if partially checked tristate checkbox should be checked on toggle, false if it should be unchecked

setCheckMixedOnToggle

public void setCheckMixedOnToggle(boolean checkMixedOnToggle)
Sets whether partially checked tristate checkbox should be checked or unchecked on toggle

Parameters:
checkMixedOnToggle - whether partially checked tristate checkbox should be checked or unchecked on toggle

getState

public CheckState getState()
Returns tristate checkbox check state.

Returns:
tristate checkbox check state

getNextState

public CheckState getNextState(CheckState checkState)
Returns next check state for toggle action.

Parameters:
checkState - current check state
Returns:
next check state for toggle action

setState

public void setState(CheckState state)
Sets tristate checkbox check state.

Parameters:
state - new tristate checkbox check state

isChecked

public boolean isChecked()
Returns whether checkbox is checked or not.

Returns:
true if checkbox is checked, false otherwise

setChecked

public void setChecked()
Forces checked state.


isMixed

public boolean isMixed()
Returns whether checkbox is in mixed state or not.

Returns:
true if checkbox is in mixed state, false otherwise

setMixed

public void setMixed()
Forces mixed state.


isUnchecked

public boolean isUnchecked()
Returns whether checkbox is unchecked or not.

Returns:
true if checkbox is unchecked, false otherwise

setUnchecked

public void setUnchecked()
Forces unchecked state.


getWebUI

public WebTristateCheckBoxUI getWebUI()
Returns Web-UI applied to this class.

Overrides:
getWebUI in class WebCheckBox
Returns:
Web-UI applied to this class

updateUI

public void updateUI()
Installs a Web-UI into this component.

Overrides:
updateUI in class WebCheckBox

getUIClassID

public java.lang.String getUIClassID()

Overrides:
getUIClassID in class javax.swing.JCheckBox