Swinging towards Swing


It is said that every problem in Computer Science can be solved by adding another layer of indirection. In this case we added two just to be sure 🙂

As I wrote before, Thomas’ project is to make PathVisio toolkit-independent so we can draw Pathways to an SWT Widget, a Swing JPanel or even an SVG file directly through the Graphics2D abstraction layer.

This work is now complete, the Pathway drawing component is now completely toolkit independent. In the screen shot below, you can see three different versions of PathVisio running side-by-side. In the top-left you see the old SWT version. In the bottom you see a Swing-only version, and in the right you see the new Graphics2D Pathway widget inside the old SWT GUI.


In the latter case, the Pathway drawing is rendered with Graphics2D onto a Swing JPanel, which is then wrapped inside the SWT app using the SWT-AWT Bridge. Surprisingly, there is hardly any performance overhead.

But what’s the advantage? Using Thomas’ code I now have an easy way to visualize my Pathway difference sets to SVG. My original idea was to generate SVG directly using one of the XML writing libs in java, but now I can use Batik and the Graphics2D functions which is much easier. I just managed to get the first graphical output of my gpmldiff tool. It would have taken me at least a week longer if I had to write the SVG directly.

Tags: ,

One Response to “Swinging towards Swing”

  1. Alex says:

    Hey, this is really great progress! I’m excited to see the gpmldiff output.