Class DefaultPolarItemRenderer

    • Field Detail

      • plot

        private PolarPlot plot
        The plot that the renderer is assigned to.
      • seriesFilled

        private BooleanList seriesFilled
        Flags that control whether the renderer fills each series or not.
      • drawOutlineWhenFilled

        private boolean drawOutlineWhenFilled
        Flag that controls whether an outline is drawn for filled series or not.
      • fillComposite

        private transient java.awt.Composite fillComposite
        The composite to use when filling series.
      • useFillPaint

        private boolean useFillPaint
        A flag that controls whether the fill paint is used for filling shapes.
      • legendLine

        private transient java.awt.Shape legendLine
        The shape that is used to represent a line in the legend.
      • shapesVisible

        private boolean shapesVisible
        Flag that controls whether item shapes are visible or not.
      • connectFirstAndLastPoint

        private boolean connectFirstAndLastPoint
        Flag that controls if the first and last point of the dataset should be connected or not.
      • toolTipGeneratorList

        private ObjectList toolTipGeneratorList
        A list of tool tip generators (one per series).
      • baseToolTipGenerator

        private XYToolTipGenerator baseToolTipGenerator
        The base tool tip generator.
      • urlGenerator

        private XYURLGenerator urlGenerator
        The URL text generator.
      • legendItemToolTipGenerator

        private XYSeriesLabelGenerator legendItemToolTipGenerator
        The legend item tool tip generator.
      • legendItemURLGenerator

        private XYSeriesLabelGenerator legendItemURLGenerator
        The legend item URL generator.
    • Constructor Detail

      • DefaultPolarItemRenderer

        public DefaultPolarItemRenderer()
        Creates a new instance of DefaultPolarItemRenderer
    • Method Detail

      • getDrawOutlineWhenFilled

        public boolean getDrawOutlineWhenFilled()
        Returns true if the renderer will draw an outline around a filled polygon, false otherwise.
        Returns:
        A boolean.
      • setDrawOutlineWhenFilled

        public void setDrawOutlineWhenFilled​(boolean drawOutlineWhenFilled)
        Set the flag that controls whether the outline around a filled polygon will be drawn or not and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        drawOutlineWhenFilled - the flag.
      • getFillComposite

        public java.awt.Composite getFillComposite()
        Get the composite that is used for filling.
        Returns:
        The composite (never null).
      • setFillComposite

        public void setFillComposite​(java.awt.Composite composite)
        Sets the composite which will be used for filling polygons and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        composite - the composite to use (null not permitted).
      • getShapesVisible

        public boolean getShapesVisible()
        Returns true if a shape will be drawn for every item, or false if not.
        Returns:
        A boolean.
      • setShapesVisible

        public void setShapesVisible​(boolean visible)
        Set the flag that controls whether a shape will be drawn for every item, or not and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        visible - the flag.
      • getConnectFirstAndLastPoint

        public boolean getConnectFirstAndLastPoint()
        Returns true if first and last point of a series will be connected, false otherwise.
        Returns:
        The current status of the flag.
      • setConnectFirstAndLastPoint

        public void setConnectFirstAndLastPoint​(boolean connect)
        Set the flag that controls whether the first and last point of a series will be connected or not and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        connect - the flag.
      • isSeriesFilled

        public boolean isSeriesFilled​(int series)
        Returns true if the renderer should fill the specified series, and false otherwise.
        Parameters:
        series - the series index (zero-based).
        Returns:
        A boolean.
      • setSeriesFilled

        public void setSeriesFilled​(int series,
                                    boolean filled)
        Sets a flag that controls whether or not a series is filled.
        Parameters:
        series - the series index.
        filled - the flag.
      • getUseFillPaint

        public boolean getUseFillPaint()
        Returns true if the renderer should use the fill paint setting to fill shapes, and false if it should just use the regular paint.
        Returns:
        A boolean.
        See Also:
        setUseFillPaint(boolean)
      • setUseFillPaint

        public void setUseFillPaint​(boolean flag)
        Sets the flag that controls whether the fill paint is used to fill shapes, and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        flag - the flag.
        See Also:
        getUseFillPaint()
      • getLegendLine

        public java.awt.Shape getLegendLine()
        Returns the shape used to represent a line in the legend.
        Returns:
        The legend line (never null).
        See Also:
        setLegendLine(Shape)
      • setLegendLine

        public void setLegendLine​(java.awt.Shape line)
        Sets the shape used as a line in each legend item and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        line - the line (null not permitted).
        See Also:
        getLegendLine()
      • addEntity

        protected void addEntity​(EntityCollection entities,
                                 java.awt.Shape area,
                                 XYDataset dataset,
                                 int series,
                                 int item,
                                 double entityX,
                                 double entityY)
        Adds an entity to the collection.
        Parameters:
        entities - the entity collection being populated.
        area - the entity area (if null a default will be used).
        dataset - the dataset.
        series - the series.
        item - the item.
        entityX - the entity's center x-coordinate in user space (only used if area is null).
        entityY - the entity's center y-coordinate in user space (only used if area is null).
      • drawSeries

        public void drawSeries​(java.awt.Graphics2D g2,
                               java.awt.geom.Rectangle2D dataArea,
                               PlotRenderingInfo info,
                               PolarPlot plot,
                               XYDataset dataset,
                               int seriesIndex)
        Plots the data for a given series.
        Specified by:
        drawSeries in interface PolarItemRenderer
        Parameters:
        g2 - the drawing surface.
        dataArea - the data area.
        info - collects plot rendering info.
        plot - the plot.
        dataset - the dataset.
        seriesIndex - the series index.
      • drawAngularGridLines

        public void drawAngularGridLines​(java.awt.Graphics2D g2,
                                         PolarPlot plot,
                                         java.util.List ticks,
                                         java.awt.geom.Rectangle2D dataArea)
        Draw the angular gridlines - the spokes.
        Specified by:
        drawAngularGridLines in interface PolarItemRenderer
        Parameters:
        g2 - the drawing surface.
        plot - the plot (null not permitted).
        ticks - the ticks (null not permitted).
        dataArea - the data area.
      • drawRadialGridLines

        public void drawRadialGridLines​(java.awt.Graphics2D g2,
                                        PolarPlot plot,
                                        ValueAxis radialAxis,
                                        java.util.List ticks,
                                        java.awt.geom.Rectangle2D dataArea)
        Draw the radial gridlines - the rings.
        Specified by:
        drawRadialGridLines in interface PolarItemRenderer
        Parameters:
        g2 - the drawing surface (null not permitted).
        plot - the plot (null not permitted).
        radialAxis - the radial axis (null not permitted).
        ticks - the ticks (null not permitted).
        dataArea - the data area.
      • getLegendItem

        public LegendItem getLegendItem​(int series)
        Return the legend for the given series.
        Specified by:
        getLegendItem in interface PolarItemRenderer
        Parameters:
        series - the series index.
        Returns:
        The legend item.
      • getToolTipGenerator

        public XYToolTipGenerator getToolTipGenerator​(int series,
                                                      int item)
        Returns the tooltip generator for the specified series and item.
        Specified by:
        getToolTipGenerator in interface PolarItemRenderer
        Parameters:
        series - the series index.
        item - the item index.
        Returns:
        The tooltip generator (possibly null).
      • equals

        public boolean equals​(java.lang.Object obj)
        Tests this renderer for equality with an arbitrary object.
        Overrides:
        equals in class AbstractRenderer
        Parameters:
        obj - the object (null not permitted).
        Returns:
        true if this renderer is equal to obj, and false otherwise.
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Returns a clone of the renderer.
        Overrides:
        clone in class AbstractRenderer
        Returns:
        A clone.
        Throws:
        java.lang.CloneNotSupportedException - if the renderer cannot be cloned.
      • readObject

        private void readObject​(java.io.ObjectInputStream stream)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
        Provides serialization support.
        Parameters:
        stream - the input stream.
        Throws:
        java.io.IOException - if there is an I/O error.
        java.lang.ClassNotFoundException - if there is a classpath problem.
      • writeObject

        private void writeObject​(java.io.ObjectOutputStream stream)
                          throws java.io.IOException
        Provides serialization support.
        Parameters:
        stream - the output stream.
        Throws:
        java.io.IOException - if there is an I/O error.