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 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.
 void cancel()
          Cancels the current drag and drop operation (if there is any).
 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.
 Inserter getInserter()
          Gets the algorithm used to override decisions of a DockStation.
 Merger getMerger()
          Gets an algorithm useful for merging two DockStations.
 boolean hasTarget()
          Tells whether the current drag and drop operation has a target, i.e.
 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 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 setInserter(Inserter inserter)
          Sets the algorithm which is used to override decisions of a DockStation.
 void setMerger(Merger merger)
          Sets an algorithm for merging two DockStations.
 

Method Detail

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

getInserter

Inserter getInserter()
Gets the algorithm used to override decisions of a DockStation.

Returns:
the algorithm, can be null

setInserter

void setInserter(Inserter inserter)
Sets the algorithm which is used to override decisions of a DockStation.

Parameters:
inserter - the 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

hasTarget

boolean hasTarget()
Tells whether the current drag and drop operation has a target, i.e. if the operation would be a success if it would end now.

Returns:
whether the current operation has a target, false if there is no operation running

cancel

void cancel()
Cancels the current drag and drop operation (if there is any). All evidence of a DnD operation is to be removed immediatelly. Listeners will receive a canceled-event.


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