bibliothek.gui.dock.control
Class DoubleClickController

java.lang.Object
  extended by bibliothek.gui.dock.control.DoubleClickController

public class DoubleClickController
extends Object

Adds a MouseListener to all Dockables, DockTitles and other DockElementRepresentatives, informs the registered DoubleClickController.GlobalDoubleClickListeners whenever the user clicks twice on such an element.

Author:
Benjamin Sigg

Nested Class Summary
protected  class DoubleClickController.GlobalDoubleClickListener
          A listener which waits for a double-click-event.
 
Constructor Summary
DoubleClickController(ControllerSetupCollection setup)
          Creates a new DoubleClickController.
 
Method Summary
 void addListener(DoubleClickListener listener)
          Adds a listener to this controller.
 void removeListener(DoubleClickListener listener)
          Removes a listener from this controller.
 void send(Dockable dockable, MouseEvent event)
          Fires an event to the DoubleClickController.GlobalDoubleClickListeners whose location in the tree is equal or below dockable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleClickController

public DoubleClickController(ControllerSetupCollection setup)
Creates a new DoubleClickController.

Parameters:
setup - an observable that informs this object when controller is set up.
Method Detail

addListener

public void addListener(DoubleClickListener listener)
Adds a listener to this controller.

Parameters:
listener - the new observer

removeListener

public void removeListener(DoubleClickListener listener)
Removes a listener from this controller.

Parameters:
listener - the observer to remove

send

public void send(Dockable dockable,
                 MouseEvent event)
Fires an event to the DoubleClickController.GlobalDoubleClickListeners whose location in the tree is equal or below dockable. The order in which the observers receive the event depends on their distance to the dockable.

Parameters:
dockable - the dockable which was selected by the user
event - the cause of the invocation, its click count must be 2.