bibliothek.gui.dock.themes.basic.action
Class BasicButtonModelAdapter

java.lang.Object
  extended by bibliothek.gui.dock.themes.basic.action.BasicButtonModelAdapter
All Implemented Interfaces:
BasicButtonModelListener

public class BasicButtonModelAdapter
extends Object
implements BasicButtonModelListener

A simple implementation of BasicButtonModelListener forwarding any event expect triggered(), bound(BasicButtonModel, DockController) and unbound(BasicButtonModel, DockController) to changed().

Author:
Benjamin Sigg

Constructor Summary
BasicButtonModelAdapter()
           
 
Method Summary
 void backgroundChanged(BasicButtonModel model, BackgroundPaint oldBackground, BackgroundPaint newBackground)
          Called when the background algorithm has been exchanged.
 void borderChanged(BasicButtonModel model, String key, BorderModifier oldBorder, BorderModifier newBorder)
          Called when a border has changed.
 void bound(BasicButtonModel model, DockController controller)
          Called after controller was installed on model.
protected  void changed()
          Called by all methods except triggered() of this adapter.
 void disabledIconChanged(BasicButtonModel model, Icon oldIcon, Icon icon)
           
 void enabledStateChanged(BasicButtonModel model, boolean enabled)
          Called if the action was enabled or disabled.
 void iconChanged(BasicButtonModel model, ActionContentModifier modifier, Icon oldIcon, Icon icon)
          Called if an icon of model changed.
 void mouseInside(BasicButtonModel model, boolean mouseInside)
          Called if the mouse enters or leaves the view.
 void mousePressed(BasicButtonModel model, boolean mousePressed)
          Called if the mouse is pressed or released.
 void orientationChanged(BasicButtonModel model, DockTitle.Orientation old, DockTitle.Orientation orientation)
          Called if the orientation of the view changed.
 void selectedStateChanged(BasicButtonModel model, boolean selected)
          Called if the selection state of model changed.
 void textChanged(BasicButtonModel model, String oldText, String text)
          Called if the text of model changed.
 void tooltipChanged(BasicButtonModel model, String old, String tooltip)
          Called if the tooltip of the action changed.
 void triggered()
          Called if the user triggered the action.
 void unbound(BasicButtonModel model, DockController controller)
          Called after controller was uninstalled from model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicButtonModelAdapter

public BasicButtonModelAdapter()
Method Detail

textChanged

public void textChanged(BasicButtonModel model,
                        String oldText,
                        String text)
Description copied from interface: BasicButtonModelListener
Called if the text of model changed.

Specified by:
textChanged in interface BasicButtonModelListener
Parameters:
model - the source of the event
oldText - the old value, can be null
text - the new value, can be null

disabledIconChanged

public void disabledIconChanged(BasicButtonModel model,
                                Icon oldIcon,
                                Icon icon)

enabledStateChanged

public void enabledStateChanged(BasicButtonModel model,
                                boolean enabled)
Description copied from interface: BasicButtonModelListener
Called if the action was enabled or disabled.

Specified by:
enabledStateChanged in interface BasicButtonModelListener
Parameters:
model - the source of the event.
enabled - the new enable state

mouseInside

public void mouseInside(BasicButtonModel model,
                        boolean mouseInside)
Description copied from interface: BasicButtonModelListener
Called if the mouse enters or leaves the view.

Specified by:
mouseInside in interface BasicButtonModelListener
Parameters:
model - the source of the event
mouseInside - whether the mouse is inside or not

mousePressed

public void mousePressed(BasicButtonModel model,
                         boolean mousePressed)
Description copied from interface: BasicButtonModelListener
Called if the mouse is pressed or released.

Specified by:
mousePressed in interface BasicButtonModelListener
Parameters:
model - the source of the event
mousePressed - the state of the mouse

orientationChanged

public void orientationChanged(BasicButtonModel model,
                               DockTitle.Orientation old,
                               DockTitle.Orientation orientation)
Description copied from interface: BasicButtonModelListener
Called if the orientation of the view changed.

Specified by:
orientationChanged in interface BasicButtonModelListener
Parameters:
model - the source of the event
old - the old value
orientation - the new value

iconChanged

public void iconChanged(BasicButtonModel model,
                        ActionContentModifier modifier,
                        Icon oldIcon,
                        Icon icon)
Description copied from interface: BasicButtonModelListener
Called if an icon of model changed.

Specified by:
iconChanged in interface BasicButtonModelListener
Parameters:
model - the source of the event
modifier - the context in which the icon is used
oldIcon - the old value
icon - the new value

selectedStateChanged

public void selectedStateChanged(BasicButtonModel model,
                                 boolean selected)
Description copied from interface: BasicButtonModelListener
Called if the selection state of model changed.

Specified by:
selectedStateChanged in interface BasicButtonModelListener
Parameters:
model - the source of the event.
selected - the new state

tooltipChanged

public void tooltipChanged(BasicButtonModel model,
                           String old,
                           String tooltip)
Description copied from interface: BasicButtonModelListener
Called if the tooltip of the action changed.

Specified by:
tooltipChanged in interface BasicButtonModelListener
Parameters:
model - the source of the event
old - the old value
tooltip - the new value

backgroundChanged

public void backgroundChanged(BasicButtonModel model,
                              BackgroundPaint oldBackground,
                              BackgroundPaint newBackground)
Description copied from interface: BasicButtonModelListener
Called when the background algorithm has been exchanged.

Specified by:
backgroundChanged in interface BasicButtonModelListener
Parameters:
model - the source of this event
oldBackground - the old background algorithm, can be null
newBackground - the new background algorithm, can be null

borderChanged

public void borderChanged(BasicButtonModel model,
                          String key,
                          BorderModifier oldBorder,
                          BorderModifier newBorder)
Description copied from interface: BasicButtonModelListener
Called when a border has changed.

Specified by:
borderChanged in interface BasicButtonModelListener
Parameters:
model - the source of this event
key - the identifier of the border
oldBorder - the old border, can be null
newBorder - the new border, can be null

bound

public void bound(BasicButtonModel model,
                  DockController controller)
Description copied from interface: BasicButtonModelListener
Called after controller was installed on model.

Specified by:
bound in interface BasicButtonModelListener
Parameters:
model - the source of this event
controller - the controller that was installed

unbound

public void unbound(BasicButtonModel model,
                    DockController controller)
Description copied from interface: BasicButtonModelListener
Called after controller was uninstalled from model.

Specified by:
unbound in interface BasicButtonModelListener
Parameters:
model - the source of this event
controller - the controller that was removed

triggered

public void triggered()
Description copied from interface: BasicButtonModelListener
Called if the user triggered the action.

Specified by:
triggered in interface BasicButtonModelListener

changed

protected void changed()
Called by all methods except triggered() of this adapter.