public class DragPointSet extends Object implements PointSequence
ChangeListener
s that can be attached via addChangeListener(ChangeListener)
.
The points are stored in an array of double-arrays with length 3.
To use, create an instance and attach it's base (getBase()
into the scene. Attach
a ChangeListener to handle dragging.Constructor and Description |
---|
DragPointSet(double[][] initialVertices) |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ChangeListener cl) |
SceneGraphComponent |
getBase()
Returns the
SceneGraphComponent containing the
point geometry as well as the tool to drag the points. |
double[][] |
getPoints()
Returns the points as an array of 3-vectors (double arrays with length 3).
|
boolean |
isClosed()
true if the point sequence is periodic, false if not.
|
void |
pointDragged(PointDragEvent e) |
void |
removeChangeListener(ChangeListener cl) |
void |
setClosed(boolean closed)
set if the point sequence should be interpreted as periodic.
|
void |
transform(double[] vertex)
Override this method and do a transformation of the dragged vertex,
e.g., projection to the sphere.
|
public DragPointSet(double[][] initialVertices)
initialVertices
- the initial points.public void pointDragged(PointDragEvent e)
public void transform(double[] vertex)
vertex
- public SceneGraphComponent getBase()
SceneGraphComponent
containing the
point geometry as well as the tool to drag the points.public double[][] getPoints()
getPoints
in interface PointSequence
public boolean isClosed()
isClosed
in interface PointSequence
public void setClosed(boolean closed)
closed
- public void addChangeListener(ChangeListener cl)
addChangeListener
in interface PointSequence
A
- listener that gets notified whenever the points change.public void removeChangeListener(ChangeListener cl)