From: <mu...@us...> - 2008-09-26 09:46:19
|
Revision: 1649 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=1649&view=rev Author: mungady Date: 2008-09-26 09:46:14 +0000 (Fri, 26 Sep 2008) Log Message: ----------- 2008-09-26 David Gilbert <dav...@ob...> * source/org/jfree/chart/axis/Axis.java (fireChangeEvent): New method, also updated various other methods to call fireChangeEvent(). Modified Paths: -------------- branches/jfreechart-1.0.x-branch/ChangeLog branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/Axis.java Modified: branches/jfreechart-1.0.x-branch/ChangeLog =================================================================== --- branches/jfreechart-1.0.x-branch/ChangeLog 2008-09-26 09:25:37 UTC (rev 1648) +++ branches/jfreechart-1.0.x-branch/ChangeLog 2008-09-26 09:46:14 UTC (rev 1649) @@ -1,5 +1,11 @@ 2008-09-26 David Gilbert <dav...@ob...> + * source/org/jfree/chart/axis/Axis.java + (fireChangeEvent): New method, + also updated various other methods to call fireChangeEvent(). + +2008-09-26 David Gilbert <dav...@ob...> + * source/org/jfree/chart/renderer/category/WaterfallRenderer.java (drawItem): Fixed bar misalignment when maxBarWidth is applied. Modified: branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/Axis.java =================================================================== --- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/Axis.java 2008-09-26 09:25:37 UTC (rev 1648) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/Axis.java 2008-09-26 09:46:14 UTC (rev 1649) @@ -80,6 +80,7 @@ * 22-Aug-2006 : API doc updates (DG); * 06-Jun-2008 : Added setTickLabelInsets(RectangleInsets, boolean) (DG); * 25-Sep-2008 : Added minor tick support, see patch 1934255 by Peter Kolb (DG); + * 26-Sep-2008 : Added fireChangeEvent() method (DG); * */ @@ -339,7 +340,7 @@ public void setVisible(boolean flag) { if (flag != this.visible) { this.visible = flag; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } } @@ -372,13 +373,13 @@ if (existing != null) { if (!existing.equals(label)) { this.label = label; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } } else { if (label != null) { this.label = label; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } } @@ -409,7 +410,7 @@ } if (!this.labelFont.equals(font)) { this.labelFont = font; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } } @@ -437,7 +438,7 @@ throw new IllegalArgumentException("Null 'paint' argument."); } this.labelPaint = paint; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } /** @@ -480,7 +481,7 @@ if (!insets.equals(this.labelInsets)) { this.labelInsets = insets; if (notify) { - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } } } @@ -506,7 +507,7 @@ */ public void setLabelAngle(double angle) { this.labelAngle = angle; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } /** @@ -534,7 +535,7 @@ */ public void setAxisLineVisible(boolean visible) { this.axisLineVisible = visible; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } /** @@ -561,7 +562,7 @@ throw new IllegalArgumentException("Null 'paint' argument."); } this.axisLinePaint = paint; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } /** @@ -588,7 +589,7 @@ throw new IllegalArgumentException("Null 'stroke' argument."); } this.axisLineStroke = stroke; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } /** @@ -619,7 +620,7 @@ if (flag != this.tickLabelsVisible) { this.tickLabelsVisible = flag; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } } @@ -652,7 +653,7 @@ public void setMinorTickMarksVisible(boolean flag) { if (flag != this.minorTickMarksVisible) { this.minorTickMarksVisible = flag; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } } @@ -683,7 +684,7 @@ if (!this.tickLabelFont.equals(font)) { this.tickLabelFont = font; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } } @@ -712,7 +713,7 @@ throw new IllegalArgumentException("Null 'paint' argument."); } this.tickLabelPaint = paint; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } /** @@ -740,7 +741,7 @@ } if (!this.tickLabelInsets.equals(insets)) { this.tickLabelInsets = insets; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } } @@ -768,7 +769,7 @@ public void setTickMarksVisible(boolean flag) { if (flag != this.tickMarksVisible) { this.tickMarksVisible = flag; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } } @@ -794,7 +795,7 @@ */ public void setTickMarkInsideLength(float length) { this.tickMarkInsideLength = length; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } /** @@ -819,7 +820,7 @@ */ public void setTickMarkOutsideLength(float length) { this.tickMarkOutsideLength = length; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } /** @@ -847,7 +848,7 @@ } if (!this.tickMarkStroke.equals(stroke)) { this.tickMarkStroke = stroke; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } } @@ -875,7 +876,7 @@ throw new IllegalArgumentException("Null 'paint' argument."); } this.tickMarkPaint = paint; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } /** @@ -904,7 +905,7 @@ */ public void setMinorTickMarkInsideLength(float length) { this.minorTickMarkInsideLength = length; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } /** @@ -933,7 +934,7 @@ */ public void setMinorTickMarkOutsideLength(float length) { this.minorTickMarkOutsideLength = length; - notifyListeners(new AxisChangeEvent(this)); + fireChangeEvent(); } /** @@ -1095,14 +1096,21 @@ * @param event information about the change to the axis. */ protected void notifyListeners(AxisChangeEvent event) { - Object[] listeners = this.listenerList.getListenerList(); for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i] == AxisChangeListener.class) { ((AxisChangeListener) listeners[i + 1]).axisChanged(event); } } + } + /** + * Sends an {@link AxisChangeEvent} to all registered listeners. + * + * @since 1.0.12 + */ + protected void fireChangeEvent() { + notifyListeners(new AxisChangeEvent(this)); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |