bibliothek.gui.dock.control
Interface DockRelocator

All Known Implementing Classes:
AbstractDockRelocator, DefaultDockRelocator

public interface DockRelocator

The DockRelocator is responsible for executing and managing the basic drag and drop operations.

Author:
Benjamin Sigg

Method Summary
 void addDockRelocatorListener(DockRelocatorListener listener)
          Deprecated. will be removed in a future release
 void addMode(DockRelocatorMode mode)
          Adds a mode to this relocator, a mode can be activated or deactivated when the user presses a button like "ctrl" or "shift" during a drag and drop operation.
 void addVetoableDockRelocatorListener(VetoableDockRelocatorListener listener)
          Adds a listener to this manager.
 DirectRemoteRelocator createDirectRemote(Dockable dockable)
          Creates a device with which drag&drop operations concerning dockable can be initiated and executed.
 DirectRemoteRelocator createDirectRemote(Dockable dockable, boolean forceDrag)
          Creates a device with which drag&drop operations concerning dockable can be initiated and executed.
 RemoteRelocator createRemote(Dockable dockable)
          Creates a device with which drag&drop operations concerning dockable can be initiated and executed.
 RemoteRelocator createRemote(Dockable dockable, boolean forceDrag)
          Creates a device with which drag&drop operations concerning dockable can be initiated and executed.
 int getDragDistance()
          Gets the distance the user must move the mouse in order to begin a drag operation.
 Merger getMerger()
          Gets an algorithm useful for merging two DockStations.
 boolean isDragOnlyTitel()
          Tells whether dockables can only be dragged through their title or not.
 boolean isOnMove()
          Tells whether the user has currently grabbed a dockable and moves the dockable around.
 boolean isOnPut()
          Tells whether this relocator currently puts a Dockable.
 void removeDockRelocatorListener(DockRelocatorListener listener)
          Deprecated. will be removed in a future release
 void removeMode(DockRelocatorMode mode)
          Removes a mode that has earlier been added to this relocator.
 void removeVetoableDockRelocatorListener(VetoableDockRelocatorListener listener)
          Removes a listener from this manager.
 void setDragDistance(int dragDistance)
          Sets the distance the user must move the mouse in order to begin a drag operation.
 void setDragOnlyTitel(boolean dragOnlyTitel)
          Tells whether dockables can only be dragged through their title or not.
 void setMerger(Merger merger)
          Sets an algorithm for merging two DockStations.
 

Method Detail

addDockRelocatorListener

@Deprecated
void addDockRelocatorListener(DockRelocatorListener listener)
Deprecated. will be removed in a future release

Adds a listener to this manager. The listener will be informed whenever a Dockable is moved.

Parameters:
listener - the new listener

removeDockRelocatorListener

@Deprecated
void removeDockRelocatorListener(DockRelocatorListener listener)
Deprecated. will be removed in a future release

Removes a listener from this manager.

Parameters:
listener - the listener to remove

addVetoableDockRelocatorListener

void addVetoableDockRelocatorListener(VetoableDockRelocatorListener listener)
Adds a listener to this manager. The listener will be informed whenever a Dockable is moved.

Parameters:
listener - the new listener

removeVetoableDockRelocatorListener

void removeVetoableDockRelocatorListener(VetoableDockRelocatorListener listener)
Removes a listener from this manager.

Parameters:
listener - the listener to remove

isDragOnlyTitel

boolean isDragOnlyTitel()
Tells whether dockables can only be dragged through their title or not.

Returns:
true if a Dockable must be dragged through their titles, false if every part of the dockable can be grabbed by the mouse.
See Also:
setDragOnlyTitel(boolean)

setDragOnlyTitel

void setDragOnlyTitel(boolean dragOnlyTitel)
Tells whether dockables can only be dragged through their title or not.

Parameters:
dragOnlyTitel - true if a Dockable must be dragged through its title, false if every part of the dockable can be grabbed by the mouse.

getDragDistance

int getDragDistance()
Gets the distance the user must move the mouse in order to begin a drag operation.

Returns:
the distance in pixel

setDragDistance

void setDragDistance(int dragDistance)
Sets the distance the user must move the mouse in order to begin a drag operation.

Parameters:
dragDistance - the distance in pixel

getMerger

Merger getMerger()
Gets an algorithm useful for merging two DockStations.

Returns:
the algorithm, can be null

setMerger

void setMerger(Merger merger)
Sets an algorithm for merging two DockStations.

Parameters:
merger - the new algorithm, can be null

addMode

void addMode(DockRelocatorMode mode)
Adds a mode to this relocator, a mode can be activated or deactivated when the user presses a button like "ctrl" or "shift" during a drag and drop operation.

Parameters:
mode - the new mode, not null

removeMode

void removeMode(DockRelocatorMode mode)
Removes a mode that has earlier been added to this relocator.

Parameters:
mode - the mode to remove

isOnMove

boolean isOnMove()
Tells whether the user has currently grabbed a dockable and moves the dockable around.

Returns:
true if a Dockable is currently dragged

isOnPut

boolean isOnPut()
Tells whether this relocator currently puts a Dockable. A Dockable is put as soon as the user releases the mouse.

Returns:
true if a Dockable is moved

createDirectRemote

DirectRemoteRelocator createDirectRemote(Dockable dockable)
Creates a device with which drag&drop operations concerning dockable can be initiated and executed.

Parameters:
dockable - the dockable which might be moved
Returns:
the new remote

createDirectRemote

DirectRemoteRelocator createDirectRemote(Dockable dockable,
                                         boolean forceDrag)
Creates a device with which drag&drop operations concerning dockable can be initiated and executed.

Parameters:
dockable - the dockable which might be moved
forceDrag - if this flag is set to true, then dragging will always start even if one of the usual conditions is not met. I.e. dragging will start even if dockable does not have a parent of even if the parent does not allow dragging. This flag should be used with caution.
Returns:
the new remote

createRemote

RemoteRelocator createRemote(Dockable dockable)
Creates a device with which drag&drop operations concerning dockable can be initiated and executed.

Parameters:
dockable - the dockable which might be moved
Returns:
the new remote

createRemote

RemoteRelocator createRemote(Dockable dockable,
                             boolean forceDrag)
Creates a device with which drag&drop operations concerning dockable can be initiated and executed.

Parameters:
dockable - the dockable which might be moved
forceDrag - if this flag is set to true, then dragging will always start even if one of the usual conditions is not met. I.e. dragging will start even if dockable does not have a parent of even if the parent does not allow dragging. This flag should be used with caution.
Returns:
the new remote