public class DragInteractor extends AbstractInteractor
Constructor and Description |
---|
DragInteractor() |
Modifier and Type | Method and Description |
---|---|
void |
addLayerListener(LayerListener l)
Add the given layer listener to this interactor.
|
void |
appendConstraint(PointConstraint constraint)
Append a constraint to the list of constraints on
this interactor.
|
void |
constrainPoint(java.awt.geom.Point2D p)
Constrain a point using the current constraints.
|
void |
fireLayerEvent(LayerEvent event)
Fire a layer event.
|
boolean |
getSelectiveEnabled()
Get the flag that says that the interactor responds only
if the figure being moused on is selected.
|
java.lang.Object[] |
getTargetArray()
Get the target array.
|
double |
getX()
Get the current value of the X coordinate
|
double |
getY()
Get the current value of the Y coordinate
|
void |
mouseDragged(LayerEvent e)
Constrain the point and move the target if the mouse
move.
|
void |
mousePressed(LayerEvent e)
Handle a mouse press on a figure or layer.
|
void |
mouseReleased(LayerEvent e)
Handle a mouse released event.
|
void |
prependConstraint(PointConstraint constraint)
Prepend a constraint to the list of constraints on
this interactor.
|
void |
removeLayerListener(LayerListener l)
Remove the given layer listener from this interactor.
|
boolean |
setSelectiveEnabled(boolean s)
Set the flag that says that the interactor responds only
if the figure being moused on is selected.
|
void |
setTargetArray(java.lang.Object[] arr)
Set the target that the interactor operates on.
|
void |
setup(LayerEvent e)
Initialize the interactor before a mouse-pressed event is
processed.
|
java.util.Iterator |
targets()
Get an iterator over the target figures.
|
void |
translate(LayerEvent e,
double x,
double y)
Translate the target by the given distance.
|
accept, getMouseFilter, isConsuming, isEnabled, isMotionEnabled, mouseClicked, mouseEntered, mouseExited, mouseMoved, setConsuming, setEnabled, setMotionEnabled, setMouseFilter
public void addLayerListener(LayerListener l)
public void appendConstraint(PointConstraint constraint)
public void constrainPoint(java.awt.geom.Point2D p)
public void fireLayerEvent(LayerEvent event)
public boolean getSelectiveEnabled()
public java.lang.Object[] getTargetArray()
public double getX()
public double getY()
public void mouseDragged(LayerEvent e)
mouseDragged
in interface LayerListener
mouseDragged
in class AbstractInteractor
public void mousePressed(LayerEvent e)
mousePressed
in interface LayerListener
mousePressed
in class AbstractInteractor
public void mouseReleased(LayerEvent e)
mouseReleased
in interface LayerListener
mouseReleased
in class AbstractInteractor
public void prependConstraint(PointConstraint constraint)
public void removeLayerListener(LayerListener l)
public boolean setSelectiveEnabled(boolean s)
public void setTargetArray(java.lang.Object[] arr)
public void setup(LayerEvent e)
public java.util.Iterator targets()
public void translate(LayerEvent e, double x, double y)