bibliothek.gui.dock.themes.border
Class BorderForwarder

java.lang.Object
  extended by bibliothek.gui.dock.themes.border.BorderForwarder
All Implemented Interfaces:
DockBorder, UIValue<BorderModifier>
Direct Known Subclasses:
BasicDockableDisplayer.DisplayerBorder

public class BorderForwarder
extends Object
implements DockBorder

This helper class implements DockBorder, provides methods to register itself on the current ThemeManager, and updates the border of some JComponent using the current BorderModifier.

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from interface bibliothek.gui.dock.themes.border.DockBorder
KIND
 
Constructor Summary
BorderForwarder(Path kind, String id, JComponent target)
          Creates a new forwarder.
 
Method Summary
protected  void forward(Border border)
          Calls JComponent.setBorder(Border) on the target JComponent of this forwarder.
 BorderModifier get()
          Gets the BorderModifier that is currently used by this forwarder.
 boolean isForwarding()
          Tells whether the current call to JComponent.setBorder(Border) is executed by this forwarder.
 void set(BorderModifier value)
          Called when the underlying resource of this UIValue changes.
 void setBorder(Border border)
          Sets the basic border of this forwarder.
 void setController(DockController controller)
          Sets the DockController which should be monitored for the current BorderModifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BorderForwarder

public BorderForwarder(Path kind,
                       String id,
                       JComponent target)
Creates a new forwarder.

Parameters:
kind - what kind of UIValue this is
id - the identifier this UIValue should monitor
target - the component whose border is going to be replaced
Method Detail

setBorder

public void setBorder(Border border)
Sets the basic border of this forwarder. The basic border will be used as argument for BorderModifier.modify(Border).

Parameters:
border - the new border, can be null

set

public void set(BorderModifier value)
Description copied from interface: UIValue
Called when the underlying resource of this UIValue changes.

Specified by:
set in interface UIValue<BorderModifier>
Parameters:
value - the new value

get

public BorderModifier get()
Gets the BorderModifier that is currently used by this forwarder.

Returns:
the current modifier or null

setController

public void setController(DockController controller)
Sets the DockController which should be monitored for the current BorderModifier.

Parameters:
controller - the new controller or null

forward

protected void forward(Border border)
Calls JComponent.setBorder(Border) on the target JComponent of this forwarder. During the call isForwarding() returns true.

Parameters:
border - the border to really show

isForwarding

public boolean isForwarding()
Tells whether the current call to JComponent.setBorder(Border) is executed by this forwarder.

Returns:
true if currently forward(Border) is running