bibliothek.gui.dock.station.split
Class FullScreenClickableListener

java.lang.Object
  extended by bibliothek.gui.dock.event.DockAdapter
      extended by bibliothek.gui.dock.station.split.FullScreenClickableListener
All Implemented Interfaces:
DockableListener, DockControllerListener, DockRegisterListener, DockRelocatorListener, DockStationListener

public class FullScreenClickableListener
extends DockAdapter

A listener which is added to a SplitDockStation. The listener observes all children and adds to each DockTitle or Dockable a FullScreenClickableListener.FullScreenListener. The listener is removed when a Dockable is removed from this station.

Author:
Benjamin Sigg

Nested Class Summary
protected  class FullScreenClickableListener.FullScreenListener
          A listener which waits for a double-click-event to change the fullscreen-mode of a Dockable.
 
Field Summary
private  java.util.Map<Dockable,FullScreenClickableListener.FullScreenListener> dockableListeners
          A map that tells which listener was added to which Dockable
private  java.util.Set<DockStation> knownStations
          A set that tells to which station this listener is added
private  SplitDockStation station
          The station which is observed by this listener
private  java.util.Map<DockTitle,FullScreenClickableListener.FullScreenListener> titleListeners
          A map that tells which listener was added to which DockTitle
 
Constructor Summary
FullScreenClickableListener(SplitDockStation station)
          Constructs a new listener.
 
Method Summary
private  void add(Dockable dockable)
          Adds a listener to dockable which might change the fullscreen-mode of dockable or one of its parents.
private  void collect(Dockable dockable)
          Adds to dockable (if shouldCollect(Dockable) returns true) and to all its children a listener.
private  void collect(DockStation station)
          Adds to all children of station a listener.
 void destroy()
          Deconstructor of this listener, removes all listeners from any known observed object.
 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.
 SplitDockStation getStation()
          Gets the station which is observed by this listener.
private  void remove(Dockable dockable)
          Removes the listener which was added earlier to dockable.
protected  boolean shouldCollect(Dockable dockable)
          Determines whether dockable should be observed or not.
protected  boolean shouldCollect(Dockable dockable, DockTitle title)
          Determines whether title should be observed or not.
 void titleBinded(DockController controller, DockTitle title, Dockable dockable)
          Called when title was binded to dockable.
 void titleUnbinded(DockController controller, DockTitle title, Dockable dockable)
          Called when title was unbinded from dockable.
private  void uncollect(Dockable dockable)
          Removes any listener that was added to dockable.
private  void uncollect(DockStation station)
          Removes all listener from station and its children.
protected  Dockable unwrap(Dockable dockable)
          Searches a parent of dockable which has the station as its direct parent.
 
Methods inherited from class bibliothek.gui.dock.event.DockAdapter
dockableAdding, dockableDrag, dockableFocused, dockablePut, dockableRegistered, dockableRegistering, dockableRemoving, dockableUnregistered, dockableVisibiltySet, dockStationRegistered, dockStationRegistering, dockStationUnregistered, titleBinded, titleIconChanged, titleTextChanged, titleUnbinded
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

station

private SplitDockStation station
The station which is observed by this listener


dockableListeners

private java.util.Map<Dockable,FullScreenClickableListener.FullScreenListener> dockableListeners
A map that tells which listener was added to which Dockable


titleListeners

private java.util.Map<DockTitle,FullScreenClickableListener.FullScreenListener> titleListeners
A map that tells which listener was added to which DockTitle


knownStations

private java.util.Set<DockStation> knownStations
A set that tells to which station this listener is added

Constructor Detail

FullScreenClickableListener

public FullScreenClickableListener(SplitDockStation station)
Constructs a new listener.

Parameters:
station - the station which should be observed
Method Detail

getStation

public SplitDockStation getStation()
Gets the station which is observed by this listener.

Returns:
the observed station

collect

private void collect(Dockable dockable)
Adds to dockable (if shouldCollect(Dockable) returns true) and to all its children a listener.

Parameters:
dockable - the Dockable which will be observed

collect

private void collect(DockStation station)
Adds to all children of station a listener.

Parameters:
station - the station which will be observed

uncollect

private void uncollect(Dockable dockable)
Removes any listener that was added to dockable.

Parameters:
dockable - the Dockable which will no longer be observed

uncollect

private void uncollect(DockStation station)
Removes all listener from station and its children.

Parameters:
station - the station which will no longer be observed

add

private void add(Dockable dockable)
Adds a listener to dockable which might change the fullscreen-mode of dockable or one of its parents.

Parameters:
dockable - the Dockable which will be observed

remove

private void remove(Dockable dockable)
Removes the listener which was added earlier to dockable.

Parameters:
dockable - the Dockable which will no longer be observed

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 DockAdapter
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 DockAdapter
Parameters:
station - the station where the old child was removed
dockable - the old child

titleBinded

public void titleBinded(DockController controller,
                        DockTitle title,
                        Dockable dockable)
Description copied from interface: DockControllerListener
Called when title was binded to dockable. This method is called after the DockTitle.bind()-method was invoked.

Specified by:
titleBinded in interface DockControllerListener
Overrides:
titleBinded in class DockAdapter
Parameters:
controller - the origin of the event
title - the DockTitle that was binded
dockable - the owner of title

titleUnbinded

public void titleUnbinded(DockController controller,
                          DockTitle title,
                          Dockable dockable)
Description copied from interface: DockControllerListener
Called when title was unbinded from dockable. This method is called after the DockTitle.bind()-method was invoked.

Specified by:
titleUnbinded in interface DockControllerListener
Overrides:
titleUnbinded in class DockAdapter
Parameters:
controller - the origin of the event
title - the DockTitle which was unbinded
dockable - the old owner of title

unwrap

protected Dockable unwrap(Dockable dockable)
Searches a parent of dockable which has the station as its direct parent.

Parameters:
dockable - the root of the search
Returns:
dockable, a parent of dockable or null

shouldCollect

protected boolean shouldCollect(Dockable dockable)
Determines whether dockable should be observed or not.

Parameters:
dockable - the dockable which will be checked
Returns:
true if dockable should have a listener, false otherwise

shouldCollect

protected boolean shouldCollect(Dockable dockable,
                                DockTitle title)
Determines whether title should be observed or not.

Parameters:
dockable - the owner of title
title - the title which will be checked
Returns:
true if title has to be observed, false otherwise

destroy

public void destroy()
Deconstructor of this listener, removes all listeners from any known observed object.