|
[Magercise 1 | API Docs | Short Course | Magercises]
Help is available for each task.
Start the BeanBox, either from a command shell or a graphical file navigator
such as Windows Explorer.
The command sequence for starting the BeanBox is:
cd beanbox run [Windows NT/95] or run.sh [UNIX] Task 2
The BeanBox consists of three windows: the palette, the worksheet area, and
the property sheet for the currently selected Bean. The palette and property
sheet windows appear only in design mode. To hide/show them, select the
design-mode menu item under the "View" menu. For this Magercise, they should
be visible.
The BeanBox windows should be similar to the following, except larger:
The currently selected Bean has a dashed line around it (initially, the
worksheet object itself). The property sheet lists the properties for the
currently selected Bean. To change a property, first select it from the
sheet. Selecting a property activates a custom property editor, if available;
otherwise, it simply sets the focus to the text-field object for text-oriented
property specification.
You can specify custom colors with comma-separated red-blue-green (RGB) color values (from 0 to 255) in the text field, or you can simply select a color, for example, white, from the drop-down list.
To place something on the worksheet, select it from the palette (with a single
mouse click) and place it on the worksheet (with a second single mouse click).
First, experiment with one of the command buttons. You can then try several
other Beans.
There is no drag-and-drop behavior from the palette to the worksheet. When you select a Bean from the palette (single click), the cursor changes to a cross-hair shape. Then, you simply pick a location on the worksheet to deposit the Bean and click again. To move a Bean, move the cursor near the top edge until it changes to a four-way cursor. At this point, you can drag the object over the worksheet. To resize a Bean, move the cursor near a corner until it changes to a diagonal, two-way arrow. At this point, you can resize it in both directions simultaneously. To delete a Bean from the worksheet, select it and then choose "Cut" from the "Edit" menu.
Next, take a look at the The text output describes the properties and events supported by this Bean. For a given Bean, you should find a correspondence between the data reported in the text output and both the properties listed in the property sheet and the events available from the "Edit" menu. Next, clear out the BeanBox to prepare for the main task, configuring a juggler Bean with two controls. Simply select "Clear" from the "File" menu. (Note that the BeanBox doesn't warn you that the worksheet contents have not been saved. You can also accidentally exit the BeanBox without getting a save-your-work prompt--you will lose whatever work you've done.)
The next task is to configure start and stop controls for a
Next, change the label for either
First, select an
These operations enable a rubberband-like red line that you drag to the target, in this case, the juggler Bean:
Next, change the label for the other
First, select the other
These operations enable a rubberband-like red line that you drag to the target, in this case, the juggler Bean:
Lastly, you can save your work as an applet using the "MakeApplet..." command, to use it outside the BeanBox. Select "MakeApplet..." from the "File" menu. Save the applet and related files in the default BeanBox "tmp" directory, or choose an alternate location. Note that if you provide a name for the JAR file, you must explicitly specify the ".jar" extension.
You can now exit the BeanBox and run the applet with
Several files are saved as part of the "MakeApplet..." operation, all of which
are required; see the read-me file. You can view the saved worksheet Beans
with | |||||||||||||||
|
| ||||||||||||