|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rit.numeric.plot.impl.XYPlot
public class XYPlot
Class XYPlot provides an XY plot. The plot has an X axis, a Y axis, and one or more plot series (type PlotSeries). The plot may optionally have a Grid. Labels (class Label) may be added to a plot and are drawn after drawing all the plot series.
| Field Summary | |
|---|---|
static Paint |
DEFAULT_BACKGROUND
The default background paint (white). |
static double |
DEFAULT_MARGIN
The default margin (54). |
protected Paint |
myBackgroundPaint
Background paint. |
protected double |
myBottomMargin
Bottom margin. |
protected Rectangle2D.Double |
myBoundingBox
Bounding box. |
protected Grid |
myGrid
Grid. |
protected double |
myHeight
Height. |
protected ArrayList<Label> |
myLabels
List of labels. |
protected double |
myLeftMargin
Left margin. |
protected ArrayList<PlotSeries> |
myPlotSeries
List of plot series. |
protected double |
myRightMargin
Right margin. |
protected double |
myTopMargin
Top margin. |
protected double |
myWidth
Width. |
protected NumericalAxis |
myXAxis
X axis. |
protected NumericalAxis |
myYAxis
Y axis. |
| Constructor Summary | |
|---|---|
XYPlot(NumericalAxis theXAxis,
NumericalAxis theYAxis)
Construct a new XY plot with the given axes. |
|
XYPlot(NumericalAxis theXAxis,
NumericalAxis theYAxis,
Grid theGrid)
Construct a new XY plot with the given axes and grid. |
|
XYPlot(NumericalAxis theXAxis,
NumericalAxis theYAxis,
Grid theGrid,
double theMargin)
Construct a new XY plot with the given axes, grid, and margin. |
|
XYPlot(NumericalAxis theXAxis,
NumericalAxis theYAxis,
Grid theGrid,
double theLeftMargin,
double theTopMargin,
double theRightMargin,
double theBottomMargin)
Construct a new XY plot with the given axes, grid, and margins. |
|
XYPlot(NumericalAxis theXAxis,
NumericalAxis theYAxis,
Grid theGrid,
double theLeftMargin,
double theTopMargin,
double theRightMargin,
double theBottomMargin,
Paint theBackgroundPaint)
Construct a new XY plot with the given axes, grid, margins, and background. |
|
| Method Summary | |
|---|---|
void |
addLabel(Label theLabel)
Add the given label to this XY plot. |
void |
addPlotSeries(PlotSeries thePlotSeries)
Add the given plot series to this XY plot. |
void |
draw(Graphics2D g2d)
Draw this drawable object in the given graphics context. |
Paint |
getBackgroundPaint()
Returns this displayable object's background paint. |
Rectangle2D |
getBoundingBox()
Returns this displayable object's bounding box. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double DEFAULT_MARGIN
public static final Paint DEFAULT_BACKGROUND
protected NumericalAxis myXAxis
protected NumericalAxis myYAxis
protected Grid myGrid
protected ArrayList<PlotSeries> myPlotSeries
protected ArrayList<Label> myLabels
protected double myLeftMargin
protected double myTopMargin
protected double myRightMargin
protected double myBottomMargin
protected double myWidth
protected double myHeight
protected Rectangle2D.Double myBoundingBox
protected Paint myBackgroundPaint
| Constructor Detail |
|---|
public XYPlot(NumericalAxis theXAxis,
NumericalAxis theYAxis)
theXAxis - X axis.theYAxis - Y axis.
NullPointerException - (unchecked exception) Thrown if theXAxis is null or
theYAxis is null.
public XYPlot(NumericalAxis theXAxis,
NumericalAxis theYAxis,
Grid theGrid)
theXAxis - X axis.theYAxis - Y axis.theGrid - Grid, or null for no grid.
NullPointerException - (unchecked exception) Thrown if theXAxis is null or
theYAxis is null.
public XYPlot(NumericalAxis theXAxis,
NumericalAxis theYAxis,
Grid theGrid,
double theMargin)
theXAxis - X axis.theYAxis - Y axis.theGrid - Grid, or null for no grid.theMargin - Margin.
NullPointerException - (unchecked exception) Thrown if theXAxis is null or
theYAxis is null.
IllegalArgumentException - (unchecked exception) Thrown if theMargin is less than 0.
public XYPlot(NumericalAxis theXAxis,
NumericalAxis theYAxis,
Grid theGrid,
double theLeftMargin,
double theTopMargin,
double theRightMargin,
double theBottomMargin)
theXAxis - X axis.theYAxis - Y axis.theGrid - Grid, or null for no grid.theLeftMargin - Left margin.theTopMargin - Top margin.theRightMargin - Right margin.theBottomMargin - Left margin.
NullPointerException - (unchecked exception) Thrown if theXAxis is null or
theYAxis is null.
IllegalArgumentException - (unchecked exception) Thrown if any margin is less than 0.
public XYPlot(NumericalAxis theXAxis,
NumericalAxis theYAxis,
Grid theGrid,
double theLeftMargin,
double theTopMargin,
double theRightMargin,
double theBottomMargin,
Paint theBackgroundPaint)
theXAxis - X axis.theYAxis - Y axis.theGrid - Grid, or null for no grid.theLeftMargin - Left margin.theTopMargin - Top margin.theRightMargin - Right margin.theBottomMargin - Left margin.theBackgroundPaint - Background paint.
NullPointerException - (unchecked exception) Thrown if theXAxis is null,
theYAxis is null, or theBackgroundPaint is null.
IllegalArgumentException - (unchecked exception) Thrown if any margin is less than 0.| Method Detail |
|---|
public void addPlotSeries(PlotSeries thePlotSeries)
thePlotSeries - Plot series.
NullPointerException - (unchecked exception) Thrown if thePlotSeries is null.public void addLabel(Label theLabel)
theLabel - Label.
NullPointerException - (unchecked exception) Thrown if theLabel is null.public void draw(Graphics2D g2d)
This XY plot is drawn so that the upper left corner (including the margins) is located at the display coordinates (0, 0) in the graphics context.
draw in interface Drawableg2d - 2-D graphics context.public Rectangle2D getBoundingBox()
getBoundingBox in interface Displayablepublic Paint getBackgroundPaint()
getBackgroundPaint in interface Displayable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||