| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (4 out of 12)

Working With Workspaces

Several simple operations are common to all workspaces:

To create a workspace interactively:

When you create a new workspace, it is not associated with any other item. This type of workspace is called a top-level workspace.

When you create a new workspace interactively, G2 displays its center at the current center of the G2 process's window, as shown in the next figure:


To create a workspace programmatically:

G2 does not automatically display a workspace that is created programmatically. To display a new workspace programmatically, use the show action.

To display a workspace's menu:

To move a workspace using the mouse:

To display a workspace on top of all other workspaces:

  1. Click on the background of the workspace to display its menu.

  2. Choose Lift to Top.

To display a workspace beneath all other workspaces:

  1. Click on the background of the workspace to display its menu.

  2. Choose Drop to Bottom.

To minimize the extent of the workspace borders:

  1. Click on the background of the workspace to display its menu.

  2. Choose Shrink Wrap.

To produce a cascade display of all displayed workspaces:

You can also use several system-defined keystroke commands to affect the position and scale of any workspace. For information on these commands, see Appendix C, Keystroke Commands.

Operating on an Area of a Workspace Interactively

You can work with a group of items in the same workspace. Use the Operate on Area menu choice to select items by drawing an area box around items on a workspace, then work with the group as you would for a single item.

To work with a group of items on a workspace:

  1. Choose KB Workspace > Operate on Area.

This dialog box appears:


  1. If the dialog box is obscuring the items you want to select, move the dialog box out of the way.

  2. Position the area box to surround the items of interest.

    1. To change the size of the area box, click the mouse on a side and drag the side in or out to shrink or stretch the area box on that side, or click the mouse on a corner to drag the corner out or in to pull two sides at once.

    2. To move the area box itself, place the mouse pointer anywhere inside the area box (not on the black lines themselves), and drag the area box with the mouse.

    An item must be entirely within the inside edge of the area box to be included in the area, although its name box may be partially or entirely outside of the area box.

  3. Press the appropriate button:

    Button Description
    Move
    Attaches everything enclosed in the area box to your cursor. Move to the new location and click to place.
    Clone
    Clones all of the items in the area box and attaches them to your cursor. Move to a new location and click to place.
    Transfer
    Attaches everything in the area box to your cursor. Move your cursor to another workspace and click to locate the items there.
    Left
    Aligns the left sides of the items in the area box with the left side of the leftmost item.
    L/R Center
    Aligns the left-to-right centers of the items in the area box.
    Right
    Aligns the right sides of the items in the area box with the right side of the rightmost item.
    Top
    Aligns the tops of the items in the area box with the top of the topmost item.
    T/B Center
    Aligns the top-to-bottom centers of the items in the area box.
    Bottom
    Aligns the bottoms of the items in the box with the bottom of the bottom-most item.
    Delete
    Deletes all of the items in the area box. G2 prompts you to confirm this operation.
    Quit
    Stops the Operate On Area operation. The area box and dialog box disappear. You can also quit by pressing Control + a or by starting another activity in another area.

Operating on an Area of a Workspace Programmatically

Several system procedures provide the programmatic equivalent of most of the interactive Operate on Area choices. The procedures are described in the G2 System Procedures Reference Manual:

Cloning a Workspace

You can clone a workspace to copy the contents of the cloned workspace to another workspace. G2 copies all items contained on the workspace, including the subworkspaces of those items, the items on those subworkspaces, and so on. Cloning workspaces is a convenient technique for quickly developing groups of items.

To clone a workspace interactively:

When you create a new workspace interactively by cloning, G2 displays the origin of the new workspace at the center of the window.

To clone a workspace programmatically:

G2 does not automatically display a workspace that is created by cloning programmatically. To display a new workspace programmatically, use the show action.

After cloning a workspace, G2 leaves the resulting cloned items with the same status as if those items had been cloned individually. For example, a cloned rule is left with a status of INCOMPLETE. For more information about the status of an item, see Identifying the Status Knowledge of Items.


Note: If you clone a subworkspace whose top-level workspace is associated with a module, G2 automatically specifies the Module-assignment attribute in the new top-level workspace as the name of that module.

Deleting a Workspace

To delete a workspace interactively:

To delete a workspace programmatically:


Caution: When you delete a workspace, you delete all items upon the workspace itself, the subworkspaces of those items, and so on. You also delete all instances of any user-defined class whose definition is on that workspace or on any subworkspace below that workspace in the workspace hierarchy.

Disabling and Enabling a Workspace

When you disable a workspace, G2 behaves as if the workspace and all items below it in the workspace hierarchy do not exist. However, class definitions that reside upon a disabled workspace (or upon a subworkspace under its workspace hierarchy) remain in effect.


Note: A disabled workspace is not excluded from existence checks in a KB such as the count of each kb-workspace.

Just as for any disabled item, the fact that a workspace is disabled is part of the knowledge stored in a saved KB file. A disabled workspace remains disabled until you enable it. You can disable both top-level workspaces and subworkspaces.

To disable an enabled workspace:

To enable an disabled workspace:

Hiding and Showing a Workspace

Hiding a workspace means to stop displaying it. Showing it means to display the workspace again. You can hide and show a workspace interactively or programmatically.

Hiding a Workspace

To hide a workspace interactively:

To hide a workspace programmatically:

You can hide the workspace of an item, the subworkspace of an item, the workspace of an item on the superior workspace of an item, and the current workspace. For more information, see hide.

Showing a Workspace

The technique for showing a workspace depends on whether the workspace is named and whether it is a subworkspace.

To show a named workspace interactively:

To show an unnamed workspace interactively:

To show the subworkspace of an item interactively:

To show a workspace programmatically:

You can show programmatically any named workspace, the subworkspace of an item, the workspace of an item that is superior to an item, and any workspace that you can describe using a generic reference. You can also show a workspace at a particular scale and position. For more information, see show.

Scaling a Workspace

G2 displays a workspace according to its current scale. By default, the current scale of a new workspace is the normalized scale for the G2 process, which G2 determines by calculating the ratio of workspace units per pixel of resolution on your computer's monitor.

The absolute size in which a workspace appears when displayed at full scale depends upon the settings specified for the -magnification and -resolution command-line options when the G2 process was launched. See Appendix A, Launching a G2 Process, for more information.

G2 displays each workspace at some factor greater than or less than its full scale. You can enlarge and shrink the size of a workspace by using keystroke commands or programmatically. G2 scales a workspace up or down to a maximum or minimum size.

To enlarge the size of a workspace interactively:

To shrink the size of a workspace interactively:

See Appendix C, Keystroke Commands for a list of all keystroke commands that affect the display of workspaces.

To change the size of a workspace programmatically:

For a complete description of this syntax, see show.

The scale at which G2 displays a workspace is specific to the window in which the user is viewing the current KB. For more information, see Displaying Independent Views of the Current KB.

Positioning a Workspace Within its Window

You can move a workspace within its G2 window by specifying a new location for its origin with respect to the current center of the window. G2 considers the current center of the window to be the location (0,0).

Note that the window's current center can change from moment to moment, as you resize the window by using the controls provided by your computer's window manager software.

For example, assume that you have created the workspace shown in this figure:


The workspace contains one action button and two readout tables that report the action button location upon the workspace with respect to the workspace origin.

This next two figures show how pressing the action button causes G2 to move this workspace after you have resized the window:



| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (4 out of 12)

Copyright © 1997 Gensym Corporation, Inc.