Development, Java @ 31 January 2007, “No Comments”

As part of our, seemingly unending, refactoring of Robonobo, we packaged the whole app into an applet. However, writing a UI in swing felt very un-webby, and would fail to integreate, visually, with the style of the site. We would also like our users to have the ability to be able to customize or rebuild their own UIs using simple standards.
Luckily, however, applets have some very cool features that I only just learnt about, inlcuding LiveConnect (from whence XPConnect comes from). This provides a bridge between java and javascript, allowing me to call java functions from javascript and return real java objects to javascript.

Using this, we created an applet with no UI, that sits in a 0×0 pixel container, and a javascript support library which communicates and wraps the functionality provided by robonobo. All the UI can now be rendered using html, css and javascript, in a very ajaxian fashion.

There are a couple of gotchas though:

  • You cannot return primitive types such as int, float, etc. Instead you must use the object equivilents Integer, Float, etc.
  • Calling from javascript comes from an unprivileged thread, so despite your applet’s policy, it may well be denied permissions. You can simply wrap such requests on the java-side with an AccessController.doPrivileged()
  • Large applets can lock up the browser because the JVM and the jar are being loaded concurrently. This can be aleviated by splitting your applet into a smaller jar containing just the applet and interfaces, and the main jar containing the implementation. This way, the jvm and applet initialize quickly, and then do not block the browser when the second jar is downloaded.
Development @ 05 January 2007, “1 Comment”

I work for a couple of companies whose employees are distributed across timezones and countries and someone needs to write a bit of software to make this easier. Something like BoxCloud combined with Subversion. The idea being that all shared files exist on each individual machine and are synchronized when people come online. All previous versions of the documents are stored as well. A new file can be shared with everyone just by placing into a special folder on ones computer, which is monitored by the client.

Then, you need a Push-to-talk voip system. Often you dont need to have a full conversation with someone, but instead let them know what your doing, or that you have just updated a document, etc. A special key on the keyboard (maybe caps lock? put it to some good use) will enable you to say a few words to a person or to the whole team.