JFreeChart SWT version

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
raghavan_26
Posts: 59
Joined: Fri Oct 13, 2006 11:35 am
Contact:

JFreeChart SWT version

Post by raghavan_26 » Fri Oct 13, 2006 11:49 am

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

silent
Posts: 50
Joined: Wed Mar 16, 2005 2:55 pm
Location: Korea
Contact:

Post by silent » Fri Oct 20, 2006 12:23 pm

:roll: I wonder, too.
Tokdo belongs to Korea.

Not a 'sea of japan', But a 'East Sea(Dong hae)'

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Mon Oct 23, 2006 12:14 pm

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.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

heprom
Posts: 91
Joined: Sat May 27, 2006 4:25 am
Location: Paris

Post by heprom » Mon Oct 30, 2006 11:49 am

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

exo
Posts: 4
Joined: Tue Oct 31, 2006 1:49 am
Location: Israel

Post by exo » Tue Oct 31, 2006 2:06 am

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.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Tue Oct 31, 2006 3:19 pm

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

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

exo
Posts: 4
Joined: Tue Oct 31, 2006 1:49 am
Location: Israel

SWT dependencies

Post by exo » Sun Nov 05, 2006 10:01 am

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>

heprom
Posts: 91
Joined: Sat May 27, 2006 4:25 am
Location: Paris

Post by heprom » Mon Nov 06, 2006 4:29 pm

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

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Mon Nov 06, 2006 5:01 pm

heprom wrote:If you want David I can modify the JFreechart build script like that.
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.

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

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

heprom
Posts: 91
Joined: Sat May 27, 2006 4:25 am
Location: Paris

Post by heprom » Mon Nov 06, 2006 5:30 pm

ok I will try to do that toonight...

Locked