|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jreality.tutorial.util.polygon.DragPointSet
public class DragPointSet
A sequence of points that can be dragged. Reports any changes of the point positions to
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 Summary | |
---|---|
DragPointSet(double[][] initialVertices)
|
Method Summary | |
---|---|
void |
addChangeListener(javax.swing.event.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(javax.swing.event.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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DragPointSet(double[][] initialVertices)
initialVertices
- the initial points.Method Detail |
---|
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(javax.swing.event.ChangeListener cl)
addChangeListener
in interface PointSequence
A
- listener that gets notified whenever the points change.public void removeChangeListener(javax.swing.event.ChangeListener cl)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |