@Test public void testGetLegendItems() { DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(35.0, "S1", "C1"); dataset.addValue(45.0, "S1", "C2"); dataset.addValue(55.0, "S2", "C1"); dataset.addValue(15.0, "S2", "C2"); SpiderWebPlot plot = new SpiderWebPlot(dataset); List<LegendItem> legendItems = plot.getLegendItems(); assertEquals(2, legendItems.size()); LegendItem item1 = legendItems.get(0); assertEquals("S1", item1.getLabel()); assertEquals("S1", item1.getSeriesKey()); assertEquals(0, item1.getSeriesIndex()); assertEquals(dataset, item1.getDataset()); assertEquals(0, item1.getDatasetIndex()); LegendItem item2 = legendItems.get(1); assertEquals("S2", item2.getLabel()); assertEquals("S2", item2.getSeriesKey()); assertEquals(1, item2.getSeriesIndex()); assertEquals(dataset, item2.getDataset()); assertEquals(0, item2.getDatasetIndex()); }
@Override public List<LegendItem> getLegendItems() { List<LegendItem> result = new ArrayList<LegendItem>(); if (getDataset() == null) { return result; } List<Comparable> keys = null; if (this.dataExtractOrder == TableOrder.BY_ROW) { keys = this.dataset.getRowKeys(); } else if (this.dataExtractOrder == TableOrder.BY_COLUMN) { keys = this.dataset.getColumnKeys(); } if (keys == null) { return result; } int series = 0; Shape shape = getLegendItemShape(); for (Comparable key : keys) { String label = key.toString(); String description = label; Paint paint = getSeriesPaint(series); Paint outlinePaint = getSeriesOutlinePaint(series); Stroke stroke = getSeriesOutlineStroke(series); LegendItem item = new LegendItem(label, description, null, null, shape, paint, stroke, outlinePaint); item.setDataset(getDataset()); item.setSeriesKey(key); item.setSeriesIndex(series); result.add(item); series++; } return result; }
SpiderWebPlot extends Plot implements Cloneable, Serializable { @Override public List<LegendItem> getLegendItems() { List<LegendItem> result = new ArrayList<LegendItem>(); if (getDataset() == null) { return result; } List<Comparable> keys = null; if (this.dataExtractOrder == TableOrder.BY_ROW) { keys = this.dataset.getRowKeys(); } else if (this.dataExtractOrder == TableOrder.BY_COLUMN) { keys = this.dataset.getColumnKeys(); } if (keys == null) { return result; } int series = 0; Shape shape = getLegendItemShape(); for (Comparable key : keys) { String label = key.toString(); String description = label; Paint paint = getSeriesPaint(series); Paint outlinePaint = getSeriesOutlinePaint(series); Stroke stroke = getSeriesOutlineStroke(series); LegendItem item = new LegendItem(label, description, null, null, shape, paint, stroke, outlinePaint); item.setDataset(getDataset()); item.setSeriesKey(key); item.setSeriesIndex(series); result.add(item); series++; } return result; } }
SpiderWebPlot extends Plot implements Cloneable, Serializable { @Override public List<LegendItem> getLegendItems() { List<LegendItem> result = new ArrayList<LegendItem>(); if (getDataset() == null) { return result; } List<Comparable> keys = null; if (this.dataExtractOrder == TableOrder.BY_ROW) { keys = this.dataset.getRowKeys(); } else if (this.dataExtractOrder == TableOrder.BY_COLUMN) { keys = this.dataset.getColumnKeys(); } if (keys == null) { return result; } int series = 0; Shape shape = getLegendItemShape(); for (Comparable key : keys) { String label = key.toString(); String description = label; Paint paint = getSeriesPaint(series); Paint outlinePaint = getSeriesOutlinePaint(series); Stroke stroke = getSeriesOutlineStroke(series); LegendItem item = new LegendItem(label, description, null, null, shape, paint, stroke, outlinePaint); item.setDataset(getDataset()); item.setSeriesKey(key); item.setSeriesIndex(series); result.add(item); series++; } return result; } SpiderWebPlot();  SpiderWebPlot(CategoryDataset dataset);  SpiderWebPlot(CategoryDataset dataset, TableOrder extract); }
SpiderWebPlot extends Plot implements Cloneable, Serializable { @Override public List<LegendItem> getLegendItems() { List<LegendItem> result = new ArrayList<LegendItem>(); if (getDataset() == null) { return result; } List<Comparable> keys = null; if (this.dataExtractOrder == TableOrder.BY_ROW) { keys = this.dataset.getRowKeys(); } else if (this.dataExtractOrder == TableOrder.BY_COLUMN) { keys = this.dataset.getColumnKeys(); } if (keys == null) { return result; } int series = 0; Shape shape = getLegendItemShape(); for (Comparable key : keys) { String label = key.toString(); String description = label; Paint paint = getSeriesPaint(series); Paint outlinePaint = getSeriesOutlinePaint(series); Stroke stroke = getSeriesOutlineStroke(series); LegendItem item = new LegendItem(label, description, null, null, shape, paint, stroke, outlinePaint); item.setDataset(getDataset()); item.setSeriesKey(key); item.setSeriesIndex(series); result.add(item); series++; } return result; } SpiderWebPlot();  SpiderWebPlot(CategoryDataset dataset);  SpiderWebPlot(CategoryDataset dataset, TableOrder extract); @Override String getPlotType(); CategoryDataset getDataset(); void setDataset(CategoryDataset dataset); boolean isWebFilled(); void setWebFilled(boolean flag); TableOrder getDataExtractOrder(); void setDataExtractOrder(TableOrder order); double getHeadPercent(); void setHeadPercent(double percent); double getStartAngle(); void setStartAngle(double angle); double getMaxValue(); void setMaxValue(double value); Rotation getDirection(); void setDirection(Rotation direction); double getInteriorGap(); void setInteriorGap(double percent); double getAxisLabelGap(); void setAxisLabelGap(double gap); Paint getAxisLinePaint(); void setAxisLinePaint(Paint paint); Stroke getAxisLineStroke(); void setAxisLineStroke(Stroke stroke); Paint getSeriesPaint(); void setSeriesPaint(Paint paint); Paint getSeriesPaint(int series); void setSeriesPaint(int series, Paint paint); Paint getBaseSeriesPaint(); void setBaseSeriesPaint(Paint paint); Paint getSeriesOutlinePaint(); void setSeriesOutlinePaint(Paint paint); Paint getSeriesOutlinePaint(int series); void setSeriesOutlinePaint(int series, Paint paint); Paint getBaseSeriesOutlinePaint(); void setBaseSeriesOutlinePaint(Paint paint); Stroke getSeriesOutlineStroke(); void setSeriesOutlineStroke(Stroke stroke); Stroke getSeriesOutlineStroke(int series); void setSeriesOutlineStroke(int series, Stroke stroke); Stroke getBaseSeriesOutlineStroke(); void setBaseSeriesOutlineStroke(Stroke stroke); Shape getLegendItemShape(); void setLegendItemShape(Shape shape); Font getLabelFont(); void setLabelFont(Font font); Paint getLabelPaint(); void setLabelPaint(Paint paint); CategoryItemLabelGenerator getLabelGenerator(); void setLabelGenerator(CategoryItemLabelGenerator generator); CategoryToolTipGenerator getToolTipGenerator(); void setToolTipGenerator(CategoryToolTipGenerator generator); CategoryURLGenerator getURLGenerator(); void setURLGenerator(CategoryURLGenerator generator); @Override List<LegendItem> getLegendItems(); @Override void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,
            PlotState parentState, PlotRenderingInfo info); @Override boolean equals(Object obj); @Override Object clone(); }
SpiderWebPlot extends Plot implements Cloneable, Serializable { @Override public List<LegendItem> getLegendItems() { List<LegendItem> result = new ArrayList<LegendItem>(); if (getDataset() == null) { return result; } List<Comparable> keys = null; if (this.dataExtractOrder == TableOrder.BY_ROW) { keys = this.dataset.getRowKeys(); } else if (this.dataExtractOrder == TableOrder.BY_COLUMN) { keys = this.dataset.getColumnKeys(); } if (keys == null) { return result; } int series = 0; Shape shape = getLegendItemShape(); for (Comparable key : keys) { String label = key.toString(); String description = label; Paint paint = getSeriesPaint(series); Paint outlinePaint = getSeriesOutlinePaint(series); Stroke stroke = getSeriesOutlineStroke(series); LegendItem item = new LegendItem(label, description, null, null, shape, paint, stroke, outlinePaint); item.setDataset(getDataset()); item.setSeriesKey(key); item.setSeriesIndex(series); result.add(item); series++; } return result; } SpiderWebPlot();  SpiderWebPlot(CategoryDataset dataset);  SpiderWebPlot(CategoryDataset dataset, TableOrder extract); @Override String getPlotType(); CategoryDataset getDataset(); void setDataset(CategoryDataset dataset); boolean isWebFilled(); void setWebFilled(boolean flag); TableOrder getDataExtractOrder(); void setDataExtractOrder(TableOrder order); double getHeadPercent(); void setHeadPercent(double percent); double getStartAngle(); void setStartAngle(double angle); double getMaxValue(); void setMaxValue(double value); Rotation getDirection(); void setDirection(Rotation direction); double getInteriorGap(); void setInteriorGap(double percent); double getAxisLabelGap(); void setAxisLabelGap(double gap); Paint getAxisLinePaint(); void setAxisLinePaint(Paint paint); Stroke getAxisLineStroke(); void setAxisLineStroke(Stroke stroke); Paint getSeriesPaint(); void setSeriesPaint(Paint paint); Paint getSeriesPaint(int series); void setSeriesPaint(int series, Paint paint); Paint getBaseSeriesPaint(); void setBaseSeriesPaint(Paint paint); Paint getSeriesOutlinePaint(); void setSeriesOutlinePaint(Paint paint); Paint getSeriesOutlinePaint(int series); void setSeriesOutlinePaint(int series, Paint paint); Paint getBaseSeriesOutlinePaint(); void setBaseSeriesOutlinePaint(Paint paint); Stroke getSeriesOutlineStroke(); void setSeriesOutlineStroke(Stroke stroke); Stroke getSeriesOutlineStroke(int series); void setSeriesOutlineStroke(int series, Stroke stroke); Stroke getBaseSeriesOutlineStroke(); void setBaseSeriesOutlineStroke(Stroke stroke); Shape getLegendItemShape(); void setLegendItemShape(Shape shape); Font getLabelFont(); void setLabelFont(Font font); Paint getLabelPaint(); void setLabelPaint(Paint paint); CategoryItemLabelGenerator getLabelGenerator(); void setLabelGenerator(CategoryItemLabelGenerator generator); CategoryToolTipGenerator getToolTipGenerator(); void setToolTipGenerator(CategoryToolTipGenerator generator); CategoryURLGenerator getURLGenerator(); void setURLGenerator(CategoryURLGenerator generator); @Override List<LegendItem> getLegendItems(); @Override void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,
            PlotState parentState, PlotRenderingInfo info); @Override boolean equals(Object obj); @Override Object clone(); static final double DEFAULT_HEAD; static final double DEFAULT_AXIS_LABEL_GAP; static final double DEFAULT_INTERIOR_GAP; static final double MAX_INTERIOR_GAP; static final double DEFAULT_START_ANGLE; static final Font DEFAULT_LABEL_FONT; static final Paint DEFAULT_LABEL_PAINT; static final Paint DEFAULT_LABEL_BACKGROUND_PAINT; static final Paint DEFAULT_LABEL_OUTLINE_PAINT; static final Stroke DEFAULT_LABEL_OUTLINE_STROKE; static final Paint DEFAULT_LABEL_SHADOW_PAINT; static final double DEFAULT_MAX_VALUE; }