| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (6 out of 18)

Defining Icons

Creating and modifying icons with the Icon Editor entails some or all of the following:

You must create a layer before you can use it, but otherwise you can perform these operations in any desired order. You can also use the Text Editor in conjunction with the Icon Editor to give an icon extended capabilities that the Icon Editor alone does not provide:

Starting an Icon Definition

You cannot invoke the icon editor on a CLASS-DEFINITION until you have specified a superior class that has an iconic representation.

When you invoke the Icon Editor on an OBJECT-DEFINITION that has no superior class, the editor creates by default a single layer whose color is the metacolor foreground. You can use this layer as a starting point to create an icon for the class definition. When you later specify a superior class, the icon you have defined will override the inherited icon.

When you invoke the editor on a class definition that already has an icon, either locally defined or inherited from a superior class, the editor displays the layers of the icon in the layers pad. You can edit this icon as desired. Changes will affect only the icon definition of the class itself; the definition in the superior class will not be affected.

Controlling Icon Size and Shape

The default icon size is a square whose side is 100 workspace units. You can reshape an icon to have different dimensions. The length and width need not be equal.

To reshape an icon:

Either:

As you drag the corner, the icon size indicator changes accordingly. Alternatively:

The corner of the icon viewer moves to reflect the specified shape.

You can reshape an icon for which graphics already exist. Such changes do not affect the existing graphics. If you shrink the viewer so that it is smaller than existing graphics, the graphics are truncated on the right and/or bottom. However, the obscured information is not lost: it can be recovered at any time by increasing the size of the icon.


Tip: If you intend to rotate an icon, make both the length and the width even numbers. Then the item-x-position and item-y-position of the icon will not change when it is rotated.

Controlling Icon Viewer Magnification

By default, the icon viewer shows an icon as it would appear on a normal sized workspace. You can magnify the icon viewer without affecting the icon itself. Such magnification can be convenient for drawing finely detailed icons.

To magnify the icon viewer:

The actual size of the icon, measured in workspace units, is unaffected.

To demagnify the icon viewer:

The actual size of the icon, measured in workspace units, is unaffected.

You can obtain magnifications much larger than the x3 button provides by using Control + b to enlarge the Icon Editor workspace. As the editor becomes larger, the icon viewer grows with it, increasing the effective magnification. Use Control + s to shrink the editor back to normal size.

Working with Layers

You can create, clone, move, or delete a layer at any time. Before you can do any of these, you must select one of the existing layers.

To select a layer:

The layer becomes the current layer.

Creating Layers

To create a new layer:

  1. Select the existing layer above which the new layer is to appear.

  2. Click the New button.

The editor creates a new empty layer above the selected layer, then selects the new layer. The new layer has the same color as the previously selected layer, but does not belong to any region.

Moving Layers

To move a layer:

  1. Select the layer that is to be moved.

  2. Drag the layer to the desired position in the layers pad.

The editor shifts layers up or down as needed to make room for the moved layer, and places that layer in the indicated position. The icon in the icon viewer changes as appropriate to reflect the new ordering of the layers.

You can move a layer to the right of the layers pad while you are dragging it, so that you can see the other layers during the move.

Cloning Layers

To clone a layer:

  1. Select the layer that is to be cloned.

  2. Click the Clone button.

The editor creates a clone of the selected layer immediately below the layer, then selects the clone. The cloned layer is an exact duplicate of the original, except that it does not belong to any region.

Deleting Layers

To delete a layer:

  1. Select the layer that is to be deleted.

  2. Click the Delete button.

The editor deletes the layer, then shifts other layers up as needed to fill the space.

Specifying Colors

Every layer has an associated color or metacolor. All graphics on the layer have this color. You can change the color of a layer at any time.

To set the color of a layer:

  1. Select the layer.

    The current color appears in the Color Indicator.

  2. Click on the name of the current color.

    The color selection workspace appears.

  3. Select the desired color or metacolor.

    The color of the layer changes to be the selected color.

The color transparent looks opaque in the Icon Editor, so you can see the graphics in a transparent layer, but is transparent when the icon appears on a workspace, allowing the workspace background to show through.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (6 out of 18)

Copyright © 1997 Gensym Corporation, Inc.