public class DnDTracker extends AbstractTool implements DragTracker
DnDTracker can be used stand-alone or instead of DragTracker
in the
SelectionTool
or the DelegationSelectionTool
.
To get a drag image using drag and drop, the drawing needs to provide an image output format.
Drag and Drop is about information moving, not images or objects. Its about moving a figure to another application and that application understanding both its shape, color, attributes, and everything about it - not necessarily how it looks.
Modifier and Type | Field and Description |
---|---|
protected Figure |
anchorFigure |
protected java.awt.geom.Point2D.Double |
anchorOrigin
The anchorOrigin holds the origin of all dragged figures of the
mousePressed event.
|
protected java.awt.geom.Point2D.Double |
anchorPoint
The anchorPoint holds the location of the mouse of the
mousePressed event.
|
protected java.awt.geom.Rectangle2D.Double |
dragRect
The drag rectangle encompasses the bounds of all dragged figures.
|
protected java.awt.geom.Point2D.Double |
previousOrigin
The previousOrigin holds the origin of all dragged figures of the
previous mouseDragged event.
|
protected java.awt.geom.Point2D.Double |
previousPoint
The previousPoint holds the location of the mouse of the previous
mouseDragged event.
|
anchor, editor, isWorking, listenerList
propertySupport
Constructor and Description |
---|
DnDTracker() |
DnDTracker(Figure figure) |
Modifier and Type | Method and Description |
---|---|
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mouseMoved(java.awt.event.MouseEvent evt) |
void |
mousePressed(java.awt.event.MouseEvent evt) |
void |
mouseReleased(java.awt.event.MouseEvent evt) |
void |
setDraggedFigure(Figure f) |
activate, addToolListener, addUndoableEditListener, constrainPoint, constrainPoint, createActionMap, createInputMap, deactivate, draw, editCopy, editCut, editDelete, editDuplicate, editPaste, fireAreaInvalidated, fireAreaInvalidated, fireBoundsInvalidated, fireToolDone, fireToolStarted, getActionMap, getDrawing, getEditor, getInputMap, getToolTipText, getView, isActive, keyPressed, keyReleased, keyTyped, maybeFireBoundsInvalidated, mouseClicked, mouseEntered, mouseExited, removeToolListener, removeUndoableEditListener, setActionMap, setInputMap, supportsHandleInteraction, updateCursor, viewToDrawing
addPropertyChangeListener, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
activate, addToolListener, deactivate, draw, editCopy, editCut, editDelete, editDuplicate, editPaste, getToolTipText, removeToolListener, supportsHandleInteraction
protected Figure anchorFigure
protected java.awt.geom.Rectangle2D.Double dragRect
protected java.awt.geom.Point2D.Double previousOrigin
protected java.awt.geom.Point2D.Double anchorOrigin
protected java.awt.geom.Point2D.Double previousPoint
protected java.awt.geom.Point2D.Double anchorPoint
public DnDTracker()
public DnDTracker(Figure figure)
public void mouseMoved(java.awt.event.MouseEvent evt)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class AbstractTool
public void mousePressed(java.awt.event.MouseEvent evt)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class AbstractTool
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseReleased(java.awt.event.MouseEvent evt)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class AbstractTool
public void setDraggedFigure(Figure f)
setDraggedFigure
in interface DragTracker