Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/bugfix/jfree#364' into
Browse files Browse the repository at this point in the history
release/eclipse-orbit
  • Loading branch information
Yuri-Blankenstein-TNO committed May 24, 2023
2 parents ff34593 + e848076 commit 2ecda4f
Show file tree
Hide file tree
Showing 2 changed files with 179 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ History
- Enable scrollbars by refactoring `ValueAxis#autoAdjustRange()` ([#220](https://github.com/jfree/jfreechart/issues/220));
- Exposing `getAnnotations()` method on `XYItemRenderer` interface ([#221](https://github.com/jfree/jfreechart/issues/221));
- Adding means to measure and illustrate differences in XYPlots ([#224](https://github.com/jfree/jfreechart/issues/224));
- Add clearSeriesXXX methods for all series settings in AbstractRenderer ([#364](https://github.com/jfree/jfreechart/issues/364))

##### Version 1.5.5 (not yet released)
- fix cross hair painting ([#340](https://github.com/jfree/jfreechart/issues/340))
Expand Down
178 changes: 178 additions & 0 deletions src/main/java/org/jfree/chart/renderer/AbstractRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,20 @@ public void setSeriesVisible(int series, Boolean visible, boolean notify) {
}
}

/**
* Clears the flags that controls whether a series is visible for this
* renderer and, if requested, sends a {@link RendererChangeEvent} to all
* registered listeners.
*
* @param notify notify listeners?
*/
public void clearSeriesVisible(boolean notify) {
this.seriesVisibleList.clear();
if (notify) {
fireChangeEvent();
}
}

/**
* Returns the default visibility for all series.
*
Expand Down Expand Up @@ -613,6 +627,20 @@ public void setSeriesVisibleInLegend(int series, Boolean visible,
}
}

/**
* Clears the series visible in the legend settings for this renderer and,
* if requested, sends a {@link RendererChangeEvent} to all registered
* listeners.
*
* @param notify notify listeners?
*/
public void clearSeriesVisibleInLegend(boolean notify) {
this.seriesVisibleInLegendList.clear();
if (notify) {
fireChangeEvent();
}
}

/**
* Returns the default visibility in the legend for all series.
*
Expand Down Expand Up @@ -901,6 +929,20 @@ public void setSeriesFillPaint(int series, Paint paint, boolean notify) {
}
}

/**
* Clears the series fill paint settings for this renderer and, if
* requested, sends a {@link RendererChangeEvent} to all registered
* listeners.
*
* @param notify notify listeners?
*/
public void clearSeriesFillPaints(boolean notify) {
this.fillPaintList.clear();
if (notify) {
fireChangeEvent();
}
}

/**
* Returns the default fill paint.
*
Expand Down Expand Up @@ -1054,6 +1096,20 @@ public void setSeriesOutlinePaint(int series, Paint paint, boolean notify) {
}
}

/**
* Clears the series outline paint settings for this renderer and, if
* requested, sends a {@link RendererChangeEvent} to all registered
* listeners.
*
* @param notify notify listeners?
*/
public void clearSeriesOutlinePaints(boolean notify) {
this.outlinePaintList.clear();
if (notify) {
fireChangeEvent();
}
}

/**
* Returns the default outline paint.
*
Expand Down Expand Up @@ -1368,6 +1424,20 @@ public void setSeriesOutlineStroke(int series, Stroke stroke,
}
}

/**
* Clears the series outline stroke settings for this renderer and, if
* requested, sends a {@link RendererChangeEvent} to all registered
* listeners.
*
* @param notify notify listeners?
*/
public void clearSeriesOutlineStrokes(boolean notify) {
this.outlineStrokeList.clear();
if (notify) {
fireChangeEvent();
}
}

/**
* Returns the default outline stroke.
*
Expand Down Expand Up @@ -1520,6 +1590,19 @@ public void setSeriesShape(int series, Shape shape, boolean notify) {
}
}

/**
* Clears the series shape settings for this renderer and, if requested,
* sends a {@link RendererChangeEvent} to all registered listeners.
*
* @param notify notify listeners?
*/
public void clearSeriesShapes(boolean notify) {
this.shapeList.clear();
if (notify) {
fireChangeEvent();
}
}

/**
* Returns the default shape.
*
Expand Down Expand Up @@ -1655,6 +1738,20 @@ public void setSeriesItemLabelsVisible(int series, Boolean visible,
}
}

/**
* Clears the visibility of item labels for a series settings for this
* renderer and, if requested, sends a {@link RendererChangeEvent} to all
* registered listeners.
*
* @param notify notify listeners?
*/
public void clearSeriesItemLabelsVisible(boolean notify) {
this.itemLabelsVisibleList.clear();
if (notify) {
fireChangeEvent();
}
}

/**
* Returns the base setting for item label visibility. A {@code null}
* result should be interpreted as equivalent to {@code Boolean.FALSE}.
Expand Down Expand Up @@ -1759,6 +1856,19 @@ public void setSeriesItemLabelFont(int series, Font font, boolean notify) {
}
}

/**
* Clears the item label font settings for this renderer and, if requested,
* sends a {@link RendererChangeEvent} to all registered listeners.
*
* @param notify notify listeners?
*/
public void clearSeriesItemLabelFonts(boolean notify) {
this.itemLabelFontMap.clear();
if (notify) {
fireChangeEvent();
}
}

/**
* Returns the default item label font (this is used when no other font
* setting is available).
Expand Down Expand Up @@ -1898,6 +2008,19 @@ public void setSeriesItemLabelPaint(int series, Paint paint,
}
}

/**
* Clears the item label paint settings for this renderer and, if requested,
* sends a {@link RendererChangeEvent} to all registered listeners.
*
* @param notify notify listeners?
*/
public void clearSeriesItemLabelPaints(boolean notify) {
this.itemLabelPaintList.clear();
if (notify) {
fireChangeEvent();
}
}

/**
* Returns the default item label paint.
*
Expand Down Expand Up @@ -2007,6 +2130,20 @@ public void setSeriesPositiveItemLabelPosition(int series,
}
}

/**
* Clears the item label position for all positive values for series
* settings for this renderer and, if requested, sends a
* {@link RendererChangeEvent} to all registered listeners.
*
* @param notify notify listeners?
*/
public void clearSeriesPositiveItemLabelPositions(boolean notify) {
this.positiveItemLabelPositionMap.clear();
if (notify) {
fireChangeEvent();
}
}

/**
* Returns the default positive item label position.
*
Expand Down Expand Up @@ -2382,6 +2519,19 @@ public void setLegendShape(int series, Shape shape) {
fireChangeEvent();
}

/**
* Clears the series legend shapes for this renderer and, if requested,
* sends a {@link RendererChangeEvent} to all registered listeners.
*
* @param notify notify listeners?
*/
public void clearLegendShapes(boolean notify) {
this.legendShapeList.clear();
if (notify) {
fireChangeEvent();
}
}

/**
* Returns the default legend shape, which may be {@code null}.
*
Expand Down Expand Up @@ -2466,6 +2616,20 @@ public void setLegendTextFont(int series, Font font) {
fireChangeEvent();
}

/**
* Clears the font used for the legend text for series settings for this
* renderer and, if requested, sends a {@link RendererChangeEvent} to all
* registered listeners.
*
* @param notify notify listeners?
*/
public void clearLegendTextFonts(boolean notify) {
this.legendTextFontMap.clear();
if (notify) {
fireChangeEvent();
}
}

/**
* Returns the default legend text font, which may be {@code null}.
*
Expand Down Expand Up @@ -2528,6 +2692,20 @@ public void setLegendTextPaint(int series, Paint paint) {
fireChangeEvent();
}

/**
* Clears the paint used for the legend text for series settings for this
* renderer and, if requested, sends a {@link RendererChangeEvent} to all
* registered listeners.
*
* @param notify notify listeners?
*/
public void clearLegendTextPaints(boolean notify) {
this.legendTextPaint.clear();
if (notify) {
fireChangeEvent();
}
}

/**
* Returns the default legend text paint, which may be {@code null}.
*
Expand Down

0 comments on commit 2ecda4f

Please sign in to comment.