Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/main/java/org/jfree/chart/plot/XYPlot.java
Original file line number Diff line number Diff line change
Expand Up @@ -4158,11 +4158,8 @@ public Range getDataRange(ValueAxis axis) {
DatasetUtils.findRangeBounds(d));
}
}
// FIXME: the XYItemRenderer interface doesn't specify the
// getAnnotations() method but it should
if (r instanceof AbstractXYItemRenderer) {
AbstractXYItemRenderer rr = (AbstractXYItemRenderer) r;
Collection c = rr.getAnnotations();
if (r != null) {
Collection c = r.getAnnotations();
Iterator i = c.iterator();
while (i.hasNext()) {
XYAnnotation a = (XYAnnotation) i.next();
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/org/jfree/chart/renderer/xy/XYItemRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.geom.Rectangle2D;
import java.util.Collection;

import org.jfree.chart.LegendItem;
import org.jfree.chart.LegendItemSource;
Expand Down Expand Up @@ -1335,6 +1336,13 @@ void setSeriesCreateEntities(int series, Boolean create,
*/
void addAnnotation(XYAnnotation annotation, Layer layer);

/**
* Returns all annotations of all layers currently added to this renderer.
*
* @return all annotations for this renderer
*/
public Collection getAnnotations();

/**
* Removes the specified annotation and sends a {@link RendererChangeEvent}
* to all registered listeners.
Expand Down