Project Browser - this
menu entry will open an additional project browser. This may be useful
if the number of projects is large and it would be useful to view different
projects simultaneously;
Class Browser - this menu
entry will open an additional class browser. This may be useful if the
number of classes is large and it would be useful to view different classes
simultaneously;
Preferences
- this menu entry will open a pane in which system wide preferences can
be viewed and changed. Examples of preferences are then launcher and graph
editor background colours. System preferences are stored in a text format
in the
user.preferences file. It is not advisable to edit this file
directly, however if it has been edited incorrectly or if the default values
for preferences is required then this file may be safely deleted;
Exit - this menu entry will
cause Moses to terminate.
The Theme Menu
As mentioned above
Moses may mimic one of a number of look and feels. In this menu it is possible
to change the look and feel that Moses uses. Changing the look and feel
will cause it to be stored in the
user.preferences file and to be
used when Moses is started again.
The first items in this menu
allow standard system look and feels to be selected:
Default - the default
look and feel for the platform on which Moses is running;
Windows - the Windows
look and feel, Naturally when Moses is running on Windows this is identical
to the default look and feel;
Motif - the Motif
look and feel, Naturally when Moses is running on Unix under X-Windows
this is identical to the default look and feel;
The remaining entries are variations on the
standard Java Metal look and feel. It
provides options that not only differ in colour but also in font sizes.
The last item in the theme
menu is a variation on the Java Metal look and theme that is defined in
the file MosesTheme.properties . In this properties file the red,
green, blue colour intensities for the major aspects of the Metal theme
are defined.
Please note that Java does not
support all platform look and feels on all platforms. If a non supported
look and feel is selected then the default look and feel will be selected,
an error dialogue will appear and the menu item disabled.
The Window
Menu
In the Window menu
all open panes in the Launcher will be represented by an entry. Selecting
an entry will bring that pane forward and if it is iconized will deiconify
it. This is particularly useful if many panes are open simultaneously.
The Help Menu
The Help Menu contains
two items:
About - selecting this menu item will cause
a dialogue to appear containing version and status information about Moses;
Help - selecting this menu item will cause a
pane to appear allowing the help system to be accessed.

The Help Pane
The help system in Moses consists
of a large number of Hypertext markup language (
HTML) files. The help system is therefore a simple web browser and is designed
specifically for obtaining and displaying small amounts of information.
It is possible to access the
Moses help system using a standard web browser such as Netscape Communicator
or Internet Explorer. Using either one of these browsers will enable the
help system to be printed or run on another system. The root HTML file
is found in the
code/help directory and is entitled
toc.html
.
Editors
In this chapter the
four standard Moses editors (graph, text, Java source and simulation configuration)
will be described. Each editor is designed to edit a particular type of
repository object. Editors are not invoked explicitly but from the repository
browsers. This ensures that the appropriate editor is started for the particular
object to be edited.

The Graph Editor
The graph editor allows
graphs in Moses to be edited and viewed. Graph types are described in Moses
using the Graph Type Description Language (GTDL). This process is described
in See The Attribute Editor
.
Part of the process of supporting
a new formalism in Moses is to define how the graph editor is to be configured
for a particular formalism. This configuration may include special menus,
tool bars items and edit behaviour. This is in addition to standard menus,
tool bar items and functions applicable for all formalisms. The standard
menus and the tool bar items are defined in the Editor.properties file.
This file may be modified to suite a users preferences including the preferred
language.
See
The Graph Editor shows a graph editor editing a graph using the Time
Petri Net formalism.
The Tool Bar
The tool bar is used
to access functionality that is most often used. The following describes
the default tool bar items:
Check-in - check the graph into the repository;
Print - using the previously defined or standard
settings the graph will be printed. Depending on the platform a Print dialogue
may be raised in which options may be modified;
Open/Close Graph Editor Pane - this will open
or close the second edit pane. Having two consistent edit panes which can
have different scale factors viewing different parts of the same graph
is particularly useful when editing large graphs. (see See
The Graph Editor with Split Edit Panes );
Syntax Check - this button will invoke a syntax
check of the graph. Any syntax error will cause an error pane to be raised;
Cut - the selected objects will be cut from
the graph and stored into a graph clipboard for later possible pasting;
Copy - the selected objects will be copied and
the copy stored into a graph clipboard for later possible pasting;
Paste - the contents of the graph clipboard
will be inserted into the graph;
Of the following tool bar buttons
only one button may remain depressed at any one time.
-
Mouse Selection - when this button is depressed
any press in the edit pane will allow edit pane operations to be performed;
-
Formalism Defined Buttons - pressing a formalism
defined button will cause a formalism object to be dragged into the edit
pane when the cursor enters the edit pane.
For more information on edit
pane functions see See Colour
Attribute Pane
The Graph Menu
The Graph menu contains
menu items relating to the graph as a whole.
Check-in - check the graph causing it to be
stored into the repository;
Release - if the graph was open for edit release
it and continue on in view mode;
Syntax Check - this button will invoke a syntax
check of the graph. Any syntax error will cause an error pane to be raised;
Open/Close Graph Editor Pane - this will open
or close the second edit pane. Having two consistent edit panes which can
have different scale factors viewing different parts of the same graph
is particularly useful when editing large graphs. (see See
The Graph Editor with Split Edit Panes );
Open/Close Attribute Editor Pane - this will
open or close the attribute editor. See
The Graph Editor with Attribute Editor Pane shows the attribute editor
on the selected transition in the edit pane;
Printer Setup - on some platforms this menu
entry will cause a system printer setup dialogue to be raised in which
print options can be viewed and modified;
Print - using the previously defined or standard
settings the graph will be printed. Depending on the platform a Print dialogue
may be raised in which options may be modified;
Quit - discard all edits and close the editor.
Check in and Exit - check the graph causing
it to be stored into the repository and close the editor.
The Edit Menu
Apart from
Undo
,
Redo ,
Paste and
Select All the remaining menu items
require that there are objects selected in the edit pane.
Undo - this menu item will undo previous edit
operations. Edit operations are stored from either when the graph editor
was started or the last Check-in operation;
Redo - edit operations that have been undone
can be redone by selecting this menu item;
Cut - the selected objects will be cut from
the graph and stored into a graph clipboard for later possible pasting;
Copy - the selected objects will be copied and
the copy stored into a graph clipboard for later possible pasting;
Paste - the contents of the graph clipboard
will be inserted into the graph;
Select All - selecting this menu entry will
result in every object in the edit pane being selected;
Select None - selecting this entry will result
in no object in the edit pane being selected.
The Flip Submenu
The flip submenu
contains two menu entries to either flip the selected graph objects vertically
or horizontally. Flipping involves mirroring the selected objects icons
about a vertical or horizontal axes through the center of the objects combined
bounding box.
Flip Vertical - create a mirror image of the
selected objects about a vertical axis through the center of the selected
objects bounding box.
Flip Horizontal - create a mirror image of the
selected objects about a horizontal axis through the center of the selected
objects bounding box.
The Rotate Submenu
The rotate submenu
contains two menu entries to either rotate the selected graph objects by
45 degrees or by an arbitrary amount. Rotating involves rotating the selected
objects clockwise about the center of the objects combined bounding box.
Rotate 45 degrees - rotate the selected objects
45 degrees clockwise about the center of the selected objects bounding
box;
Rotate - raise a dialogue prompting the user
for the number of degrees (positive or negative) to rotate the selected
objects clockwise about the center of the selected objects bounding box.
The Align Submenu
The align submenu
repositions the selected elements so that either all edges or center horizontal
or vertical positions coincide.
Align Left - Align all selected elements so
that their left edges align on the left edge of the selected objects bounding
box;
Align Center - Align all selected elements so
that their center vertical positions align on a vertical axis through the
selected objects bounding box center;
Align Right - Align all selected elements so
that their right edges align on the right edge of the selected objects
bounding box;
Align Top - Align all selected elements so that
their top edges align on the top edge of the selected objects bounding
box;
Align Center - Align all selected elements so
that their center horizontal positions align on a horizontal axis through
the selected objects bounding box center;
Align Bottom - Align all selected elements so
that their bottom edges align on the bottom edge of the selected objects
bounding box;
Formalism Dependent Menu Entries
The remain menus
in the graph editor are dependent upon the formalism being edited.
See
A User Defined Menu shows the menu for the
Time Petri Net formalism.
These formalism dependent menu entries are often also present in the tool
bar and are used to insert objects of the formalism into the graph.
Object Specific Pop up Menu
The attributes of
each object visible in the edit pane may also be viewed or edited individually
by clicking on the object with the right mouse button. This will cause
an object specific attribute pop up menu to be raised from which an attribute
can be chosen to be viewed/edited from within a dialogue. The resulting
dialogue will contain the appropriate attribute editor pane (also see
See
The Attribute Editor ).
The Edit Pane
The graph editor
is designed to allow the easy editing of graphs. In the editor all objects
are either vertices or an edges. A number of operations are specific to
vertices or edges. In this section all standard editor operations are described.
Click Select/Deselect
Selecting and deselecting
objects is a prerequisite operation for many functions. In addition to
being able to select all objects on a graph using the
Select All
menu item or being able to deselect all currently selected objects using
the
Select None menu item from the Edit menu (
See The Edit Menu ) individual objects can be selected/deselected using
the mouse.
Elements may be selected
individually by clicking on the object. Clicking on an area where there
are no elements will deselect all selected objects. Multiple objects can
be selected by holding the
shift key down while clicking. If while
holding the shift key down the object being clicked upon is already selected
then the object will be deselected with the remaining selected objects
being unaffected.
See
Edge and Vertex Selection shows two portions of a graph in which an
edge with knick and a vertex are selected and a selected vertex.

Drag Select
Pressing the mouse
button in an area where there are no objects and dragging the mouse will
cause a selection rectangle to be displayed. When the mouse button is released
all objects contained completely within the selection rectangle will be
selected.
Additions to the
current selection are made by holding the
shift key down while drag
selecting. If while holding the shift key down an object contained within
the selection rectangle is already selected then the object will be deselected.

Panning
Panning is rather
like scrolling. Rather than manipulate the scroll bars to cause the visible
portion of edit pane to be moved it is possible to do this by pressing
and dragging the right mouse button. This enables the visible part of the
edit pane to be moved in both axes without having to move the cursor to
the scroll bars.
Inserting Vertices
Vertices may be inserted
into the graph by selecting a vertex to insert from the tool bar or menu
entry and moving the cursor into the edit pane. As soon as the cursor enters
the edit pane the icon representing the vertex will be visible and will
track the cursor (
See Inserting
a Vertex ). When the mouse is clicked the vertex is inserted into the
graph and a new vertex will track the cursor. Hence by simply clicking
the mouse in the edit pane multiple vertices can be easily inserted. Once
the cursor leaves the edit pane the vertex tracking the mouse will be removed.
Inserting Edges
Inserting edges is
a multi-step operation as not only do the source and destination vertices
need to be identified but perhaps also knick points.
See
Inserting an Edge shows the edit pane after an edge tool bar button
has been pressed or menu item selected and the mouse is within the edit
pane.
To insert an edge the following
steps need to be carried out:
The insertion of an edge can
be cancelled by simply moving the cursor out of the edit pane.
The above steps assume that
neither the source or destination vertices have
connectors . The
use of connectors is formalism dependent and are required when an edge
must not only specify the source or destination vertex but also a particular
connector.
An edge may be connected directly
with a connector by clicking on the connector icon. If the mouse is not
clicked on a vertex's connector icon but on the vertex itself and the vertex
does define connectors a connection dialogue will be raised in which the
valid connectors are shown. The Default Connection button will cause the
edge to be connected with the vertex but not to a particular connector.

Deleting Vertices or Edges
Vertices and edges
can be deleted by first selecting the objects to be deleted and then pressing
the
Cut tool bar button, selecting the
Cut menu Item or pressing
the
delete key. When deleting vertices all dependent edges (those
edges whose source or destinations include the to be deleted vertices)
will also be deleted. This ensures that the graph remains consistent.
Moving the Current Selection
Objects can be moved
within the edit pane by two methods. The objects to be moved must first
be selected and can be
nudged in a particular direction by pressing
an arrow key. The amount moved is dependent upon the current grid setting.
If the grid is off then the selected objects will be moved by one. For
moving objects a greater distance if the mouse button is pressed on a selected
object and dragged all the elements in the selection will be dragged simultaneously.
Edges are dependent upon their
source and destination vertices. If a vertex is moved then all connected
edges will be moved. If an edge contains knick points then these points
can be moved along with the selected objects if the edge is included in
the selection.
Resizing Vertices and moving Knick Points
When a vertex is
selected its icon includes four
handles denoting the corners of
a rectangular box surrounding the object. The vertex can be resized by
pressing the mouse button on one of these handles and dragging the handle
and hence the corner of the icon to a new position. The operation is completed
when the mouse button is released. If the grid is selected the corner will
be aligned to a grid point.
When an edge is selected handles
will appear denoting the start and end of the edge in addition to a handle
for every knick point. The start and end handles are only used to indicate
that the edge has been selected and can not be moved. The knick points
however, may be moved in a similar manner as described in the previous
paragraph.

Inserting/Deleting Edge Knick Points
After an edge has
been inserted into the graph it is still possible to insert or delete knick
points.
Knick points can be inserted
into an edge by pressing the mouse button on the edge where the knick point
is to be inserted and dragging the mouse. The edge need not be selected
but this operation will cause the edge to be selected and hence a handle
will be shown for the newly created knick point. The knick point can then
be moved into the desired position.
A knick point is deleted when
it is moved to a position where it is redundant, i.e. there is no discernable
change of direction at the knick point.
Scale/Grid Control
Associated with each
Edit pane are controls for changing the scale in which objects are drawn
and controls to set, use and show the grid. The scale and grid settings
are stored with the graph so that when the graph is subsequently opened
the graph will be drawn at the previously selected scale and the grid will
be as it was previously.
The Scale Controls
There are three user
interface objects for controlling the scale at which objects are drawn.
The scale factors are defined in the
Editor.properties file
and may be changed by the user.
Scale Pull Down Menu - Selecting an item from
the Scale pull down menu will immediately redraw the graph at the chosen
scale;
The reduce scale button - pressing this button
will set the scale to be the next smallest and immediately redraw the graph;
The increase scale button - pressing this button
will set the scale to be the next biggest and immediately redraw the graph.
The Grid Controls
The grid controls
enable or disable the placement of objects in the edit pane to be aligned
to a grid of a particular size and also whether the grid is visible or
not. The grid sizes are defined in the
Editor.properties file
and may be changed by the user
Grid Pull Down Menu - Selecting an item from
the Grid pull down menu will change the grid size and if the grid is visible
will immediately redraw the grid in the new size;
The Grid Off button - pressing this radio button
will turn the grid off, therefore all positioning operations will not be
aligned to the grid. If the grid was visible the edit pane will be redrawn
without the grid;
The Grid Hide button - pressing this radio button
will turn the grid on but not visible, therefore all positioning operations
will not be aligned to the grid. If the grid was visible the edit pane
will be redrawn without the grid;
The Grid Show button - pressing this radio button
will turn the grid on and make it visible, therefore all positioning operations
will not be aligned to the grid. If the grid was not visible the edit pane
will be redrawn with the grid.
The Attribute Editor
In the attribute
editor specific object or graph attributes can be viewed and edited (
See The Graph Editor with Attribute Editor Pane ). Attributes are described
in the formalism description with a data type and an access type. Only
those attributes that have an access type that is not
hidden will
be able to be edited in the attribute editor. The attribute editor can
be opened or closed by either pressing a tool bar button or selecting the
Open/Close Attribute Editor menu item from the
Graph menu.
Attributes are edited in data
type specific editor panes. In all editor panes that accept text entry
the system specific
cut/copy/paste keyboard short-cuts allow exchange
of information between editor panes. In addition there is a pop up menu
raised when the right mouse button is clicked with
cut/copy/paste
menu items.
The attribute editor will
show particular attribute panes depending on the current selection in the
edit pane. If no objects are selected then edit panes for graph attributes
are visible. If a single vertex or edge is selected the all attributes
for that object will be able to be viewed and edited. Finally when a number
of objects are selected then only those attributes that all objects have
in common will be able to be viewed and edited.
Each attribute pane includes
two buttons
Cancel and
Commit . The Commit button will take
the user input and if correct will update the corresponding object(s) attribute.
Cancel will delete the user input and replace it with the original value
of the attribute stored when the attribute pane was created. If this value
is required the Commit button must again be pressed. In addition to the
two buttons a check box can be selected so that the attribute will be visible
in the edit pane. The following paragraphs describe each of the attribute
panes:
Integer Attribute Pane
In this pane attributes
of type integer are viewed and edited. The user input is checked for validity
when the Commit button is pressed. If the input was not a valid integer
it will be ignored and an error message shown.
Real Attribute Pane
In this pane attributes
of type real are viewed and edited. The user input is checked for validity
when the Commit button is pressed. If the input was not a valid real it
will be ignored and an error message shown.
String Attribute Pane
In this pane attributes
of type string are viewed and edited. Type string is assumed to be a single
line of text and returns will be ignored.
Text Attribute Pane
In this pane attributes
of type text are viewed and edited. Type text is assumed to consist of
one or more lines of text.
Expression Attribute Pane
In this pane expressions
written in the
Elan language are input. When the commit button is
pressed the expression is parsed and any errors will cause an error message
to be displayed.
Expression Frame Attribute Pane
In this pane expression
frames written in the
Elan language are input. When the commit button
is pressed the frame is parsed and any errors will cause an error message
to be displayed.
Parameters Attribute Pane
In this pane parameter
lists are input. When the commit button is pressed the list is parsed and
any errors will cause an error message to be displayed.
Colour Attribute Pane
In this pane colours
are displayed and edited. The attribute pane has 3 sub-panes in which colours
are displayed and edited in different ways.
Supporting a New Graph Type
Moses is designed
to be a formalism independent discrete event system environment. There
is no implicit formalism in Moses, hence all formalisms must be defined
before being used to model a system. There are three main steps in defining
a new formalism:
define the elements of
the formalism using the GTDL description language;
define an editor plug-in
that described the editing syntax of a formalism;
define a
.properties
file to configure the graphics editor.
The GTDL formalism description
The GTDL language
is described in
XXXXX . The GTDL description includes a description
of all vertices and edges used in the formalism. Associated with every
vertex and edge are attributes. The user may be required to be able to
edit attributes and hence each attribute has an associated visibility parameter
indicating whether the attribute is to be manipulated directly by the user
or indirectly via the use of a tool. The graphics editor supports a number
of standard attribute editors.
Defining the Icons of a Vertex or Edge
Every vertex that
is to be visible from within the graphics editor includes a shape attribute.
The shape attribute includes the name of the java class that creates the
icon to represent the vertex. Similarly edges define optionally shape (line),
head and tail attributes which define the name of the java classes that
creates the icon for these attributes.
If the name of the attribute
does not contain a period it is assumed that there is a corresponding class
in the package moses.canvas.shapes. A name containing a period is assumed
to be a fully defined java class name. The classes in the moses.canvas.shapes
package serve as templates for user defined shape classes.
An important concept is that
an icon is constructed from a number of graphics primitives. The graphics
primitives allow virtually any icon to be constructed by the shape classes.
The Editor Plug-In
The GTDL description
includes a line:
const editorPlugInName = "moses.models.plugins.PetriNetPlugIn"
. This line describes the location of an editor-plug-in java class file
that contains information necessary to allow the graphics editor to support
the new formalism. The editor plug in defines a number of items:
static String bundleName
= "Simple_Petri_Net" ; This line defines the name of a
properties file
that describes the formalism specific editor. Keeping this information
in a
properties file enables Moses to be easily localised for a
particular language locale;
public static final
String insertCommentAction = "insert-comment" ; A series of action
strings is defined - one for each insert command to be supported by the
editor. The strings defined here have an associated entry in the
properties
file;
public Hashtable getActionTable(GraphType
gt) This method returns the a table from which a command list can be
built. The table has two entries - one for vertices - one for edges. Each
subentry is also a table where entries have the action string (defined
above) and the graphtype of the vertex or edge to insert;
public boolean canAddVertex(GraphType
gt, Vertex newVertex) This method is called to test whether a new vertex
can be inserted into the graph. In this method part of the syntax of a
formalism can be implemented;
public boolean canRemoveVertex(GraphType
gt, Vertex oldVertex) This method is called to test whether a vertex
can be removed from the graph. In this method part of the syntax of a formalism
can be implemented;
public boolean canConnect(GraphType
gt, Edge edge, GraphObject element) This method is called to test whether
a new edge can be connected to an element and inserted into the graph.
In this method the part of the syntax of a formalism can be implemented.
public ResourceBundle
getResources() Returns the resources described in the properties
file;
public void setResources(ResourceBundle
rb) Sets the resources described in the properties file.
The Properties File
The properties file
contains formalism dependent editor information. It defines additional
formalism dependent menus and tool bar items. In addition an action string
defines the name of the action to be executed when either a menu item has
been selected or a tool bar button has been pressed. The following box
shows a typical properties file. Please note the properties file is commented
describing the individual fields.
# @(#)PetriNet.properties 1.1 16-9-98
#
# Resource strings for a very simple class of PetriNets.
# menubar definition
#
# Each of the strings that follow form a key to be
# used to refer to the actual menu definition.
menubar=insert
# insert Menu definition
#
# Each of the strings that follow form a key to be
# used as the basis of a menu item definition.
# dashes are used to insert dividers into the menu
#
# the following line defines the menu entries
insert=comment - place trans - arc
# return the actual string representing the menu
insertLabel=Insert
# for each menu entry three strings can be defined
two of which are obligatory
# xxxLabel returns the actual string representing
the menu entry
# xxxAction returns the actual string representing
the command.
# This must be the same as defined in the specific
editorPlugIn .
# xxxImage returns the actual string representing
the image to be used to represent the menu entry (optional)
commentLabel=Comment
commentImage=petri-images/comment.gif
commentAction=insert-comment
placeLabel=Place
placeImage=petri-images/place.gif
placeAction=insert-place
transLabel=Transition
transImage=petri-images/trans.gif
transAction=insert-transition
arcLabel=Arc
arcImage=petri-images/arc.gif
arcAction=insert-arc
# toolbar definition
#
# Each of the strings that follow form a key to be
# used as the basis of the tool definition. Actions
# are of course sharable, and in this case are shared
# with the menu items.
# dashes are used to insert extra space between buttons
toolbar=comment place trans arc
# for each menu entry a string can be defined
# xxxTooltip returns the actual string representing
the tooltip to be shown
commentTooltip=Insert a comment
placeTooltip=Insert a place
transTooltip=Insert a transition
arcTooltip=Insert an arc

The Text Editor

The Java Source Editor

The Simulation Configuration Editor
Index
H
J
L
M
Moses
P
Properties