de.matthiasmann.twl
Class ToggleButton

java.lang.Object
  extended by de.matthiasmann.twl.Widget
      extended by de.matthiasmann.twl.TextWidget
          extended by de.matthiasmann.twl.Button
              extended by de.matthiasmann.twl.ToggleButton

public class ToggleButton
extends Button

A toggle button.

This class extends Button with the ablity to bind the selected state to a BooleanModel.

The prefert way to use this class is by using the callback on the BooleanModel.

To implement radio buttons one of the option models can be used:


Nested Class Summary
 
Nested classes/interfaces inherited from class de.matthiasmann.twl.Widget
Widget.OffscreenMouseAdjustments, Widget.RenderOffscreen
 
Field Summary
 
Fields inherited from class de.matthiasmann.twl.Button
STATE_ARMED, STATE_PRESSED, STATE_SELECTED
 
Fields inherited from class de.matthiasmann.twl.TextWidget
STATE_HOVER, STATE_TEXT_CHANGED, STATE_TEXT_SELECTION
 
Fields inherited from class de.matthiasmann.twl.Widget
STATE_DISABLED, STATE_HAS_FOCUSED_CHILD, STATE_HAS_OPEN_POPUPS, STATE_KEYBOARD_FOCUS
 
Constructor Summary
ToggleButton()
           
ToggleButton(BooleanModel model)
           
ToggleButton(java.lang.String text)
           
 
Method Summary
 boolean isActive()
           
 void setActive(boolean active)
           
 void setModel(BooleanModel model)
           
 
Methods inherited from class de.matthiasmann.twl.Button
addCallback, afterAddToGUI, applyTheme, applyThemeButton, beforeRemoveFromGUI, disarm, doCallback, getMinHeight, getMinWidth, getModel, getMouseButton, getText, handleEvent, hasCallbacks, removeCallback, setEnabled, setModel, setMouseButton, setText, setVisible, widgetDisabled
 
Methods inherited from class de.matthiasmann.twl.TextWidget
applyThemeTextWidget, computeRelativeCursorPositionX, computeRelativeCursorPositionX, computeTextHeight, computeTextWidth, computeTextX, computeTextY, destroy, getAlignment, getCharSequence, getFont, getNumTextLines, getPreferredInnerHeight, getPreferredInnerWidth, handleMouseHover, hasText, isCache, isMultilineText, paintLabelText, paintTextAt, paintWidget, paintWithSelection, paintWithSelection, setAlignment, setCache, setCharSequence, setFont
 
Methods inherited from class de.matthiasmann.twl.Widget
add, addActionMapping, addPropertyChangeListener, addPropertyChangeListener, adjustSize, allChildrenRemoved, applyThemeBackground, applyThemeBorder, applyThemeInputMap, applyThemeMaxSize, applyThemeMinSize, applyThemeMouseCursor, applyThemeOffscreenExtra, applyThemeOverlay, applyThemeTooltip, borderChanged, canAcceptKeyboardFocus, childAdded, childInvalidateLayout, childRemoved, childVisibilityChanged, computeSize, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, focusFirstChild, focusLastChild, focusNextChild, focusPrevChild, getActionMap, getAnimationState, getBackground, getBorderBottom, getBorderHorizontal, getBorderLeft, getBorderRight, getBorderTop, getBorderVertical, getBottom, getChild, getChildAt, getChildIndex, getGUI, getHeight, getInnerBottom, getInnerHeight, getInnerRight, getInnerWidth, getInnerX, getInnerY, getInputMap, getKeyboardFocusOrder, getMaxHeight, getMaxWidth, getMouseCursor, getMouseCursor, getNumChildren, getOffscreenExtraBottom, getOffscreenExtraLeft, getOffscreenExtraRight, getOffscreenExtraTop, getOrCreateActionMap, getOverlay, getParent, getPreferredHeight, getPreferredWidth, getRenderOffscreen, getRight, getRootWidget, getTheme, getThemePath, getThemeTooltipContent, getTintAnimator, getTooltipContent, getTooltipContentAt, getWidgetAt, getWidth, getX, getY, giveupKeyboardFocus, handleKeyStrokeAction, hasKeyboardFocus, hasOpenPopups, hasSharedAnimationState, insertChild, invalidateLayout, invalidateLayoutLocally, isAbsoluteTheme, isClip, isDepthFocusTraversal, isEnabled, isFocusKeyEnabled, isInside, isLocallyEnabled, isMouseInside, isVisible, keyboardFocusChildChanged, keyboardFocusGained, keyboardFocusGained, keyboardFocusLost, layout, layoutChildFullInnerArea, layoutChildrenFullInnerArea, moveChild, paint, paintBackground, paintChild, paintChildren, paintDragOverlay, paintOverlay, positionChanged, reapplyTheme, removeAllChildren, removeChild, removeChild, removePropertyChangeListener, removePropertyChangeListener, requestKeyboardFocus, requestKeyboardFocus, resetTooltip, setActionMap, setBackground, setBorderSize, setBorderSize, setBorderSize, setBorderSize, setCanAcceptKeyboardFocus, setClip, setDepthFocusTraversal, setFocusKeyEnabled, setInnerSize, setInputMap, setMaxSize, setMinSize, setMouseCursor, setOffscreenExtra, setOffscreenExtra, setOverlay, setPosition, setRenderOffscreen, setSize, setTheme, setTintAnimator, setTooltipContent, sizeChanged, updateTintAnimation, updateTooltip, validateLayout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToggleButton

public ToggleButton()

ToggleButton

public ToggleButton(BooleanModel model)

ToggleButton

public ToggleButton(java.lang.String text)
Method Detail

setModel

public void setModel(BooleanModel model)

isActive

public boolean isActive()

setActive

public void setActive(boolean active)