2.1.4 Basics
The
Basics page of the Graph Tool contains the
following fields:
Name
The
Name field
shows the name of
the current graph type. This field also has a pop-up menu that allows you to
open an existing graph type (
Open...) or create a new one (
New...
and
New Subtype...).
The prefix in the name can be used to make the type
abstract (i.e. it may not be instantiated as such itself but acts as a parent
type for its descendant subtypes) and affect whether or not it will be shown to
a modeler in the user interface:
| If
the name begins with an underscore, ‘_’, the
type is considered as abstract. It will be available for the language
definitions and type hierarchies, and will appear in the user interface, but can
not be instantiated by the
user. |
| If
the name begins with two underscores, ‘__’, the type is considered
as hidden. In addition to being abstract, a hidden type will not be shown to the
modeler, and the modeler will not be made aware that they exist in the type
hierarchy. Types made abstract for implementation reasons (e.g. to add
properties common to subtypes, or to add an intermediate level in a type
hierarchy to allow selection of just that part of the hierarchy) should
generally be marked as
hidden. |
Ancestor
The read-only
Ancestor field shows the type from which
the current type is descended: by default,
Graph.
Project
Each type in a modeling language is stored in a certain
project in the repository. By default a newly created type is stored to the
current default project. To store it somewhere else, choose the desired project
from the Project pull-down list. Please note that you can only choose
from those projects that are currently open. If the project you want is not yet
open, you can open it from the MetaEdit+ Launcher (Repository | Open
Project...).
The project can be changed as long as the pull-down list
remains enabled. As a type must always be defined or loaded from the repository
before its subtype, descendants of existing types always belong to the same
project as their ancestors: otherwise it would be possible to open a project
containing a subtype, without having first loaded its
super-type.
Properties list
The
Properties list shows the defined properties of
this type. For each property the following is shown: the
Local
name of the property, the
Property type used in
the property, the
Data type of the property type
and whether the property has unique values
(
Unique?) within this type.
The local name of the property is the name that is used
for the property within this type, e.g. shown as a label in the Property dialog,
and used to access the property with MERL. The property type column shows the
name of the property type: a property type may be used in many types, or even
more than once within the same type. For example, the same ‘Price in
USD’ property type could be used as both an ‘Initial price’
and ‘Discount price’ property, with those local names. The data
type shows the type of the contents of the property (see Section
2.6.3 for details of data types): it
cannot be edited directly from here.
Figure 2–2. Properties list pop-up menu.
The
Properties list
has a context sensitive pop-up menu
(as in
Figure 1–1) that is used
for defining the properties and also for creating the property dialogs for this
type (see Section
2.6 for the definition
of properties and Chapter
4 for the
definition of property dialogs). The
Properties list pop-up menu contains
the following items — note that depending on various factors not all of
them may be available at any given time:
| Set
as Identifier sets the currently selected property to
be the identifier for instances of this type. The identifier is the property
that is shown in all selection dialogs, and which is often unique among the
instances of this type. The choice of identifier can be modified later, but
notice that this will have a very visible effect, as the name of this
type’s instances that the user sees will change in many MetaEdit+ tools.
The identifying property type is marked in the property list with an asterisk
(*) before the local
name. |
| The
Toggle Uniqueness menu item toggles whether values
of this property type are unique within this type. The
Unique? field has a value of true or false in it
according to this toggle. The default setting for uniqueness is false, and thus
normally there can be many instances with the same value in their property
fields (unless the property is shared). If this menu item is selected, then the
values of this property must be unique within this property type, excepting e.g.
empty string
fields. |
| The
Local Name... menu item opens a dialog where the
local name for the selected property can be given. Usually this can be left the
same as the name of the property type, as defined in the Property Tool. If you
have used general property names to maximize the possibilities for reuse and
want to specialize them here, you can set a different local name here. Users in
general see the local name, e.g. in property dialogs. Property sharing uses the
property type name, as that is the same across all sharers of that
property. |
| For
example you might have a property type called ‘Name’, which you want
to use for all object types to allow property sharing between them. You could
then use the property in object type ‘State’ in WatchApplication
diagrams, giving it the local name ‘State name’. This would allow
you to reuse existing property names anywhere where the ‘Name’
property was used (e.g. as the name of the subgraph of that State), but still
see the familiar ‘State name’ in ‘State’
dialogs. |
| Starting
the local name with an underscore (‘_’) will make the property
read-only. Property instances will have their initial values as per the
metamodel but can not be edited by the user. A double underscore
(‘__’) at the beginning of the local name will make it hidden. In
this case, too, the instances will have the initial value as defined in the
metamodel (accessible by generators, labels in symbols etc.), but the property
will not be shown to the user in property dialogs, lists, sidebars
etc. |
| The
abstract and hidden properties affect the behavior of resulting property
dialogs. Hidden properties do not appear in the dialogs and if all properties of
a type are hidden, no property dialog will be opened for it. Similarly, if all
of a type’s properties are read-only, a property dialog won’t be
opened when the type is instantiated.
|
| Custom
property dialogs’ widgets retain their original read-only or hidden status
even if the status of the underlying property itself
changes. |
| The
Property Definition menu item, or alternatively a double click, opens a
Property Tool for the selected property (see Section 2.6 for details on using the Property
Tool). The attributes of a property type can be changed in the Property Tool,
affecting all types that use that property
type. |
| The
Add Property... menu item opens a dialog containing a list of all the
defined property types. Thus if you want to add an existing property type, just
select its name from the list and it will be added to the properties of this
type. If you want to define a new property type, select ‘New Property
Type’ from the start of the dialog list. This opens a Property Tool where
the new property type can be defined. When you generate that new Property type,
it will be automatically added to this
type. |
| The
Change Property... menu item opens a dialog
containing a list of all property types which have the same data type as the
selected one. Thus if you want to change an existing property type, just select
it from the properties list, choose Change Property... from the menu, and
select the property type with which you want to substitute
it. |
| If
a property has been added to the Properties list but not yet saved (by pressing
the Save button), it can be changed to use a property type of any data
type. |
| Move
Property... allows you to move the selected property
to a different position in the list, altering the order in the default dialog
for this type. Note that inherited property types ¾ shown with dark red text ¾ must be moved in the ancestor, and this change will
affect all other descendants. If you want to change the order in only one
descendant, you will have to edit the dialog for that type and move the property
name and widget manually
there. |
| Remove
Property removes the selected property type from this
type. Please note that inherited property types must be deleted in the ancestor,
and this change will affect all other descendants. Once the change has been
made, this action can only be undone by closing the Graph Tool without saving,
or after saving by abandoning the transaction; adding the same property type
back with the same name will create a new property field, the value of which
will be empty in all
instances. |
Description
The
Description field
shows the
textual description of this type. The field should contain the documentation of
this type in a form usable as a help text by modeling language users, because
this text appears in the help for the modeling language. Basic text formatting
(bold etc.) can be applied as in other text fields in MetaEdit+ (see Section
3.3.4 in MetaEdit+ User’s
Guide).