Projects

I develop quite a lot, this growing list is an attempt to contain a sampling of the things I've written. They range from small scripts in various programming languages to Widgets and programs. The dates reflect when the item was last updated. For older projects, the date may be when it was first publically posted. Click the icon images to see a larger preview of the project. Some projects may not have larger previews.

In addition to the following personal projects I also contribute to other open source projects on GitHub and Gitorious. Many of my personal projects are hosted on Bitbucket.

Layer Draw

1.0.0
Layer Draw icon

A not-quite-so-simple example of how to do layered drawing in Swing. I've seen a lot of Swing programmers try to tackle making some sort of display where a user can draw arbitrary shapes on to a panel.

The typical (and intuitive?) approach is to use only one panel, and draw everything on it. This works if a new shape is not drawn on the panel until after the mouse is released. If the new shape is continually updated to show the user how it now looks, all shapes previously drawn to the panel must be redrawn (due to how Swing repaints work). This doesn't scale if many shapes have been drawn to the panel, or if the previous shapes are complex.

A better solution, shown via this example Java program, is to have two panels stacked by z-index. The panel on bottom just concerns itself with drawing all previous shapes. The top panel is only for drawing the new shape, so it can continually be updated without having to redraw anything else. When the user finishes drawing it, it is then added to the list of shapes the bottom panel handles. This approach works much better even with many or complex shapes, as the bottom panel has to be redrawn less often.

Drag Demo

1.0.1
Drag Demo icon

A small example class, written in Java, to demonstrate how to construct a panel showing an image larger than the panel's view area while allowing the user to drag it around to bring other parts of the image into view.

Shuffle Puzzle

1.0.0
Shuffle Puzzle icon

A simple "shuffle puzzle" program written in C#. Just drag an image onto the window after the program starts to start a new game. When the image is completely reassembled, the game will display how long it took and how many moves were used.

Right-click the window for more options. The game has preferences to change the size of the squares, how many squares are used, whether or not to play the tile-sliding sound, and whether to crop non-rectangular images to a square.