Documentation of 'org.jfree.chart.renderer.xy.AbstractXYItemRenderer' Java class
AbstractXYItemRenderer
org.jfree.chart.renderer.xy

Class AbstractXYItemRenderer

    • Method Detail

      • getPassCount

        public int getPassCount()
        Returns the number of passes through the data that the renderer requires in order to draw the chart. Most charts will require a single pass, but some require two passes.
        Specified by:
        getPassCount in interface XYItemRenderer
        Returns:
        The pass count.
      • getPlot

        public XYPlot getPlot()
        Returns the plot that the renderer is assigned to.
        Specified by:
        getPlot in interface XYItemRenderer
        Returns:
        The plot (possibly null).
      • setPlot

        public void setPlot(XYPlot plot)
        Sets the plot that the renderer is assigned to.
        Specified by:
        setPlot in interface XYItemRenderer
        Parameters:
        plot - the plot (null permitted).
      • initialise

        public XYItemRendererState initialise(java.awt.Graphics2D g2,
                                              java.awt.geom.Rectangle2D dataArea,
                                              XYPlot plot,
                                              XYDataset data,
                                              PlotRenderingInfo info)
        Initialises the renderer and returns a state object that should be passed to all subsequent calls to the drawItem() method.

        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
        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 (never null).
      • getItemLabelGenerator

        public XYItemLabelGenerator getItemLabelGenerator(int series,
                                                          int item)
        Returns the label generator for a data item. This implementation simply passes control to the getSeriesItemLabelGenerator(int) method. If, for some reason, you want a different generator for individual items, you can override this method.
        Specified by:
        getItemLabelGenerator in interface XYItemRenderer
        Parameters:
        series - the series index (zero based).
        item - the item index (zero based).
        Returns:
        The generator (possibly null).
      • getToolTipGenerator

        public XYToolTipGenerator getToolTipGenerator(int series,
                                                      int item)
        Returns the tool tip generator for a data item. If, for some reason, you want a different generator for individual items, you can override this method.
        Specified by:
        getToolTipGenerator in interface XYItemRenderer
        Parameters:
        series - the series index (zero based).
        item - the item index (zero based).
        Returns:
        The generator (possibly null).
      • addAnnotation

        public void addAnnotation(XYAnnotation annotation)
        Adds an annotation and sends a RendererChangeEvent to all registered listeners. The annotation is added to the foreground layer.
        Specified by:
        addAnnotation in interface XYItemRenderer
        Parameters:
        annotation - the annotation (null not permitted).
      • addAnnotation

        public void addAnnotation(XYAnnotation annotation,
                                  org.jfree.ui.Layer layer)
        Adds an annotation to the specified layer and sends a RendererChangeEvent to all registered listeners.
        Specified by:
        addAnnotation in interface XYItemRenderer
        Parameters:
        annotation - the annotation (null not permitted).
        layer - the layer (null not permitted).
      • removeAnnotation

        public boolean removeAnnotation(XYAnnotation annotation)
        Removes the specified annotation and sends a RendererChangeEvent to all registered listeners.
        Specified by:
        removeAnnotation in interface XYItemRenderer
        Parameters:
        annotation - the annotation to remove (null not permitted).
        Returns:
        A boolean to indicate whether or not the annotation was successfully removed.
      • getAnnotations

        public java.util.Collection getAnnotations()
        Returns a collection of the annotations that are assigned to the renderer.
        Returns:
        A collection of annotations (possibly empty but never null).
        Since:
        1.0.13
      • findDomainBounds

        public Range findDomainBounds(XYDataset dataset)
        Returns the lower and upper bounds (range) of the x-values in the specified dataset.
        Specified by:
        findDomainBounds in interface XYItemRenderer
        Parameters:
        dataset - the dataset (null permitted).
        Returns:
        The range (null if the dataset is null or empty).
        See Also:
        findRangeBounds(XYDataset)
      • findRangeBounds

        public Range findRangeBounds(XYDataset dataset)
        Returns the range of values the renderer requires to display all the items from the specified dataset.
        Specified by:
        findRangeBounds in interface XYItemRenderer
        Parameters:
        dataset - the dataset (null permitted).
        Returns:
        The range (null if the dataset is null or empty).
        See Also:
        findDomainBounds(XYDataset)
      • getLegendItems

        public LegendItemCollection getLegendItems()
        Returns a (possibly empty) collection of legend items for the series that this renderer is responsible for drawing.
        Specified by:
        getLegendItems in interface LegendItemSource
        Returns:
        The legend item collection (never null).
      • getLegendItem

        public LegendItem getLegendItem(int datasetIndex,
                                        int series)
        Returns a default legend item for the specified series. Subclasses should override this method to generate customised items.
        Specified by:
        getLegendItem in interface XYItemRenderer
        Parameters:
        datasetIndex - the dataset index (zero-based).
        series - the series index (zero-based).
        Returns:
        A legend item for the series.
      • fillDomainGridBand

        public void fillDomainGridBand(java.awt.Graphics2D g2,
                                       XYPlot plot,
                                       ValueAxis axis,
                                       java.awt.geom.Rectangle2D dataArea,
                                       double start,
                                       double end)
        Fills a band between two values on the axis. This can be used to color bands between the grid lines.
        Specified by:
        fillDomainGridBand in interface XYItemRenderer
        Parameters:
        g2 - the graphics device.
        plot - the plot.
        axis - the domain axis.
        dataArea - the data area.
        start - the start value.
        end - the end value.
      • fillRangeGridBand

        public void fillRangeGridBand(java.awt.Graphics2D g2,
                                      XYPlot plot,
                                      ValueAxis axis,
                                      java.awt.geom.Rectangle2D dataArea,
                                      double start,
                                      double end)
        Fills a band between two values on the range axis. This can be used to color bands between the grid lines.
        Specified by:
        fillRangeGridBand in interface XYItemRenderer
        Parameters:
        g2 - the graphics device.
        plot - the plot.
        axis - the range axis.
        dataArea - the data area.
        start - the start value.
        end - the end value.
      • drawDomainGridLine

        public void drawDomainGridLine(java.awt.Graphics2D g2,
                                       XYPlot plot,
                                       ValueAxis axis,
                                       java.awt.geom.Rectangle2D dataArea,
                                       double value)
        Draws a grid line against the range axis.
        Specified by:
        drawDomainGridLine in interface XYItemRenderer
        Parameters:
        g2 - the graphics device.
        plot - the plot.
        axis - the value axis.
        dataArea - the area for plotting data (not yet adjusted for any 3D effect).
        value - the value at which the grid line should be drawn.
      • drawDomainLine

        public void drawDomainLine(java.awt.Graphics2D g2,
                                   XYPlot plot,
                                   ValueAxis axis,
                                   java.awt.geom.Rectangle2D dataArea,
                                   double value,
                                   java.awt.Paint paint,
                                   java.awt.Stroke stroke)
        Draws a line perpendicular to the domain axis.
        Parameters:
        g2 - the graphics device.
        plot - the plot.
        axis - the value axis.
        dataArea - the area for plotting data (not yet adjusted for any 3D effect).
        value - the value at which the grid line should be drawn.
        paint - the paint (null not permitted).
        stroke - the stroke (null not permitted).
        Since:
        1.0.5
      • drawRangeLine

        public void drawRangeLine(java.awt.Graphics2D g2,
                                  XYPlot plot,
                                  ValueAxis axis,
                                  java.awt.geom.Rectangle2D dataArea,
                                  double value,
                                  java.awt.Paint paint,
                                  java.awt.Stroke stroke)
        Draws a line perpendicular to the range axis.
        Specified by:
        drawRangeLine in interface XYItemRenderer
        Parameters:
        g2 - the graphics device.
        plot - the plot.
        axis - the value axis.
        dataArea - the area for plotting data (not yet adjusted for any 3D effect).
        value - the value at which the grid line should be drawn.
        paint - the paint.
        stroke - the stroke.
      • drawDomainMarker

        public void drawDomainMarker(java.awt.Graphics2D g2,
                                     XYPlot plot,
                                     ValueAxis domainAxis,
                                     Marker marker,
                                     java.awt.geom.Rectangle2D dataArea)
        Draws a vertical line on the chart to represent a 'range marker'.
        Specified by:
        drawDomainMarker in interface XYItemRenderer
        Parameters:
        g2 - the graphics device.
        plot - the plot.
        domainAxis - the domain axis.
        marker - the marker line.
        dataArea - the axis data area.
      • drawRangeMarker

        public void drawRangeMarker(java.awt.Graphics2D g2,
                                    XYPlot plot,
                                    ValueAxis rangeAxis,
                                    Marker marker,
                                    java.awt.geom.Rectangle2D dataArea)
        Draws a horizontal line across the chart to represent a 'range marker'.
        Specified by:
        drawRangeMarker in interface XYItemRenderer
        Parameters:
        g2 - the graphics device.
        plot - the plot.
        rangeAxis - the range axis.
        marker - the marker line.
        dataArea - the axis data area.
      • equals

        public boolean equals(java.lang.Object obj)
        Tests this renderer for equality with another object.
        Overrides:
        equals in class AbstractRenderer
        Parameters:
        obj - the object (null permitted).
        Returns:
        true or false.
      • drawAnnotations

        public void drawAnnotations(java.awt.Graphics2D g2,
                                    java.awt.geom.Rectangle2D dataArea,
                                    ValueAxis domainAxis,
                                    ValueAxis rangeAxis,
                                    org.jfree.ui.Layer layer,
                                    PlotRenderingInfo info)
        Draws all the annotations for the specified layer.
        Specified by:
        drawAnnotations in interface XYItemRenderer
        Parameters:
        g2 - the graphics device.
        dataArea - the data area.
        domainAxis - the domain axis.
        rangeAxis - the range axis.
        layer - the layer.
        info - the plot rendering info.
      • isPointInRect

        public static boolean isPointInRect(java.awt.geom.Rectangle2D rect,
                                            double x,
                                            double y)
        Returns true if the specified point (x, y) falls within or on the boundary of the specified rectangle.
        Parameters:
        rect - the rectangle (null not permitted).
        x - the x-coordinate.
        y - the y-coordinate.
        Returns:
        A boolean.
        Since:
        1.0.10

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.