Class XYSplineRenderer

    • Field Detail

      • precision

        private int precision
        Resolution of splines (number of line segments between points)
    • Constructor Detail

      • XYSplineRenderer

        public XYSplineRenderer()
        Creates a new instance with the precision attribute defaulting to 5 and no fill of the area 'under' the spline.
      • XYSplineRenderer

        public XYSplineRenderer​(int precision)
        Creates a new renderer with the specified precision and no fill of the area 'under' (between '0' and) the spline.
        Parameters:
        precision - the number of points between data items.
      • XYSplineRenderer

        public XYSplineRenderer​(int precision,
                                XYSplineRenderer.FillType fillType)
        Creates a new renderer with the specified precision and specified fill of the area 'under' (between '0' and) the spline.
        Parameters:
        precision - the number of points between data items.
        fillType - the type of fill beneath the curve (null not permitted).
    • Method Detail

      • getPrecision

        public int getPrecision()
        Returns the number of line segments used to approximate the spline curve between data points.
        Returns:
        The number of line segments.
        See Also:
        setPrecision(int)
      • setPrecision

        public void setPrecision​(int p)
        Set the resolution of splines and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        p - number of line segments between points (must be > 0).
        See Also:
        getPrecision()
      • getGradientPaintTransformer

        public GradientPaintTransformer getGradientPaintTransformer()
        Returns the gradient paint transformer, or null.
        Returns:
        The gradient paint transformer (possibly null).
      • setGradientPaintTransformer

        public void setGradientPaintTransformer​(GradientPaintTransformer gpt)
        Sets the gradient paint transformer and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        gpt - the transformer (null permitted).
      • initialise

        public XYItemRendererState initialise​(java.awt.Graphics2D g2,
                                              java.awt.geom.Rectangle2D dataArea,
                                              XYPlot plot,
                                              XYDataset data,
                                              PlotRenderingInfo info)
        Initialises the renderer.

        This method will be called before the first item is rendered, giving the renderer an opportunity to initialise any state information it wants to maintain. The renderer can do nothing if it chooses.

        Specified by:
        initialise in interface XYItemRenderer
        Overrides:
        initialise in class XYLineAndShapeRenderer
        Parameters:
        g2 - the graphics device.
        dataArea - the area inside the axes.
        plot - the plot.
        data - the data.
        info - an optional info collection object to return data back to the caller.
        Returns:
        The renderer state.
      • drawPrimaryLineAsPath

        protected void drawPrimaryLineAsPath​(XYItemRendererState state,
                                             java.awt.Graphics2D g2,
                                             XYPlot plot,
                                             XYDataset dataset,
                                             int pass,
                                             int series,
                                             int item,
                                             ValueAxis xAxis,
                                             ValueAxis yAxis,
                                             java.awt.geom.Rectangle2D dataArea)
        Draws the item (first pass). This method draws the lines connecting the items. Instead of drawing separate lines, a GeneralPath is constructed and drawn at the end of the series painting.
        Overrides:
        drawPrimaryLineAsPath in class XYLineAndShapeRenderer
        Parameters:
        g2 - the graphics device.
        state - the renderer state.
        plot - the plot (can be used to obtain standard color information etc).
        dataset - the dataset.
        pass - the pass.
        series - the series index (zero-based).
        item - the item index (zero-based).
        xAxis - the domain axis.
        yAxis - the range axis.
        dataArea - the area within which the data is being drawn.
      • solveTridiag

        private void solveTridiag​(float[] sub,
                                  float[] diag,
                                  float[] sup,
                                  float[] b,
                                  int n)
      • equals

        public boolean equals​(java.lang.Object obj)
        Tests this renderer for equality with an arbitrary object.
        Overrides:
        equals in class XYLineAndShapeRenderer
        Parameters:
        obj - the object (null permitted).
        Returns:
        A boolean.