Package samer.tools
Class Plotter
- java.lang.Object
-
- samer.core.util.heavy.VCanvas
-
- samer.tools.Plotter
-
- Direct Known Subclasses:
- FunctionPlotter, ScatterPlot, VectorPlotter
public class Plotter extends samer.core.util.heavy.VCanvas
A Plotter object is a Canvas with its own Graphics (ie a GCanvas) which has two LinearMaps to map a portion of 2d space to the window. It can optionally draw the X and Y axes.
The inner class Pen provides access to drawing functions in the real-valued coordinate space.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description class
Plotter.Pen
This class provides a state based plotting environment (slightly inspired by Postscripts crazy reverse polish).
-
Field Summary
Fields Modifier and Type Field and Description static int
BOTH
static int
NEITHER
for passing to setAxes(int)static int
XAXIS
IMap
xmap
static int
YAXIS
IMap
ymap
-
Constructor Summary
Constructors Constructor and Description Plotter()
Default constructor makes Plotter with both axes drawn, in grey.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
clear(java.awt.Graphics g)
void
drawAxes(java.awt.Graphics g)
not really for public usevoid
exposeMaps()
Plotter.Pen
getPen()
return a new Pen for this PlotterPlotter.Pen
getPen(java.awt.Graphics g)
java.awt.Dimension
getPreferredSize()
void
paint(java.awt.Graphics g)
void
setAxes(int f)
use one of NONE, XAXIS, YAXIS or BOTHvoid
setAxesColor(java.awt.Color c)
protected void
sized()
-
-
-
Field Detail
-
BOTH
public static final int BOTH
- See Also:
- Constant Field Values
-
NEITHER
public static final int NEITHER
for passing to setAxes(int)- See Also:
- Constant Field Values
-
XAXIS
public static final int XAXIS
- See Also:
- Constant Field Values
-
xmap
public IMap xmap
-
YAXIS
public static final int YAXIS
- See Also:
- Constant Field Values
-
ymap
public IMap ymap
-
-
Constructor Detail
-
Plotter
public Plotter()
Default constructor makes Plotter with both axes drawn, in grey. LinearMaps take their default setup.- See Also:
samer.core.util.LinearMap
-
-
Method Detail
-
exposeMaps
public void exposeMaps()
-
sized
protected void sized()
-
getPreferredSize
public java.awt.Dimension getPreferredSize()
-
setAxes
public void setAxes(int f)
use one of NONE, XAXIS, YAXIS or BOTH
-
setAxesColor
public void setAxesColor(java.awt.Color c)
-
drawAxes
public void drawAxes(java.awt.Graphics g)
not really for public use
-
clear
public void clear(java.awt.Graphics g)
-
paint
public void paint(java.awt.Graphics g)
-
getPen
public Plotter.Pen getPen()
return a new Pen for this Plotter
-
getPen
public Plotter.Pen getPen(java.awt.Graphics g)
-
-