|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Object
|
+--Plotter
|
+--Plotter2
A plotter augmented with extra methods to facilitate common tasks. This plotter can remember a viewport (a rectangle on the screen), and automatically supply the position and dimensions, simplifying coordinate transformations.
| Field Summary | |
protected java.awt.Color |
graphCol
The colour to use when plotting the actual graph |
protected int |
h
|
protected int |
hSpace
|
protected int |
vSpace
|
protected int |
w
|
protected int |
x
|
protected int |
y
|
| Fields inherited from class Plotter |
ABS_MAX,
ABS_MIN,
axes,
bottomMargin,
eqn,
fold,
foldSize,
foldSym,
infY,
interpolate,
log,
majorTickSize,
maxX,
maxY,
minorTickSize,
minX,
minY,
noUnitsX,
noUnitsY,
rangeX,
rangeY,
soln,
tickRatio,
topMargin,
viewLeft,
viewRange,
viewRight,
xLabel,
xScale,
yLabel,
yScale |
| Constructor Summary | |
Plotter2(Solvable eqn)
Creates a new plotter, with an empty (0,0,0,0) viewport |
|
Plotter2(Solvable eqn,
int x,
int y,
int w,
int h)
Creates a new plotter |
|
| Method Summary | |
double |
fromScreenX(int i)
Converts an x value from screen space to graph space |
double |
fromScreenY(int i)
Converts a y value from screen space to graph space |
java.awt.Color |
getGraphColor()
Returns the colour used when plotting the actual graph |
void |
paint(java.awt.Graphics g)
Paints this graph, with axes and scales (if appropriate) inside the viewport. |
void |
setGraphColor(java.awt.Color c)
Sets the colour to use when plotting the actual graph |
void |
setMaxX(double d)
Adjusts the maximum x value |
void |
setMaxY(double d)
Adjusts the maximum y value |
void |
setMinX(double d)
Adjusts the minimum x value |
void |
setMinY(double d)
Adjusts the minimum y value |
void |
setRect(int x,
int y,
int w,
int h)
Sets the viewport for this plotter. |
int |
toScreenX(double d)
Converts an x value from graph space to screen space |
int |
toScreenY(double d)
Converts a y value from graph space to screen space |
void |
updateSolution(java.awt.Graphics g)
Fills the cache with solution data. |
| Methods inherited from class Plotter |
chooseTickSize,
copyScale,
fold,
fromScreenX,
fromScreenY,
getMax,
getMin,
getSpaceX,
getSpaceY,
isInterpolated,
isLogarithmic,
labelAxisX,
labelAxisY,
paint,
paintAxes,
paintGraph,
paintGraphFolded,
paintLabelBelow,
paintLabelToLeft,
paintVerticalMarkers,
scaleToFit,
scaleToFit,
setAxes,
setFold,
setFold,
setFold,
setInterpolated,
setLabels,
setLogarithmic,
setRangeX,
setRangeY,
setScalesEnabled,
setView,
setViewAndRange,
snap,
squareValues,
toScreenX,
toScreenY,
toString,
updateSolution |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected java.awt.Color graphCol
protected int x
protected int y
protected int w
protected int h
protected int hSpace
protected int vSpace
| Constructor Detail |
public Plotter2(Solvable eqn,
int x,
int y,
int w,
int h)
eqn - The Solvable object to obtain solution data fromx - The x coordinate of the viewporty - The y coordinate of the viewportw - The width of the viewporth - The height of the viewportpublic Plotter2(Solvable eqn)
eqn - The Solvable object to obtain solution data from| Method Detail |
public void paint(java.awt.Graphics g)
g - The Graphics surface on which to paintpublic void updateSolution(java.awt.Graphics g)
public void setRect(int x,
int y,
int w,
int h)
x - The x coordinate of the viewporty - The y coordinate of the viewportw - The width of the viewporth - The height of the viewportpublic void setMinY(double d)
public void setMaxY(double d)
public void setMinX(double d)
public void setMaxX(double d)
public int toScreenX(double d)
public int toScreenY(double d)
public double fromScreenX(int i)
public double fromScreenY(int i)
public java.awt.Color getGraphColor()
public void setGraphColor(java.awt.Color c)
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||