|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.gui.BaseShape
edu.neu.ccs.gui.TweakableShape
edu.neu.ccs.gui.TweakableCurve
Class TweakableCurve extends TweakableShape and
fixes the Path.Strategy to be Path.BEZIER_CUBIC.
The class provides a wealth of constructors so that the user can supply precisely the data that is needed and avoid having to specify default data. Let us explain in detail how this will work.
The four possible constructor parameters in order are:
float[][] vertex
float[][] tangent
ClosureMode closuremode
WindingRule windingrule
Preconditions:
null or
float[N][2] for some N.null or
float[N][2] for the same N as in the vertex
array.If the given vertex array is null then the
given tangent array is ignored and the internal vertex and
tangent arrays are set to float[0][2].
Otherwise if the given tangent array is null
then the vertex array will be cloned and an array of zero
tangents will be constructed.
Otherwise both the vertex and tangent array should be
float[N][2] for the same N. These arrays will
be cloned to set the internal vertex and tangent data.
The default constructor has no parameters. In all other constructors, the
vertex must be supplied to define the vertex points that the
curve must pass through in sequential order.
The caller may supply any subset of the remaining parameters but whatever parameters are supplied must be in the order listed above. Since the types of the last three parameters are distinct, Java will be able to determine the particular constructor being called.
The tangent array is used to compute the Bezier control points for the cubic arches.
The closure mode determines whether the path will be closed or open and is
either ClosureMode.CLOSED or ClosureMode.OPEN.
The default is ClosureMode.CLOSED.
The winding rule determines which of two mathematical algorithms built
into Java are used to fill regions: WindingRule.WIND_NON_ZERO
or WindingRule.WIND_EVEN_ODD. There are valid arguments to
choose either algorithm as the default but we have chosen WIND_NON_ZERO as
the default.
Since the constructor parameters have been extensively discussed in this introduction, the comments in the actual constructors will be very brief.
| Field Summary |
| Fields inherited from class edu.neu.ccs.gui.TweakableShape |
ADD_VERTEX_TANGENT, REMOVE_VERTEX_TANGENT, SET_TANGENT, SET_VERTEX, SET_VERTEX_TANGENT |
| 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 | |
TweakableCurve()
The default constructor. |
|
TweakableCurve(float[][] vertex)
The constructor with the given vertex data. |
|
TweakableCurve(float[][] vertex,
ClosureMode closuremode)
The constructor with the given vertex data and the given closure mode. |
|
TweakableCurve(float[][] vertex,
ClosureMode closuremode,
WindingRule windingrule)
The constructor with the given vertex data, the given closure mode, and the given winding rule. |
|
TweakableCurve(float[][] vertex,
float[][] tangent)
The constructor with the given vertex data and the given tangent data. |
|
TweakableCurve(float[][] vertex,
float[][] tangent,
ClosureMode closuremode)
The constructor with the given vertex data, the given tangent data, and the given closure mode. |
|
TweakableCurve(float[][] vertex,
float[][] tangent,
ClosureMode closuremode,
WindingRule windingrule)
The constructor with the given vertex data, the given tangent data, the given closure mode, and the given winding rule. |
|
TweakableCurve(float[][] vertex,
float[][] tangent,
WindingRule windingrule)
The constructor with the given vertex data, the given tangent data, and the given winding rule. |
|
TweakableCurve(float[][] vertex,
WindingRule windingrule)
The constructor with the given vertex data and the given winding rule. |
|
| Method Summary | |
void |
setPathStrategy(Path.Strategy pathstrategy)
Since the Path.Strategy of this class is fixed to be
Path.BEZIER_CUBIC, this method overrides the inherited
method to do nothing. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TweakableCurve()
The default constructor.
public TweakableCurve(float[][] vertex)
The constructor with the given vertex data.
vertex - the vertex data
public TweakableCurve(float[][] vertex,
WindingRule windingrule)
The constructor with the given vertex data and the given winding rule.
vertex - the vertex datawindingrule - the winding rule
public TweakableCurve(float[][] vertex,
ClosureMode closuremode)
The constructor with the given vertex data and the given closure mode.
vertex - the vertex dataclosuremode - the closure mode
public TweakableCurve(float[][] vertex,
ClosureMode closuremode,
WindingRule windingrule)
The constructor with the given vertex data, the given closure mode, and the given winding rule.
vertex - the vertex dataclosuremode - the closure modewindingrule - the winding rule
public TweakableCurve(float[][] vertex,
float[][] tangent)
The constructor with the given vertex data and the given tangent data.
vertex - the vertex datatangent - the tangent data
public TweakableCurve(float[][] vertex,
float[][] tangent,
WindingRule windingrule)
The constructor with the given vertex data, the given tangent data, and the given winding rule.
vertex - the vertex datatangent - the tangent datawindingrule - the winding rule
public TweakableCurve(float[][] vertex,
float[][] tangent,
ClosureMode closuremode)
The constructor with the given vertex data, the given tangent data, and the given closure mode.
vertex - the vertex datatangent - the tangent dataclosuremode - the closure mode
public TweakableCurve(float[][] vertex,
float[][] tangent,
ClosureMode closuremode,
WindingRule windingrule)
The constructor with the given vertex data, the given tangent data, the given closure mode, and the given winding rule.
vertex - the vertex datatangent - the tangent dataclosuremode - the closure modewindingrule - the winding rule| Method Detail |
public final void setPathStrategy(Path.Strategy pathstrategy)
Since the Path.Strategy of this class is fixed to be
Path.BEZIER_CUBIC, this method overrides the inherited
method to do nothing.
setPathStrategy in class BaseShapepathstrategy - the path strategy to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||