@Test public void testGetLegendItems() { XYSeriesCollection d = new XYSeriesCollection(); d.addSeries(new XYSeries("A")); d.addSeries(new XYSeries("B")); DefaultPolarItemRenderer r = new DefaultPolarItemRenderer(); PolarPlot plot = new PolarPlot(); plot.setDataset(d); plot.setRenderer(r); List<LegendItem> items = plot.getLegendItems(); assertEquals(2, items.size()); LegendItem item1 = items.get(0); assertEquals("A", item1.getLabel()); LegendItem item2 = items.get(1); assertEquals("B", item2.getLabel()); }
@Override public List<LegendItem> getLegendItems() { if (this.fixedLegendItems != null) { return new ArrayList<LegendItem>(this.fixedLegendItems); } List<LegendItem> result = new ArrayList<LegendItem>(); int count = this.datasets.size(); for (int datasetIndex = 0; datasetIndex < count; datasetIndex++) { XYDataset dataset = getDataset(datasetIndex); PolarItemRenderer renderer = getRenderer(datasetIndex); if (dataset != null && renderer != null) { int seriesCount = dataset.getSeriesCount(); for (int i = 0; i < seriesCount; i++) { LegendItem item = renderer.getLegendItem(i); result.add(item); } } } return result; }
PolarPlot extends Plot implements ValueAxisPlot, Zoomable,
        RendererChangeListener, Cloneable, Serializable { @Override public List<LegendItem> getLegendItems() { if (this.fixedLegendItems != null) { return new ArrayList<LegendItem>(this.fixedLegendItems); } List<LegendItem> result = new ArrayList<LegendItem>(); int count = this.datasets.size(); for (int datasetIndex = 0; datasetIndex < count; datasetIndex++) { XYDataset dataset = getDataset(datasetIndex); PolarItemRenderer renderer = getRenderer(datasetIndex); if (dataset != null && renderer != null) { int seriesCount = dataset.getSeriesCount(); for (int i = 0; i < seriesCount; i++) { LegendItem item = renderer.getLegendItem(i); result.add(item); } } } return result; } }
PolarPlot extends Plot implements ValueAxisPlot, Zoomable,
        RendererChangeListener, Cloneable, Serializable { @Override public List<LegendItem> getLegendItems() { if (this.fixedLegendItems != null) { return new ArrayList<LegendItem>(this.fixedLegendItems); } List<LegendItem> result = new ArrayList<LegendItem>(); int count = this.datasets.size(); for (int datasetIndex = 0; datasetIndex < count; datasetIndex++) { XYDataset dataset = getDataset(datasetIndex); PolarItemRenderer renderer = getRenderer(datasetIndex); if (dataset != null && renderer != null) { int seriesCount = dataset.getSeriesCount(); for (int i = 0; i < seriesCount; i++) { LegendItem item = renderer.getLegendItem(i); result.add(item); } } } return result; } PolarPlot();  PolarPlot(XYDataset dataset, ValueAxis radiusAxis,
                PolarItemRenderer renderer); }
PolarPlot extends Plot implements ValueAxisPlot, Zoomable,
        RendererChangeListener, Cloneable, Serializable { @Override public List<LegendItem> getLegendItems() { if (this.fixedLegendItems != null) { return new ArrayList<LegendItem>(this.fixedLegendItems); } List<LegendItem> result = new ArrayList<LegendItem>(); int count = this.datasets.size(); for (int datasetIndex = 0; datasetIndex < count; datasetIndex++) { XYDataset dataset = getDataset(datasetIndex); PolarItemRenderer renderer = getRenderer(datasetIndex); if (dataset != null && renderer != null) { int seriesCount = dataset.getSeriesCount(); for (int i = 0; i < seriesCount; i++) { LegendItem item = renderer.getLegendItem(i); result.add(item); } } } return result; } PolarPlot();  PolarPlot(XYDataset dataset, ValueAxis radiusAxis,
                PolarItemRenderer renderer); @Override String getPlotType(); ValueAxis getAxis(); ValueAxis getAxis(int index); void setAxis(ValueAxis axis); void setAxis(int index, ValueAxis axis); void setAxis(int index, ValueAxis axis, boolean notify); PolarAxisLocation getAxisLocation(); PolarAxisLocation getAxisLocation(int index); void setAxisLocation(PolarAxisLocation location); void setAxisLocation(PolarAxisLocation location, boolean notify); void setAxisLocation(int index, PolarAxisLocation location); void setAxisLocation(int index, PolarAxisLocation location,
            boolean notify); int getAxisCount(); XYDataset getDataset(); XYDataset getDataset(int index); void setDataset(XYDataset dataset); void setDataset(int index, XYDataset dataset); int getDatasetCount(); int indexOf(XYDataset dataset); PolarItemRenderer getRenderer(); PolarItemRenderer getRenderer(int index); void setRenderer(PolarItemRenderer renderer); void setRenderer(int index, PolarItemRenderer renderer); void setRenderer(int index, PolarItemRenderer renderer,
                            boolean notify); TickUnit getAngleTickUnit(); void setAngleTickUnit(TickUnit unit); double getAngleOffset(); void setAngleOffset(double offset); boolean isCounterClockwise(); void setCounterClockwise(boolean counterClockwise); boolean isAngleLabelsVisible(); void setAngleLabelsVisible(boolean visible); Font getAngleLabelFont(); void setAngleLabelFont(Font font); Paint getAngleLabelPaint(); void setAngleLabelPaint(Paint paint); boolean isAngleGridlinesVisible(); void setAngleGridlinesVisible(boolean visible); Stroke getAngleGridlineStroke(); void setAngleGridlineStroke(Stroke stroke); Paint getAngleGridlinePaint(); void setAngleGridlinePaint(Paint paint); boolean isRadiusGridlinesVisible(); void setRadiusGridlinesVisible(boolean visible); Stroke getRadiusGridlineStroke(); void setRadiusGridlineStroke(Stroke stroke); Paint getRadiusGridlinePaint(); void setRadiusGridlinePaint(Paint paint); boolean isRadiusMinorGridlinesVisible(); void setRadiusMinorGridlinesVisible(boolean flag); int getMargin(); void setMargin(int margin); List<LegendItem> getFixedLegendItems(); void setFixedLegendItems(List<LegendItem> items); void addCornerTextItem(String text); void removeCornerTextItem(String text); void clearCornerTextItems(); void mapDatasetToAxis(int index, int axisIndex); void mapDatasetToAxes(int index, List<Integer> axisIndices); ValueAxis getAxisForDataset(int index); int getAxisIndex(ValueAxis axis); int getIndexOf(PolarItemRenderer renderer); @Override void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,
            PlotState parentState, PlotRenderingInfo info); @Override void zoom(double percent); @Override Range getDataRange(ValueAxis axis); @Override void datasetChanged(DatasetChangeEvent event); @Override void rendererChanged(RendererChangeEvent event); @Override List<LegendItem> getLegendItems(); @Override boolean equals(Object obj); @Override Object clone(); @Override void zoomDomainAxes(double factor, PlotRenderingInfo state,
                               Point2D source); @Override void zoomDomainAxes(double factor, PlotRenderingInfo state,
                               Point2D source, boolean useAnchor); @Override void zoomDomainAxes(double lowerPercent, double upperPercent,
                               PlotRenderingInfo state, Point2D source); @Override void zoomRangeAxes(double factor, PlotRenderingInfo state,
                              Point2D source); @Override void zoomRangeAxes(double factor, PlotRenderingInfo info,
                              Point2D source, boolean useAnchor); @Override void zoomRangeAxes(double lowerPercent, double upperPercent,
                              PlotRenderingInfo state, Point2D source); @Override boolean isDomainZoomable(); @Override boolean isRangeZoomable(); @Override PlotOrientation getOrientation(); Point translateToJava2D(double angleDegrees, double radius,
            ValueAxis axis, Rectangle2D dataArea); }
PolarPlot extends Plot implements ValueAxisPlot, Zoomable,
        RendererChangeListener, Cloneable, Serializable { @Override public List<LegendItem> getLegendItems() { if (this.fixedLegendItems != null) { return new ArrayList<LegendItem>(this.fixedLegendItems); } List<LegendItem> result = new ArrayList<LegendItem>(); int count = this.datasets.size(); for (int datasetIndex = 0; datasetIndex < count; datasetIndex++) { XYDataset dataset = getDataset(datasetIndex); PolarItemRenderer renderer = getRenderer(datasetIndex); if (dataset != null && renderer != null) { int seriesCount = dataset.getSeriesCount(); for (int i = 0; i < seriesCount; i++) { LegendItem item = renderer.getLegendItem(i); result.add(item); } } } return result; } PolarPlot();  PolarPlot(XYDataset dataset, ValueAxis radiusAxis,
                PolarItemRenderer renderer); @Override String getPlotType(); ValueAxis getAxis(); ValueAxis getAxis(int index); void setAxis(ValueAxis axis); void setAxis(int index, ValueAxis axis); void setAxis(int index, ValueAxis axis, boolean notify); PolarAxisLocation getAxisLocation(); PolarAxisLocation getAxisLocation(int index); void setAxisLocation(PolarAxisLocation location); void setAxisLocation(PolarAxisLocation location, boolean notify); void setAxisLocation(int index, PolarAxisLocation location); void setAxisLocation(int index, PolarAxisLocation location,
            boolean notify); int getAxisCount(); XYDataset getDataset(); XYDataset getDataset(int index); void setDataset(XYDataset dataset); void setDataset(int index, XYDataset dataset); int getDatasetCount(); int indexOf(XYDataset dataset); PolarItemRenderer getRenderer(); PolarItemRenderer getRenderer(int index); void setRenderer(PolarItemRenderer renderer); void setRenderer(int index, PolarItemRenderer renderer); void setRenderer(int index, PolarItemRenderer renderer,
                            boolean notify); TickUnit getAngleTickUnit(); void setAngleTickUnit(TickUnit unit); double getAngleOffset(); void setAngleOffset(double offset); boolean isCounterClockwise(); void setCounterClockwise(boolean counterClockwise); boolean isAngleLabelsVisible(); void setAngleLabelsVisible(boolean visible); Font getAngleLabelFont(); void setAngleLabelFont(Font font); Paint getAngleLabelPaint(); void setAngleLabelPaint(Paint paint); boolean isAngleGridlinesVisible(); void setAngleGridlinesVisible(boolean visible); Stroke getAngleGridlineStroke(); void setAngleGridlineStroke(Stroke stroke); Paint getAngleGridlinePaint(); void setAngleGridlinePaint(Paint paint); boolean isRadiusGridlinesVisible(); void setRadiusGridlinesVisible(boolean visible); Stroke getRadiusGridlineStroke(); void setRadiusGridlineStroke(Stroke stroke); Paint getRadiusGridlinePaint(); void setRadiusGridlinePaint(Paint paint); boolean isRadiusMinorGridlinesVisible(); void setRadiusMinorGridlinesVisible(boolean flag); int getMargin(); void setMargin(int margin); List<LegendItem> getFixedLegendItems(); void setFixedLegendItems(List<LegendItem> items); void addCornerTextItem(String text); void removeCornerTextItem(String text); void clearCornerTextItems(); void mapDatasetToAxis(int index, int axisIndex); void mapDatasetToAxes(int index, List<Integer> axisIndices); ValueAxis getAxisForDataset(int index); int getAxisIndex(ValueAxis axis); int getIndexOf(PolarItemRenderer renderer); @Override void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,
            PlotState parentState, PlotRenderingInfo info); @Override void zoom(double percent); @Override Range getDataRange(ValueAxis axis); @Override void datasetChanged(DatasetChangeEvent event); @Override void rendererChanged(RendererChangeEvent event); @Override List<LegendItem> getLegendItems(); @Override boolean equals(Object obj); @Override Object clone(); @Override void zoomDomainAxes(double factor, PlotRenderingInfo state,
                               Point2D source); @Override void zoomDomainAxes(double factor, PlotRenderingInfo state,
                               Point2D source, boolean useAnchor); @Override void zoomDomainAxes(double lowerPercent, double upperPercent,
                               PlotRenderingInfo state, Point2D source); @Override void zoomRangeAxes(double factor, PlotRenderingInfo state,
                              Point2D source); @Override void zoomRangeAxes(double factor, PlotRenderingInfo info,
                              Point2D source, boolean useAnchor); @Override void zoomRangeAxes(double lowerPercent, double upperPercent,
                              PlotRenderingInfo state, Point2D source); @Override boolean isDomainZoomable(); @Override boolean isRangeZoomable(); @Override PlotOrientation getOrientation(); Point translateToJava2D(double angleDegrees, double radius,
            ValueAxis axis, Rectangle2D dataArea); static final double DEFAULT_ANGLE_TICK_UNIT_SIZE; static final double DEFAULT_ANGLE_OFFSET; static final Stroke DEFAULT_GRIDLINE_STROKE; static final Paint DEFAULT_GRIDLINE_PAINT; }