Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#364 Adding clearSeriesXXX methods for all series settings #365

Open
wants to merge 1 commit into
base: v1.5.x
Choose a base branch
from
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ at GitHub:
History
-------
##### Version 1.5.5 (not yet released)
- Add clearSeriesXXX methods for all series settings in AbstractRenderer ([#364](https://github.com/jfree/jfreechart/issues/364))
- fix cross hair painting ([#340](https://github.com/jfree/jfreechart/issues/340))

##### Version 1.5.4 (8 January 2023)
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