|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbibliothek.gui.dock.control.DockRelocator
bibliothek.gui.dock.control.DefaultDockRelocator
public class DefaultDockRelocator
Default implementation of a handler that performs the drag & drop operations
for a DockController
.
Nested Class Summary | |
---|---|
private class |
DefaultDockRelocator.DefaultRemoteRelocator
An implementation connecting a RemoteRelocator to the
enclosing DefaultDockRelocator . |
private class |
DefaultDockRelocator.MouseDockableListener
A listener to the set of known Dockables . |
private class |
DefaultDockRelocator.TitleListener
Observers this controller and registers listeners to all new titles. |
private class |
DefaultDockRelocator.TitleWindow
A window which shows a single DockTitle . |
Field Summary | |
---|---|
private DockStation |
dragStation
the current destination of a dragged dockable |
private DefaultDockRelocator.TitleWindow |
movingTitleWindow
a window painting a title onto the screen |
private boolean |
onMove
true as long as the user drags a title or a Dockable |
private boolean |
onPut
true while a drag and drop-operation is performed |
private java.awt.Point |
pressPointLocal
the point where the mouse was pressed on the currently dragged title |
private java.awt.Point |
pressPointScreen
the point where the mouse was pressed on the currently dragged title |
Constructor Summary | |
---|---|
DefaultDockRelocator(DockController controller)
Creates a new manager. |
Method Summary | |
---|---|
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(java.awt.event.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(java.awt.event.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(java.awt.event.MouseEvent e,
DockTitle title,
Dockable dockable)
Invoked while the user drags a title or Dockable and releases a mouse button. |
protected void |
executePut(Dockable dockable,
DockStation station)
Executes a drag and drop event. |
private DefaultDockRelocator.TitleWindow |
getTitleWindow(Dockable dockable,
DockTitle title)
Gets a window which shows a title of dockable . |
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. |
private boolean |
isParent(java.awt.Window parent,
java.awt.Window child)
Tells whether parent is really a parent of child
or not. |
protected java.util.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 DockStation |
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 . |
private void |
titleDragCancel()
Cancels a drag and drop operation. |
private void |
updateTitleWindowPosition(java.awt.Point mouse)
Updates the location of the movingTitleWindow according
to the current location of the mouse. |
Methods inherited from class bibliothek.gui.dock.control.DockRelocator |
---|
addDockRelocatorListener, fireDockableDrag, fireDockablePut, getController, getDragDistance, isDragOnlyTitel, listListeners, removeDockRelocatorListener, setDragDistance, setDragOnlyTitel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private boolean onMove
true
as long as the user drags a title or a Dockable
private boolean onPut
true
while a drag and drop-operation is performed
private DockStation dragStation
private DefaultDockRelocator.TitleWindow movingTitleWindow
private java.awt.Point pressPointScreen
private java.awt.Point pressPointLocal
Constructor Detail |
---|
public DefaultDockRelocator(DockController controller)
controller
- the controller whose dockables are movedMethod 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 executePut(Dockable dockable, DockStation station)
dockable
is removed
from its parent (if the parent is not station
) and
dropped to station
. The new location of
dockable
has to be precomputed by station
.
dockable
- a Dockable
which is movedstation
- the new parent of dockable
protected DockStation 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 java.util.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
private boolean isParent(java.awt.Window parent, java.awt.Window child)
parent
is really a parent of child
or not.
parent
- a window which may be an ancestor of child
child
- a window which may be child of parent
true
if parent
is an
ancestor of child
protected void dragMousePressed(java.awt.event.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(java.awt.event.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.
private void updateTitleWindowPosition(java.awt.Point mouse)
movingTitleWindow
according
to the current location of the mouse.
mouse
- the location of the mouseprotected void dragMouseReleased(java.awt.event.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
private void titleDragCancel()
private DefaultDockRelocator.TitleWindow getTitleWindow(Dockable dockable, DockTitle title)
dockable
. The
title on the window will be binded to dockable
.
dockable
- the Dockable for which a title should be showntitle
- a title which is grabbed by the mouse, can be null
null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |