That's very helpful.  Thanks!

From: Greg Brown []
Sent: Monday, November 30, 2009 2:14 PM
Subject: Re: Graph library for use with pivot


I put together a quick example to demonstrate how you might do this in Pivot. You can see the results here - it shows the "Hello World" example code from the JGraph distribution running in a Pivot window:

This is really just a proof of concept, but you can at least see that it is possible (and not terribly difficult).

Also, I discovered that it is actually possible to wrap an instance of mxGraph directly rather than wrapping an mxGraphComponent, so the event handling issue I mentioned earlier may not be a problem.


On Nov 30, 2009, at 10:36 AM, Greg Brown wrote:

I am personally not aware of any existing JGraph libraries for Pivot, but it may be possible to simply embed your existing Swing-based graphs in a Pivot app. Both Swing and Pivot use Java2D for rendering, so you'd just need to write a Pivot wrapper for the JGraph component. You might run into some issues handling mouse input, but if that is not a requirement for your application, it should actually be pretty straightforward: you'd write a custom Pivot component whose skin is basically just a thin wrapper around a JGraph instance. 

The Pivot/JFree library is actually implemented exactly like this - it uses a higher level abstraction that effectively hides the fact that JFree is used under the hood, but the general concepts are the same:

If you have any questions, please feel free to post them here and we'll do our best to help!


On Nov 30, 2009, at 9:24 AM, Scarberry, Randall E (Randy) wrote:

Does anyone know of a Java graph library that would work well with pivot?  A project of mine involves "webifying" a Swing-based desktop application that makes heavy use of Jgraph, which is a swing-dependent library.  If we find a replacement for Jgraph without the swing dependencies, we may use pivot for the web version.


Randy S.