JFreeChart SWT version
-
- Posts: 59
- Joined: Fri Oct 13, 2006 11:35 am
- Contact:
JFreeChart SWT version
Hi all,
I am raghavan , I have used Jfreechart Swing version It was fabulous to work with Tool ...
Presently My Project requirement has changed They want to Implement Jfreecharts in SWT i have used Swt version also It was good ..
I wanted to just know By when will they Release the complete JfreeChart -SWT version ..
Thanks In Advance
raghavan
I am raghavan , I have used Jfreechart Swing version It was fabulous to work with Tool ...
Presently My Project requirement has changed They want to Implement Jfreecharts in SWT i have used Swt version also It was good ..
I wanted to just know By when will they Release the complete JfreeChart -SWT version ..
Thanks In Advance
raghavan
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
There is an experimental SWTGraphics2D class in the JFreeChart 1.0.2 release. The charts that you can produce using this are usable, but not the same quality that you'll get using Java2D. This is because SWT sadly doesn't provide as rich a set of graphics functions as Java2D.
That seems odd to me, because I read that SWT uses Cairo (on Linux at least) as the graphics backend, and Cairo supports pretty much all the Java2D features that JFreeChart needs. All that is needed is for SWT to expose Cairo via the Graphics2D API, and then using JFreeChart on SWT becomes trivial.
Unfortunately I don't have the skill set required to implement this, but hopefully someone else will see the potential and do it. I'd be prepared to provide some funding for this, if someone can demonstrate that they have the skill to complete the job.
That seems odd to me, because I read that SWT uses Cairo (on Linux at least) as the graphics backend, and Cairo supports pretty much all the Java2D features that JFreeChart needs. All that is needed is for SWT to expose Cairo via the Graphics2D API, and then using JFreeChart on SWT becomes trivial.
Unfortunately I don't have the skill set required to implement this, but hopefully someone else will see the potential and do it. I'd be prepared to provide some funding for this, if someone can demonstrate that they have the skill to complete the job.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Hi Raghavan,
good to hear the experimental version is already working for you.
As pointed out by David, the chart you obtain are not as good as the java2D ones unfortunately.
One thing is if you look at the roadmap [1] of the developpement version of SWT (3.3), there is plans to improve the graphics capabilities shortly, which is great. This should lead to improvements in the SWT version of JFreeChart.
by the way if you see bugs, please report.
[1] http://www.eclipse.org/swt/R3_3/plan.html
good to hear the experimental version is already working for you.
As pointed out by David, the chart you obtain are not as good as the java2D ones unfortunately.
One thing is if you look at the roadmap [1] of the developpement version of SWT (3.3), there is plans to improve the graphics capabilities shortly, which is great. This should lead to improvements in the SWT version of JFreeChart.
by the way if you see bugs, please report.
[1] http://www.eclipse.org/swt/R3_3/plan.html
Hi,
The experimental SWT support is working fine for me too and it looks great I think. Unfortunately it is not part of the experimental JAR by default and one has to change the build script and rebuild the package.
What I'd like to see is the support of the ChartPanel methods, because currently the ChartComposite is quite limited. In my first try to disable the menu I found that SetPopupMenu() method is missing and then I found that addChartMouseListener() is also missing. Looking forward for the future versions with improved SWT support. Great job so far.
The experimental SWT support is working fine for me too and it looks great I think. Unfortunately it is not part of the experimental JAR by default and one has to change the build script and rebuild the package.
What I'd like to see is the support of the ChartPanel methods, because currently the ChartComposite is quite limited. In my first try to disable the menu I found that SetPopupMenu() method is missing and then I found that addChartMouseListener() is also missing. Looking forward for the future versions with improved SWT support. Great job so far.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
If someone knows how to modify the Ant build script so that it picks up the right SWT dependencies on different platforms, it would be great to have this automatically built.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


SWT dependencies
Why not just put swt.jar into libs directory for compilation? I did so. And for runtime, the user will put his SWT into classpath.
In Azureus project the build script assumes swt.jar is in libs dir before compilation. It is multiplatform SWT application. This is a portion of the build script:
<target name="compile" depends="init" >
<path id="libs.classpath">
<fileset dir="${root.dir}/${libs.dir}" includes="**/*.jar" />
</path>
<javac srcdir="${root.dir}" destdir="${root.dir}" .....>
<classpath refid="libs.classpath" />
</javac>
</target>
In Azureus project the build script assumes swt.jar is in libs dir before compilation. It is multiplatform SWT application. This is a portion of the build script:
<target name="compile" depends="init" >
<path id="libs.classpath">
<fileset dir="${root.dir}/${libs.dir}" includes="**/*.jar" />
</path>
<javac srcdir="${root.dir}" destdir="${root.dir}" .....>
<classpath refid="libs.classpath" />
</javac>
</target>
The problem is I'm not sure the swt.jar is exactly cross plateform in the sense it is a slightly different jar on the different OS. I cannot have a look right now, I'll check that toonight.
In my own app, I have two different build targets (one for linux and one for win32), see [1] for the build script. So far I could not find how to do it in only one target but I'm note sure it is possible and at least it picks up the right SWT dependencies.
If you want David I can modify the JFreechart build script like that.
[1] http://svn.gna.org/viewcvs/mtreader/tru ... iew=markup
In my own app, I have two different build targets (one for linux and one for win32), see [1] for the build script. So far I could not find how to do it in only one target but I'm note sure it is possible and at least it picks up the right SWT dependencies.
If you want David I can modify the JFreechart build script like that.
[1] http://svn.gna.org/viewcvs/mtreader/tru ... iew=markup
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Whatever you can do to make it easier would be great. Note that I've just moved the SWT related source code into a separate 'swt' directory for the 1.0.3 release (this will make it easier for people to ignore it if they have no interest in SWT). You could add a build.xml file in there if you want to, or modify the existing script if you prefer.heprom wrote:If you want David I can modify the JFreechart build script like that.
I haven't looked closely at this stuff yet, but I'd like to make it easy for people to build:
jfreechart-1.0.x-swt.jar
swtgraphics2d.jar (containing the general classes in org.jfree.experimental.swt);
...and then go ahead and use those in their applications. Perhaps a README in the 'swt' directory would be useful?
I'm going to try to get JFreeChart 1.0.3 released on Thursday night or Friday morning, so anything you want to go into this release should be done asap.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

