|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.generation5.util.Plot
An abstract base class providing basic functionality for the plot classes.
| Field Summary | |
protected boolean |
drawAxes
Draw the axes. |
protected double |
maxX
Maximum X-range |
protected double |
maxY
Maximum Y-range. |
protected double |
minX
Minimum X-range |
protected double |
minY
Minimum Y-range |
protected int[] |
plotTypes
The type of plot for a given data series. |
| Constructor Summary | |
Plot()
Creates a new instance of Plot |
|
| Method Summary | |
protected void |
calculateRanges()
Calculates the ranges for the X and Y coordinates. |
protected void |
drawAxes(java.awt.Graphics g,
int width,
int height)
Draws the axes on the given graphics context. |
double |
getMaximumX()
Return the maximum X-coordinate. |
double |
getMaximumY()
Get the maximum Y-coordinate. |
double |
getMinimumX()
Return the minimum X-coordinate. |
double |
getMinimumY()
Return the minimum Y-coordinate. |
double |
getRangeX()
Return the X-range. |
double |
getRangeY()
Return the Y-range. |
abstract void |
render(java.awt.Graphics g,
int width,
int height)
Render the plot on a graphics context. |
void |
setDrawAxes(boolean da)
Allows the axes to be toggled on and off. |
void |
setMaximumX(double mx)
Set the maximum X-coordinate. |
void |
setMaximumY(double my)
Set the maximum Y-coordinate. |
void |
setMinimumX(double mx)
Set the minimum X-coordinate. |
void |
setRange(double minX,
double maxX,
double minY,
double maxY)
Set the range covered by the plot. |
PlotPoint |
translateCoordinate(double x,
double y,
int width,
int height)
Translates a cartesian coordinate to absolute coordinates for the graphics context. |
PlotPoint |
translateCoordinate(PlotPoint point,
int width,
int height)
Translates a cartesian coordinate to absolute coordinates for the graphics context. |
void |
writeImage(java.lang.String s,
int width,
int height)
Write the plot to file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int[] plotTypes
protected double minX
protected double maxX
protected double minY
protected double maxY
protected boolean drawAxes
| Constructor Detail |
public Plot()
| Method Detail |
public void setDrawAxes(boolean da)
da - should the axes be drawn?
public abstract void render(java.awt.Graphics g,
int width,
int height)
render in interface Visualizableg - the graphics context.width - the width of the context.height - the height of the context.
public void writeImage(java.lang.String s,
int width,
int height)
writeImage in interface Visualizables - the image filename.width - the width of the image.height - the height of the image.
public PlotPoint translateCoordinate(double x,
double y,
int width,
int height)
x - the x-position.y - the y-position.width - the width of the graphics context.height - the height of the graphics context.
PlotPoint corresponding to the absolute coordinates.
public PlotPoint translateCoordinate(PlotPoint point,
int width,
int height)
point - the point to translate.width - the width of the graphics context.height - the height of the graphics context.
PlotPoint corresponding to the absolute coordinates.protected void calculateRanges()
public double getRangeX()
public double getRangeY()
public double getMinimumX()
public void setMinimumX(double mx)
mx - the new minimum X-coordinate.public double getMaximumX()
public void setMaximumX(double mx)
mx - the new maximum X-coordinate.public double getMinimumY()
public double getMaximumY()
public void setMaximumY(double my)
my - the new maximum Y-coordinate.
public void setRange(double minX,
double maxX,
double minY,
double maxY)
minX - the minimum X-coordinate.maxX - the maximum X-coordinate.minY - the minimum Y-coordinate.maxY - the maximum Y-coordinate.
protected void drawAxes(java.awt.Graphics g,
int width,
int height)
g - the graphics context.width - the width of the context.height - the height of the context.
|
This documentation is part of the Generation5 JDK.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||