public class DockDragEvent extends DockEvent
This event is used by API extenders to manage drag and drop action related to docking. This is not meant to be used by User Applications.
Standard processing of dragging is (ignoring DockableStateChange events) :
acceptDrag(Shape)
Constructor and Description |
---|
DockDragEvent(DockingDesktop desktop,
DockableDragSource source,
java.awt.event.MouseEvent event)
Creates an event based on a drag source and a mouse event.
|
Modifier and Type | Method and Description |
---|---|
void |
acceptDrag(java.awt.Shape dropShape)
Used by a DockDropReceiver to indicate that the drag operation is accepted
(mouse is over a droppable zone).
|
void |
delegateDrag()
Rejects the drag, but allows the docking system to search for othet drop receiver
in ancestors.
|
java.awt.Shape |
getDropShape()
Returns the shape to display if drag is accepted.
|
boolean |
isDragAccepted()
returns true if drag is accepted.
|
boolean |
isDragDelegated()
If drag is not accepted, this method will be invoked to evaluate
a delegating event processing.
|
void |
rejectDrag()
Used to reject the drag (e.g.
|
getDesktop, getDockingAction, getDragSource, getMouseEvent, setDockingAction
public DockDragEvent(DockingDesktop desktop, DockableDragSource source, java.awt.event.MouseEvent event)
The mouse coordinates are converted into the receiver's coordinates.
public boolean isDragAccepted()
public boolean isDragDelegated()
This is useful for nested DropReceivers (like TabbedDockableContainers)
public java.awt.Shape getDropShape()
This method will be invoked only if isDragAccepted
returns true
As this method can be called on every mouse drag over a component, it is a good practice to reuse the same shape as lond a possible (do not create a new Shape at every invocation).
public void acceptDrag(java.awt.Shape dropShape)
As of version 2.1, please note that you also have to invoke #setDockingAction() to specify the action associated with the drag shape.
dropShape
- the shape (in drop component coordinates) showing the drop zone,
which will be displayed on the glasspane of the DockingPanel.public void rejectDrag()
public void delegateDrag()
for example, a TabbedDockableContainer that doesn't allow drops on its borders can delegates this management to its container.
Copyright © 2010-2014 Pacific Biosciences. All Rights Reserved.