MiceOnABeam Product Documentation

Modified: 4/21/2013 4:22 PM
Recently changed articles You can subscribe to this wiki article using an RSS feed reader.

Using the State Editor

Title Bar

The title bar consists of the following three distinct areas:

The name of the script model is always shown first. For top-level states, the name of the file in which the script model saved together with the version of the model is then shown in parentheses. Lastly, an asterisk * is shown if the script model has been modified since its last save.

Toolbar

The toolbar provides a set of modeling elements that can be created within a State Editor. To create a particular element first click on the corresponding icon on the toolbar and then click at the desired location for the component with the State Editor.

If the Shift key is pressed and held prior to selecting a tool from the toolbar, then the tool selection will persist as long as the Shift key is pressed.  Otherwise after creating a modeling component within the State Editor, the selected tool will reset to the Select tool.

Used to select a modeling component within the State Editor. Once selected a component can be moved or re-sized via a click and drag mouse operation.

A component can be added or subtracted from the set of currently selected components by pressing and holding the Shift key first prior to clicking the component.

Components can also be selected by clicking in an unused area of the State Editor and dragging the cursor to form a selection rectangle that can be used to intersect a number of modeling components, all of which will then be selected.  Note that transitions cannot be selected in this manner.

To select a transition click on or close to the transition's label or line segment.

 Used to create a new state within the State Editor. See: State.

 

 

  Used to create a transition between two components within the
             State Editor. After selecting the Transition Tool icon, click within
             the source component within the State Editor, and drag to the
             destination modeling component.

To create a Self Transition, after selecting the Transition Tool icon, simply click within the border of a state within the State Editor. See: Transition.

Used to create a Choice Point within the State Editor. See: Choice Point.

 

Used to create a Junction Point within the State Editor. See: Junction Point.

 

  Used to create a Shallow History Point within the State Editor.
  See: Shallow History.

 

  Used to create a Deep History Point within the State Editor.
  See: Deep History.

 

  Used to create a Final State within the State Editor. See: Final State.

 

  Used to create a Terminate Point within the State Editor. See: Terminate.

 

   Clicking on the info icon will toggle the auto-display of modeling component
   comments. When enabled moving the mouse over a modeling component
         will display it's comment (if any) in a pop-up note.

When the Show extended model comments option in the Models pane of the Options dialog is enabled, additional design information is included along with the component's comment.

  • For a state this includes additional information on it's Entry and Exit actions, contained transition (LSL) events and defined State Variables and Functions.

  • For a transition this includes additional information on it's (LSL) event, Transition Guard and Transition Action.

Within the extended comment information Guard Condition and State Variable initialization code are fully shown and not abbreviated as they are when displayed in the state notation label.

After selecting the Show Info button in the State Editor toolbar and hovering over a state, the resulting pop-up will show the complete Entry & Exit Action code for the state. In this way a model's code can be more easily scanned without having to repeatedly open and close state Property Editors.

Note that clicking anywhere within the State Editor will turn the auto-display of comments off.

   Clicking on the magnifying glass will open up the Search Dialog.
   Similarly, entering in a text string in the text box will open up the
        Search Dialog and automatically start the search.

 

Editor Context Menu

Positioning the cursor over a modeling component and right-clicking will bring up the context menu for that component. Various operations can be performed on the component by selecting a menu item from it's context menu. Note that for some operations as indicated below, some menu items only operate on items that have been previously selected.

This context menu item is activated when there are one or more selected modeling components. First it copies the selected components to an internal copy buffer (not the system Clipboard), and then deletes them. Transitions which are connected to other components which are not part of the selection, will not be included in the copy.

LSL code can be cut, copied and pasted only via their respective context-menu items within a Code Editor.

This context menu item is activated when there are one or more selected modeling components. It copies the selected components to an internal copy buffer (not the system Clipboard). Transitions which are connected to other components which are not part of the selection, will not be included in the copy.

LSL code can be cut, copied and pasted only via their respective context-menu items within a Code Editor.

Pastes the previously copied modeling components to the current cursor position in the State Editor. In this way you can copy and paste modeling components from one State Editor to another.

►Note that copied components will be renamed if there is a corresponding component with the same name within the State Editor. As well, if the copy buffer contains "one-of" components that already exist in the destination State Editor (such as Shallow History, Deep History, Final State and Terminate Point), then these components and their connected transitions will not be included in the paste.

LSL code can be cut, copied and pasted only via their respective context-menu items within a Code Editor.

This context menu item is activated when there are one or more selected modeling components. Deletes the currently selected objects in the currently active State Editor.

This context menu item is activated if the cursor is placed over a modeling component when the context menu is opened. Provides for in-place editing of a component's name. The Enter key will save the new name, while the Esc key will cancel and close the edit. Clicking the mouse outside the edit box will also cancel the edit.

This context menu item is activated if the cursor is placed over a modeling component when the context menu is opened. Opens up the Properties Editor for the component. See Code Editor for a description the built-in Code Editor functions.

The state name, Entry Action, and Exit Action can be edited here. Select the OK button to save the changes and exit the editor. Select the Cancel button to cancel the changes and exit.

The transition name, Guard Condition and Transition Action can be edited here.

Select the OK button to save the changes and exit the editor. Select the Cancel button to cancel the changes and exit.

A help popup is displayed describing the selected event when choosing an event in the Transition Properties Editor.

This context menu item is activated either if the cursor is placed over a modeling component, or if placed over the background of the State Editor when the context menu is opened. In the former case it opens up the Comment Editor for the selected component where the comment can be viewed and/or edited. In the latter case it opens up the Comment Editor for the enclosing state.

This context menu item is activated if the cursor is placed over a state that has configurable State Variables, when the context menu is opened. Opens up the Component Configuration Wizard for the component. You can customize the component by modifying the values of the displayed variables.

This context menu item is activated either if the cursor is placed over a state, or if placed over the background of the State Editor when the context menu is opened. In the former case it opens up the State Variables and Functions Editor for the selected state. In the latter case it opens up the State Variables and Functions Editor for the enclosing state. For further details on this feature please see: State Variables & Functions.

This context menu item is activated if the cursor is placed over a state when the context menu is opened. It replaces the contents of the current State Editor with the decomposition of the selected state. In other words, the State Editor moves one level down in the state hierarchy.

When selected from within a top-level State Editor, a new State Editor will be opened on the selected state. In this case, it's operation is equivalent to that of Open State.

This context menu item is activated if the cursor is placed over the background of the State Editor when the context menu is opened. It replaces the contents of the current State Editor with the decomposition of the state one level up. In other words, the State Editor moves one level up in the state hierarchy.

You can also double-click over the background of a State Editor to go to it's containing state. This is equivalent to selecting Go Outside State.

This context menu item is activated if the cursor is placed over a state when the context menu is opened. It opens up a new State Editor with the decomposition of the selected state.

This context menu item is activated if the cursor is placed over a state when the context menu is opened. It opens up a new State Explorer for the selected state.

This context menu item is activated when there are one or more selected modeling components when the context menu is opened. The selected modeling components are pushed down a level in the state hierarchy, to become contained within a newly-created Composite State. Note that transitions which are connected to other components which are not part of the selection, will not be included within the Composite State.

This context menu item is activated if the cursor is placed over a Composite State when the context menu is opened. The contained components of a Composite State are removed and brought up a level within the state hierarchy and the (former) Composite State is then removed. Note that transitions which are connected to the border inside the Composite State, will be deleted.

This context menu item is activated if either the cursor is placed over an Entry or Exit Point on the border of a Composite State when the context menu is opened. It toggles between making the point visible or not on the state's external border.

An Entry or Exit Point will always be visible on the state's external border when a connection is made to it from within the state's decomposition. In such case, the menu item will be disabled.

For further details on Entry and Exit Points, please see Entry Point and Exit Point.

This context menu item is activated when there are one or more selected modeling components. When enabled, the graphical position of the modeling component is locked in place and cannot be moved or re-sized.

This context menu item is activated if the cursor is placed over a transition when the context menu is opened. When enabled, the transition will be smoothed and drawn as a set of curves controlled by it's selection handles. When disabled, the transition will be drawn as a connected series of straight lines.

States, Transitions, Entry and Exit Points all have a default graphical look that can be restored as follows:

  • State: Resizes the state to it's default creation size.
  • Transition: Removes any bends in the transition and redraws the transition from it's source to it's destination.
  • Entry/Exit Point: An Entry or Exit Point on the internal border of a Composite State can be moved independently of it's corresponding point on the outside border of the state where the transition intersects the state. Selecting Restore Default Look will re-align the Entry/Exit Point to it's corresponding point on the outside border.

    If the Entry/Exit Point is visible on the outside border of the state, then selecting
    Restore Default Look on the inside Entry/Exit Point will make it dependent upon the location of the outside point. Similarly, selecting Restore Default Look on the externally visible Entry/Exit Point will make the latter dependent on the location of the corresponding inside Entry/Exit Point.

Graphical Operations

States, Transitions, and Entry/Exit Points can all be renamed by simply double-clicking the component. This will open up an in-place text editor where the name can be modified. The Enter key will save the new name, while the Esc key will cancel and close the edit. Clicking the mouse outside the edit box will also cancel the edit.

►Note that the double-click action can be changed in the Models section of the Options dialog.

Any modeling component can be moved within the State Editor by doing one of the following:

  • Click on the component and drag it to it's new position; or
  • Select the component by clicking on it. Then use the arrow keys to move the component one pixel at a time.

To avoid spurious moves when clicking on modeling components, the mouse (on mouse-down) has to move a minimum distance in order to initiate a graphical move. (Components can still always be moved one pixel at a time by using the arrow keys.)

Note that components (aside from transitions) cannot be moved passed the internal border of the State Editor. As well, a component cannot be moved to overlap another component, but can however be dragged across another component to appear on the other side.

Click and dragging any one component of a set of modeling components that have been selected, will move the entire group.

A modeling component can be deleted by first selecting it and then either pressing the Delete key or choosing Delete from the Main Program Edit Menu.

A state can be resized within the State Editor as follows:

  1. Select the component by clicking on it. A selection rectangle will surround the component.
  2. Click and drag one of the resize handles to expand or shrink the component in the corresponding direction.
Note that if there are visible Entry or Exit Points on the border of the state, or the location of a transition end point has been fixed on the state, the state will not be able to be resized past the position of the respective point.

To move a group of modeling components or resize a group of states, select the group of components either by Shift-clicking each component, or by clicking and dragging the mouse on the background of the State Editor to form a selection rectangle, and then encompass or intersect all components that are to be part of the group.

Click and drag any one component of the selected group to move the entire group. Similarly if any state within the group is resized via it's resize handles, all other states will also be correspondingly resized.

To redirect a transition end point from one modeling component to another first select the transition. Then drag either the source or destination end point selection handle to the new state.

If the move is permitted, the transition will be redrawn to/from the new destination/source. If the move is not permitted, the transition will return to it's previous position.

By default a transition is drawn from the centerpoint of the source modeling component to the centerpoint of the destination component. As the source or destination is moved, the transition end point connecting to the component will move around the perimeter of the component as a result of the default drawing method. This is often convenient when a state machine is first being drawn.

As the script model evolves, it often desirable to fix the location of either the source or destination transition end point on a state's external border.  This is particularly important when there are multiple transitions between two states. To do this first select the transition, and then drag one of it's end point selection handles just next to the desired location on the state's border.

To restore a transition end point whose location has been fixed, drag the end point selection handle to the interior of the state. Alternatively select the transition itself, and choose Restore Default Look from it's context menu which will redraw the entire transition according to the default as described above.

To bend a transition, first select the transition. Then click and drag the middle selection handle to the desired position.

Note that a transition will be automatically curved the first time it's mid-point selection handle is moved if the Automatically Smooth Transition option is enabled in the Transitions panel of the Options dialog.

To create an additional selection handle, press and hold the Control key and click on the desired location. Then click and drag the new selection handle to create the new bend. To delete a selection handle, just Control-click it.

In addition if you would prefer straight line segments instead of curves for a particular transition, de-select Smooth Transition from it's context menu.

Note that when states connected to a bent transition are moved, each state will automatically try to maintain a 90° angle with the transition segment connected to it.

To restore a modified transition to it's default shape, choose Restore Default Look from it's context menu.

To align a particular line or curved segment of a transition to either a horizontal or vertical position, just hold down the Shift key when clicking and dragging a selection handle to the nearest horizontal or vertical plane. Note that alignment is always done one segment at a time, from the selected selection handle to the adjacent handle (towards the starting point of the transition).

You can move the display of the transition's label to another selection handle by holding down both the Control & Shift keys and then clicking on the desired selection handle.

The State Editor window can be resized by clicking and dragging one of it's four corners or four sides. Note that the size of a State Editor for each state in a script model is saved.

The State Editor's size will be constrained by both internal components as they approach the internal state border, and Entry/Exit Points on the internal border.

A Self Transition originates from and terminates on the same state. To create one, select the Transition Tool, and then click within the border of a single state.

The initial size of a Self Transition is automatically calculated. However it's size can be changed by selecting the transition. Then click and drag the transition's mid-point handle to adjust it's size.

To move a Self Transition, just click and hold to select it, and drag it clockwise around the state, keeping the cursor outside the state for best results. Alternatively you can select the transition and then click and drag either endpoint selection handle to a new position on the state border.

Simply double-click over the background of a State Editor to go to it's containing state. This is equivalent to selecting Go Outside State from the State Editor's context menu.

In conjunction with setting the Double-Click Action to Go Inside Component within the Models pane of the Options dialog, you can easily traverse up and down the state hierarchy for models with Composite States.

Misc

The icon is displayed on on the bottom of the State Editor if the enclosing state has State Variables/Functions defined. This saves you from opening the State Variables and Functions Editor for the enclosing state to determine this.

The display of the State Variables/Functions icon can be enabled or disabled via the Show State Variables & Functions Icon option in the States panel of the Options dialog.

 

Tags:
Home: MiceOnABeam Product Documentation Copyright © 2010-2018 MiceOnABeam Software