|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--edu.neu.ccs.gui.BaseShape
|
+--edu.neu.ccs.gui.TweakableShape
Class TweakableShape implements a BaseShape
in which the vertex array and the tangent array may be changed
independently of one another.
To define a shape in which the tangent array is computed from the
vertex array automatically, use the class AutomaticShape.
Path,
AutomaticShape| Field Summary | |
static String |
ADD_VERTEX_TANGENT
Bound property name to add one vertex/tangent pair. |
static String |
REMOVE_VERTEX_TANGENT
Bound property name to remove one vertex/tangent pair. |
static String |
SET_TANGENT
Bound property name to set one tangent. |
static String |
SET_TANGENT_DATA
Bound property name to set the tangent data. |
static String |
SET_VERTEX
Bound property name to set one vertex. |
static String |
SET_VERTEX_DATA
Bound property name to set the vertex data. |
static String |
SET_VERTEX_TANGENT
Bound property name to set one vertex/tangent pair. |
static String |
SET_VERTEX_TANGENT_DATA
Bound property name to set the vertex/tangent data. |
| Fields inherited from class edu.neu.ccs.gui.BaseShape |
REMOVE_SHAPE_DATA, SET_CLOSURE_MODE, SET_PATH_STRATEGY, SET_WINDING_RULE, tangent, vertex |
| Constructor Summary | |
TweakableShape()
The default constructor with an empty shape. |
|
TweakableShape(float[][] vertex)
The constructor with the given vertex data. |
|
TweakableShape(float[][] vertex,
float[][] tangent)
The constructor with the given vertex and tangent data. |
|
TweakableShape(float[][] vertex,
float[][] tangent,
Path.Strategy pathstrategy)
The constructor with the given vertex and tangent data and the given path strategy. |
|
TweakableShape(float[][] vertex,
float[][] tangent,
Path.Strategy pathstrategy,
ClosureMode closuremode)
The constructor with the given vertex and tangent data, the given path strategy, and the given closure mode. |
|
TweakableShape(float[][] vertex,
float[][] tangent,
Path.Strategy pathstrategy,
ClosureMode closuremode,
WindingRule windingrule)
The constructor with the given vertex and tangent data, the given path strategy, the given closure mode, and the given winding rule. |
|
| Method Summary | |
void |
addVertexTangent(int index,
float[] array)
Adds a new vertex and tangent at the given index to the given set of point and displacement coordinates represented as float[4] with the four array locations filled with x, y, dx, dy. |
void |
addVertexTangent(int index,
float x,
float y,
float dx,
float dy)
Adds a new vertex and tangent at the given index with the given point and displacement coordinates x, y, dx, dy. |
void |
removeVertexTangent(int index)
Removes the vertex/tangent at the given index. |
void |
setTangent(int index,
float[] delta)
Sets the tangent at the given index to the given displacement. |
void |
setTangent(int index,
float dx,
float dy)
Sets the tangent at the given index to the given displacement coordinates. |
void |
setTangentData(float[][] tangent)
Sets the tangent data of the shape using a 2-dimensional array of single precision numbers. |
void |
setVertex(int index,
float[] point)
Sets the vertex at the given index to the given point. |
void |
setVertex(int index,
float x,
float y)
Sets the vertex at the given index to the given point coordinates. |
void |
setVertexData(float[][] vertex)
Sets the vertex data of the shape using a 2-dimensional array of single precision numbers. |
void |
setVertexTangent(int index,
float[] array)
Sets the vertex and tangent at the given index to the given set of point and displacement coordinates represented as float[4] with the four array locations filled with x, y, dx, dy. |
void |
setVertexTangent(int index,
float x,
float y,
float dx,
float dy)
Sets the vertex and tangent at the given index to the given point and displacement coordinates. |
void |
setVertexTangentData(float[][] vertex,
float[][] tangent)
Sets the vertex and tangent data of the shape using two 2-dimensional arrays of single precision numbers. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String SET_VERTEX_DATA
public static final String SET_TANGENT_DATA
public static final String SET_VERTEX_TANGENT_DATA
public static final String SET_VERTEX
public static final String SET_TANGENT
public static final String SET_VERTEX_TANGENT
public static final String ADD_VERTEX_TANGENT
public static final String REMOVE_VERTEX_TANGENT
| Constructor Detail |
public TweakableShape()
The default constructor with an empty shape.
The default settings are as follows:
new float[0][2]new float[0][2]Path.POLYGONClosureMode.CLOSEDWindingRule.WIND_NON_ZERO.
TweakableShape(float[][]),
TweakableShape(float[][], float[][]),
TweakableShape(float[][], float[][], Path.Strategy),
TweakableShape(float[][], float[][], Path.Strategy, ClosureMode),
TweakableShape(float[][], float[][], Path.Strategy, ClosureMode, WindingRule),
setVertexTangentData(float[][], float[][])public TweakableShape(float[][] vertex)
The constructor with the given vertex data.
Precondition:
null entries.
vertex - the vertex dataTweakableShape(),
TweakableShape(float[][], float[][]),
TweakableShape(float[][], float[][], Path.Strategy),
TweakableShape(float[][], float[][], Path.Strategy, ClosureMode),
TweakableShape(float[][], float[][], Path.Strategy, ClosureMode, WindingRule),
setVertexTangentData(float[][], float[][])
public TweakableShape(float[][] vertex,
float[][] tangent)
The constructor with the given vertex and tangent data.
Precondition 1:
null entries.Precondition 2:
null or
float[N][2] with non-null entries
for the same N as in the vertex array.If tangent is null
then an array of zero tangents is supplied.
vertex - the vertex datatangent - the tangent dataTweakableShape(),
TweakableShape(float[][]),
TweakableShape(float[][], float[][], Path.Strategy),
TweakableShape(float[][], float[][], Path.Strategy, ClosureMode),
TweakableShape(float[][], float[][], Path.Strategy, ClosureMode, WindingRule),
setVertexTangentData(float[][], float[][])
public TweakableShape(float[][] vertex,
float[][] tangent,
Path.Strategy pathstrategy)
The constructor with the given vertex and tangent data and the given path strategy.
Precondition 1:
null entries.Precondition 2:
null or
float[N][2] with non-null entries
for the same N as in the vertex array.If tangent is null
then an array of zero tangents is supplied.
vertex - the vertex datatangent - the tangent datapathstrategy - the path strategyTweakableShape(),
TweakableShape(float[][]),
TweakableShape(float[][], float[][]),
TweakableShape(float[][], float[][], Path.Strategy, ClosureMode),
TweakableShape(float[][], float[][], Path.Strategy, ClosureMode, WindingRule),
setVertexTangentData(float[][], float[][])
public TweakableShape(float[][] vertex,
float[][] tangent,
Path.Strategy pathstrategy,
ClosureMode closuremode)
The constructor with the given vertex and tangent data, the given path strategy, and the given closure mode.
Precondition 1:
null entries.Precondition 2:
null or
float[N][2] with non-null entries
for the same N as in the vertex array.If tangent is null
then an array of zero tangents is supplied.
vertex - the vertex datatangent - the tangent datapathstrategy - the path strategyclosuremode - the closure modeTweakableShape(),
TweakableShape(float[][]),
TweakableShape(float[][], float[][]),
TweakableShape(float[][], float[][], Path.Strategy),
TweakableShape(float[][], float[][], Path.Strategy, ClosureMode, WindingRule),
setVertexTangentData(float[][], float[][])
public TweakableShape(float[][] vertex,
float[][] tangent,
Path.Strategy pathstrategy,
ClosureMode closuremode,
WindingRule windingrule)
The constructor with the given vertex and tangent data, the given path strategy, the given closure mode, and the given winding rule.
Precondition 1:
null entries.Precondition 2:
null or
float[N][2] with non-null entries
for the same N as in the vertex array.If tangent is null
then an array of zero tangents is supplied.
vertex - the vertex datatangent - the tangent datapathstrategy - the path strategyclosuremode - the closure modewindingrule - the winding ruleTweakableShape(),
TweakableShape(float[][]),
TweakableShape(float[][], float[][]),
TweakableShape(float[][], float[][], Path.Strategy),
TweakableShape(float[][], float[][], Path.Strategy, ClosureMode),
setVertexTangentData(float[][], float[][])| Method Detail |
public final void setVertexData(float[][] vertex)
Sets the vertex data of the shape using a 2-dimensional array of single precision numbers.
Does not change the tangent data.
Precondition:
null entries
for the same N as in the current tangent array.Does nothing if the preconditions fail.
Fires property change: SET_VERTEX_DATA.
vertex - the vertex datasetTangentData(float[][]),
setVertexTangentData(float[][], float[][])public final void setTangentData(float[][] tangent)
Sets the tangent data of the shape using a 2-dimensional array of single precision numbers.
Does not change the vertex data.
Precondition:
null or
float[N][2] with non-null entries
for the same N as in the current vertex array.If tangent is null
then an array of zero tangents is supplied.
Does nothing if the preconditions fail.
Fires property change: SET_TANGENT_DATA.
tangent - the tangent datasetVertexData(float[][]),
setVertexTangentData(float[][], float[][])
public final void setVertexTangentData(float[][] vertex,
float[][] tangent)
Sets the vertex and tangent data of the shape using two 2-dimensional arrays of single precision numbers.
Precondition 1:
null entries.Precondition 2:
null or
float[N][2] with non-null entries
for the same N as in the vertex array.If tangent is null
then an array of zero tangents is supplied.
Does nothing if the preconditions fail.
Fires property change: SET_VERTEX_TANGENT_DATA.
vertex - the vertex datatangent - the tangent datasetVertexData(float[][]),
setTangentData(float[][])
public final void setVertex(int index,
float x,
float y)
Sets the vertex at the given index to the given point coordinates.
Does nothing if the index is not in [0, length()).
Does not change the tangent data.
Fires property change: SET_VERTEX.
index - the vertex indexx - the new x-coordinate for the vertexy - the new y-coordinate for the vertexsetVertex(int, float[]),
setTangent(int, float, float),
setTangent(int, float[]),
setVertexTangent(int, float, float, float, float),
setVertexTangent(int, float[])
public final void setVertex(int index,
float[] point)
Sets the vertex at the given index to the given point.
Does nothing if the index is not in [0, length()).
Does nothing if point is not float[2].
Does not change the tangent data.
Fires property change: SET_VERTEX.
index - the vertex indexpoint - the new position for the vertexsetVertex(int, float, float),
setTangent(int, float, float),
setTangent(int, float[]),
setVertexTangent(int, float, float, float, float),
setVertexTangent(int, float[])
public final void setTangent(int index,
float dx,
float dy)
Sets the tangent at the given index to the given displacement coordinates.
Does nothing if the index is not in [0, length()).
Does not change the vertex data.
Fires property change: SET_TANGENT.
index - the tangent indexdx - the new x-coordinate for the displacementdy - the new y-coordinate for the displacementsetVertex(int, float, float),
setVertex(int, float[]),
setTangent(int, float[]),
setVertexTangent(int, float, float, float, float),
setVertexTangent(int, float[])
public final void setTangent(int index,
float[] delta)
Sets the tangent at the given index to the given displacement.
Does nothing if the index is not in [0, length()).
Does nothing if delta is not float[2].
Does not change the vertex data.
Fires property change: SET_TANGENT.
index - the tangent indexdelta - the new displacement for the tangentsetVertex(int, float, float),
setVertex(int, float[]),
setTangent(int, float, float),
setVertexTangent(int, float, float, float, float),
setVertexTangent(int, float[])
public final void setVertexTangent(int index,
float x,
float y,
float dx,
float dy)
Sets the vertex and tangent at the given index to the given point and displacement coordinates.
Does nothing if the index is not in [0, length()).
Fires property change: SET_VERTEX_TANGENT.
index - the vertex/tangent indexx - the new x-coordinate for the vertexy - the new y-coordinate for the vertexdx - the new x-coordinate for the displacementdy - the new y-coordinate for the displacementsetVertex(int, float, float),
setVertex(int, float[]),
setTangent(int, float, float),
setTangent(int, float[]),
setVertexTangent(int, float[])
public final void setVertexTangent(int index,
float[] array)
Sets the vertex and tangent at the given index to the given set of point and displacement coordinates represented as float[4] with the four array locations filled with x, y, dx, dy.
Does nothing if the index is not in [0, length()).
Does nothing if array is not float[4].
Fires property change: SET_VERTEX_TANGENT.
index - the vertex/tangent indexarray - the array for the vertex/tangent with x, y, dx, dysetVertex(int, float, float),
setVertex(int, float[]),
setTangent(int, float, float),
setTangent(int, float[]),
setVertexTangent(int, float, float, float, float)
public final void addVertexTangent(int index,
float x,
float y,
float dx,
float dy)
Adds a new vertex and tangent at the given index with the given point and displacement coordinates x, y, dx, dy.
Does nothing if the index is not in [0, length()].
If index is 0, the insertion is at the front.
If index is length(), the insertion is at the end.
Fires property change: ADD_VERTEX_TANGENT.
index - the vertex/tangent indexx - the x-coordinate for the vertexy - the y-coordinate for the vertexdx - the x-coordinate for the tangentdy - the y-coordinate for the tangentaddVertexTangent(int, float[]),
removeVertexTangent(int)
public final void addVertexTangent(int index,
float[] array)
Adds a new vertex and tangent at the given index to the given set of point and displacement coordinates represented as float[4] with the four array locations filled with x, y, dx, dy.
Does nothing if the index is not in [0, length()].
If index is 0, the insertion is at the front.
If index is length(), the insertion is at the end.
Does nothing if array is not float[4].
Fires property change: ADD_VERTEX_TANGENT.
index - the vertex indexarray - the array for the vertex/tangent with x, y, dx, dyaddVertexTangent(int, float, float, float, float),
removeVertexTangent(int)public final void removeVertexTangent(int index)
Removes the vertex/tangent at the given index.
Does nothing if the index is not in [0, length()).
Fires property change: REMOVE_VERTEX_TANGENT.
index - the vertex indexaddVertexTangent(int, float, float, float, float),
addVertexTangent(int, float[])
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||