2.1.3 Graph Tool command reference
The Graph Tool menu bar contains a number of commands, many of
which are also available in the toolbar. Most commands are also found in the
other metamodeling tools; the name of the first menu, Graph, will change
appropriately in other tools.
New
To create a new object type, press the
New toolbar
button or select
Graph | New... from the menu
bar.
New Subtype...
By default, new object types are sub-typed from the generic
Object type. It is also possible, however, to organize object types into an
inheritance hierarchy. You can build such hierarchies below all of the
metatypes. Inheritance is mainly data inheritance, based on the property types
in non-property tools (i.e. in Graph Tool, Object Tool, Relationship Tool, Role
Tool and Port Tool) and according to the data type in Property Tool. The new
object, relationship, role or port type inherits all of the properties of its
ancestor type.
There is also some inheritance of behavior, e.g. an object
can take part in a binding which includes an ancestor of that object’s
type (see Section
2.1.6). Similarly a
property whose data type is a given non-property type may also contain
non-properties whose types are descendants of the given type.
To create a new object type as a subtype of another object
type, select
Graph | New Subtype... (or hold Shift down and press
New in the toolbar) and select the desired ancestor type from the list of
available object types. The name of the ancestor for the current object type
will be shown in the read-only
Ancestor
field.
Open
Graph | Open... will bring up a list of object types in
currently open projects. Selecting an object type from the list will load the
object type definition in the Graph Tool.
Save
Graph | Save and the Save and Save and Close
toolbar buttons save the changes to the object type; the latter also closes
the Graph Tool. The buttons are disabled until the user has changed some field
in the Graph Tool. Changes to dialogs and symbols are accepted in their
respective tools, and thus do not affect the state of these buttons. In a
non-Workbench version of MetaEdit+, these buttons are always disabled.
When saving, one of the following messages may appear:
| You
are not authorized to metamodel! |
This means
that the current user is not one of the metamodelers set by the system
administrator. Contact your system administrator.
| Could
not obtain the lock for metamodeling for the metatype in project xxx. Lock is
held by user xx. Current metamodeling security level is
exclusive/single. |
This only appears in the
multi-user version, and means that someone else is modeling or metamodeling at
the same time. If the metamodeling security level is exclusive, then you will
have to wait until all other users have logged out, and you have committed or
abandoned your transaction, before you can make type changes. If the
metamodeling security level is single, then you will have to wait until the
other metamodeler has logged out, and you have committed or abandoned your
transaction, before you can make changes.
Exit
Select
Graph | Exit or close the window to quit the
Graph Tool.
Generators
Tools | Generator Editor or the corresponding toolbar
button opens a Generator Editor, described in Section
5.3, on the generator definitions of this
Graph type.
Generators are defined in Graph types
and inherited from supertypes, including the Graph metatype.
Set Identifier Generator
As an alternative to having an identifying property, Tools
| Set Identifier Generator defines a generator for the object type
identifier. A separate editor to define the generator will be launched when this
menu item is selected.
As such generators are normally short and do not have a
name, they have no GeneratorName()
header (nor the older Report
'GeneratorName' and
EndReport). An identifier generator can
call subgenerators, but only those defined in Graph, not its subtypes. Note that
you must avoid using the generator id
command on this object during its identifier generator:
id will try to output the identifier
for this object, which will of course call this same generator, leading to an
infinite recursion. You can however safely use
id for other objects of this type or
others.
When the identifier is generated, no asterisk (*) will be
shown before any local name in the Properties list. If the object type
has no identifier at all, the name of the type is returned.
To remove an Identifier Generator and revert to displaying
one of the properties as the identifier, select that property in the property
list and choose
Set as Identifier from the pop-up menu (see
Figure 2–2 in Section
2.1.4).
| As
identifiers are calculated to display objects in a textual format in many places
in MetaEdit+, errors when running identifier generators are handled by returning
the output so far, plus an error message – opening a normal error dialog
would be impractical. Infinite recursion within an identifier generator is
prevented by a timeout on such generators, returning an error in a similar
way. |
Property Dialogs
Tools | Generate Default Dialog
automatically defines a dialog for this object type, overriding any custom
dialog. This default dialog contains a label and entry field for each property,
arranged vertically in the order in which they appear in the property list. At
the bottom of the default dialog are
OK,
Cancel and
Info...
buttons.
Tools | Edit Dialog opens a
Dialog Editor for the properties of this object type. The default dialog can
thus be modified for your needs and taste with this operation. See Chapter
4 for
details.
Icon Editor
Tools | Icon Editor opens an Icon Editor where you can
draw the graphical icon to show in browsers etc. for the graph type and its
instances. Icons can only be edited for types that already exist, thus this
button is not available until the type has been saved. See Section
3.5 for details of using the Icon
Editor.
Info Tool
Tools | Info Tool displays an Info Tool for the type,
showing which types this type uses, and which other types use this
type.
Help
Help | Object Tool displays help
about the Object
Tool.