Using the BeanBox |
The
beans/beanbox
. directory contains Windows (run.bat) and Unix (run.sh) scripts that start the BeanBox. You can use these commands to start the BeanBox, or use make:Or:gnumake runnmake runSee the BDK files
beans/doc/makefiles.html
andbeans/doc/gnu.txt
for information about getting copies of these make tools.When started, the BeanBox displays three windows: The BeanBox, ToolBox, and the Properties sheet. Here's how they look:
The ToolBox contains the Beans available for use by the BeanBox. You can add Beans to the ToolBox. The BeanBox is the work area; you select Beans from the ToolBox and drop them on the BeanBox so you can work on them. The Properties sheet displays the properties for the currently selected Bean within the BeanBox.
This illustration shows the BeanBox with the
Juggler
demo Bean placed within it. The hatching around the Juggler is how the BeanBox indicates which Bean within the BeanBox is selected. Clicking on a Bean within the BeanBox selects it. The Properties sheet displays theJuggler
properties.Adding a Bean to the ToolBox
When the BeanBox is started, it automatically loads the ToolBox with all the Beans it finds within the JAR files contained in the
beans/jars
directory. Move your JAR files into that directory to have them automatically loaded at BeanBox startup. Load Beans from JAR files located elsewhere by using the File|LoadJar... BeanBox menu item.Dropping a Bean on the BeanBox
Clicking on a Bean name within the ToolBox chooses that Bean for placement within the BeanBox. To drop a
JellyBean
instance onto the BeanBox
- Click on the word
JellyBean
in the ToolBox. The cursor will change to a crosshair.- Click within the BeanBox. The
JellyBean
will appear and will be selected.Note the change in the Properties sheet when you put the
JellyBean
in the BeanBox. Before you placed theJellyBean
in the BeanBox, the BeanBox's properties were displayed; after placing theJellyBean
in the BeanBox, theJellyBean
properties are displayed. If you missed the change, click within the BeanBox, away from theJellyBean
. This will select the BeanBox rather than theJellyBean
. The Properties sheet will then display the BeanBox's properties.After dropping a
JellyBean
instance on the BeanBox, the Properties sheet displays theJellyBean
properties: color, foreground, priceInCents, background, and font.Editing Bean Properties
The Properties sheet displays each property's name and its current value. Values are displayed in an editable text field (strings and numbers), a choice menu (booleans), or as painted values (colors and fonts). Each property has an associated property editor. Clicking on a property within the Properties sheet activates the property's editor. Properties displayed in text fields or choice menus are edited within the Properties sheet. Because editing their values requires a more sophisticated user interface,
Color
andFont
property types use a custom property editor. When you click on a color or font property a separate panel will pop up to do the editing. Try clicking on each of theJellyBean
properties.Saving and Restoring Beans
The BeanBox uses Java Object Serialization to save and restore Beans and their state. The following steps demonstrate how to save and restore a Bean:
- Drop a
JellyBean
on the BeanBox.- Change the
color
property to anything you want.- Select the File|Save BeanBox menu item. A file browser will pop up; use it to save the Bean to a file.
- Select the File|Clear BeanBox menu item.
- Select the File|Load BeanBox menu item. The file browser will again pop up; use it to retrieve the serialized Bean.
Using the BeanBox |