org.jfree.chart.urls.StandardXYURLGenerator Java Examples
The following examples show how to use
org.jfree.chart.urls.StandardXYURLGenerator.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ChartFactory.java From openstock with GNU General Public License v3.0 | 7 votes |
/** * Creates a wind plot with default settings. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel a label for the x-axis (<code>null</code> permitted). * @param yAxisLabel a label for the y-axis (<code>null</code> permitted). * @param dataset the dataset for the chart (<code>null</code> permitted). * @param legend a flag that controls whether or not a legend is created. * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return A wind plot. * */ public static JFreeChart createWindPlot(String title, String xAxisLabel, String yAxisLabel, WindDataset dataset, boolean legend, boolean tooltips, boolean urls) { ValueAxis xAxis = new DateAxis(xAxisLabel); ValueAxis yAxis = new NumberAxis(yAxisLabel); yAxis.setRange(-12.0, 12.0); WindItemRenderer renderer = new WindItemRenderer(); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
Example #2
Source File: ChartFactory.java From openstock with GNU General Public License v3.0 | 6 votes |
/** * Creates a line chart (based on an {@link XYDataset}) with default * settings. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel a label for the X-axis (<code>null</code> permitted). * @param yAxisLabel a label for the Y-axis (<code>null</code> permitted). * @param dataset the dataset for the chart (<code>null</code> permitted). * @param orientation the plot orientation (horizontal or vertical) * (<code>null</code> NOT permitted). * @param legend a flag specifying whether or not a legend is required. * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return The chart. */ public static JFreeChart createXYLineChart(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { ParamChecks.nullNotPermitted(orientation, "orientation"); NumberAxis xAxis = new NumberAxis(xAxisLabel); xAxis.setAutoRangeIncludesZero(false); NumberAxis yAxis = new NumberAxis(yAxisLabel); XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false); XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(orientation); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
Example #3
Source File: ChartFactory.java From buffer_bci with GNU General Public License v3.0 | 6 votes |
/** * Creates a wind plot with default settings. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel a label for the x-axis (<code>null</code> permitted). * @param yAxisLabel a label for the y-axis (<code>null</code> permitted). * @param dataset the dataset for the chart (<code>null</code> permitted). * @param legend a flag that controls whether or not a legend is created. * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return A wind plot. * */ public static JFreeChart createWindPlot(String title, String xAxisLabel, String yAxisLabel, WindDataset dataset, boolean legend, boolean tooltips, boolean urls) { ValueAxis xAxis = new DateAxis(xAxisLabel); ValueAxis yAxis = new NumberAxis(yAxisLabel); yAxis.setRange(-12.0, 12.0); WindItemRenderer renderer = new WindItemRenderer(); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
Example #4
Source File: ChartFactory.java From buffer_bci with GNU General Public License v3.0 | 6 votes |
/** * Creates a line chart (based on an {@link XYDataset}) with default * settings. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel a label for the X-axis (<code>null</code> permitted). * @param yAxisLabel a label for the Y-axis (<code>null</code> permitted). * @param dataset the dataset for the chart (<code>null</code> permitted). * @param orientation the plot orientation (horizontal or vertical) * (<code>null</code> NOT permitted). * @param legend a flag specifying whether or not a legend is required. * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return The chart. */ public static JFreeChart createXYLineChart(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { ParamChecks.nullNotPermitted(orientation, "orientation"); NumberAxis xAxis = new NumberAxis(xAxisLabel); xAxis.setAutoRangeIncludesZero(false); NumberAxis yAxis = new NumberAxis(yAxisLabel); XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false); XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(orientation); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
Example #5
Source File: ChartFactory.java From buffer_bci with GNU General Public License v3.0 | 6 votes |
/** * Creates a wind plot with default settings. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel a label for the x-axis (<code>null</code> permitted). * @param yAxisLabel a label for the y-axis (<code>null</code> permitted). * @param dataset the dataset for the chart (<code>null</code> permitted). * @param legend a flag that controls whether or not a legend is created. * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return A wind plot. * */ public static JFreeChart createWindPlot(String title, String xAxisLabel, String yAxisLabel, WindDataset dataset, boolean legend, boolean tooltips, boolean urls) { ValueAxis xAxis = new DateAxis(xAxisLabel); ValueAxis yAxis = new NumberAxis(yAxisLabel); yAxis.setRange(-12.0, 12.0); WindItemRenderer renderer = new WindItemRenderer(); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
Example #6
Source File: ChartFactory.java From buffer_bci with GNU General Public License v3.0 | 6 votes |
/** * Creates a line chart (based on an {@link XYDataset}) with default * settings. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel a label for the X-axis (<code>null</code> permitted). * @param yAxisLabel a label for the Y-axis (<code>null</code> permitted). * @param dataset the dataset for the chart (<code>null</code> permitted). * @param orientation the plot orientation (horizontal or vertical) * (<code>null</code> NOT permitted). * @param legend a flag specifying whether or not a legend is required. * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return The chart. */ public static JFreeChart createXYLineChart(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { ParamChecks.nullNotPermitted(orientation, "orientation"); NumberAxis xAxis = new NumberAxis(xAxisLabel); xAxis.setAutoRangeIncludesZero(false); NumberAxis yAxis = new NumberAxis(yAxisLabel); XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false); XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(orientation); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
Example #7
Source File: ChartFactory.java From ECG-Viewer with GNU General Public License v2.0 | 6 votes |
/** * Creates a wind plot with default settings. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel a label for the x-axis (<code>null</code> permitted). * @param yAxisLabel a label for the y-axis (<code>null</code> permitted). * @param dataset the dataset for the chart (<code>null</code> permitted). * @param legend a flag that controls whether or not a legend is created. * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return A wind plot. * */ public static JFreeChart createWindPlot(String title, String xAxisLabel, String yAxisLabel, WindDataset dataset, boolean legend, boolean tooltips, boolean urls) { ValueAxis xAxis = new DateAxis(xAxisLabel); ValueAxis yAxis = new NumberAxis(yAxisLabel); yAxis.setRange(-12.0, 12.0); WindItemRenderer renderer = new WindItemRenderer(); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
Example #8
Source File: ChartFactory.java From ECG-Viewer with GNU General Public License v2.0 | 6 votes |
/** * Creates a line chart (based on an {@link XYDataset}) with default * settings. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel a label for the X-axis (<code>null</code> permitted). * @param yAxisLabel a label for the Y-axis (<code>null</code> permitted). * @param dataset the dataset for the chart (<code>null</code> permitted). * @param orientation the plot orientation (horizontal or vertical) * (<code>null</code> NOT permitted). * @param legend a flag specifying whether or not a legend is required. * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return The chart. */ public static JFreeChart createXYLineChart(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { ParamChecks.nullNotPermitted(orientation, "orientation"); NumberAxis xAxis = new NumberAxis(xAxisLabel); xAxis.setAutoRangeIncludesZero(false); NumberAxis yAxis = new NumberAxis(yAxisLabel); XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false); XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(orientation); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
Example #9
Source File: ChartFactory.java From SIMVA-SoS with Apache License 2.0 | 6 votes |
/** * Creates a wind plot with default settings. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel a label for the x-axis (<code>null</code> permitted). * @param yAxisLabel a label for the y-axis (<code>null</code> permitted). * @param dataset the dataset for the chart (<code>null</code> permitted). * @param legend a flag that controls whether or not a legend is created. * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return A wind plot. * */ public static JFreeChart createWindPlot(String title, String xAxisLabel, String yAxisLabel, WindDataset dataset, boolean legend, boolean tooltips, boolean urls) { ValueAxis xAxis = new DateAxis(xAxisLabel); ValueAxis yAxis = new NumberAxis(yAxisLabel); yAxis.setRange(-12.0, 12.0); WindItemRenderer renderer = new WindItemRenderer(); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
Example #10
Source File: ChartFactory.java From SIMVA-SoS with Apache License 2.0 | 6 votes |
/** * Creates a line chart (based on an {@link XYDataset}) with default * settings. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel a label for the X-axis (<code>null</code> permitted). * @param yAxisLabel a label for the Y-axis (<code>null</code> permitted). * @param dataset the dataset for the chart (<code>null</code> permitted). * @param orientation the plot orientation (horizontal or vertical) * (<code>null</code> NOT permitted). * @param legend a flag specifying whether or not a legend is required. * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return The chart. */ public static JFreeChart createXYLineChart(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { ParamChecks.nullNotPermitted(orientation, "orientation"); NumberAxis xAxis = new NumberAxis(xAxisLabel); xAxis.setAutoRangeIncludesZero(false); NumberAxis yAxis = new NumberAxis(yAxisLabel); XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false); XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(orientation); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
Example #11
Source File: ChartFactory.java From ccu-historian with GNU General Public License v3.0 | 6 votes |
/** * Creates a wind plot with default settings. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel a label for the x-axis (<code>null</code> permitted). * @param yAxisLabel a label for the y-axis (<code>null</code> permitted). * @param dataset the dataset for the chart (<code>null</code> permitted). * @param legend a flag that controls whether or not a legend is created. * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return A wind plot. * */ public static JFreeChart createWindPlot(String title, String xAxisLabel, String yAxisLabel, WindDataset dataset, boolean legend, boolean tooltips, boolean urls) { ValueAxis xAxis = new DateAxis(xAxisLabel); ValueAxis yAxis = new NumberAxis(yAxisLabel); yAxis.setRange(-12.0, 12.0); WindItemRenderer renderer = new WindItemRenderer(); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
Example #12
Source File: ChartFactory.java From ccu-historian with GNU General Public License v3.0 | 6 votes |
/** * Creates a line chart (based on an {@link XYDataset}) with default * settings. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel a label for the X-axis (<code>null</code> permitted). * @param yAxisLabel a label for the Y-axis (<code>null</code> permitted). * @param dataset the dataset for the chart (<code>null</code> permitted). * @param orientation the plot orientation (horizontal or vertical) * (<code>null</code> NOT permitted). * @param legend a flag specifying whether or not a legend is required. * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return The chart. */ public static JFreeChart createXYLineChart(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { ParamChecks.nullNotPermitted(orientation, "orientation"); NumberAxis xAxis = new NumberAxis(xAxisLabel); xAxis.setAutoRangeIncludesZero(false); NumberAxis yAxis = new NumberAxis(yAxisLabel); XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false); XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(orientation); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
Example #13
Source File: ChartFactory.java From SIMVA-SoS with Apache License 2.0 | 5 votes |
/** * Creates a histogram chart. This chart is constructed with an * {@link XYPlot} using an {@link XYBarRenderer}. The domain and range * axes are {@link NumberAxis} instances. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel the x axis label (<code>null</code> permitted). * @param yAxisLabel the y axis label (<code>null</code> permitted). * @param dataset the dataset (<code>null</code> permitted). * @param orientation the orientation (horizontal or vertical) * (<code>null</code> NOT permitted). * @param legend create a legend? * @param tooltips display tooltips? * @param urls generate URLs? * * @return The chart. */ public static JFreeChart createHistogram(String title, String xAxisLabel, String yAxisLabel, IntervalXYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { ParamChecks.nullNotPermitted(orientation, "orientation"); NumberAxis xAxis = new NumberAxis(xAxisLabel); xAxis.setAutoRangeIncludesZero(false); ValueAxis yAxis = new NumberAxis(yAxisLabel); XYItemRenderer renderer = new XYBarRenderer(); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(orientation); plot.setDomainZeroBaselineVisible(true); plot.setRangeZeroBaselineVisible(true); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
Example #14
Source File: ChartFactory.java From buffer_bci with GNU General Public License v3.0 | 5 votes |
/** * Creates a histogram chart. This chart is constructed with an * {@link XYPlot} using an {@link XYBarRenderer}. The domain and range * axes are {@link NumberAxis} instances. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel the x axis label (<code>null</code> permitted). * @param yAxisLabel the y axis label (<code>null</code> permitted). * @param dataset the dataset (<code>null</code> permitted). * @param orientation the orientation (horizontal or vertical) * (<code>null</code> NOT permitted). * @param legend create a legend? * @param tooltips display tooltips? * @param urls generate URLs? * * @return The chart. */ public static JFreeChart createHistogram(String title, String xAxisLabel, String yAxisLabel, IntervalXYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { ParamChecks.nullNotPermitted(orientation, "orientation"); NumberAxis xAxis = new NumberAxis(xAxisLabel); xAxis.setAutoRangeIncludesZero(false); ValueAxis yAxis = new NumberAxis(yAxisLabel); XYItemRenderer renderer = new XYBarRenderer(); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(orientation); plot.setDomainZeroBaselineVisible(true); plot.setRangeZeroBaselineVisible(true); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
Example #15
Source File: ChartFactory.java From openstock with GNU General Public License v3.0 | 5 votes |
/** * Creates a histogram chart. This chart is constructed with an * {@link XYPlot} using an {@link XYBarRenderer}. The domain and range * axes are {@link NumberAxis} instances. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel the x axis label (<code>null</code> permitted). * @param yAxisLabel the y axis label (<code>null</code> permitted). * @param dataset the dataset (<code>null</code> permitted). * @param orientation the orientation (horizontal or vertical) * (<code>null</code> NOT permitted). * @param legend create a legend? * @param tooltips display tooltips? * @param urls generate URLs? * * @return The chart. */ public static JFreeChart createHistogram(String title, String xAxisLabel, String yAxisLabel, IntervalXYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { ParamChecks.nullNotPermitted(orientation, "orientation"); NumberAxis xAxis = new NumberAxis(xAxisLabel); xAxis.setAutoRangeIncludesZero(false); ValueAxis yAxis = new NumberAxis(yAxisLabel); XYItemRenderer renderer = new XYBarRenderer(); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(orientation); plot.setDomainZeroBaselineVisible(true); plot.setRangeZeroBaselineVisible(true); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
Example #16
Source File: ChartFactory.java From buffer_bci with GNU General Public License v3.0 | 5 votes |
/** * Creates a histogram chart. This chart is constructed with an * {@link XYPlot} using an {@link XYBarRenderer}. The domain and range * axes are {@link NumberAxis} instances. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel the x axis label (<code>null</code> permitted). * @param yAxisLabel the y axis label (<code>null</code> permitted). * @param dataset the dataset (<code>null</code> permitted). * @param orientation the orientation (horizontal or vertical) * (<code>null</code> NOT permitted). * @param legend create a legend? * @param tooltips display tooltips? * @param urls generate URLs? * * @return The chart. */ public static JFreeChart createHistogram(String title, String xAxisLabel, String yAxisLabel, IntervalXYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { ParamChecks.nullNotPermitted(orientation, "orientation"); NumberAxis xAxis = new NumberAxis(xAxisLabel); xAxis.setAutoRangeIncludesZero(false); ValueAxis yAxis = new NumberAxis(yAxisLabel); XYItemRenderer renderer = new XYBarRenderer(); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(orientation); plot.setDomainZeroBaselineVisible(true); plot.setRangeZeroBaselineVisible(true); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
Example #17
Source File: ChartFactory.java From opensim-gui with Apache License 2.0 | 5 votes |
/** * Creates a wind plot with default settings. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel a label for the x-axis (<code>null</code> permitted). * @param yAxisLabel a label for the y-axis (<code>null</code> permitted). * @param dataset the dataset for the chart (<code>null</code> permitted). * @param legend a flag that controls whether or not a legend is created. * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return A wind plot. * */ public static JFreeChart createWindPlot(String title, String xAxisLabel, String yAxisLabel, WindDataset dataset, boolean legend, boolean tooltips, boolean urls) { ValueAxis xAxis = new DateAxis(xAxisLabel); ValueAxis yAxis = new NumberAxis(yAxisLabel); yAxis.setRange(-12.0, 12.0); WindItemRenderer renderer = new WindItemRenderer(); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); return chart; }
Example #18
Source File: ChartFactory.java From opensim-gui with Apache License 2.0 | 5 votes |
/** * Creates a histogram chart. This chart is constructed with an * {@link XYPlot} using an {@link XYBarRenderer}. The domain and range * axes are {@link NumberAxis} instances. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel the x axis label (<code>null</code> permitted). * @param yAxisLabel the y axis label (<code>null</code> permitted). * @param dataset the dataset (<code>null</code> permitted). * @param orientation the orientation (horizontal or vertical) * (<code>null</code> NOT permitted). * @param legend create a legend? * @param tooltips display tooltips? * @param urls generate URLs? * * @return The chart. */ public static JFreeChart createHistogram(String title, String xAxisLabel, String yAxisLabel, IntervalXYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { if (orientation == null) { throw new IllegalArgumentException("Null 'orientation' argument."); } NumberAxis xAxis = new NumberAxis(xAxisLabel); xAxis.setAutoRangeIncludesZero(false); ValueAxis yAxis = new NumberAxis(yAxisLabel); XYItemRenderer renderer = new XYBarRenderer(); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(orientation); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); return chart; }
Example #19
Source File: ChartFactory.java From opensim-gui with Apache License 2.0 | 5 votes |
/** * Creates a line chart (based on an {@link XYDataset}) with default * settings. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel a label for the X-axis (<code>null</code> permitted). * @param yAxisLabel a label for the Y-axis (<code>null</code> permitted). * @param dataset the dataset for the chart (<code>null</code> permitted). * @param orientation the plot orientation (horizontal or vertical) * (<code>null</code> NOT permitted). * @param legend a flag specifying whether or not a legend is required. * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return The chart. */ public static JFreeChart createXYLineChart(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { if (orientation == null) { throw new IllegalArgumentException("Null 'orientation' argument."); } NumberAxis xAxis = new NumberAxis(xAxisLabel); xAxis.setAutoRangeIncludesZero(false); NumberAxis yAxis = new NumberAxis(yAxisLabel); XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false); XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(orientation); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); return chart; }
Example #20
Source File: ChartFactory.java From astor with GNU General Public License v2.0 | 5 votes |
/** * Creates a wind plot with default settings. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel a label for the x-axis (<code>null</code> permitted). * @param yAxisLabel a label for the y-axis (<code>null</code> permitted). * @param dataset the dataset for the chart (<code>null</code> permitted). * @param legend a flag that controls whether or not a legend is created. * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return A wind plot. * */ public static JFreeChart createWindPlot(String title, String xAxisLabel, String yAxisLabel, WindDataset dataset, boolean legend, boolean tooltips, boolean urls) { ValueAxis xAxis = new DateAxis(xAxisLabel); ValueAxis yAxis = new NumberAxis(yAxisLabel); yAxis.setRange(-12.0, 12.0); WindItemRenderer renderer = new WindItemRenderer(); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setBaseURLGenerator(new StandardXYURLGenerator()); } XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); return chart; }
Example #21
Source File: ChartFactory.java From astor with GNU General Public License v2.0 | 5 votes |
/** * Creates a histogram chart. This chart is constructed with an * {@link XYPlot} using an {@link XYBarRenderer}. The domain and range * axes are {@link NumberAxis} instances. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel the x axis label (<code>null</code> permitted). * @param yAxisLabel the y axis label (<code>null</code> permitted). * @param dataset the dataset (<code>null</code> permitted). * @param orientation the orientation (horizontal or vertical) * (<code>null</code> NOT permitted). * @param legend create a legend? * @param tooltips display tooltips? * @param urls generate URLs? * * @return The chart. */ public static JFreeChart createHistogram(String title, String xAxisLabel, String yAxisLabel, IntervalXYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { if (orientation == null) { throw new IllegalArgumentException("Null 'orientation' argument."); } NumberAxis xAxis = new NumberAxis(xAxisLabel); xAxis.setAutoRangeIncludesZero(false); ValueAxis yAxis = new NumberAxis(yAxisLabel); XYItemRenderer renderer = new XYBarRenderer(); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setBaseURLGenerator(new StandardXYURLGenerator()); } XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(orientation); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); return chart; }
Example #22
Source File: ChartFactory.java From astor with GNU General Public License v2.0 | 5 votes |
/** * Creates a line chart (based on an {@link XYDataset}) with default * settings. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel a label for the X-axis (<code>null</code> permitted). * @param yAxisLabel a label for the Y-axis (<code>null</code> permitted). * @param dataset the dataset for the chart (<code>null</code> permitted). * @param orientation the plot orientation (horizontal or vertical) * (<code>null</code> NOT permitted). * @param legend a flag specifying whether or not a legend is required. * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return The chart. */ public static JFreeChart createXYLineChart(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { if (orientation == null) { throw new IllegalArgumentException("Null 'orientation' argument."); } NumberAxis xAxis = new NumberAxis(xAxisLabel); xAxis.setAutoRangeIncludesZero(false); NumberAxis yAxis = new NumberAxis(yAxisLabel); XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false); XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(orientation); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setBaseURLGenerator(new StandardXYURLGenerator()); } JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); return chart; }
Example #23
Source File: ChartFactory.java From ccu-historian with GNU General Public License v3.0 | 5 votes |
/** * Creates a histogram chart. This chart is constructed with an * {@link XYPlot} using an {@link XYBarRenderer}. The domain and range * axes are {@link NumberAxis} instances. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel the x axis label (<code>null</code> permitted). * @param yAxisLabel the y axis label (<code>null</code> permitted). * @param dataset the dataset (<code>null</code> permitted). * @param orientation the orientation (horizontal or vertical) * (<code>null</code> NOT permitted). * @param legend create a legend? * @param tooltips display tooltips? * @param urls generate URLs? * * @return The chart. */ public static JFreeChart createHistogram(String title, String xAxisLabel, String yAxisLabel, IntervalXYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { ParamChecks.nullNotPermitted(orientation, "orientation"); NumberAxis xAxis = new NumberAxis(xAxisLabel); xAxis.setAutoRangeIncludesZero(false); ValueAxis yAxis = new NumberAxis(yAxisLabel); XYItemRenderer renderer = new XYBarRenderer(); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(orientation); plot.setDomainZeroBaselineVisible(true); plot.setRangeZeroBaselineVisible(true); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
Example #24
Source File: ChartFactory.java From ECG-Viewer with GNU General Public License v2.0 | 5 votes |
/** * Creates a histogram chart. This chart is constructed with an * {@link XYPlot} using an {@link XYBarRenderer}. The domain and range * axes are {@link NumberAxis} instances. * * @param title the chart title (<code>null</code> permitted). * @param xAxisLabel the x axis label (<code>null</code> permitted). * @param yAxisLabel the y axis label (<code>null</code> permitted). * @param dataset the dataset (<code>null</code> permitted). * @param orientation the orientation (horizontal or vertical) * (<code>null</code> NOT permitted). * @param legend create a legend? * @param tooltips display tooltips? * @param urls generate URLs? * * @return The chart. */ public static JFreeChart createHistogram(String title, String xAxisLabel, String yAxisLabel, IntervalXYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { ParamChecks.nullNotPermitted(orientation, "orientation"); NumberAxis xAxis = new NumberAxis(xAxisLabel); xAxis.setAutoRangeIncludesZero(false); ValueAxis yAxis = new NumberAxis(yAxisLabel); XYItemRenderer renderer = new XYBarRenderer(); if (tooltips) { renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); } if (urls) { renderer.setURLGenerator(new StandardXYURLGenerator()); } XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(orientation); plot.setDomainZeroBaselineVisible(true); plot.setRangeZeroBaselineVisible(true); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
Example #25
Source File: YIntervalRendererTests.java From astor with GNU General Public License v2.0 | 4 votes |
/** * Check that the equals() method distinguishes all fields. */ public void testEquals() { YIntervalRenderer r1 = new YIntervalRenderer(); YIntervalRenderer r2 = new YIntervalRenderer(); assertEquals(r1, r2); // the following fields are inherited from the AbstractXYItemRenderer r1.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator()); assertFalse(r1.equals(r2)); r2.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator()); assertTrue(r1.equals(r2)); r1.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator()); assertFalse(r1.equals(r2)); r2.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator()); assertTrue(r1.equals(r2)); r1.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator()); assertFalse(r1.equals(r2)); r2.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator()); assertTrue(r1.equals(r2)); r1.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); assertFalse(r1.equals(r2)); r2.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); assertTrue(r1.equals(r2)); r1.setSeriesURLGenerator(0, new StandardXYURLGenerator()); assertFalse(r1.equals(r2)); r2.setSeriesURLGenerator(0, new StandardXYURLGenerator()); assertTrue(r1.equals(r2)); r1.setBaseURLGenerator(new StandardXYURLGenerator()); assertFalse(r1.equals(r2)); r2.setBaseURLGenerator(new StandardXYURLGenerator()); assertTrue(r1.equals(r2)); r1.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.FOREGROUND); assertFalse(r1.equals(r2)); r2.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.FOREGROUND); assertTrue(r1.equals(r2)); r1.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.BACKGROUND); assertFalse(r1.equals(r2)); r2.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.BACKGROUND); assertTrue(r1.equals(r2)); r1.setDefaultEntityRadius(99); assertFalse(r1.equals(r2)); r2.setDefaultEntityRadius(99); assertTrue(r1.equals(r2)); r1.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator( "{0} {1}")); assertFalse(r1.equals(r2)); r2.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator( "{0} {1}")); assertTrue(r1.equals(r2)); r1.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator()); assertFalse(r1.equals(r2)); r2.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator()); assertTrue(r1.equals(r2)); r1.setLegendItemURLGenerator(new StandardXYSeriesLabelGenerator()); assertFalse(r1.equals(r2)); r2.setLegendItemURLGenerator(new StandardXYSeriesLabelGenerator()); assertTrue(r1.equals(r2)); }
Example #26
Source File: StandardXYURLGeneratorTests.java From astor with GNU General Public License v2.0 | 4 votes |
/** * Checks that the class does not implement PublicCloneable (the generator * is immutable). */ public void testPublicCloneable() { StandardXYURLGenerator g1 = new StandardXYURLGenerator("index.html?"); assertFalse(g1 instanceof PublicCloneable); }
Example #27
Source File: YIntervalRendererTests.java From astor with GNU General Public License v2.0 | 4 votes |
/** * Check that the equals() method distinguishes all fields. */ public void testEquals() { YIntervalRenderer r1 = new YIntervalRenderer(); YIntervalRenderer r2 = new YIntervalRenderer(); assertEquals(r1, r2); // the following fields are inherited from the AbstractXYItemRenderer r1.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator()); assertFalse(r1.equals(r2)); r2.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator()); assertTrue(r1.equals(r2)); r1.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator()); assertFalse(r1.equals(r2)); r2.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator()); assertTrue(r1.equals(r2)); r1.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator()); assertFalse(r1.equals(r2)); r2.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator()); assertTrue(r1.equals(r2)); r1.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); assertFalse(r1.equals(r2)); r2.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); assertTrue(r1.equals(r2)); r1.setSeriesURLGenerator(0, new StandardXYURLGenerator()); assertFalse(r1.equals(r2)); r2.setSeriesURLGenerator(0, new StandardXYURLGenerator()); assertTrue(r1.equals(r2)); r1.setBaseURLGenerator(new StandardXYURLGenerator()); assertFalse(r1.equals(r2)); r2.setBaseURLGenerator(new StandardXYURLGenerator()); assertTrue(r1.equals(r2)); r1.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.FOREGROUND); assertFalse(r1.equals(r2)); r2.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.FOREGROUND); assertTrue(r1.equals(r2)); r1.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.BACKGROUND); assertFalse(r1.equals(r2)); r2.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.BACKGROUND); assertTrue(r1.equals(r2)); r1.setDefaultEntityRadius(99); assertFalse(r1.equals(r2)); r2.setDefaultEntityRadius(99); assertTrue(r1.equals(r2)); r1.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator( "{0} {1}")); assertFalse(r1.equals(r2)); r2.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator( "{0} {1}")); assertTrue(r1.equals(r2)); r1.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator()); assertFalse(r1.equals(r2)); r2.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator()); assertTrue(r1.equals(r2)); r1.setLegendItemURLGenerator(new StandardXYSeriesLabelGenerator()); assertFalse(r1.equals(r2)); r2.setLegendItemURLGenerator(new StandardXYSeriesLabelGenerator()); assertTrue(r1.equals(r2)); r1.setAdditionalItemLabelGenerator(new IntervalXYItemLabelGenerator()); assertFalse(r1.equals(r2)); r2.setAdditionalItemLabelGenerator(new IntervalXYItemLabelGenerator()); assertTrue(r1.equals(r2)); }
Example #28
Source File: YIntervalRendererTest.java From buffer_bci with GNU General Public License v3.0 | 4 votes |
/** * Check that the equals() method distinguishes all fields. */ @Test public void testEquals() { YIntervalRenderer r1 = new YIntervalRenderer(); YIntervalRenderer r2 = new YIntervalRenderer(); assertEquals(r1, r2); // the following fields are inherited from the AbstractXYItemRenderer r1.setItemLabelGenerator(new StandardXYItemLabelGenerator()); assertFalse(r1.equals(r2)); r2.setItemLabelGenerator(new StandardXYItemLabelGenerator()); assertTrue(r1.equals(r2)); r1.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator()); assertFalse(r1.equals(r2)); r2.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator()); assertTrue(r1.equals(r2)); r1.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator()); assertFalse(r1.equals(r2)); r2.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator()); assertTrue(r1.equals(r2)); r1.setToolTipGenerator(new StandardXYToolTipGenerator()); assertFalse(r1.equals(r2)); r2.setToolTipGenerator(new StandardXYToolTipGenerator()); assertTrue(r1.equals(r2)); r1.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator()); assertFalse(r1.equals(r2)); r2.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator()); assertTrue(r1.equals(r2)); r1.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); assertFalse(r1.equals(r2)); r2.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); assertTrue(r1.equals(r2)); r1.setURLGenerator(new StandardXYURLGenerator()); assertFalse(r1.equals(r2)); r2.setURLGenerator(new StandardXYURLGenerator()); assertTrue(r1.equals(r2)); r1.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.FOREGROUND); assertFalse(r1.equals(r2)); r2.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.FOREGROUND); assertTrue(r1.equals(r2)); r1.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.BACKGROUND); assertFalse(r1.equals(r2)); r2.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.BACKGROUND); assertTrue(r1.equals(r2)); r1.setDefaultEntityRadius(99); assertFalse(r1.equals(r2)); r2.setDefaultEntityRadius(99); assertTrue(r1.equals(r2)); r1.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator( "{0} {1}")); assertFalse(r1.equals(r2)); r2.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator( "{0} {1}")); assertTrue(r1.equals(r2)); r1.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator()); assertFalse(r1.equals(r2)); r2.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator()); assertTrue(r1.equals(r2)); r1.setLegendItemURLGenerator(new StandardXYSeriesLabelGenerator()); assertFalse(r1.equals(r2)); r2.setLegendItemURLGenerator(new StandardXYSeriesLabelGenerator()); assertTrue(r1.equals(r2)); r1.setAdditionalItemLabelGenerator(new IntervalXYItemLabelGenerator()); assertFalse(r1.equals(r2)); r2.setAdditionalItemLabelGenerator(new IntervalXYItemLabelGenerator()); assertTrue(r1.equals(r2)); }
Example #29
Source File: YIntervalRendererTest.java From ccu-historian with GNU General Public License v3.0 | 4 votes |
/** * Check that the equals() method distinguishes all fields. */ @Test public void testEquals() { YIntervalRenderer r1 = new YIntervalRenderer(); YIntervalRenderer r2 = new YIntervalRenderer(); assertEquals(r1, r2); // the following fields are inherited from the AbstractXYItemRenderer r1.setItemLabelGenerator(new StandardXYItemLabelGenerator()); assertFalse(r1.equals(r2)); r2.setItemLabelGenerator(new StandardXYItemLabelGenerator()); assertTrue(r1.equals(r2)); r1.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator()); assertFalse(r1.equals(r2)); r2.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator()); assertTrue(r1.equals(r2)); r1.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator()); assertFalse(r1.equals(r2)); r2.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator()); assertTrue(r1.equals(r2)); r1.setToolTipGenerator(new StandardXYToolTipGenerator()); assertFalse(r1.equals(r2)); r2.setToolTipGenerator(new StandardXYToolTipGenerator()); assertTrue(r1.equals(r2)); r1.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator()); assertFalse(r1.equals(r2)); r2.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator()); assertTrue(r1.equals(r2)); r1.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); assertFalse(r1.equals(r2)); r2.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); assertTrue(r1.equals(r2)); r1.setURLGenerator(new StandardXYURLGenerator()); assertFalse(r1.equals(r2)); r2.setURLGenerator(new StandardXYURLGenerator()); assertTrue(r1.equals(r2)); r1.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.FOREGROUND); assertFalse(r1.equals(r2)); r2.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.FOREGROUND); assertTrue(r1.equals(r2)); r1.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.BACKGROUND); assertFalse(r1.equals(r2)); r2.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.BACKGROUND); assertTrue(r1.equals(r2)); r1.setDefaultEntityRadius(99); assertFalse(r1.equals(r2)); r2.setDefaultEntityRadius(99); assertTrue(r1.equals(r2)); r1.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator( "{0} {1}")); assertFalse(r1.equals(r2)); r2.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator( "{0} {1}")); assertTrue(r1.equals(r2)); r1.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator()); assertFalse(r1.equals(r2)); r2.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator()); assertTrue(r1.equals(r2)); r1.setLegendItemURLGenerator(new StandardXYSeriesLabelGenerator()); assertFalse(r1.equals(r2)); r2.setLegendItemURLGenerator(new StandardXYSeriesLabelGenerator()); assertTrue(r1.equals(r2)); r1.setAdditionalItemLabelGenerator(new IntervalXYItemLabelGenerator()); assertFalse(r1.equals(r2)); r2.setAdditionalItemLabelGenerator(new IntervalXYItemLabelGenerator()); assertTrue(r1.equals(r2)); }
Example #30
Source File: YIntervalRendererTest.java From ECG-Viewer with GNU General Public License v2.0 | 4 votes |
/** * Check that the equals() method distinguishes all fields. */ @Test public void testEquals() { YIntervalRenderer r1 = new YIntervalRenderer(); YIntervalRenderer r2 = new YIntervalRenderer(); assertEquals(r1, r2); // the following fields are inherited from the AbstractXYItemRenderer r1.setItemLabelGenerator(new StandardXYItemLabelGenerator()); assertFalse(r1.equals(r2)); r2.setItemLabelGenerator(new StandardXYItemLabelGenerator()); assertTrue(r1.equals(r2)); r1.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator()); assertFalse(r1.equals(r2)); r2.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator()); assertTrue(r1.equals(r2)); r1.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator()); assertFalse(r1.equals(r2)); r2.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator()); assertTrue(r1.equals(r2)); r1.setToolTipGenerator(new StandardXYToolTipGenerator()); assertFalse(r1.equals(r2)); r2.setToolTipGenerator(new StandardXYToolTipGenerator()); assertTrue(r1.equals(r2)); r1.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator()); assertFalse(r1.equals(r2)); r2.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator()); assertTrue(r1.equals(r2)); r1.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); assertFalse(r1.equals(r2)); r2.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); assertTrue(r1.equals(r2)); r1.setURLGenerator(new StandardXYURLGenerator()); assertFalse(r1.equals(r2)); r2.setURLGenerator(new StandardXYURLGenerator()); assertTrue(r1.equals(r2)); r1.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.FOREGROUND); assertFalse(r1.equals(r2)); r2.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.FOREGROUND); assertTrue(r1.equals(r2)); r1.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.BACKGROUND); assertFalse(r1.equals(r2)); r2.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.BACKGROUND); assertTrue(r1.equals(r2)); r1.setDefaultEntityRadius(99); assertFalse(r1.equals(r2)); r2.setDefaultEntityRadius(99); assertTrue(r1.equals(r2)); r1.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator( "{0} {1}")); assertFalse(r1.equals(r2)); r2.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator( "{0} {1}")); assertTrue(r1.equals(r2)); r1.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator()); assertFalse(r1.equals(r2)); r2.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator()); assertTrue(r1.equals(r2)); r1.setLegendItemURLGenerator(new StandardXYSeriesLabelGenerator()); assertFalse(r1.equals(r2)); r2.setLegendItemURLGenerator(new StandardXYSeriesLabelGenerator()); assertTrue(r1.equals(r2)); r1.setAdditionalItemLabelGenerator(new IntervalXYItemLabelGenerator()); assertFalse(r1.equals(r2)); r2.setAdditionalItemLabelGenerator(new IntervalXYItemLabelGenerator()); assertTrue(r1.equals(r2)); }