edu.rit.numeric.plot.impl
Class XYPlotSeries
- java.lang.Object
-
- edu.rit.numeric.plot.impl.PlotSeries
-
- edu.rit.numeric.plot.impl.XYPlotSeries
-
- All Implemented Interfaces:
- java.io.Externalizable, java.io.Serializable
public class XYPlotSeries extends PlotSeries
Class XYPlotSeries provides a plot series for an XYPlot. An XYSeries specifies the data points to be plotted. A dot is drawn at each data point in the series. A line segment is drawn from each data point to the next data point in the series.Class XYPlotSeries provides operations to tell where to plot data points as well as which Drawable object to use to plot the points. Class Dots provides several shapes of drawable objects for plotting data points.
Class XYPlotSeries provides operations to tell where to plot line segments as well as which stroke and color objects to use to plot the line segments. Class Strokes provides several kinds of strokes for drawing lines.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description XYPlotSeries()Construct a new XY plot series.XYPlotSeries(XYSeries theDataSeries, java.awt.BasicStroke theStroke, java.awt.Color theColor)Construct a new XY plot series.XYPlotSeries(XYSeries theDataSeries, java.awt.BasicStroke theStroke, java.awt.Color theColor, boolean isSmooth)Construct a new XY plot series.XYPlotSeries(XYSeries theDataSeries, Dots theDots)Construct a new XY plot series.XYPlotSeries(XYSeries theDataSeries, Dots theDots, java.awt.BasicStroke theStroke, java.awt.Color theColor)Construct a new XY plot series.XYPlotSeries(XYSeries theDataSeries, Dots theDots, java.awt.BasicStroke theStroke, java.awt.Color theColor, boolean isSmooth)Construct a new XY plot series.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetDotCount()Returns the number of dots to be plotted.doublegetDotX(int i)Returns the X coordinate of the given dot.doublegetDotY(int i)Returns the Y coordinate of the given dot.intgetLineCount()Returns the number of line segments to be plotted.doublegetLineX1(int i)Returns the starting X coordinate of the given line segment.doublegetLineX2(int i)Returns the ending X coordinate of the given line segment.doublegetLineY1(int i)Returns the starting Y coordinate of the given line segment.doublegetLineY2(int i)Returns the ending Y coordinate of the given line segment.-
Methods inherited from class edu.rit.numeric.plot.impl.PlotSeries
getColor, getDataSeries, getDots, getStroke, isSmooth, readExternal, writeExternal
-
-
-
-
Constructor Detail
-
XYPlotSeries
public XYPlotSeries()
Construct a new XY plot series. This constructor is intended for use only by object deserialization.
-
XYPlotSeries
public XYPlotSeries(XYSeries theDataSeries, Dots theDots)
Construct a new XY plot series. The given data series contains the data points to be plotted. Dots are plotted on the data points using the given drawable object. Lines are not drawn between data points.- Parameters:
theDataSeries- Data series.theDots- Drawable object for plotting data points. If null, dots are not plotted on the data points.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if theDataSeries is null.
-
XYPlotSeries
public XYPlotSeries(XYSeries theDataSeries, java.awt.BasicStroke theStroke, java.awt.Color theColor)
Construct a new XY plot series. The given data series contains the data points to be plotted. No dots are plotted on the data points. Lines are drawn between data points using the given stroke and color. The curve is not smooth.- Parameters:
theDataSeries- Data series.theStroke- Stroke for drawing lines between data points. If null, lines are not drawn between data points.theColor- Color for drawing lines between data points. If null, lines are not drawn between data points.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if theDataSeries is null.
-
XYPlotSeries
public XYPlotSeries(XYSeries theDataSeries, java.awt.BasicStroke theStroke, java.awt.Color theColor, boolean isSmooth)
Construct a new XY plot series. The given data series contains the data points to be plotted. No dots are plotted on the data points. Lines are drawn between data points using the given stroke and color. The curve is smooth or not as specified by the isSmooth argument.- Parameters:
theDataSeries- Data series.theStroke- Stroke for drawing lines between data points. If null, lines are not drawn between data points.theColor- Color for drawing lines between data points. If null, lines are not drawn between data points.isSmooth- True to plot a smooth curve, false to plot straight line segments.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if theDataSeries is null.
-
XYPlotSeries
public XYPlotSeries(XYSeries theDataSeries, Dots theDots, java.awt.BasicStroke theStroke, java.awt.Color theColor)
Construct a new XY plot series. The given data series contains the data points to be plotted. Dots are plotted on the data points using the given drawable object. Lines are drawn between data points using the given stroke and color. The curve is not smooth.- Parameters:
theDataSeries- Data series.theDots- Drawable object for plotting data points. If null, dots are not plotted on the data points.theStroke- Stroke for drawing lines between data points. If null, lines are not drawn between data points.theColor- Color for drawing lines between data points. If null, lines are not drawn between data points.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if theDataSeries is null.
-
XYPlotSeries
public XYPlotSeries(XYSeries theDataSeries, Dots theDots, java.awt.BasicStroke theStroke, java.awt.Color theColor, boolean isSmooth)
Construct a new XY plot series. The given data series contains the data points to be plotted. Dots are plotted on the data points using the given drawable object. Lines are drawn between data points using the given stroke and color. The curve is smooth or not as specified by the isSmooth argument.- Parameters:
theDataSeries- Data series.theDots- Drawable object for plotting data points. If null, dots are not plotted on the data points.theStroke- Stroke for drawing lines between data points. If null, lines are not drawn between data points.theColor- Color for drawing lines between data points. If null, lines are not drawn between data points.isSmooth- True to plot a smooth curve, false to plot straight line segments.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if theDataSeries is null.
-
-
Method Detail
-
getDotCount
public int getDotCount()
Returns the number of dots to be plotted.- Specified by:
getDotCountin classPlotSeries
-
getDotX
public double getDotX(int i)
Returns the X coordinate of the given dot.- Specified by:
getDotXin classPlotSeries- Parameters:
i- Dot index.- Returns:
- X coordinate.
- Throws:
java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if i is not in the range 0 .. getDotCount()-1.
-
getDotY
public double getDotY(int i)
Returns the Y coordinate of the given dot.This method must be overridden in a subclass.
- Specified by:
getDotYin classPlotSeries- Parameters:
i- Dot index.- Returns:
- Y coordinate.
- Throws:
java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if i is not in the range 0 .. getDotCount()-1.
-
getLineCount
public int getLineCount()
Returns the number of line segments to be plotted.- Specified by:
getLineCountin classPlotSeries
-
getLineX1
public double getLineX1(int i)
Returns the starting X coordinate of the given line segment.- Specified by:
getLineX1in classPlotSeries- Parameters:
i- Line segment index.- Returns:
- Starting X coordinate.
- Throws:
java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if i is not in the range 0 .. getLineCount()-1.
-
getLineY1
public double getLineY1(int i)
Returns the starting Y coordinate of the given line segment.- Specified by:
getLineY1in classPlotSeries- Parameters:
i- Line segment index.- Returns:
- Starting Y coordinate.
- Throws:
java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if i is not in the range 0 .. getLineCount()-1.
-
getLineX2
public double getLineX2(int i)
Returns the ending X coordinate of the given line segment.- Specified by:
getLineX2in classPlotSeries- Parameters:
i- Line segment index.- Returns:
- Ending X coordinate.
- Throws:
java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if i is not in the range 0 .. getLineCount()-1.
-
getLineY2
public double getLineY2(int i)
Returns the ending Y coordinate of the given line segment.- Specified by:
getLineY2in classPlotSeries- Parameters:
i- Line segment index.- Returns:
- Ending Y coordinate.
- Throws:
java.lang.IndexOutOfBoundsException- (unchecked exception) Thrown if i is not in the range 0 .. getLineCount()-1.
-
-
DMelt 3.0 © DataMelt by jWork.ORG