/** * Removes all annotations and sends a {@link RendererChangeEvent} * to all registered listeners. */ @Override public void removeAnnotations() { for (XYAnnotation annotation : this.foregroundAnnotations) { annotation.removeChangeListener(this); } for (XYAnnotation annotation : this.backgroundAnnotations) { annotation.removeChangeListener(this); } this.foregroundAnnotations.clear(); this.backgroundAnnotations.clear(); fireChangeEvent(); }
/** * Clears all the annotations and sends a {@link PlotChangeEvent} to all * registered listeners. * * @see #addAnnotation(XYAnnotation) */ public void clearAnnotations() { for (XYAnnotation annotation : this.annotations) { annotation.removeChangeListener(this); } this.annotations.clear(); fireChangeEvent(); }
/** * Removes all annotations and sends a {@link RendererChangeEvent} * to all registered listeners. */ public void removeAnnotations() { for(int i = 0; i < this.foregroundAnnotations.size(); i++){ XYAnnotation annotation = (XYAnnotation) this.foregroundAnnotations.get(i); annotation.removeChangeListener(this); } for(int i = 0; i < this.backgroundAnnotations.size(); i++){ XYAnnotation annotation = (XYAnnotation) this.backgroundAnnotations.get(i); annotation.removeChangeListener(this); } this.foregroundAnnotations.clear(); this.backgroundAnnotations.clear(); fireChangeEvent(); }
/** * Clears all the annotations and sends a {@link PlotChangeEvent} to all * registered listeners. * * @see #addAnnotation(XYAnnotation) */ public void clearAnnotations() { for(int i = 0; i < this.annotations.size(); i++){ XYAnnotation annotation = (XYAnnotation) this.annotations.get(i); annotation.removeChangeListener(this); } this.annotations.clear(); fireChangeEvent(); }
/** * Removes the specified annotation and sends a {@link RendererChangeEvent} * to all registered listeners. * * @param annotation the annotation to remove (<code>null</code> not * permitted). * * @return A boolean to indicate whether or not the annotation was * successfully removed. */ public boolean removeAnnotation(XYAnnotation annotation) { boolean removed = this.foregroundAnnotations.remove(annotation); removed = removed & this.backgroundAnnotations.remove(annotation); annotation.removeChangeListener(this); fireChangeEvent(); return removed; }
/** * Removes the specified annotation and sends a {@link RendererChangeEvent} * to all registered listeners. * * @param annotation the annotation to remove ({@code null} not * permitted). * * @return A boolean to indicate whether or not the annotation was * successfully removed. */ @Override public boolean removeAnnotation(XYAnnotation annotation) { boolean removed = this.foregroundAnnotations.remove(annotation); removed = removed & this.backgroundAnnotations.remove(annotation); annotation.removeChangeListener(this); fireChangeEvent(); return removed; }
/** * Removes an annotation from the plot and sends a {@link PlotChangeEvent} * to all registered listeners. * * @param annotation the annotation (<code>null</code> not permitted). * @param notify notify listeners? * * @return A boolean (indicates whether or not the annotation was removed). * * @since 1.0.10 */ public boolean removeAnnotation(XYAnnotation annotation, boolean notify) { if (annotation == null) { throw new IllegalArgumentException("Null 'annotation' argument."); } boolean removed = this.annotations.remove(annotation); annotation.removeChangeListener(this); if (removed && notify) { fireChangeEvent(); } return removed; }
/** * Removes an annotation from the plot and sends a {@link PlotChangeEvent} * to all registered listeners. * * @param annotation the annotation ({@code null} not permitted). * @param notify notify listeners? * * @return A boolean (indicates whether or not the annotation was removed). * * @since 1.0.10 */ public boolean removeAnnotation(XYAnnotation annotation, boolean notify) { Args.nullNotPermitted(annotation, "annotation"); boolean removed = this.annotations.remove(annotation); annotation.removeChangeListener(this); if (removed && notify) { fireChangeEvent(); } return removed; }