First I created an XML file that specifies the technique hierarchy. Inside it I allow references to other subtrees of techniques that are defined elsewhere in the file. Upon parsing of the file the references are replaced with copies of those subtrees. This saves a lot of work. The whole reason that I think this application can be a success is because there is so much overlap among techniques after the first few moves. I also created a DTD (Document Type Definition) for my XML hierarchy syntax. This enforces all kinds of syntactical and semantic checking on my data file when it gets parsed. This saves me from doing much difficult debugging further downstream - as would be the case if I did not have the DTD. This is one of the big advantages of using XML to specify the datafile (but not the only one). Here is a snippet from the XML datafile to give you an idea of what I am talking about:
::: :::
Next I shot the images at the dojo using my camcorder on a tripod. The camcorder takes low resolution images (1Kx1K), but they were still too big for my purposes, so I resampled them to be much smaller using IRFan (a free image processing tool). One of the mistakes I made was to not batch the contrast and color correction. I did it all manually which was stupid for 2 reasons: 1) it was tedious, 2) all the images look like they have different lighting and colors. I did it this way because of the limitations of IRFan. Maybe on my next attempt I will try photoshop or script GIMP. I also need to redo a few of the images. I think I may need more images than I originally planned. There are too many abrupt camara angle switches in some cases.
I then created a Java program that read in the XML data file (parsed it using javax.xml.parsers). This is another advantage of XML, there are native java parsers and validating logic available (I hardly had to write any code to do this part). Then the program generates an HTML page that contains a ton of generated javascript to specify state information. Javascript builds the dropdowns, handles the images to show, and does the rollovers. Every time you change a dropdown, Javascript dynamically changes the page DOM to show appropriate new form elements and images.
Another advantage of using XML to specify the techniques, that I did not even explore, is that I can use XSLT to transform the technique data into many other forms. For example, I could have an XSLT transform to produce an SVG application based on the same datafile, or perhaps I could convert the technique hierarchy into somehting that could be printed nicely.