@Override public LegendItem getLegendItem(int datasetIndex, int series) { LegendItem li = super.getLegendItem(datasetIndex, series); Stroke outlineStroke = getItemStroke(series, 0); Paint fillPaint = li.getFillPaint(); Paint outlinePaint = fillPaint; if (!fillCoordinates) { fillPaint = new Color(255, 255, 255, 255); } return new LegendItem( li.getLabel(), li.getDescription(), li.getToolTipText(), li.getURLText(), li.getShape(), fillPaint, outlineStroke, outlinePaint); }
@Override public LegendItem getLegendItem(int datasetIndex, int series) { LegendItem li = super.getLegendItem(datasetIndex, series); Stroke outlineStroke = getItemStroke(series, 0); Paint fillPaint = li.getFillPaint(); Paint outlinePaint = fillPaint; if (!fillCoordinates) { fillPaint = new Color(255, 255, 255, 255); } return new LegendItem(li.getLabel(), li.getDescription(), li.getToolTipText(), li.getURLText(), li.getShape(), fillPaint, outlineStroke, outlinePaint); }
/** * Returns a (possibly empty) collection of legend items for the series * that this renderer is responsible for drawing. * * @return The legend item collection (never {@code null}). */ @Override public LegendItemCollection getLegendItems() { if (this.plot == null) { return new LegendItemCollection(); } LegendItemCollection result = new LegendItemCollection(); int index = this.plot.getIndexOf(this); XYDataset dataset = this.plot.getDataset(index); if (dataset != null) { int seriesCount = dataset.getSeriesCount(); for (int i = 0; i < seriesCount; i++) { if (isSeriesVisibleInLegend(i)) { LegendItem item = getLegendItem(index, i); if (item != null) { result.add(item); } } } } return result; }
/** * Returns a (possibly empty) collection of legend items for the series * that this renderer is responsible for drawing. * * @return The legend item collection (never <code>null</code>). */ public LegendItemCollection getLegendItems() { if (this.plot == null) { return new LegendItemCollection(); } LegendItemCollection result = new LegendItemCollection(); int index = this.plot.getIndexOf(this); XYDataset dataset = this.plot.getDataset(index); if (dataset != null) { int seriesCount = dataset.getSeriesCount(); for (int i = 0; i < seriesCount; i++) { if (isSeriesVisibleInLegend(i)) { LegendItem item = getLegendItem(index, i); if (item != null) { result.add(item); } } } } return result; }