bibliothek.gui.dock.station.support
Class DockableVisibilityManager

java.lang.Object
  extended by bibliothek.gui.dock.event.DockStationAdapter
      extended by bibliothek.gui.dock.station.support.DockableVisibilityManager
All Implemented Interfaces:
DockStationListener

public class DockableVisibilityManager
extends DockStationAdapter

Knows for every child of a DockStation whether it is visible or not. The station can call the fire()-method to send events to listeners, if the visibility of some children has changed. The manager fires events automatically if a Dockable is added or removed from the parent station. The manager tries to minimize the number of messages sent to the listeners.

Author:
Benjamin Sigg

Field Summary
private  DockStationListenerManager listeners
           
private  java.util.Map<Dockable,java.lang.Boolean> visibility
           
 
Constructor Summary
DockableVisibilityManager(DockStationListenerManager listeners)
          Constructs a new manager
 
Method Summary
 void dockableAdded(DockStation station, Dockable dockable)
          Invoked after dockable has been added to station.
 void dockableRemoved(DockStation station, Dockable dockable)
          Invoked after dockable has been removed from station.
 void fire()
          Checks which Dockables have changed their state and fires events for them.
 
Methods inherited from class bibliothek.gui.dock.event.DockStationAdapter
dockableAdding, dockableRemoving, dockableVisibiltySet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

private DockStationListenerManager listeners

visibility

private java.util.Map<Dockable,java.lang.Boolean> visibility
Constructor Detail

DockableVisibilityManager

public DockableVisibilityManager(DockStationListenerManager listeners)
Constructs a new manager

Parameters:
listeners - the listeners used to fire events
Method Detail

fire

public void fire()
Checks which Dockables have changed their state and fires events for them.


dockableAdded

public void dockableAdded(DockStation station,
                          Dockable dockable)
Description copied from interface: DockStationListener
Invoked after dockable has been added to station.

Specified by:
dockableAdded in interface DockStationListener
Overrides:
dockableAdded in class DockStationAdapter
Parameters:
station - the station where the new child was added
dockable - the new child

dockableRemoved

public void dockableRemoved(DockStation station,
                            Dockable dockable)
Description copied from interface: DockStationListener
Invoked after dockable has been removed from station.

Specified by:
dockableRemoved in interface DockStationListener
Overrides:
dockableRemoved in class DockStationAdapter
Parameters:
station - the station where the old child was removed
dockable - the old child