|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.control.relocator.AbstractDockRelocator bibliothek.gui.dock.control.relocator.DefaultDockRelocator
public class DefaultDockRelocator
Default implementation of a handler that performs the drag & drop operations
for a DockController
.
Field Summary | |
---|---|
static PropertyKey<Boolean> |
AUTO_DROP_ON_ANY_MOUSE_RELEASED_EVENT
If true , then any mouse-released event may stop a drag-and-drop operation.If false , then only mouse-released events that originate from the same Component
as the mouse-pressed event that started the operation may cancel it.The default value is true . |
static String |
EXTENSION_PARAM
Name of a parameter of an ExtensionName pointing to this |
static Path |
INSERTER_EXTENSION
Path of an ExtensionName that adds new Inserter s |
static Path |
MERGE_EXTENSION
Path of an ExtensionName that adds new Merger s |
Constructor Summary | |
---|---|
DefaultDockRelocator(DockController controller,
ControllerSetupCollection setup)
Creates a new manager. |
Method Summary | |
---|---|
void |
cancel()
Cancels the current drag and drop operation (if there is any). |
protected boolean |
canMerge(StationDropOperation operation,
DockStation parent,
Dockable selection)
Checks whether the current Merger can merge parent
with child . |
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. |
protected RemoteRelocator.Reaction |
dragMouseDragged(int x,
int y,
int modifiers,
DockTitle title,
Dockable dockable,
boolean always,
boolean forceDrag)
Handles a mouse-pressed event. |
protected RemoteRelocator.Reaction |
dragMouseDragged(int x,
int y,
int modifiers,
DockTitle title,
Dockable dockable,
boolean always,
boolean forceDrag,
boolean showMovingImage)
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,
boolean forceDrag)
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 boolean |
executeOperation(Dockable dockable,
RelocateOperation operation)
Executes the drag and drop event operation . |
boolean |
hasTarget()
Tells whether the current drag and drop operation has a target, i.e. |
protected boolean |
isCancelLocation(int x,
int y,
Dockable moved)
Checks whether the mouse is at a location that cancels a drag and drop operation. |
protected boolean |
isCancelLocation(int x,
int y,
DockElementRepresentative item)
Checks whether the mouse is at a location that cancels a drag and drop 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 boolean |
isStationValid(DockStation station)
Only stations passing this test are considered during drag and drop operation as new parent. |
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.relocator.AbstractDockRelocator |
---|
addMode, addVetoableDockRelocatorListener, checkModes, disableAllModes, fireCanceled, fireDragged, fireDragging, fireDropped, fireDropping, fireGrabbed, fireGrabbing, fireSearched, getController, getDragDistance, getInserter, getMerger, isDragOnlyTitle, removeMode, removeVetoableDockRelocatorListener, setDragDistance, setDragOnlyTitle, setInserter, setMerger, vetoableListeners |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final PropertyKey<Boolean> AUTO_DROP_ON_ANY_MOUSE_RELEASED_EVENT
true
, then any mouse-released event may stop a drag-and-drop operation.false
, then only mouse-released events that originate from the same Component
as the mouse-pressed event that started the operation may cancel it.true
.
public static final Path MERGE_EXTENSION
ExtensionName
that adds new Merger
s
public static final Path INSERTER_EXTENSION
ExtensionName
that adds new Inserter
s
public static final String EXTENSION_PARAM
ExtensionName
pointing to this
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
true
if a Dockable is currently draggedpublic boolean isOnPut()
DockRelocator
true
if a Dockable is movedpublic boolean hasTarget()
DockRelocator
false
if there is no operation runningpublic DirectRemoteRelocator createDirectRemote(Dockable dockable)
DockRelocator
dockable
can be initiated and executed.
dockable
- the dockable which might be moved
public DirectRemoteRelocator createDirectRemote(Dockable dockable, boolean forceDrag)
DockRelocator
dockable
can be initiated and executed.
dockable
- the dockable which might be movedforceDrag
- 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.
public RemoteRelocator createRemote(Dockable dockable)
DockRelocator
dockable
can be initiated and executed.
dockable
- the dockable which might be moved
public RemoteRelocator createRemote(Dockable dockable, boolean forceDrag)
DockRelocator
dockable
can be initiated and executed.
dockable
- the dockable which might be movedforceDrag
- 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.
protected boolean executeOperation(Dockable dockable, RelocateOperation operation)
operation
.
dockable
- a Dockable
which is movedoperation
- the operation to execute
true
if the operation was a success, false
if the operation was canceledprotected 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(StationDropOperation operation, DockStation parent, Dockable selection)
Merger
can merge parent
with child
.
operation
- the operation that would be exectedparent
- 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 boolean isCancelLocation(int x, int y, Dockable moved)
isCancelLocation(int, int, DockElementRepresentative)
with all the DockElementRepresentative
that can be found for moved
.
x
- x-coordinate on the screeny
- y-coordinate on the screenmoved
- the item that was moved around
true
if the current location can never result in a valid drop operationprotected boolean isCancelLocation(int x, int y, DockElementRepresentative item)
false
.
x
- x-coordinate on the screeny
- y-coordinate on the screenitem
- the item that was moved around
true
if the current location can never result in a valid drop operation@ClientOnly protected boolean isStationValid(DockStation station)
station
- the station to check
true
if station
should be considered as new parentprotected 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, boolean forceDrag)
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 aroundforceDrag
- 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.
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, boolean forceDrag)
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.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.
protected RemoteRelocator.Reaction dragMouseDragged(int x, int y, int modifiers, DockTitle title, Dockable dockable, boolean always, boolean forceDrag, boolean showMovingImage)
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.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.showMovingImage
- whether to show a MovingImage
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
public void cancel()
DockRelocator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |