| |||||||||||
|
This demo enables the user to reserve campsites in a campground. 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. Java Web Start The demo's data model, CampData, uses a set of Site data objects for each reservation date. The data objects hold the campsite attributes and reservation information. Display elements representing the location of each site are read from the camp.elt file (created in Geo) and are matched to the data objects by the toolkit's element model. The main program is the Camp class. A background image shows the map of the campground. Renderers are configured in the camp.rdr file. Shape renderers are used to render the triangles, the blue and yellow dots, and the selection rectangle, while Text renderers add the site number and length. Converters are used to convert the hookup values to the appropriate internal data type as the renderers are read in. Rendering hints are configured in the camp.properties file. | |||||||||||
|
Copyright © 2001-2007 Apprisant Technologies Inc. | |||||||||||