bibliothek.gui.dock.station
Class OrientationObserver

java.lang.Object
  extended by bibliothek.gui.dock.station.OrientationObserver
All Implemented Interfaces:
OrientingDockStationListener

public abstract class OrientationObserver
extends Object
implements OrientingDockStationListener

The OrientationObserver adds itself as OrientingDockStationListener to the first OrientingDockStation that is found as parent of a specific Dockable.

Author:
Benjamin Sigg

Constructor Summary
OrientationObserver(bibliothek.gui.Dockable dockable)
          Creates a new observer
 
Method Summary
 void changed(OrientingDockStationEvent event)
          Called if the Orientation of one or many children of some OrientingDockStation has changed.
 void destroy()
          Destroyes this observer, all resources are prepared for garbage collection.
 bibliothek.gui.Dockable getDockable()
          Gets the Dockable which is monitored by this OrientationObserver.
 Orientation getOrientation()
          Gets the Orientation that should currently be applied to the dockable,
protected abstract  void orientationChanged(Orientation current)
          Called if the orientation of the dockable changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrientationObserver

public OrientationObserver(bibliothek.gui.Dockable dockable)
Creates a new observer

Parameters:
dockable - the element whose parent OrientingDockStation should be observed
Method Detail

destroy

public void destroy()
Destroyes this observer, all resources are prepared for garbage collection.


getDockable

public bibliothek.gui.Dockable getDockable()
Gets the Dockable which is monitored by this OrientationObserver.

Returns:
the element, not null

orientationChanged

protected abstract void orientationChanged(Orientation current)
Called if the orientation of the dockable changed. This method may be called several times with the same argument.

Parameters:
current - the new orientation, can null if the dockable does not have an OrientingDockStation as parent

getOrientation

public Orientation getOrientation()
Gets the Orientation that should currently be applied to the dockable,

Returns:
the current orientation or null if the dockable does not have an OrientingDockStation as parent.

changed

public void changed(OrientingDockStationEvent event)
Description copied from interface: OrientingDockStationListener
Called if the Orientation of one or many children of some OrientingDockStation has changed.

Specified by:
changed in interface OrientingDockStationListener
Parameters:
event - detailed information about the event