|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.control.DockRelocator bibliothek.gui.dock.control.DefaultDockRelocator
@Todo(compatibility=COMPATIBLE, priority=ENHANCEMENT, target=VERSION_1_1_0, description="Moving a dockable over itself should cancel the drag operation. This setting should be configurable.") public class DefaultDockRelocator
Default implementation of a handler that performs the drag & drop operations
for a DockController
.
Constructor Summary | |
---|---|
DefaultDockRelocator(DockController controller,
ControllerSetupCollection setup)
Creates a new manager. |
Method Summary | |
---|---|
protected boolean |
canMerge(DockStation parent,
Dockable selection)
Checks whether the current Merger can merge parent
with child . |
protected int |
compare(DockStation a,
DockStation b)
Tries to decide which station is over the other stations. |
DirectRemoteRelocator |
createDirectRemote(Dockable dockable)
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. |
protected RemoteRelocator.Reaction |
dragMouseDragged(int x,
int y,
int modifiers,
DockTitle title,
Dockable dockable,
boolean always)
Handles a mouse-pressed event. |
protected void |
dragMouseDragged(MouseEvent e,
DockTitle title,
Dockable dockable)
Invoked while the user drags a title or Dockable. |
protected RemoteRelocator.Reaction |
dragMousePressed(int x,
int y,
int dx,
int dy,
int modifiers,
Dockable dockable)
Handles a mouse-pressed event. |
protected void |
dragMousePressed(MouseEvent e,
DockTitle title,
Dockable dockable)
Invoked by the listeners of a title to start a drag and drop operation. |
protected RemoteRelocator.Reaction |
dragMouseReleased(int x,
int y,
int modifiers,
Dockable dockable)
Handles a mouse-released event. |
protected void |
dragMouseReleased(MouseEvent e,
DockTitle title,
Dockable dockable)
Invoked while the user drags a title or Dockable and releases a mouse button. |
protected void |
executeOperation(Dockable dockable,
RelocateOperation operation)
Executes the drag and drop event operation . |
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. |
protected List<DockStation> |
listStationsOrdered(int x,
int y,
Dockable moved)
Makes a list of all stations which are visible and contain the point x/y . |
protected RelocateOperation |
preparePut(int mouseX,
int mouseY,
int titleX,
int titleY,
Dockable dockable)
Searches a station which can become the parent of dockable
if the mouse is released at mouseX/mouseY . |
Methods inherited from class bibliothek.gui.dock.control.DockRelocator |
---|
addDockRelocatorListener, addMode, checkModes, disableAllModes, fireCancel, fireDrag, fireDrop, fireInit, getController, getDragDistance, getMerger, isDragOnlyTitel, listListeners, removeDockRelocatorListener, removeMode, setDragDistance, setDragOnlyTitel, setMerger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultDockRelocator(DockController controller, ControllerSetupCollection setup)
controller
- the controller whose dockables are movedsetup
- observable informing this object when controller
is set up.Method Detail |
---|
public boolean isOnMove()
DockRelocator
isOnMove
in class DockRelocator
true
if a Dockable is currently draggedpublic boolean isOnPut()
DockRelocator
isOnPut
in class DockRelocator
true
if a Dockable is movedpublic DirectRemoteRelocator createDirectRemote(Dockable dockable)
DockRelocator
dockable
can be initiated and executed.
createDirectRemote
in class DockRelocator
dockable
- the dockable which might be moved
public RemoteRelocator createRemote(Dockable dockable)
DockRelocator
dockable
can be initiated and executed.
createRemote
in class DockRelocator
dockable
- the dockable which might be moved
protected void executeOperation(Dockable dockable, RelocateOperation operation)
operation
.
dockable
- a Dockable
which is movedoperation
- the operation to executeprotected RelocateOperation preparePut(int mouseX, int mouseY, int titleX, int titleY, Dockable dockable)
dockable
if the mouse is released at mouseX/mouseY
.
mouseX
- x-coordinate of the mouse on the screenmouseY
- y-coordinate of the mouse on the screentitleX
- x-coordinate of the dragged title or mouseXtitleY
- y-coordinate of the dragged title or mouseYdockable
- a Dockable which is dragged
dockable
or null
protected boolean canMerge(DockStation parent, Dockable selection)
Merger
can merge parent
with child
.
parent
- the new parent for the children of child
selection
- the element whose children are to be removed
true
if a merge is possibleprotected List<DockStation> listStationsOrdered(int x, int y, Dockable moved)
x/y
. The stations are ordered by their visibility.
x
- x-coordinate on the screeny
- y-coordinate on the screenmoved
- a Dockable which is dragged. If this is a
station, then no child of the station will be in the resulting list.
protected int compare(DockStation a, DockStation b)
a
- the first stationb
- the second station
protected void dragMousePressed(MouseEvent e, DockTitle title, Dockable dockable)
e
- the initializing eventtitle
- the grabbed title, can be null
if
dockable
is not null
dockable
- the grabbed Dockable, can be null
if title
is not null
protected RemoteRelocator.Reaction dragMousePressed(int x, int y, int dx, int dy, int modifiers, Dockable dockable)
x
- the x-coordinate of the mousey
- the y-coordinate of the mousedx
- the x-coordinate of the mouse on its componentdy
- the y-coordinate of the mouse on its componentmodifiers
- the state of the mouse, see InputEvent.getModifiersEx()
dockable
- the dockable which is moved around
protected void dragMouseDragged(MouseEvent e, DockTitle title, Dockable dockable)
e
- the initializing eventtitle
- the grabbed title, can be null
if
dockable
is not null
dockable
- the grabbed Dockable, can be null
if title
is not null
protected RemoteRelocator.Reaction dragMouseDragged(int x, int y, int modifiers, DockTitle title, Dockable dockable, boolean always)
x
- the x-coordinate of the mousey
- the y-coordinate of the mousemodifiers
- the state of the mouse, see InputEvent.getModifiersEx()
title
- the title which might be grabbed by the mousedockable
- the dockable which is moved aroundalways
- true
if the drag event should be executed and
restrictions to this relocator ignored.
protected void dragMouseReleased(MouseEvent e, DockTitle title, Dockable dockable)
e
- the initializing eventtitle
- the grabbed title, can be null
if
dockable
is not null
dockable
- the grabbed Dockable, can be null
if title
is not null
protected RemoteRelocator.Reaction dragMouseReleased(int x, int y, int modifiers, Dockable dockable)
x
- the x-coordinate of the mousey
- the y-coordinate of the mousemodifiers
- the state of the mouse, see InputEvent.getModifiersEx()
dockable
- the dockable which is moved around
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |