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(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.
|
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(Object[] arr)
Set the target that the interactor operates on.
|
void |
setup(LayerEvent e)
Initialize the interactor before a mouse-pressed event is
processed.
|
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, setMouseFilterpublic void addLayerListener(LayerListener l)
public void appendConstraint(PointConstraint constraint)
public void constrainPoint(Point2D p)
public void fireLayerEvent(LayerEvent event)
public boolean getSelectiveEnabled()
public Object[] getTargetArray()
public double getX()
public double getY()
public void mouseDragged(LayerEvent e)
mouseDragged in interface LayerListenermouseDragged in class AbstractInteractorpublic void mousePressed(LayerEvent e)
mousePressed in interface LayerListenermousePressed in class AbstractInteractorpublic void mouseReleased(LayerEvent e)
mouseReleased in interface LayerListenermouseReleased in class AbstractInteractorpublic void prependConstraint(PointConstraint constraint)
public void removeLayerListener(LayerListener l)
public boolean setSelectiveEnabled(boolean s)
public void setTargetArray(Object[] arr)
public void setup(LayerEvent e)
public Iterator targets()
public void translate(LayerEvent e, double x, double y)
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.