This demo lets the user reserve campsites by selecting them in the diagram. The toggle buttons on the lower left select between two hypothetical reservation dates.
Each site is annotated with the site number, the available RV hookups (yellow dot for electric, blue for full hookups), and the length of the site shown below the triangle. Available sites are shown as empty triangles and sites already reserved by others are shown filled in red. Sites reserved by the user are filled in green.
Clicking on a site selects it, and control-clicking adds sites to the selection. The Reserve and Cancel buttons on the lower right can be used to make reservations.
Click on the screen shot to run the applet, or
with Java Web Start.
| Source Files | |
|---|---|
| CampData.java | the demo's data model; has a set of data objects for each reservation date. |
| Site.java | the demo's data object class; holds campsite attributes and reservations. |
| camp.elt | positions the sites; created in the toolkit's design editor and matched to the data objects by key. |
| Camp.java | the main program, configures the diagram and loads the background image showing a map of the campground. |
| camp.rdr | describes how to render each object in the diagram, using converters to convert text values to application objects. |
| camp.properties | specifies rendering hints and logging properties. |
