Package diva.canvas.connector
Class ArcInteractor
- java.lang.Object
-
- diva.canvas.interactor.AbstractInteractor
-
- diva.canvas.interactor.DragInteractor
-
- diva.canvas.connector.ConnectorInteractor
-
- diva.canvas.connector.ArcInteractor
-
- All Implemented Interfaces:
LayerListener
,LayerMotionListener
,Interactor
,java.util.EventListener
public class ArcInteractor extends ConnectorInteractor
An interactor for dragging either end of an arc connector and for for altering the shape of the arc by dragging a midpoint grab handle. This class is designed for use in conjunction with ArcManipulator.- Version:
- $Id$
- Author:
- Edward A. Lee
-
-
Constructor Summary
Constructors Constructor Description ArcInteractor(ArcManipulator m)
Create a new interactor to be used with the given manipulator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
fireConnectorEvent(int id)
Fire a connector event to all connector listeners.void
translate(LayerEvent e, double dx, double dy)
Respond to translation of the grab-handle.-
Methods inherited from class diva.canvas.connector.ConnectorInteractor
_notifyConnectorListeners, addConnectorListener, getConnector, getHandle, getTarget, mouseReleased, removeConnectorListener, setup, snapToSite
-
Methods inherited from class diva.canvas.interactor.DragInteractor
addLayerListener, appendConstraint, constrainPoint, fireLayerEvent, getSelectiveEnabled, getTargetArray, getX, getY, mouseDragged, mousePressed, prependConstraint, removeLayerListener, setSelectiveEnabled, setTargetArray, targets
-
Methods inherited from class diva.canvas.interactor.AbstractInteractor
accept, getMouseFilter, isConsuming, isEnabled, isMotionEnabled, mouseClicked, mouseEntered, mouseExited, mouseMoved, setConsuming, setEnabled, setMotionEnabled, setMouseFilter
-
-
-
-
Constructor Detail
-
ArcInteractor
public ArcInteractor(ArcManipulator m)
Create a new interactor to be used with the given manipulator.- Parameters:
m
- The given manipulator
-
-
Method Detail
-
fireConnectorEvent
protected void fireConnectorEvent(int id)
Fire a connector event to all connector listeners.- Overrides:
fireConnectorEvent
in classConnectorInteractor
- Parameters:
id
- The id
-
translate
public void translate(LayerEvent e, double dx, double dy)
Respond to translation of the grab-handle. Move the grab-handle, and adjust the connector accordingly, snapping it to a suitable target if possible.- Overrides:
translate
in classConnectorInteractor
- Parameters:
e
- The eventdx
- The change in xdy
- The change in y
-
-