public class LocatableNodeDragInteractor extends 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(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(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(LayerEvent e,
double x,
double y)
Drag all selected nodes and move any attached edges.
|
getController
addLayerListener, appendConstraint, constrainPoint, fireLayerEvent, getSelectiveEnabled, getTargetArray, getX, getY, mouseDragged, prependConstraint, removeLayerListener, setSelectiveEnabled, setTargetArray, setup, targets
accept, getMouseFilter, isConsuming, isEnabled, isMotionEnabled, mouseClicked, mouseEntered, mouseExited, mouseMoved, setConsuming, setEnabled, setMotionEnabled, setMouseFilter
public LocatableNodeDragInteractor(LocatableNodeController controller)
controller
- The controller.public void mousePressed(LayerEvent e)
mousePressed
in interface LayerListener
mousePressed
in class DragInteractor
e
- The press event.public void mouseReleased(LayerEvent e)
mouseReleased
in interface LayerListener
mouseReleased
in class DragInteractor
e
- The release event.public void setSnapResolution(double resolution)
resolution
- The snap resolution.public void translate(LayerEvent e, double x, double y)
translate
in class NodeDragInteractor
e
- The event triggering this translation.x
- The horizontal delta.y
- The vertical delta.