public class LocatableNodeDragInteractor extends diva.graph.NodeDragInteractor
The dragging of a selection is undoable, and is based on the difference between the point where the mouse was pressed and where the mouse was released. This information is used to create MoML to undo the move if requested.
Constructor and Description |
---|
LocatableNodeDragInteractor(LocatableNodeController controller)
Create a new interactor contained within the given controller.
|
Modifier and Type | Method and Description |
---|---|
void |
mousePressed(diva.canvas.event.LayerEvent e)
When the mouse is pressed before dragging, store a copy of the
pressed point location so that a relative move can be
evaluated for undo purposes.
|
void |
mouseReleased(diva.canvas.event.LayerEvent e)
When the mouse is released after dragging, mark the frame modified
and update the panner, and generate an undo entry for the move.
|
void |
setSnapResolution(double resolution)
Specify the snap resolution.
|
void |
translate(diva.canvas.event.LayerEvent e,
double x,
double y)
Drag all selected nodes and move any attached edges.
|
addLayerListener, appendConstraint, constrainPoint, fireLayerEvent, getSelectiveEnabled, getTargetArray, getX, getY, mouseDragged, prependConstraint, removeLayerListener, setSelectiveEnabled, setTargetArray, setup, targets
public LocatableNodeDragInteractor(LocatableNodeController controller)
controller
- The controller.public void mousePressed(diva.canvas.event.LayerEvent e)
mousePressed
in interface diva.canvas.event.LayerListener
mousePressed
in class diva.canvas.interactor.DragInteractor
e
- The press event.public void mouseReleased(diva.canvas.event.LayerEvent e)
mouseReleased
in interface diva.canvas.event.LayerListener
mouseReleased
in class diva.canvas.interactor.DragInteractor
e
- The release event.public void setSnapResolution(double resolution)
resolution
- The snap resolution.public void translate(diva.canvas.event.LayerEvent e, double x, double y)
translate
in class diva.graph.NodeDragInteractor
e
- The event triggering this translation.x
- The horizontal delta.y
- The vertical delta.