org.keridwen.modelling.group.editor.utils
Class Plot2D

java.lang.Object
  extended by org.keridwen.modelling.group.editor.utils.Plot2D
All Implemented Interfaces:
EventListener, org.jfree.chart.event.PlotChangeListener

public class Plot2D
extends Object
implements org.jfree.chart.event.PlotChangeListener

Generate 2D, i.e y=f(x) like, plots.

Author:
J.Forest, Artenum SARL.

Constructor Summary
Plot2D(double[] x, double[] y, String title, String labelTitle, String legend)
          Main constructor.
Plot2D(com.artenum.frida.characteristic.SeriesOfDoubleCharacteristic series, String title, String labelTitle, String legend)
           
 
Method Summary
 void appendSeriesToCollection(com.artenum.frida.characteristic.SeriesOfDoubleCharacteristic series)
           
 void appendSeriesToCollection(String legend, double[] x, double[] y)
           
 org.jfree.chart.JFreeChart createChart(org.jfree.data.xy.XYDataset dataSet, String visuTitle, String xLabel, String yLabel)
          Generate the chart.
 org.jfree.chart.JFreeChart createChart(org.jfree.data.xy.XYSeriesCollection dataSet, String visuTitle)
          Generate the chart.
 Double getAutoXTickSize(int nbSticks)
           
 Double getAutoYTickSize(int nbSticks)
           
 org.jfree.chart.ChartPanel getChart()
          Return the final panel containing the chart.
 void plotChanged(org.jfree.chart.event.PlotChangeEvent event)
           
 void setXAxislabel(String xAxisLabel)
          Set the label of the x-axis.
 void setYAxislabel(String yAxisLabel)
          Set the label of the y-axis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Plot2D

public Plot2D(double[] x,
              double[] y,
              String title,
              String labelTitle,
              String legend)
Main constructor.

Parameters:
x - x-axis data values
y - y-axis data values
title - Title of the plot
labelTitle -
legend - - legend of the plotted values

Plot2D

public Plot2D(com.artenum.frida.characteristic.SeriesOfDoubleCharacteristic series,
              String title,
              String labelTitle,
              String legend)
Parameters:
series -
title -
labelTitle -
legend -
Method Detail

getChart

public org.jfree.chart.ChartPanel getChart()
Return the final panel containing the chart.

Returns:
ChartPanel containing the chart.

appendSeriesToCollection

public void appendSeriesToCollection(com.artenum.frida.characteristic.SeriesOfDoubleCharacteristic series)
Parameters:
seriesCollection -
series -

appendSeriesToCollection

public void appendSeriesToCollection(String legend,
                                     double[] x,
                                     double[] y)
Parameters:
seriesCollection -
legend -
x -
y -

setXAxislabel

public void setXAxislabel(String xAxisLabel)
Set the label of the x-axis.

Parameters:
xAxisLabel - - label to be set.

setYAxislabel

public void setYAxislabel(String yAxisLabel)
Set the label of the y-axis.

Parameters:
yAxisLabel - - label to be set.

getAutoYTickSize

public Double getAutoYTickSize(int nbSticks)

getAutoXTickSize

public Double getAutoXTickSize(int nbSticks)

createChart

public org.jfree.chart.JFreeChart createChart(org.jfree.data.xy.XYSeriesCollection dataSet,
                                              String visuTitle)
Generate the chart.

Parameters:
dataSet -
visuTitle -
Returns:

createChart

public org.jfree.chart.JFreeChart createChart(org.jfree.data.xy.XYDataset dataSet,
                                              String visuTitle,
                                              String xLabel,
                                              String yLabel)
Generate the chart.

Parameters:
dataSet -
visuTitle -
xLabel -
yLabel -
Returns:

plotChanged

public void plotChanged(org.jfree.chart.event.PlotChangeEvent event)
Specified by:
plotChanged in interface org.jfree.chart.event.PlotChangeListener


Copyright © 2012-2013 Artenum. All Rights Reserved.