Skip to content

Commit

Permalink
Rename ParamChecks --> Args.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfree committed May 11, 2017
1 parent cb0c866 commit 22701c9
Show file tree
Hide file tree
Showing 217 changed files with 1,115 additions and 1,129 deletions.
42 changes: 21 additions & 21 deletions src/main/java/org/jfree/chart/ChartFactory.java
Expand Up @@ -199,7 +199,7 @@
import org.jfree.chart.urls.StandardXYURLGenerator;
import org.jfree.chart.urls.StandardXYZURLGenerator;
import org.jfree.chart.urls.XYURLGenerator;
import org.jfree.chart.util.ParamChecks;
import org.jfree.chart.util.Args;
import org.jfree.chart.util.SortOrder;
import org.jfree.chart.util.TableOrder;
import org.jfree.data.category.CategoryDataset;
Expand Down Expand Up @@ -251,7 +251,7 @@ public static ChartTheme getChartTheme() {
* @since 1.0.11
*/
public static void setChartTheme(ChartTheme theme) {
ParamChecks.nullNotPermitted(theme, "theme");
Args.nullNotPermitted(theme, "theme");
currentTheme = theme;

// here we do a check to see if the user is installing the "Legacy"
Expand Down Expand Up @@ -674,7 +674,7 @@ public static JFreeChart createMultiplePieChart(String title,
CategoryDataset dataset, TableOrder order, boolean legend,
boolean tooltips, boolean urls) {

ParamChecks.nullNotPermitted(order, "order");
Args.nullNotPermitted(order, "order");
MultiplePiePlot plot = new MultiplePiePlot(dataset);
plot.setDataExtractOrder(order);
plot.setBackgroundPaint(null);
Expand Down Expand Up @@ -718,7 +718,7 @@ public static JFreeChart createMultiplePieChart(String title,
public static JFreeChart createPieChart3D(String title, PieDataset dataset,
boolean legend, boolean tooltips, Locale locale) {

ParamChecks.nullNotPermitted(locale, "locale");
Args.nullNotPermitted(locale, "locale");
PiePlot3D plot = new PiePlot3D(dataset);
plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
if (tooltips) {
Expand Down Expand Up @@ -798,7 +798,7 @@ public static JFreeChart createMultiplePieChart3D(String title,
CategoryDataset dataset, TableOrder order, boolean legend,
boolean tooltips, boolean urls) {

ParamChecks.nullNotPermitted(order, "order");
Args.nullNotPermitted(order, "order");
MultiplePiePlot plot = new MultiplePiePlot(dataset);
plot.setDataExtractOrder(order);
plot.setBackgroundPaint(null);
Expand Down Expand Up @@ -883,7 +883,7 @@ public static JFreeChart createBarChart(String title,
CategoryDataset dataset, PlotOrientation orientation,
boolean legend, boolean tooltips, boolean urls) {

ParamChecks.nullNotPermitted(orientation, "orientation");
Args.nullNotPermitted(orientation, "orientation");
CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
ValueAxis valueAxis = new NumberAxis(valueAxisLabel);

Expand Down Expand Up @@ -973,7 +973,7 @@ public static JFreeChart createStackedBarChart(String title,
CategoryDataset dataset, PlotOrientation orientation,
boolean legend, boolean tooltips, boolean urls) {

ParamChecks.nullNotPermitted(orientation, "orientation");
Args.nullNotPermitted(orientation, "orientation");

CategoryAxis categoryAxis = new CategoryAxis(domainAxisLabel);
ValueAxis valueAxis = new NumberAxis(rangeAxisLabel);
Expand Down Expand Up @@ -1047,7 +1047,7 @@ public static JFreeChart createAreaChart(String title,
CategoryDataset dataset, PlotOrientation orientation,
boolean legend, boolean tooltips, boolean urls) {

ParamChecks.nullNotPermitted(orientation, "orientation");
Args.nullNotPermitted(orientation, "orientation");
CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
categoryAxis.setCategoryMargin(0.0);

Expand Down Expand Up @@ -1124,7 +1124,7 @@ public static JFreeChart createStackedAreaChart(String title,
CategoryDataset dataset, PlotOrientation orientation,
boolean legend, boolean tooltips, boolean urls) {

ParamChecks.nullNotPermitted(orientation, "orientation");
Args.nullNotPermitted(orientation, "orientation");
CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
categoryAxis.setCategoryMargin(0.0);
ValueAxis valueAxis = new NumberAxis(valueAxisLabel);
Expand Down Expand Up @@ -1198,7 +1198,7 @@ public static JFreeChart createLineChart(String title,
CategoryDataset dataset, PlotOrientation orientation,
boolean legend, boolean tooltips, boolean urls) {

ParamChecks.nullNotPermitted(orientation, "orientation");
Args.nullNotPermitted(orientation, "orientation");
CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
ValueAxis valueAxis = new NumberAxis(valueAxisLabel);

Expand Down Expand Up @@ -1319,7 +1319,7 @@ public static JFreeChart createWaterfallChart(String title,
CategoryDataset dataset, PlotOrientation orientation,
boolean legend, boolean tooltips, boolean urls) {

ParamChecks.nullNotPermitted(orientation, "orientation");
Args.nullNotPermitted(orientation, "orientation");
CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
categoryAxis.setCategoryMargin(0.0);

Expand Down Expand Up @@ -1441,7 +1441,7 @@ public static JFreeChart createScatterPlot(String title, String xAxisLabel,
String yAxisLabel, XYDataset dataset, PlotOrientation orientation,
boolean legend, boolean tooltips, boolean urls) {

ParamChecks.nullNotPermitted(orientation, "orientation");
Args.nullNotPermitted(orientation, "orientation");
NumberAxis xAxis = new NumberAxis(xAxisLabel);
xAxis.setAutoRangeIncludesZero(false);
NumberAxis yAxis = new NumberAxis(yAxisLabel);
Expand Down Expand Up @@ -1521,7 +1521,7 @@ public static JFreeChart createXYBarChart(String title, String xAxisLabel,
PlotOrientation orientation, boolean legend, boolean tooltips,
boolean urls) {

ParamChecks.nullNotPermitted(orientation, "orientation");
Args.nullNotPermitted(orientation, "orientation");
ValueAxis domainAxis;
if (dateAxis) {
domainAxis = new DateAxis(xAxisLabel);
Expand Down Expand Up @@ -1605,7 +1605,7 @@ public static JFreeChart createXYAreaChart(String title, String xAxisLabel,
String yAxisLabel, XYDataset dataset, PlotOrientation orientation,
boolean legend, boolean tooltips, boolean urls) {

ParamChecks.nullNotPermitted(orientation, "orientation");
Args.nullNotPermitted(orientation, "orientation");
NumberAxis xAxis = new NumberAxis(xAxisLabel);
xAxis.setAutoRangeIncludesZero(false);
NumberAxis yAxis = new NumberAxis(yAxisLabel);
Expand Down Expand Up @@ -1676,7 +1676,7 @@ public static JFreeChart createStackedXYAreaChart(String title,
PlotOrientation orientation, boolean legend, boolean tooltips,
boolean urls) {

ParamChecks.nullNotPermitted(orientation, "orientation");
Args.nullNotPermitted(orientation, "orientation");
NumberAxis xAxis = new NumberAxis(xAxisLabel);
xAxis.setAutoRangeIncludesZero(false);
xAxis.setLowerMargin(0.0);
Expand Down Expand Up @@ -1743,7 +1743,7 @@ public static JFreeChart createXYLineChart(String title, String xAxisLabel,
String yAxisLabel, XYDataset dataset, PlotOrientation orientation,
boolean legend, boolean tooltips, boolean urls) {

ParamChecks.nullNotPermitted(orientation, "orientation");
Args.nullNotPermitted(orientation, "orientation");
NumberAxis xAxis = new NumberAxis(xAxisLabel);
xAxis.setAutoRangeIncludesZero(false);
NumberAxis yAxis = new NumberAxis(yAxisLabel);
Expand Down Expand Up @@ -1801,7 +1801,7 @@ public static JFreeChart createXYStepChart(String title, String xAxisLabel,
String yAxisLabel, XYDataset dataset, PlotOrientation orientation,
boolean legend, boolean tooltips, boolean urls) {

ParamChecks.nullNotPermitted(orientation, "orientation");
Args.nullNotPermitted(orientation, "orientation");
DateAxis xAxis = new DateAxis(xAxisLabel);
NumberAxis yAxis = new NumberAxis(yAxisLabel);
yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
Expand Down Expand Up @@ -1868,7 +1868,7 @@ public static JFreeChart createXYStepAreaChart(String title,
PlotOrientation orientation, boolean legend, boolean tooltips,
boolean urls) {

ParamChecks.nullNotPermitted(orientation, "orientation");
Args.nullNotPermitted(orientation, "orientation");
NumberAxis xAxis = new NumberAxis(xAxisLabel);
xAxis.setAutoRangeIncludesZero(false);
NumberAxis yAxis = new NumberAxis(yAxisLabel);
Expand Down Expand Up @@ -2079,7 +2079,7 @@ public static JFreeChart createBubbleChart(String title, String xAxisLabel,
String yAxisLabel, XYZDataset dataset, PlotOrientation orientation,
boolean legend, boolean tooltips, boolean urls) {

ParamChecks.nullNotPermitted(orientation, "orientation");
Args.nullNotPermitted(orientation, "orientation");
NumberAxis xAxis = new NumberAxis(xAxisLabel);
xAxis.setAutoRangeIncludesZero(false);
NumberAxis yAxis = new NumberAxis(yAxisLabel);
Expand Down Expand Up @@ -2146,7 +2146,7 @@ public static JFreeChart createHistogram(String title,
PlotOrientation orientation, boolean legend, boolean tooltips,
boolean urls) {

ParamChecks.nullNotPermitted(orientation, "orientation");
Args.nullNotPermitted(orientation, "orientation");
NumberAxis xAxis = new NumberAxis(xAxisLabel);
xAxis.setAutoRangeIncludesZero(false);
ValueAxis yAxis = new NumberAxis(yAxisLabel);
Expand Down Expand Up @@ -2288,7 +2288,7 @@ public static JFreeChart createWaferMapChart(String title,
WaferMapDataset dataset, PlotOrientation orientation,
boolean legend, boolean tooltips, boolean urls) {

ParamChecks.nullNotPermitted(orientation, "orientation");
Args.nullNotPermitted(orientation, "orientation");
WaferMapPlot plot = new WaferMapPlot(dataset);
WaferMapRenderer renderer = new WaferMapRenderer();
plot.setRenderer(renderer);
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/jfree/chart/ChartPanel.java
Expand Up @@ -250,7 +250,7 @@
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.PlotRenderingInfo;
import org.jfree.chart.plot.Zoomable;
import org.jfree.chart.util.ParamChecks;
import org.jfree.chart.util.Args;
import org.jfree.chart.util.ResourceBundleWrapper;
import org.jfree.chart.util.SerialUtils;

Expand Down Expand Up @@ -1286,7 +1286,7 @@ public Paint getZoomFillPaint() {
* @since 1.0.13
*/
public void setZoomFillPaint(Paint paint) {
ParamChecks.nullNotPermitted(paint, "paint");
Args.nullNotPermitted(paint, "paint");
this.zoomFillPaint = paint;
}

Expand Down Expand Up @@ -1360,7 +1360,7 @@ else if (!flag && this.mouseWheelHandler != null) {
* @since 1.0.13
*/
public void addOverlay(Overlay overlay) {
ParamChecks.nullNotPermitted(overlay, "overlay");
Args.nullNotPermitted(overlay, "overlay");
this.overlays.add(overlay);
overlay.addChangeListener(this);
repaint();
Expand All @@ -1374,7 +1374,7 @@ public void addOverlay(Overlay overlay) {
* @since 1.0.13
*/
public void removeOverlay(Overlay overlay) {
ParamChecks.nullNotPermitted(overlay, "overlay");
Args.nullNotPermitted(overlay, "overlay");
boolean removed = this.overlays.remove(overlay);
if (removed) {
overlay.removeChangeListener(this);
Expand Down Expand Up @@ -2923,7 +2923,7 @@ private void writeAsPDF(File file, int w, int h) {
throw new IllegalStateException(
"OrsonPDF is not present on the classpath.");
}
ParamChecks.nullNotPermitted(file, "file");
Args.nullNotPermitted(file, "file");
try {
Class pdfDocClass = Class.forName("com.orsonpdf.PDFDocument");
Object pdfDoc = pdfDocClass.newInstance();
Expand Down Expand Up @@ -3009,7 +3009,7 @@ public int print(Graphics g, PageFormat pf, int pageIndex) {
* @param listener the listener ({@code null} not permitted).
*/
public void addChartMouseListener(ChartMouseListener listener) {
ParamChecks.nullNotPermitted(listener, "listener");
Args.nullNotPermitted(listener, "listener");
this.chartMouseListeners.add(ChartMouseListener.class, listener);
}

Expand Down
34 changes: 17 additions & 17 deletions src/main/java/org/jfree/chart/ChartUtils.java
Expand Up @@ -97,7 +97,7 @@
import org.jfree.chart.imagemap.StandardURLTagFragmentGenerator;
import org.jfree.chart.imagemap.ToolTipTagFragmentGenerator;
import org.jfree.chart.imagemap.URLTagFragmentGenerator;
import org.jfree.chart.util.ParamChecks;
import org.jfree.chart.util.Args;

/**
* A collection of utility methods for JFreeChart. Includes methods for
Expand Down Expand Up @@ -179,7 +179,7 @@ public static void writeChartAsPNG(OutputStream out, JFreeChart chart,
int width, int height, ChartRenderingInfo info)
throws IOException {

ParamChecks.nullNotPermitted(chart, "chart");
Args.nullNotPermitted(chart, "chart");
BufferedImage bufferedImage
= chart.createBufferedImage(width, height, info);
EncoderUtil.writeBufferedImage(bufferedImage, ImageFormat.PNG, out);
Expand All @@ -206,8 +206,8 @@ public static void writeChartAsPNG(OutputStream out, JFreeChart chart,
int width, int height, ChartRenderingInfo info,
boolean encodeAlpha, int compression) throws IOException {

ParamChecks.nullNotPermitted(out, "out");
ParamChecks.nullNotPermitted(chart, "chart");
Args.nullNotPermitted(out, "out");
Args.nullNotPermitted(chart, "chart");
BufferedImage chartImage = chart.createBufferedImage(width, height,
BufferedImage.TYPE_INT_ARGB, info);
ChartUtils.writeBufferedImageAsPNG(out, chartImage, encodeAlpha,
Expand All @@ -231,8 +231,8 @@ public static void writeScaledChartAsPNG(OutputStream out,
JFreeChart chart, int width, int height, int widthScaleFactor,
int heightScaleFactor) throws IOException {

ParamChecks.nullNotPermitted(out, "out");
ParamChecks.nullNotPermitted(chart, "chart");
Args.nullNotPermitted(out, "out");
Args.nullNotPermitted(chart, "chart");

double desiredWidth = width * widthScaleFactor;
double desiredHeight = height * heightScaleFactor;
Expand Down Expand Up @@ -304,7 +304,7 @@ public static void saveChartAsPNG(File file, JFreeChart chart,
int width, int height, ChartRenderingInfo info)
throws IOException {

ParamChecks.nullNotPermitted(file, "file");
Args.nullNotPermitted(file, "file");
OutputStream out = new BufferedOutputStream(new FileOutputStream(file));
try {
ChartUtils.writeChartAsPNG(out, chart, width, height, info);
Expand Down Expand Up @@ -334,8 +334,8 @@ public static void saveChartAsPNG(File file, JFreeChart chart,
int width, int height, ChartRenderingInfo info, boolean encodeAlpha,
int compression) throws IOException {

ParamChecks.nullNotPermitted(file, "file");
ParamChecks.nullNotPermitted(chart, "chart");
Args.nullNotPermitted(file, "file");
Args.nullNotPermitted(chart, "chart");
OutputStream out = new BufferedOutputStream(new FileOutputStream(file));
try {
writeChartAsPNG(out, chart, width, height, info, encodeAlpha,
Expand Down Expand Up @@ -405,8 +405,8 @@ public static void writeChartAsJPEG(OutputStream out, JFreeChart chart,
int width, int height, ChartRenderingInfo info)
throws IOException {

ParamChecks.nullNotPermitted(out, "out");
ParamChecks.nullNotPermitted(chart, "chart");
Args.nullNotPermitted(out, "out");
Args.nullNotPermitted(chart, "chart");
BufferedImage image = chart.createBufferedImage(width, height,
BufferedImage.TYPE_INT_RGB, info);
EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out);
Expand All @@ -432,8 +432,8 @@ public static void writeChartAsJPEG(OutputStream out, float quality,
JFreeChart chart, int width, int height, ChartRenderingInfo info)
throws IOException {

ParamChecks.nullNotPermitted(out, "out");
ParamChecks.nullNotPermitted(chart, "chart");
Args.nullNotPermitted(out, "out");
Args.nullNotPermitted(chart, "chart");
BufferedImage image = chart.createBufferedImage(width, height,
BufferedImage.TYPE_INT_RGB, info);
EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out, quality);
Expand Down Expand Up @@ -494,8 +494,8 @@ public static void saveChartAsJPEG(File file, float quality,
public static void saveChartAsJPEG(File file, JFreeChart chart,
int width, int height, ChartRenderingInfo info) throws IOException {

ParamChecks.nullNotPermitted(file, "file");
ParamChecks.nullNotPermitted(chart, "chart");
Args.nullNotPermitted(file, "file");
Args.nullNotPermitted(chart, "chart");
OutputStream out = new BufferedOutputStream(new FileOutputStream(file));
try {
writeChartAsJPEG(out, chart, width, height, info);
Expand Down Expand Up @@ -525,8 +525,8 @@ public static void saveChartAsJPEG(File file, float quality,
JFreeChart chart, int width, int height,
ChartRenderingInfo info) throws IOException {

ParamChecks.nullNotPermitted(file, "file");
ParamChecks.nullNotPermitted(chart, "chart");
Args.nullNotPermitted(file, "file");
Args.nullNotPermitted(chart, "chart");
OutputStream out = new BufferedOutputStream(new FileOutputStream(
file));
try {
Expand Down

0 comments on commit 22701c9

Please sign in to comment.