de.matthiasmann.twl.model
Interface ButtonModel

All Known Implementing Classes:
SimpleButtonModel, ToggleButtonModel

public interface ButtonModel

A generic button model. Allows to separate button behavior from the button Widget. A ButtonModel should not be shared between Button instances.


Method Summary
 void addActionCallback(java.lang.Runnable callback)
           
 void addStateCallback(java.lang.Runnable callback)
           
 void connect()
          Called when the Button is placed in the GUI tree.
 void disconnect()
          Called when the Button is no longer part of the GUI tree.
 void fireActionCallback()
           
 boolean hasActionCallbacks()
           
 boolean isArmed()
           
 boolean isEnabled()
           
 boolean isHover()
           
 boolean isPressed()
           
 boolean isSelected()
           
 void removeActionCallback(java.lang.Runnable callback)
           
 void removeStateCallback(java.lang.Runnable callback)
           
 void setArmed(boolean armed)
           
 void setEnabled(boolean enabled)
           
 void setHover(boolean hover)
           
 void setPressed(boolean pressed)
           
 void setSelected(boolean selected)
           
 

Method Detail

isSelected

boolean isSelected()

isPressed

boolean isPressed()

isArmed

boolean isArmed()

isHover

boolean isHover()

isEnabled

boolean isEnabled()

setSelected

void setSelected(boolean selected)

setPressed

void setPressed(boolean pressed)

setArmed

void setArmed(boolean armed)

setHover

void setHover(boolean hover)

setEnabled

void setEnabled(boolean enabled)

addActionCallback

void addActionCallback(java.lang.Runnable callback)

removeActionCallback

void removeActionCallback(java.lang.Runnable callback)

fireActionCallback

void fireActionCallback()

hasActionCallbacks

boolean hasActionCallbacks()

addStateCallback

void addStateCallback(java.lang.Runnable callback)

removeStateCallback

void removeStateCallback(java.lang.Runnable callback)

connect

void connect()
Called when the Button is placed in the GUI tree. Callbacks to other models should only be installed after this call.


disconnect

void disconnect()
Called when the Button is no longer part of the GUI tree. Callbacks to other models should be removed.