diff --git a/README.md b/README.md index 05e3c11bef..fb32b7fb0f 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ History - add new panel for background rendering of charts (PR [#233](https://github.com/jfree/jfreechart/pull/233)) - fix tick label font for `LogAxis` with number format override ([#98](https://github.com/jfree/jfreechart/issues/98)); - added `valueVisible` flag to `MeterPlot` ([#231](https://github.com/jfree/jfreechart/pull/231)); +- added `get/setWebFillAlpha()` methods to SpiderWebPlot ([#279](https://github.com/jfree/jfreechart/pull/279)) - add argument checks for annotations ([#223](https://github.com/jfree/jfreechart/issues/223)); - removed `JFreeChartResources.java` file ([#239](https://github.com/jfree/jfreechart/issues/239)) diff --git a/src/main/java/org/jfree/chart/plot/SpiderWebPlot.java b/src/main/java/org/jfree/chart/plot/SpiderWebPlot.java index 29a8840712..33a10ff00c 100644 --- a/src/main/java/org/jfree/chart/plot/SpiderWebPlot.java +++ b/src/main/java/org/jfree/chart/plot/SpiderWebPlot.java @@ -363,11 +363,22 @@ public void setWebFilled(boolean flag) { fireChangeEvent(); } + /** + * Returns the alpha value for filling a graph (in the range 0.0 to 1.0). + * + * @return The alpha value for filling a spider plot polygon. + * + * @see #setWebFillAlpha(float) + */ + public float getWebFillAlpha() { + return webFillAlpha; + } /** - * Method to set the alpha value for the fill of a plot polygon. + * Sets the alpha value for the fill of a plot polygon and sends a {@link PlotChangeEvent} to all + * registered listeners. * - * @param alpha the new alpha value. If it is outsite [0,1] it will be corrected to fit the range. + * @param alpha the new alpha value. If it is outside [0,1] it will be corrected to fit the range. * @see #getWebFillAlpha() */ public void setWebFillAlpha(float alpha) { @@ -380,17 +391,6 @@ public void setWebFillAlpha(float alpha) { fireChangeEvent(); } - /** - * Method to return the alpha value for filling a graph. - * - * @return The alpha value for filling a spider plot polygon. - * - * @see #setWebFillAlpha(float) - */ - public float getWebFillAlpha() { - return webFillAlpha; - } - /** * Returns the data extract order (by row or by column). * @@ -1497,6 +1497,9 @@ public boolean equals(Object obj) { if (this.webFilled != that.webFilled) { return false; } + if (this.webFillAlpha != that.webFillAlpha) { + return false; + } if (this.axisLabelGap != that.axisLabelGap) { return false; } diff --git a/src/test/java/org/jfree/chart/plot/SpiderWebPlotTest.java b/src/test/java/org/jfree/chart/plot/SpiderWebPlotTest.java index c097b5deaf..381dd339df 100644 --- a/src/test/java/org/jfree/chart/plot/SpiderWebPlotTest.java +++ b/src/test/java/org/jfree/chart/plot/SpiderWebPlotTest.java @@ -189,6 +189,11 @@ public void testEquals() { p2.setWebFilled(false); assertEquals(p1, p2); + p1.setWebFillAlpha(0.5f); + assertNotEquals(p1, p2); + p2.setWebFillAlpha(0.5f); + assertEquals(p1, p2); + // axisLabelGap p1.setAxisLabelGap(0.11); assertNotEquals(p1, p2);