Code

This project began as a personal investigation in Summer 1998 and I have worked on it sporadically ever since. The code has been refactored continuously.

Development began on Windows using Sun's JDK 1.1, 1.2 betas, and 1.2.2. JDK 1.2 is now a minimum requirement for its Collections package and the Java 2D API, and JDK 1.2.2 is strongly recommended for its bug fixes (a Swing bug fix is certainly relied on, see changes.txt for details). I have run the code using JDK 1.3, but I currently use 1.4 (so I am not sure if it still works with older JDKs).

The complete distribution is downloadable as a zip file. You can also browse the javadoc online, and read the following documentation, all of which is included in the distribution.

Running Alhambra

Alhambra is built using ant, a Java make program from the Apache organisation. Jython, a Java implementation of the Python scripting language is tightly integrated into Alhambra so this must be installed first. Jython allows you to write scripts to generate tilings.

Unzip the Alhambra zip somewhere on your file system. Then go to the alhambra subdirectory and edit run.bat, if you're using Windows, so that the JYTHON_HOME variable is set to point to where you installed Jython. You should also edit the Jython registry file (in the Jython home directory) so that the python.path setting includes the scripts directory of the Alhambra install. For other operating systems you'll need to write an equivalent launch script (but it shouldn't be too difficult). Then launch run.bat to start Alhambra.

The demonstration application supplied with this distribution is called Alhambra. Alhambra allows muliple tiling windows to be open at any time. Each window is an editor for a tiling that the user can build using the mouse. The left mouse button adds a tile to the nearest free edge on the tiling. You can cycle through the tiles that may be legally added to that edge by further left mouse clicks on the tile. Clicking on a tile with the right button removes it from the tiling. There is also a prototiles window that determines the prototiles that are used when building a tiling. Alhambra starts up with the Penrose dart and kite as the current prototile set.

There are a number of demonstration Jython scripts in the scripts directory for you to try out.

Testing

Alhambra is tested using Kent Beck and Eric Gamma's JUnit testing framework that runs repeatable, automated unit tests. JUnit is not needed to run Alhambra, but if you wish to run the tests or do some development on Alhambra you should download it. See also Ward Cunningham's WikiWikiWeb for more on JUnit, and ExtremeProgramming in general.