|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.control.DockRelocator
public abstract class DockRelocator
A manager adding MouseListener
and
MouseMotionListener
to every
DockElementRepresentative
s and handling the
drag and drop events.
The behaviour of a drag and drop operation can be made dependent of the
keys that are pressed, using some DockRelocatorMode
s. These modes
are added through addMode(DockRelocatorMode)
Constructor Summary | |
---|---|
DockRelocator(DockController controller)
Creates a new manager. |
Method Summary | |
---|---|
void |
addDockRelocatorListener(DockRelocatorListener listener)
Adds a listener to this manager. |
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. |
protected void |
checkModes(int modifiers)
Ensures that all DockRelocatorMode s are in the state that
fits the current set of modifiers. |
abstract DirectRemoteRelocator |
createDirectRemote(Dockable dockable)
Creates a device with which drag&drop operations concerning dockable can be initiated and executed. |
abstract RemoteRelocator |
createRemote(Dockable dockable)
Creates a device with which drag&drop operations concerning dockable can be initiated and executed. |
protected void |
disableAllModes()
Sets all DockRelocatorMode s to inactive. |
protected void |
fireCancel(Dockable dockable)
Informs all listeners that a drag and drop operation has been canceled. |
protected void |
fireDrag(Dockable dockable,
DockStation station)
Informs all listeners that dockable will be dragged. |
protected void |
fireDrop(Dockable dockable,
DockStation station)
Informs all listeners that dockable was dropped on
station . |
protected void |
fireInit(Dockable dockable)
Informs all listeners that the drag-gesture has been made. |
DockController |
getController()
Gets the controller for which this relocator works. |
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 DockStation s. |
boolean |
isDragOnlyTitel()
Tells whether dockables can only be dragged through their title or not. |
abstract boolean |
isOnMove()
Tells whether the user has currently grabbed a dockable and moves the dockable around. |
abstract boolean |
isOnPut()
Tells whether this relocator currently puts a Dockable. |
protected DockRelocatorListener[] |
listListeners()
Gets a list of all currently registered listeners. |
void |
removeDockRelocatorListener(DockRelocatorListener listener)
Removes a listener from this manager. |
void |
removeMode(DockRelocatorMode mode)
Removes a mode that has earlier been added to this relocator. |
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 DockStation s. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DockRelocator(DockController controller)
controller
- the controller whose dockables are movedMethod Detail |
---|
public DockController getController()
public void addDockRelocatorListener(DockRelocatorListener listener)
Dockable
is moved.
listener
- the new listenerpublic void removeDockRelocatorListener(DockRelocatorListener listener)
listener
- the listener to removeprotected DockRelocatorListener[] listListeners()
protected void fireInit(Dockable dockable)
dockable
- the element that will be dragged.protected void fireCancel(Dockable dockable)
dockable
- the element that was grabbedprotected void fireDrag(Dockable dockable, DockStation station)
dockable
will be dragged.
dockable
- the dragged Dockablestation
- the parent of dockable
protected void fireDrop(Dockable dockable, DockStation station)
dockable
was dropped on
station
.
dockable
- the dropped Dockablestation
- the new owner of dockable
public boolean isDragOnlyTitel()
true
if a Dockable must be dragged through their
titles, false
if every part of the dockable can be
grabbed by the mouse.setDragOnlyTitel(boolean)
public void setDragOnlyTitel(boolean dragOnlyTitel)
dragOnlyTitel
- true
if a Dockable must be dragged through its
title, false
if every part of the dockable can be
grabbed by the mouse.public int getDragDistance()
public void setDragDistance(int dragDistance)
dragDistance
- the distance in pixelpublic Merger getMerger()
DockStation
s.
null
public void setMerger(Merger merger)
DockStation
s.
merger
- the new algorithm, can be null
public void addMode(DockRelocatorMode mode)
mode
- the new mode, not null
public void removeMode(DockRelocatorMode mode)
mode
- the mode to removeprotected void disableAllModes()
DockRelocatorMode
s to inactive.
protected void checkModes(int modifiers)
DockRelocatorMode
s are in the state that
fits the current set of modifiers.
modifiers
- the state of the last MouseEvent
, see
InputEvent.getModifiersEx()
public abstract boolean isOnMove()
true
if a Dockable is currently draggedpublic abstract boolean isOnPut()
true
if a Dockable is movedpublic abstract DirectRemoteRelocator createDirectRemote(Dockable dockable)
dockable
can be initiated and executed.
dockable
- the dockable which might be moved
public abstract RemoteRelocator createRemote(Dockable dockable)
dockable
can be initiated and executed.
dockable
- the dockable which might be moved
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |