bibliothek.gui.dock.themes.basic.action.buttons
Class ButtonContentValue

java.lang.Object
  extended by bibliothek.gui.dock.util.PropertyValue<ButtonContent>
      extended by bibliothek.gui.dock.themes.basic.action.buttons.ButtonContentValue
All Implemented Interfaces:
ButtonContentListener

public abstract class ButtonContentValue
extends PropertyValue<ButtonContent>
implements ButtonContentListener

A wrapper around an exchangeable ButtonContent that implements ButtonContentListener to listen to the current ButtonContent. This class offers methods to montior the properties of one Dockable, the class keeps track of old properties and calls the method propertyChanged() whenever at least one property truly did change.

Author:
Benjamin Sigg

Constructor Summary
ButtonContentValue(ButtonContent theme)
          Creates a new wrapper
 
Method Summary
 void changed(ButtonContent content, Dockable dockable)
          Called if any property of dockable changed such that a property of content may have changed.
 boolean isFilterActions()
          Tells whether the DockActions should be filtered by the current ButtonContentFilter before made visible.
 boolean isShowActions()
          Tells whether the default DockActions of a Dockable should be painted.
 boolean isShowChildren()
          Tells whether buttons to select the child Dockables of a DockStation should be painted.
 boolean isShowIcon()
          Tells whether an icon should be painted.
 boolean isShowKnob()
          Tells whether a knob, where the user can grab the button, should be painted.
 boolean isShowText()
          Tells whether a title text should be painted.
protected abstract  void propertyChanged()
          Called if at least one property changed.
 void setDockable(Dockable dockable)
          Sets the element whose properties should be monitored.
protected  void valueChanged(ButtonContent oldValue, ButtonContent newValue)
          Invoked when the value has been changed.
 
Methods inherited from class bibliothek.gui.dock.util.PropertyValue
getKey, getOwnValue, getProperties, getValue, isAnyValueSet, setKey, setProperties, setProperties, setValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ButtonContentValue

public ButtonContentValue(ButtonContent theme)
Creates a new wrapper

Parameters:
theme - the defaults of all values, not null. When asking for a property of this ButtonContent a value of false will be used as theme default.
Method Detail

valueChanged

protected void valueChanged(ButtonContent oldValue,
                            ButtonContent newValue)
Description copied from class: PropertyValue
Invoked when the value has been changed.

Specified by:
valueChanged in class PropertyValue<ButtonContent>
Parameters:
oldValue - the new value
newValue - the old value

setDockable

public void setDockable(Dockable dockable)
Sets the element whose properties should be monitored. The method propertyChanged() will be called whenever a property of the current ButtonContent in respect to dockable did change.

Parameters:
dockable - the element to observe or null

changed

public void changed(ButtonContent content,
                    Dockable dockable)
Description copied from interface: ButtonContentListener
Called if any property of dockable changed such that a property of content may have changed.

Specified by:
changed in interface ButtonContentListener
Parameters:
content - the content which may now have a different behavior
dockable - the element which caused the event

isShowKnob

public boolean isShowKnob()
Tells whether a knob, where the user can grab the button, should be painted.

Returns:
true if a knob should be visible

isShowIcon

public boolean isShowIcon()
Tells whether an icon should be painted.

Returns:
true if the title icon should be visible

isShowText

public boolean isShowText()
Tells whether a title text should be painted.

Returns:
true if the title text should be visible

isShowChildren

public boolean isShowChildren()
Tells whether buttons to select the child Dockables of a DockStation should be painted.

Returns:
true if buttons are required

isShowActions

public boolean isShowActions()
Tells whether the default DockActions of a Dockable should be painted.

Returns:
true if the actions should be shown

isFilterActions

public boolean isFilterActions()
Tells whether the DockActions should be filtered by the current ButtonContentFilter before made visible.

Returns:
true if the actions should be filtered

propertyChanged

protected abstract void propertyChanged()
Called if at least one property changed. If either the current ButtonContent or the current Dockable is null, then this method is never called.