All Packages Class Hierarchy This Package Previous Next Index
Class figPac.fCurve
java.lang.Object
|
+----figPac.fCurve
- public class fCurve
- extends Object
- implements fElement, fInteractive, ItemListener
Each instance of the class fCurve represents a parametrized curve.
For the algorithm used to plot the curve, see the method drawgfx.
-
CLOSED
-
-
defaultFillColor
- The default color used to fill the curve on the screen.
-
defaultPsFillColor
- The default PostScript command used to color in the curve in PostScript when the fEnv variable useColorPs is "true".
-
defaultPsFillGray
- Controls the default density used to fill the curve in postscript.
-
fillColor
- The color used to fill the curve on the screen.
-
FILLED
-
-
maxN
- The maximum number of line segments to be drawn.
-
minN
- The minimum number of line segments to be drawn.
-
OPEN
-
-
psFillColor
- The PostScript command used to color in the curve in PostScript when the fEnv variable useColorPs is "true".
-
psFillGray
- Controls the density used to fill the curve in postscript.
-
psStep
- A segment longer than step (in points) is not drawn in PostScript if the change in the value of the parameter between the ends of the segment is the minimum allowed.
-
psTolerance
- The maximum distance (in points) between the center of a chord drawn in
PostScript and the center of the corresponding arc.
-
S_VALUED
-
-
step
- A segment longer than step (in pixels) is not drawn to screen if the change in the value of the parameter between the ends of the segment is the minimum allowed.
-
tmax
- The final value of the parameter.
-
tmin
- The initial value of the parameter.
-
tolerance
- The maximum distance (in pixels) between the center of a chord drawn to
screen and the center of the corresponding arc.
-
type
- The type determines whether the curve is plotted as an open or closed path and whether
or not it is filled.
-
V_VALUED
-
-
fCurve()
-
-
fCurve(S2S)
- Creates the curve y=F(x).
-
fCurve(S2S, double, double)
- Creates the curve y=F(x) with x running from the second to the third arguments.
-
fCurve(S2S, double, double, long)
- Creates the curve y=F(x) with the initial and
final values of x given by the second and third arguments; the final
argument determines whether or not the curve is to be closed and/or filled.
-
fCurve(S2S, long)
- Creates the curve y=F(x).
-
fCurve(S2V)
- Creates a curve parametrized by the argument with the parameter running from 0 to 1.
-
fCurve(S2V, double, double)
- Creates a curve parametrized by the first argument whose initial and
final parameter values are given by the second and third arguments.
-
fCurve(S2V, double, double, long)
- Creates a curve parametrized by the first argument whose initial and
final parameter values are given by the second and third arguments; the final
argument determines whether or not the curve is to be closed and/or filled.
-
fCurve(S2V, long)
- Creates a curve parametrized by the first argument.
-
fCurve(String, int, double, double, long)
- Creates a curve specified by a String that can be parsed by fnPac to give
the equation of the curve.
-
configure(String, double)
-
-
configure(String, double[])
-
-
configure(String, String)
-
-
drawgfx(Figure, Hashtable, V2V)
- Draws to the screen a polygonal line approximating the curve.
-
drawps(Figure, Hashtable, V2V)
-
-
endEdit()
-
-
endEditAndDelete()
-
-
itemStateChanged(ItemEvent)
-
-
startEdit(figEdit)
-
-
toString()
-
tmin
public double tmin
- The initial value of the parameter. It defaults to -infinity for curves
of the form y=F(x) and to 0 for parametrized curves.
tmax
public double tmax
- The final value of the parameter. It defaults to infinity for curves
of the form y=F(x) and to 1 for parametrized curves.
minN
public int minN
- The minimum number of line segments to be drawn. Defaults to 10.
maxN
public int maxN
- The maximum number of line segments to be drawn. Defaults to 3000.
tolerance
public double tolerance
- The maximum distance (in pixels) between the center of a chord drawn to
screen and the center of the corresponding arc. Defaults to .5.
psTolerance
public double psTolerance
- The maximum distance (in points) between the center of a chord drawn in
PostScript and the center of the corresponding arc. Defaults to .1.
step
public double step
- A segment longer than step (in pixels) is not drawn to screen if the change in the value of the parameter between the ends of the segment is the minimum allowed.
Defaults to 10.
psStep
public double psStep
- A segment longer than step (in points) is not drawn in PostScript if the change in the value of the parameter between the ends of the segment is the minimum allowed.
Defaults to 5.
OPEN
public static long OPEN
CLOSED
public static long CLOSED
FILLED
public static long FILLED
type
public long type
- The type determines whether the curve is plotted as an open or closed path and whether
or not it is filled. To determine the value of type, start with type=0. If you wish to have the
curve itself plotted add either fCurve.OPEN or fCurve.CLOSED. In the latter case, a line segment from the last point to the first point is plotted in addition to the curve itself. If you wish to fill the
curve add fCurve.FILLED.
defaultFillColor
public Color defaultFillColor
- The default color used to fill the curve on the screen.
fillColor
public Color fillColor
- The color used to fill the curve on the screen.
defaultPsFillGray
public double defaultPsFillGray
- Controls the default density used to fill the curve in postscript. Black=0, white=1.
psFillGray
public double psFillGray
- Controls the density used to fill the curve in postscript. Black=0, white=1.
defaultPsFillColor
public String defaultPsFillColor
- The default PostScript command used to color in the curve in PostScript when the fEnv variable useColorPs is "true".
psFillColor
public String psFillColor
- The PostScript command used to color in the curve in PostScript when the fEnv variable useColorPs is "true".
S_VALUED
public int S_VALUED
V_VALUED
public int V_VALUED
fCurve
public fCurve(S2S F,
double xmin,
double xmax,
long type)
- Creates the curve y=F(x) with the initial and
final values of x given by the second and third arguments; the final
argument determines whether or not the curve is to be closed and/or filled.
- Parameters:
- F - The S2S (scalar to scalar) function specifying the curve.
- xmin - The minimum value of x.
- xmax - The maximum value of x.
- type - The type determines whether the curve is plotted as an open or closed path and whether or not it is filled. To determine the value of type, start with type=0. If you wish to have the
curve itself plotted add either fCurve.OPEN or fCurve.CLOSED. In the latter case, a line segment from the last point to the first point is plotted in addition to the curve itself. If you wish to fill the
curve add fCurve.FILLED.
fCurve
public fCurve(S2S F)
- Creates the curve y=F(x).
fCurve
public fCurve(S2S F,
double xmin,
double xmax)
- Creates the curve y=F(x) with x running from the second to the third arguments.
fCurve
public fCurve(S2S F,
long type)
- Creates the curve y=F(x). The second argument determines whether or
not the curve is to be closed and/or filled. If usr2dvc is invertible x runs from the larger of its two
x values at the left hand corners of the figure to the smaller of its two values at the right hand corners of
the figure.
fCurve
public fCurve(S2V XY,
double tmin,
double tmax,
long type)
- Creates a curve parametrized by the first argument whose initial and
final parameter values are given by the second and third arguments; the final
argument determines whether or not the curve is to be closed and/or filled.
- Parameters:
- XY - The S2V (scalar to vector) function parametrizing the curve.
- tmin - The minimum parameter value.
- tmax - The maximum parameter value.
- type - The type determines whether the curve is plotted as an open or closed path and whether or not it is filled. To determine the value of type, start with type=0. If you wish to have the
curve itself plotted add either fCurve.OPEN or fCurve.CLOSED. In the latter case, a line segment from the last point to the first point is plotted in addition to the curve itself. If you wish to fill the
curve add fCurve.FILLED.
fCurve
public fCurve(S2V XY)
- Creates a curve parametrized by the argument with the parameter running from 0 to 1.
fCurve
public fCurve(S2V XY,
double tmin,
double tmax)
- Creates a curve parametrized by the first argument whose initial and
final parameter values are given by the second and third arguments.
fCurve
public fCurve(S2V XY,
long type)
- Creates a curve parametrized by the first argument. The second argument
determines whether or not the curve is to be closed and/or filled. The parameter runs from
0 to 1.
fCurve
public fCurve()
fCurve
public fCurve(String functionCode,
int SorVvalued,
double tmin,
double tmax,
long type)
- Creates a curve specified by a String that can be parsed by fnPac to give
the equation of the curve.
- Parameters:
- functionCode - A string that can be parsed by fnPac to give the equation of the curve.
- sOrVvalued - Should be set to fCurve.S_VALUED for an S2S curve and to fCurve.V_VALUED for an S2V curve.
- tmin - The minimum parameter value.
- tmax - The maximum parameter value.
- type - The type determines whether the curve is plotted as an open or closed path and whether or not it is filled. To determine the value of type, start with type=0. If you wish to have the
curve itself plotted add either fCurve.OPEN or fCurve.CLOSED. In the latter case, a line segment from the last point to the first point is plotted in addition to the curve itself. If you wish to fill the
curve add fCurve.FILLED.
drawgfx
public void drawgfx(Figure fig,
Hashtable env,
V2V usr2pxl)
- Draws to the screen a polygonal line approximating the curve. The following
automatic step size adjustment algorithm is used to plot a parametric curve
(x(t),y(t)) with parameter running from tmin to tmax. First it tries using minN
steps all of size (tmax-tmin)/minN. Then, it recursively tests all steps (t_1,t_2)
as follows. If the midpoint of the straight line joining (x(t_1),y(t_1))
to (x(t_2),y(t_2)) is closer than tolerance pixels
from ( x((t_1+t_2)/2), y((t_1+t_2)/2) ), the straight line from (x(t_1),y(t_1)) to (x(t_2),y(t_2)) is plotted. Otherwise,
the step is divided in two by adding the midpoint, unless t_2-t_1 is smaller
than 2(tmax-tmin)/maxN. For these minimal time steps, the distance from
(x(t_1),y(t_1)) to (x(t_2),y(t_2)) is computed. If the distance is smaller than
step pixels, the straight line from (x(t_1),y(t_1)) to (x(t_2),y(t_2)) is plotted.
Otherwise, nothing is plotted for the interval (t_1,t_2), under the assumption
that the curve has a discontinuity in this interval.
drawps
public String drawps(Figure fig,
Hashtable env,
V2V usr2ps)
startEdit
public void startEdit(figEdit applet)
endEdit
public void endEdit()
endEditAndDelete
public void endEditAndDelete()
itemStateChanged
public void itemStateChanged(ItemEvent evt)
configure
public void configure(String name,
String Value)
configure
public void configure(String name,
double Value)
configure
public void configure(String name,
double Value[])
toString
public String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index