\r
import javax.swing.SwingUtilities;\r
\r
+import org.jfree.chart.JFreeChart;\r
import org.jfree.chart.axis.Axis;\r
import org.jfree.chart.plot.Plot;\r
import org.simantics.db.ReadGraph;\r
protected Plot plot;\r
protected PlotProperties currentProperties;\r
private PlotPropertyListener listener;\r
-\r
+ private org.jfree.chart.JFreeChart jfreechart;\r
\r
public AbstractPlot(ReadGraph graph, Resource resource) {\r
this.resource = resource;\r
public Resource getResource() {\r
return resource;\r
}\r
+ \r
+ @Override\r
+ public void setJFreeChart(JFreeChart jfreechart) {\r
+ this.jfreechart = jfreechart;\r
+ }\r
+ \r
+ public org.jfree.chart.JFreeChart getJfreechart() {\r
+ return jfreechart;\r
+ }\r
\r
protected abstract Plot newPlot();\r
protected abstract void setPlotProperties(PlotProperties properties);\r
}\r
\r
@Override\r
- public void configurePlot() {\r
+ public void configurePlot(PlotProperties properties) {\r
// TODO Auto-generated method stub\r
\r
}\r
@Override\r
public void run() {\r
setPlotProperties(result);\r
- configurePlot();\r
+ configurePlot(result);\r
}\r
});\r
}\r
*******************************************************************************/\r
package org.simantics.jfreechart.chart;\r
\r
+import org.jfree.chart.JFreeChart;\r
import org.jfree.chart.plot.Plot;\r
import org.simantics.db.Resource;\r
import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.jfreechart.chart.AbstractPlot.PlotProperties;\r
\r
/**\r
* Interface for JFreeChart.Plot type resource\r
*/\r
public Resource getResource();\r
\r
- public void configurePlot();\r
+ public void configurePlot(PlotProperties properties);\r
\r
+ \r
+ public void setJFreeChart(JFreeChart jfreechart);\r
+ \r
+ public JFreeChart getJfreechart();\r
}\r
\r
if(jfreechart == null)\r
jfreechart = new org.jfree.chart.JFreeChart(plot.getPlot());\r
-\r
+ \r
+ plot.setJFreeChart(jfreechart);\r
+ \r
if(listener == null) {\r
listener = new JFreeChartListener();\r
SimanticsUI.getSession().asyncRequest(new Read<Pair<ITitle, Boolean>>() {\r