|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.faceless.graph2.Series
public abstract class Series
The Series class is the abstract superclass for all types of data to be
plotted on an AxesGraph
.
Method Summary | |
---|---|
void |
addBox(String name,
double x1,
double y1,
double x2,
double y2,
Style style)
Add a box to this Series. |
void |
addLine(String name,
double x1,
double y1,
double x2,
double y2,
Style style)
Add a line to this Series. |
void |
addMarker(AbstractMarker marker,
double x,
double y)
Add a Marker to this Series. |
String |
getName()
Return the name of this series |
double[] |
outputToSeries(double x,
double y,
double[] out)
Given the (X,Y) co-ordinates of a point that was plotted on this Series and displayed on an Output , return the original co-ordinates
as specified in Series space. |
String |
outputToSeriesFunction()
This method returns two lines of JavaScript which perform the same function as the outputToSeries method. |
void |
setStyle(Style style)
Set the style (color) to plot this series with. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public String toString()
toString
in class Object
public final void setStyle(Style style)
Graph.setDefaultColors(java.awt.Paint[])
)
is used.
public final String getName()
public void addMarker(AbstractMarker marker, double x, double y)
Marker
to this Series.
marker
- the Marker to addx
- the X co-ordinate to place the marker aty
- the Y co-ordinate to place the marker atpublic void addLine(String name, double x1, double y1, double x2, double y2, Style style)
addLine(-Double.POSITIVE_INFINITY, 10, Double.POSITIVE_INFINITY, 10, style);
name
- the name of the line (so it can be found in ImageOutput.getAreas()
), or
null
if a name is not required.x1
- the starting X co-ordinate of the line. If NaN, will be set to -Infinityy1
- the starting Y co-ordinate of the line. If NaN, will be set to -Infinityx2
- the ending X co-ordinate of the line. If NaN, will be set to +Infinityy2
- the ending Y co-ordinate of the line. If NaN, will be set to +Infinitystyle
- the style to apply to the linepublic void addBox(String name, double x1, double y1, double x2, double y2, Style style)
addBox(-Double.POSITIVE_INFINITY, 10, Double.POSITIVE_INFINITY, 10, style);
name
- the name of the line (so it can be found in ImageOutput.getAreas()
), or
null
if a name is not required.x1
- the starting X co-ordinate of the line. If NaN, will be set to -Infinityy1
- the starting Y co-ordinate of the line. If NaN, will be set to -Infinityx2
- the ending X co-ordinate of the line. If NaN, will be set to +Infinityy2
- the ending Y co-ordinate of the line. If NaN, will be set to +Infinitystyle
- the style to apply to the linepublic double[] outputToSeries(double x, double y, double[] out)
Output
, return the original co-ordinates
as specified in Series space. In other words, convert a point in Output-space
back to the original Series-space. This method would typically be used to determine
exactly what point in a Series the mouse is hovering over.
x
- the X co-ordinate of the point, relative to the left side of the Output
the Series was plotted toy
- the Y co-ordinate of the point, relative to the bottom of the Output
the Series was plotted toout
- an array of two doubles which the output values will be written to, or null
to allocate a new one
out
was not null, return out
public String outputToSeriesFunction()
outputToSeries
method. Assuming two variables
"x" and "y", the first line is the new value of the "x" variable and the second
is the new value of "y". Again, the output of this method would typically be
used with interactive graphs to determine which point the mouse is hovering over
1.2*x + 3.2*y + ((-1*x+0*y+4)/12)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |