User Interface Implementation

The user interface has been implemented using Java Swing following the design guidelines laid out in the previous section. A cropped screen shot of the Apple "look and feel" version of the interface is shown below. The Windows XP version is available here for comparison.

The swing interface is made up of many nested sub-interfaces housed in JPanels. Each JPanel can be given a specific layout manager whose responsibility it is to position all components within the panel. The layout manager controls how much of the available container space each component occupies. Resizing the container will push and pull the components to fit the space according to the rules and constraints set out in the layout manager. Building up interfaces that align with UI conventions leads to seemingly complex looking code (for example, it took 300 lines of code to build the flocking agent interface) however this is only a by product of container nesting. Below is a CSS representation of the nested layouts I used to build the flocking interface. Each coloured block represents one JPanel.

JFrame [BorderLayout]
Toolbar [SpringLayout]
Agent Parameters [SpringLayout]
Constraints [SpringLayout]
Perception [SpringLayout]
Agent Weightings [GridLayout]
Weighting [SpringLayout]
[...] Weighting [SpringLayout]
Animation Window