TOC PREV NEXT INDEX



Property Notebooks


Notebook pages

Each time a part is added to the Working Model, its Properties Notebook is displayed in the Composer window. At any future time, a part's Properties Notebook can be viewed either by selecting the part's Object Name from the Part List or by clicking the part with the mouse.

Every part in the Composer has a minimum of three pages in its properties notebook. These three pages are

  1. The part-specific properties page
  2. The Visual properties page
  3. The Listeners page

All properties specified in the properties notebook are the initial properties that a part will have. Any properties may be changed in the working model by either event code or by user interaction with the working model. The user may restore all parts to the state specified in the properties pages by choosing the Initialize Class menu item on the Program menu.

The first property page for any part contains the name which will identify the declared object and the part-specific properties for that object. For example, the first page for a Checkbox would contain the Object Name plus the checkbox label and the initial checkbox state.

The first property page may also contain controls which have no effect on the operation of the final program, but will assist the user in using the part while in the Composer. For example, the Flow Layout part has a checkbox to indicate whether the Empty Space should appear. The user should check this checkbox to add additional parts to the Flow Layout, and uncheck it when finished. Further, the user can specify the position of the Empty Panel using the Position choice field.

The second property page is the Visual properties page. This page is identical for every part. It contains the visual properties that are common to all parts. Initially, these properties are set to 'default' which means that they should inherit the properties of the layout in which they are sitting. By changing one of these properties, the user overrides this default setting. If a visual property is changed for a layout, that property cascades through all of the parts within that layout as long as that property is set to 'default' for each of those parts.

Visual properties include

Parts from the Swing library also include

The third properties page is the Listeners page. This page contains a set of checkboxes corresponding to the kinds of events that a part is capable of 'Listening' for. The events which are most often used are presented in bold.

When a listener is selected, a new page will appear in that part's properties notebook. This new page will contain a code area where the user can specify code which should be executed in response to events of that Listener type. Many types of events have several kinds of events defined within them. Each of these events are listed in the choice field at the top of the event page. The code which is displayed in the code area corresponds to the event listed in the choice field.

The user can enter any legal Java statements in the code area. Simplicity watches for any changes made and updates the working model so that the working model always reflects the current state of the code. When the user generates an event in the Working Model, the event code will be executed. If there is an error in the code, a message will be printed to the console.

At the top of every event page is a Code Sourcerer button. The Code Sourcerer will write Java statements for the user based upon the user's choices.

All parts listen for at least five types of events.

  1. Component Events These events are generated when a part is shown, hidden, resized, or moved.
  2. Focus Events These events are generated when a part gains or loses the focus.
  3. Key Events These events are generated when the user presses or releases a key.
  4. Mouse Events These events are generated when the mouse enters or exits a part, or when a mouse button is pressed or released over a part.
  5. Mouse Motion Events These events are generated when the mouse is moved or dragged over a part.

All of the Layout parts also listen for a sixth type of event.

  1. Container Events These events are generated when components are added or removed from the layout.

Some parts generate additional events which are specific to their functionality. For example, a Button generates an Action Event whenever the user presses the Button.

The properties notebooks for the top-level containers (Main Application, Frame, Window, Dialog, Panel, Object) also have a fourth page titled Class. This page contains code areas for user code. These code areas include

A Main Application Composer will also have code areas for the four special methods that a web browser uses to control an Applet.

Each of these code areas can be also be reached using the Code menu in the Composer. They can be tested by being used in event code or by the commands on the Program menu in the Composer.


Data Representations, Inc.
http://www.datarepresentations.com
support@datarepresentations.com
sales@datarepresentations.com
TOC PREV NEXT INDEX