Friday 16 March 2007

SVG animation on Linux

Today, in my ever varied day-job, I needed an SVG viewer for Firefox on Linux.

"You twit," you shout "Firefox has native SVG support!"

Yeah, yeah. But dude I need SVG animation.

Off I go to Batik. No animation support in the Squiggle browser as of batik 1.6. At least I could not get it to run my mickey mouse animation test document.

Next, to Adobe for the SVG viewer plugin.

Duh, they bought Macromedia didn't they?

Somehow I don't think Adobe bought Macromedia in order to convert its installed Flash user base to the motherhood and apple-pie of SVG.

So to avoid a dose of corporate schizophrenia, the rational thing is for Adobe to discontinue support for its SVG plugin.

In any case, my Debian based distro didn't seem to play well with their RH7.1-9 binaries.

Finally, a quick detour via www.w3.org to www.svgi.org and I found my trusty old Opera 9.1 is at least able to make a little red square bounce back and forth across the screen.

Anyone have any better ideas about SVG animation on Linux?

Thursday 15 March 2007

Really Good UML Tool

A few years ago, I worked a little with the Poseidon UML tool from Gentleware.

Recently, UML came front and centre in my life, but all I needed was the ability to produce nice UML diagrams, not actually generate code.

I went to Gentleware, but there was only a 30 day trial on the community edition, so I looked a bit further and came up with www.umlet.com.

At a relatively small sub 5mb download, and a trivially easy install:- unzip the archive and run
java -jar umlet.jar

This is a charmingly easy to use tool with a great range of output option (svg, pdf, jpeg etc).

A real gem of a find.

Especially after BOUML and Dia not making the grade for me.

Reflection Reflecting

If you create a class object, for example from a class loader's loadClass method, then you might like to use the newInstance method to get a new instance of your class.

Why not, right?

Well, just beware.

Make sure that the class you loaded in has a constructor which takes no arguments.

If (as happened to me) the first time you tried this was on a class that had only one constructor, and that constructor took a String argument, then what you got back, when trying to cast the class to the sort of interface I wanted was an InstantiationException/Error.

The JAR's in Charge

Just a short reminder.

If you load a class from a jar file, then the classpath is whatever the jar file manifest says it is, not what your JVM thinks it is.

So use the Class-Path directive in the Manifest file, and remember that the items appearing in that directive are relative to the location of the JAR file itself.

JAR Manifest Grief Continues

More fragility on the manifest file front.

If you use the Class-Path directive, then note that the if you reference a path rather than other jar files, then that path (at least on *nix systems) must end with a slash character.

JAR Manifest File Agony

Everyone will tell you to finish off the last line of a JAR manifest file with a newline.

What they don't tell you is that if you use the Main-Class directive, then do not have any whitespace at the end of that line.

The JAR File reader includes this whitespace as part of the name of the main class.

You know you have this problem when you seen the NoClassDefFoundError/Exception whatever.