Documentation of 'edu.rit.numeric.plot.impl.SegmentedPlotSeries' Java class
SegmentedPlotSeries
edu.rit.numeric.plot.impl

Class SegmentedPlotSeries

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable


    public class SegmentedPlotSeries
    extends PlotSeries
    Class SegmentedPlotSeries provides a plot series for an XYPlot. An XYSeries specifies the data points to be plotted. The data points are divided into pairs. Each pair of data points specifies the starting and ending coordinates of a line segment. A dot is drawn at each endpoint of each line segment. A line segment's starting coordinates need not be the same as the previous line segment's ending coordinates. If the data series has an odd number of data points, the last data point is ignored.

    Class SegmentedPlotSeries 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 SegmentedPlotSeries 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int getDotCount()
      Returns the number of dots to be plotted.
      double getDotX(int i)
      Returns the X coordinate of the given dot.
      double getDotY(int i)
      Returns the Y coordinate of the given dot.
      int getLineCount()
      Returns the number of line segments to be plotted.
      double getLineX1(int i)
      Returns the starting X coordinate of the given line segment.
      double getLineX2(int i)
      Returns the ending X coordinate of the given line segment.
      double getLineY1(int i)
      Returns the starting Y coordinate of the given line segment.
      double getLineY2(int i)
      Returns the ending Y coordinate of the given line segment.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SegmentedPlotSeries

        public SegmentedPlotSeries()
        Construct a new segmented plot series. This constructor is intended for use only by object deserialization.
      • SegmentedPlotSeries

        public SegmentedPlotSeries(XYSeries theDataSeries,
                                   Dots theDots)
        Construct a new segmented 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.
      • SegmentedPlotSeries

        public SegmentedPlotSeries(XYSeries theDataSeries,
                                   java.awt.BasicStroke theStroke,
                                   java.awt.Color theColor)
        Construct a new segmented 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.
        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.
      • SegmentedPlotSeries

        public SegmentedPlotSeries(XYSeries theDataSeries,
                                   Dots theDots,
                                   java.awt.BasicStroke theStroke,
                                   java.awt.Color theColor)
        Construct a new segmented 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.
        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.
    • Method Detail

      • getDotCount

        public int getDotCount()
        Returns the number of dots to be plotted.
        Specified by:
        getDotCount in class PlotSeries
      • getDotX

        public double getDotX(int i)
        Returns the X coordinate of the given dot.
        Specified by:
        getDotX in class PlotSeries
        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:
        getDotY in class PlotSeries
        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:
        getLineCount in class PlotSeries
      • getLineX1

        public double getLineX1(int i)
        Returns the starting X coordinate of the given line segment.
        Specified by:
        getLineX1 in class PlotSeries
        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:
        getLineY1 in class PlotSeries
        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:
        getLineX2 in class PlotSeries
        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:
        getLineY2 in class PlotSeries
        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

You see the box below because you did not login.