Java, Software, Swing

Getting things done with Thinking Rock

I have used all manner of organisation tools but at the moment the one that is really working for me (and indeed which is telling me I need to write this post) is Thinking Rock. A Java application based on the NetBeans RCP that implements the GTD process.

The basic elements of the application are okay, focussing on quick capture of thoughts and providing enough tools to correctly categorise them. However it is in reviewing and working on your actions that the application really shines. A single screen allows you to review and organise both projects and tasks. The filters for managing tasks are excellent and really make it possible to work with hundreds of thoughts and ideas at the same time. Better yet as a Java Swing programme you get exactly the same functionality and features on OSX and Windows allowing me to use it on all the various computers I own or use at work. A fully-fledged version 2.0 is promised soon but the development version I have been using has been completely stable and fully featured for my use.

I thoroughly recommend it to anyone else with a cross-platform need.

Standard
Groovy, Java, Scripting, Swing

Groovy Gridbag Example

Before Christmas I decided to give the Groovy Swing Builder a go since I am in the market for a language that makes creating small utilities in Java easier. Groovy is now Groovy 1.5, fully aligned with the Java 1.5 release. The new release sees lots of improvements all over the place. The Groovy Console has had a substantial revision and is now a really good way of experimenting with more complicated scripts (previously I only really used it to run snippets of code). The text colouring and decoration really works and the previous problems with massive stack traces obscuring actual issues seem to have been fixed. Really there are just two things that are needed to make it perfect, the first is line numbers so you can relate error messages back to the script you are working on and auto-completion. I wouldn’t mind having tabbed editors in the console as well but I can live without it.

What hasn’t changed is that documentation is generally woeful and examples and tutorials are hard to find. Most of the Swing examples I could find really used small numbers of components and simple Layout Managers. I have tried to create a more complex example using Grid Bag and based around some existing Swing code I found.

It took me a lot longer than I thought it would to create this code. Part of this is just not knowing how to tackle things, Groovy allows you to set attributes within the constructor with the interesting syntax property: value. However it is hard to know when you should use this or when the interaction should occur within the braces. After getting a working example going there is only one major mystery to me here. If I do not put the table inside the scroll pane then I lose the header columns on the table in the second tab. I really cannot see why that should be and if anyone more versed in the language can help me I would be grateful.

Standard
Java, Macbook, Software, Swing

Outliners

I never really used an outliner before I got my MacBook, the Mac had a bundled copy of OmniOutliner. OmniOutliner is amazing and really blew me away. However as I’m not completely a Mac person I was looking for something that would work on more platforms. Being a Java type of guy I had a quick search of Sourceforge and Freshmeat and came up with JOE. Java Outline Editor, is a pretty nifty program that unfortunately does not seem to be being developed much at the moment. It is also oddly featured, it could be simple enough to be a single jar style application but instead the program has four or five jar dependencies for very marginal features. It’s Find/Replace and File Opener dialogs are customised and very highly featured. However the basic outline functionality is very simple.

Since it’s open source I’ve got it into Eclipse and started to hack it around abit. So far I’ve only been able to remove the XMLRPC and XP jar (as well as a couple of classes that have been replaced by Generics). The underlying model is not what I was expecting, nor is the actual implementation of the line rendering. I was also a bit surprised that the GUI elements are all built up from a XML file which was quite interesting. I was also a bit disappointed to find that JOE seems to smear preference directories in several places rather than just gathering them all under the User Home.

What I really want is a simple outliner that will work cross-platform and ideally will only be in one JAR. To that end I think the way ahead is to cut down JOE while also building from scratch a new small outliner in Java. That way, what I want will be a kind of meet-in-the-middle job.

The new outliner will be a way of understanding the Swing Event model (which I’m very hazy on) and a way to try and understand how the Application Model and the Swing components interact in a vaguely MVC way.

While looking at Outliners I also came across Jreepad which seems to be an excellent Java based replacement for my much loved JotNotes.

Standard
Swing, Web Applications

Todo Lists Todone

While having a look around at some functionality to help define my proposed Swing Todo List application I discovered Tada Lists from 37 Signals.

What a totally awesome app! Almost immediately my desire to get coding on my application died a death as I was no longer “scratching my itch”. In fact there is still some point to doing a lightweight ToDo list application I can take around with me on a pen drive but I have to say for most of my day to day stuff I have switched to using Tada. After all almost any work situation is going to find you connected to the web for other reasons.

Standard
Swing

MVC for Swing

Although I have tried to use MVC for Web applications (where to be frank I implemented a greatly simplified version of Struts without realising it) I have never been quite sure as to the benefit of doing so in a Swing application nor exactly how if I am honest.

Now though I have much more incentive to learn how to do it properly. The introduction of the excellent GUI builder Matisse in NetBeans means that it is incredibly easy to knock up a Swing GUI quickly. However to really get the maximum benefit I can see that it is important to separate the actual implementation of the underlying logic of the application from the generated code. This was exactly the problem that used to occur with Forte, JBuilder and Cafe. You would have a big wodge of generated GUI code and then an unrelated and unmanaged block of application code that often had to reside in the generated GUI code to make.

In addition I have also comes across an incredibly obtuse MVC implementation at work. This reminds me of my own attempts to implement MVC for web applications. You kind of know the principle but you’re not sure what that translates to in terms of the concrete classes and code you have to produce. I don’t personally believe in spending a lot of time bringing existing code up to scratch where you know the underpinnings are not strong. It is easier and probably better to look at what the code is meant to do and then implement that correctly rather than end up painting yourself into a corner by trying to reconcile the purpose of the code with its current implementation.

To help my understanding of MVC in a Swing application I therefore want to have a very simple reference application I can use to build up my understanding of how such an application should work and be implemented. I’ve chosen to do a very simple ToDo list application based on the Google ToDo list plugin for their Desktop app. This would be handy for me personally as I need such an application and also removes a lot of the issues with designing the application by providing a reference for the behaviour.

Next step then a few uses-cases/activity diagrams and a class diagram for the model.

Standard