Foray into Flex AIR

Adobe AIR has really excited me since I’ve been a long time fan of desktop applications. There is a time and place for web apps as well as for desktops. This post describes some of my reflections on a partial port of a Swing application to Flex.

Globesight is an economic modeling package geared toward scenario playing with a complex visualization metaphor as well as some heavy-duty binary floating point storage. It was my  Swing/UI opus magnum that I crafted a few years back – lots of UI navigation, charting, plugins, XML and binary I/O crunching and transfers. Too bad I implemented this before I came across Spring!

Although I won’t have time to port the whole application from Java/Swing, I want to see how some of the key Java technologies are handled by Flex/AIR.

  • Binary file IO for floating point numbers – I have concerns regarding Flex’s performance
  • Charting – I used the versatile JFreeChart and I expect Flex will excel here
  • Multiple windows, dialog boxes, popups
  • General screen navigation
  • How well does the Java code and classes translate into ActionScript?


Globesight Swing


Globesight Flex


Initial Reaction

Designing the Main Workbench screen and populating it from the XML project definition files was easy enough. I can’t imagine doing that so quickly in Java! So far so good. Reading in the XML is a charm.

I’ve also been able to leverage the elaborate MVC Java class hierarchy representing the domain model and visual components into ActionScript. The package hierarchy and class names almost match one for one. This leads me to think, might a Java to ActionScript translator help here? I’ve already found some info on the topic. Too bad that I simply can’t reuse the Java classes directly from Flex – too bad Flex doesn’t use the  JVM. I guess I got spoiled using Groovy which can be seamlessly (and confusingly) mixed with Java.

I’m already running into major hiccups regarding binary IO. I’ve got two dimensional arrays stored in binary floating point format (and some longs and ints in the header), and I see that ActionScript doesn’t have a long or FP data datatype! There’s Number and byte array and ultimately I assume I’ll be able to read the data, but how efficiently?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: