Class RotatedPlotter

java.lang.Object
  |
  +--Plotter
        |
        +--RotatedPlotter

class RotatedPlotter
extends Plotter

A plotter with the horizontal and vertical axes swapped, and all necessary methods overridden to reflect this change.


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
RotatedPlotter(Solvable s)
           
 
Method Summary
 double fromScreenX(int x, int w)
          Converts the specified x value from screen space to graph space
 double fromScreenY(int y, int h)
          Converts the specified y value from screen space to graph space
 void labelAxisX(java.awt.Graphics g, int w, int h)
          Labels the x axis.
 void labelAxisY(java.awt.Graphics g, int w, int h)
          Labels the y axis.
 void paintGraph(java.awt.Graphics g, int w, int h)
          Paints the graph (without scales, labels or axes).
protected  void scaleToFit()
          Adjusts the minY, maxY and rangeY parameters so that the y axis range is set to the minimum interval into which all graph data falls.
protected  void scaleToFit(int left, int right)
          Adjusts the minY, maxY and rangeY parameters so that the y axis range is set to the minimum interval into which all graph data within the specified interval falls.
 void setViewAndRange(double min, double max)
          Combines a call to setView() and setRangeX(), passing the same interval bounds to each.
 int toScreenX(double x, int w)
          Converts the specified x value from graph space to screen space
 int toScreenY(double y, int h)
          Converts the specified y value from graph space to screen space
 java.lang.String toString(double d)
          Convenience method to format a double for display.
protected  void updateSolution(int steps)
          Updates this plotter's cache of solution data.
 
Methods inherited from class Plotter
chooseTickSize, copyScale, fold, getMax, getMin, getSpaceX, getSpaceY, isInterpolated, isLogarithmic, paint, paintAxes, paintGraphFolded, paintLabelBelow, paintLabelToLeft, paintVerticalMarkers, setAxes, setFold, setFold, setFold, setInterpolated, setLabels, setLogarithmic, setRangeX, setRangeY, setScalesEnabled, setView, snap, squareValues
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

RotatedPlotter

public RotatedPlotter(Solvable s)
Method Detail

paintGraph

public void paintGraph(java.awt.Graphics g,
                       int w,
                       int h)
Description copied from class: Plotter
Paints the graph (without scales, labels or axes).
Overrides:
paintGraph in class Plotter
Tags copied from class: Plotter
Parameters:
g - The Graphics surface on which to paint
w - The width (in pixels) of the available display area
h - The height (in pixels) of the available display area

updateSolution

protected void updateSolution(int steps)
Description copied from class: Plotter
Updates this plotter's cache of solution data.
Overrides:
updateSolution in class Plotter
Tags copied from class: Plotter
Parameters:
steps - The number of x values at which the solution should be sampled

toScreenX

public int toScreenX(double x,
                     int w)
Description copied from class: Plotter
Converts the specified x value from graph space to screen space
Overrides:
toScreenX in class Plotter
Tags copied from class: Plotter
Parameters:
x - The value
w - The width (in pixels) of the available display area

toScreenY

public int toScreenY(double y,
                     int h)
Description copied from class: Plotter
Converts the specified y value from graph space to screen space
Overrides:
toScreenY in class Plotter
Tags copied from class: Plotter
Parameters:
y - The value
h - The height (in pixels) of the available display area

fromScreenX

public double fromScreenX(int x,
                          int w)
Description copied from class: Plotter
Converts the specified x value from screen space to graph space
Overrides:
fromScreenX in class Plotter
Tags copied from class: Plotter
Parameters:
x - The value
w - The width (in pixels) of the available display area

fromScreenY

public double fromScreenY(int y,
                          int h)
Description copied from class: Plotter
Converts the specified y value from screen space to graph space
Overrides:
fromScreenY in class Plotter
Tags copied from class: Plotter
Parameters:
y - The value
h - The height (in pixels) of the available display area

scaleToFit

protected void scaleToFit()
Description copied from class: Plotter
Adjusts the minY, maxY and rangeY parameters so that the y axis range is set to the minimum interval into which all graph data falls.
Overrides:
scaleToFit in class Plotter

scaleToFit

protected void scaleToFit(int left,
                          int right)
Description copied from class: Plotter
Adjusts the minY, maxY and rangeY parameters so that the y axis range is set to the minimum interval into which all graph data within the specified interval falls.
Overrides:
scaleToFit in class Plotter
Tags copied from class: Plotter
Parameters:
left - The minimum bound for the x-axis interval
right - The maximum bound for the x-axis interval

setViewAndRange

public void setViewAndRange(double min,
                            double max)
Description copied from class: Plotter
Combines a call to setView() and setRangeX(), passing the same interval bounds to each.
Overrides:
setViewAndRange in class Plotter

labelAxisX

public void labelAxisX(java.awt.Graphics g,
                       int w,
                       int h)
Description copied from class: Plotter
Labels the x axis. Major and minor ticks will be drawn, with a numerical label at each major tick. The label for this axis will also be painted. Note that "axis" here refers to the scale across the bottom of the graph, rather than the line y = 0.
Overrides:
labelAxisX in class Plotter
Tags copied from class: Plotter
Parameters:
g - The Graphics surface on which to paint
w - The width (in pixels) of the available display area
h - The height (in pixels) of the available display area

labelAxisY

public void labelAxisY(java.awt.Graphics g,
                       int w,
                       int h)
Description copied from class: Plotter
Labels the y axis. Major and minor ticks will be drawn, with a numerical label at each major tick. The label for this axis will also be painted. Note that "axis" here refers to the scale to the left of the graph, rather than the line x = 0.
Overrides:
labelAxisY in class Plotter
Tags copied from class: Plotter
Parameters:
g - The Graphics surface on which to paint
w - The width (in pixels) of the available display area
h - The height (in pixels) of the available display area

toString

public java.lang.String toString(double d)
Description copied from class: Plotter
Convenience method to format a double for display. Implementation is via a call to BaseApplet2.toString().
Overrides:
toString in class Plotter