By Chris at December 22nd, 2004 23:03:00

It's that time of year again - Annual Leave! In this case it's forced leave, as Curtin closes over the Christmas break, but at least it makes up for the lack of public holidays.

Ironically, I've done more programming so while on leave than I have while working at Curtin - as a Systems Programmer no less. That's a very sad state of affairs :P I decided that it might be an idea to brush up on Java, especially as I've never formally learnt it. So, using a really cool site that Michele found as inspiration (as well as algorithm source), I decided to try and reimplement some of the nifty patterns in Java. The results aren't too bad:



(Click on the image to see a working demo!)

Okay, so I might not actually have a clue how the algorithm that draws the pretty pattern works, but that wasn't really the object of the excercise. It was to implement something in Java, and maybe learn how to solve a few problems (eg: flickering, solved with double buffering; save window state to allow progressive [incremental] animation without sufferring from window damage), and learn some new stuff (eg: threading in Java; basic animation). So sure, it's prety rudimentary stuff, but given that I know bugger all Java, and even less Graphics programming, let alone graphics programming in Java, and that I achieved all this in one afternoon/evenning, I think I did pretty good.

For the curious, the code is available in the jar file along with the compiled byte-code. It runs standalone too (ie: "java Blargh" or "java -classpath 20041222.jar Blargh" should work). Please excuse the mess, lack of commenting, and the slightly dodgy stuff that's going on there. A whole lot of it could be implemented a whole lot better, but it's not bad for a learning excercise, I think.