From: <mu...@us...> - 2013-07-02 08:08:14
|
Revision: 2543 http://sourceforge.net/p/jfreechart/code/2543 Author: mungady Date: 2013-07-02 08:08:11 +0000 (Tue, 02 Jul 2013) Log Message: ----------- Use ParamChecks class. Modified Paths: -------------- branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/Axis.java 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 2013-07-02 08:03:54 UTC (rev 2542) +++ branches/jfreechart-1.0.x-branch/source/org/jfree/chart/axis/Axis.java 2013-07-02 08:08:11 UTC (rev 2543) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2011, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * --------- * Axis.java * --------- - * (C) Copyright 2000-2009, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2013, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): Bill Kelemen; @@ -82,6 +82,7 @@ * 25-Sep-2008 : Added minor tick support, see patch 1934255 by Peter Kolb (DG); * 26-Sep-2008 : Added fireChangeEvent() method (DG); * 19-Mar-2009 : Added entity support - see patch 2603321 by Peter Kolb (DG); + * 02-Jul-2013 : Use ParamChecks (DG); * */ @@ -114,6 +115,7 @@ import org.jfree.chart.event.AxisChangeListener; import org.jfree.chart.plot.Plot; import org.jfree.chart.plot.PlotRenderingInfo; +import org.jfree.chart.util.ParamChecks; import org.jfree.io.SerialUtilities; import org.jfree.text.TextUtilities; import org.jfree.ui.RectangleEdge; @@ -408,9 +410,7 @@ * @see #getLabelFont() */ public void setLabelFont(Font font) { - if (font == null) { - throw new IllegalArgumentException("Null 'font' argument."); - } + ParamChecks.nullNotPermitted(font, "font"); if (!this.labelFont.equals(font)) { this.labelFont = font; fireChangeEvent(); @@ -437,9 +437,7 @@ * @see #getLabelPaint() */ public void setLabelPaint(Paint paint) { - if (paint == null) { - throw new IllegalArgumentException("Null 'paint' argument."); - } + ParamChecks.nullNotPermitted(paint, "paint"); this.labelPaint = paint; fireChangeEvent(); } @@ -478,9 +476,7 @@ * @since 1.0.10 */ public void setLabelInsets(RectangleInsets insets, boolean notify) { - if (insets == null) { - throw new IllegalArgumentException("Null 'insets' argument."); - } + ParamChecks.nullNotPermitted(insets, "insets"); if (!insets.equals(this.labelInsets)) { this.labelInsets = insets; if (notify) { @@ -561,9 +557,7 @@ * @see #getAxisLinePaint() */ public void setAxisLinePaint(Paint paint) { - if (paint == null) { - throw new IllegalArgumentException("Null 'paint' argument."); - } + ParamChecks.nullNotPermitted(paint, "paint"); this.axisLinePaint = paint; fireChangeEvent(); } @@ -588,9 +582,7 @@ * @see #getAxisLineStroke() */ public void setAxisLineStroke(Stroke stroke) { - if (stroke == null) { - throw new IllegalArgumentException("Null 'stroke' argument."); - } + ParamChecks.nullNotPermitted(stroke, "stroke"); this.axisLineStroke = stroke; fireChangeEvent(); } @@ -681,16 +673,11 @@ * @see #getTickLabelFont() */ public void setTickLabelFont(Font font) { - - if (font == null) { - throw new IllegalArgumentException("Null 'font' argument."); - } - + ParamChecks.nullNotPermitted(font, "font"); if (!this.tickLabelFont.equals(font)) { this.tickLabelFont = font; fireChangeEvent(); } - } /** @@ -713,9 +700,7 @@ * @see #getTickLabelPaint() */ public void setTickLabelPaint(Paint paint) { - if (paint == null) { - throw new IllegalArgumentException("Null 'paint' argument."); - } + ParamChecks.nullNotPermitted(paint, "paint"); this.tickLabelPaint = paint; fireChangeEvent(); } @@ -740,9 +725,7 @@ * @see #getTickLabelInsets() */ public void setTickLabelInsets(RectangleInsets insets) { - if (insets == null) { - throw new IllegalArgumentException("Null 'insets' argument."); - } + ParamChecks.nullNotPermitted(insets, "insets"); if (!this.tickLabelInsets.equals(insets)) { this.tickLabelInsets = insets; fireChangeEvent(); @@ -847,9 +830,7 @@ * @see #getTickMarkStroke() */ public void setTickMarkStroke(Stroke stroke) { - if (stroke == null) { - throw new IllegalArgumentException("Null 'stroke' argument."); - } + ParamChecks.nullNotPermitted(stroke, "stroke"); if (!this.tickMarkStroke.equals(stroke)) { this.tickMarkStroke = stroke; fireChangeEvent(); @@ -876,9 +857,7 @@ * @see #getTickMarkPaint() */ public void setTickMarkPaint(Paint paint) { - if (paint == null) { - throw new IllegalArgumentException("Null 'paint' argument."); - } + ParamChecks.nullNotPermitted(paint, "paint"); this.tickMarkPaint = paint; fireChangeEvent(); } @@ -1211,9 +1190,7 @@ AxisState state) { // it is unlikely that 'state' will be null, but check anyway... - if (state == null) { - throw new IllegalArgumentException("Null 'state' argument."); - } + ParamChecks.nullNotPermitted(state, "state"); if ((label == null) || (label.equals(""))) { return state; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |