ApplFLab Guided Tour

This page gives an introduction to ApplFLab, by making an example custom component and highlighting the component editor of ApplFLab.
The reader is expected to have basic knowledge of VisualWorks.
Last revision: January 22, 1997.


Contents: The Component Editor
  1. Supplying General Information
  2. Painting the User Interfaces of the Component
  3. Setting up the Pages in the Component's Properties Tool
  4. Painting the User Interfaces of the Properties Tool Pages
  5. Supplying Painting Information and the Component's Palette Icon
  6. Putting the Component on a Palette
  7. Installing the Component in the System

In the following we will use an example to demonstrate ApplFLab's capabilities. Consider a file selection component. It is a component that enables the user to select a file (e.g. for opening it) or a directory (e.g. for saving it). We will refer to this two functionalities with the "get/put" behaviour of the file selector. We will give the file selector user interfaces that look like the standard Macintosh "get file" and "put file" dialogs (the latter without the name entry field).

1. The Component Editor

The component editor is the central tool of ApplFLab. It is used to create a new components. Besides the obvious things like the component's user interface, the component editor requires the component designer to supply all the necessary information to let the component play its role in the environment.

The component editor's user interface consists of a notebook, of which each page is used to edit different aspects of the component. Currently there are six pages. The component designer typically works through the pages from left to right and then installs the component in the system.

1.1. Supplying General Information

On the page the component designer has to enter the user interfaces that can be used for that component. The designer can choose to use already existing user interfaces, or create new ones. The actual references to the user interfaces are filled in by the component editor when the designer paints the user interfaces on the next page.
The figures below show what the page looks like before and after painting of the user interfaces for the file selector component.


Figure 1a: Specifying which user interface to use.


Figure 1b: Page 1 after installation of the user interfaces in step 2.

1.2. Painting the User Interfaces of the Component

The page consists of several subpages, one for each user interface of the constructed component. In our example, there are two, as we specified in the previous step. On each subpage a user interface can be painted in the same way we paint user interfaces with standard VisualWorks.
For our file selector, we put the following user interface components on the first canvas: a pop-up menu that represents the nesting of the current directory, a list that contains the contents of the current directory, a button indicating the volume of the current directory (selected and without label in the figure below) for returning to the parent directory, a button to display the available volumes and a button to open a selected directory or file.


Figure 2a: Painting the first user interface.

We use the standard install method to install this user interface. After installation the first page of the component editor will list this user interface by name (class name and spec selector) See figure 1b.

We do the same for the second interface for the file selector component, after adding a button to create a new directory (the button without label in the figure below, the label is created at runtime of the file selector).


Figure 2b: Painting the second user interface.

1.3. Setting up the Pages in the Component's Properties Tool

The page is used to specify the slices of the properties tool for the constructed component. By default there are four slices: basics, details, color, and position. On this page slices can be added, removed and respecified. The user interfaces of the slices are painted on the next page.


Figure 3: Specifying which properties tool pages to use.

For our file selector, we keep the default slices, and move on to the next page.

1.4. Painting the User Interfaces of the Properties Tool pages

This page contains subpages that hold on to the user interfaces of the slices. Painting is done as always, except that defining aspects and installing the user interface is not necessary; it is done automatically by the component editor (when you press the install button, see step 1.7.).

The visual appearance of the file selector is parameterized with several properties:

On the "Basics" slice, we put two aspect fields, by dragging them off the "Properties" palette, a palette that contains user interface components that can only be painted on properties slices. The aspects of this aspect field are the names of the properties that will hold on to the models of our file selector (i.e. a ValueModel on a Filename). We call them "filename" and "selection" (not shown in the figure). For the filter, we place an action field, also taken from the "Properties" palette. The components for the other properties are dragged off the standard palette: an input field for the get/put button label, and a check box for the get/put behaviour.


Figure 4a: The "Basics" page of the file selector's properties tool.

On the "Details" slice, we put two radio buttons for selection of the user interface for the file selector.


Figure 4b: The "Details" page of the file selector's properties tool.

1.5. Supplying Painting Information and the Component's Palette Icon

On this page, two things need to be specified: the default size of the component when is is dragged off a palette, and the icon that represents the component when placed on a palette.
In our example, we fill in 200 and 80 as the default width and height of the file selector, and we paint an icon as shown in the picture.


Figure 5: Supplying painting information.

1.6. Installing the Component on a Palette

The page is used to install the constructed component on a palette. Let's put the file selector on a new palette called "Files".


Figure 6: Putting the file selector component on a palette.

1.7. Installing the Component in the System

After all the previous steps, the component is installed into the system. This is done by supplying the name of a specification class.


Figure 7: User-defined component installation dialog.