Class - Rule_

Public Methods
Public Method Details
Private Methods
State

Inheritance - ::gui::Rule_ ::mps::Rule_

Public Methods

(top level)

create key pe_tag y args   Create a gui::Rule_ object and display a view of it on the current canvas (procedure)
destroy args   Delete a gui::Rule_ object and undisplay any views
deploy y args   A view of the object is displayed and sub-objects are also deployed
recall     Any view is undisplayed and sub-objects are also recalled
move mode args   Move a view of the Rule object around on a drawing canvas
optget option   Optain a value for the specified graphical option
optmod args   Set a value for a graphical option, or obtain option list(s), do arch checks, history, update
update args   Bring the current view of the object up-to-date with the architecture state
select     Show the object as selected
unselect     Undo the effects of 'select'
fade     Show the current view of the object as faded
unfade     Undo the effects of 'fade'
activate sbtag args   Show a piece of the object as ready to resize
deactivate sbtag args   Undo the effects of 'activate'
resize sbtag mode args   Resize the object due to movement of a selectbox

(low level)

addSelectBoxes     Show selection boxes on the current view of the object
adjust args   Adjust the Rule's graphical appearance, needed due to changes in other objects
align args   Align the object to the nearest canvas grid lines
buildTree top   Build the architectural state and graphical defaults of the object into a DOM tree
buildTree_gui top view   Build the graphical values of the specified view into a DOM tree
bump y dist  
checkConfig vname  
checkMove new_y last_y checkcmd  
constructor pe_tag args  
copy    
cut    
delete args  
deleteSelectBoxes     Undo the effects of 'addSelectBoxes'
destructor    
display y args   Display a graphical view of the object on the current canvas
drawQSystem c w h  
dump    
findNeighbor dir args  
findNeighborEvents y  
getActions args   Events of type action attached to this rule
getCanvas    
getCname    
getCommand mode   Returns a string that can be used to re-create/display/copy the object as it exists now
getCoord req  
getGraphicsId piece  
getGroupTag    
getGuards args   Events of type guard attached to this rule
getOptions args   Return information about the options for this object
getParams     Parameters for this rule (all message params on incoming messages)
getPcode    
getProperties     (procedure)
getPropertyList    
insert y dist args  
invalidate    
isEditable     (procedure)
isInit     Boolean indication as whether or not the rule is an init rule.
isOkToDelete    
isSpaceforEvent n_tag s_tag  
isTriggered context  
moveDist moveit xDist yDist  
optset args  
paste {mode obj}  
raise     Raise the view of the object in the canvas display order
slide mode args   Move a view of the Rule and cause neighbor rules to slide too
undisplay {view {}}   Undisplay a view of the object

Public Method Details

activate
  A selectionbox has been chosen (clicked). Show the object item as ready to be resized via selection boxe(s).
 
sbtag
  pass in the object tag of the chosen selectbox
 
args
  not used in Rule object
addSelectBoxes
  Add selectbox objects to the Rule.
adjust   ?hints? ?actionlist?
  Adjust the graphical components of the rule to their correct position given the current situation. If no arguments are given, then all components (see <actionlist>) are checked to see if adjustment is required. Providing <hints> can improve efficiency.
  This method is public so that as other objects undergo changes changes (move, resize) that can affect the rule, they can invoke this method and get the rule to adjust itself.
 
?hints?
  used to give hints to the adjust method
 
-y <y>
  a y-value to use
  if the calling code already has the pertinent y-value, then passing it here can remove the need for a lookup. This will speed up adjustment of 'Top', 'Bottom', and 'Origin'.
 
?actionlist?
  a list of components to be adjusted (default is all)
 
Label
  adjust the label position
  The rule label must actually be keyed off the location of the Begin event, so any change there must be reflected in the rule label position as well.
 
Top
  adjust guard (top of rule) to match BeginEvent location
  this will also automatically invoke 'adjust Label'
 
Bottom
  adjust action (bottom of rule) to match EndEvent location
 
Origin
  adjust origin of rule to match MidEvent location
align
  The origin of the Rule (where mid-event is positioned) is aligned to the nearest grid line.
buildTree
  The architectural state and initial graphical state of the Rule object are grafted onto the DOM tree element indicated.
 
top
  a pointer to a tree element
buildTree_gui
  The current graphical state of the specified view is grafted onto the DOM tree element indicated.
 
top
  a pointer to a tree element
 
view
  the View (Edit sheet) from which to obtain the view of the Rule object
bump
checkConfig
checkMove   new_y last_y checkcmd
  Given a new y-value, and the previous y-value, figure out if it is okay to move the rule to the new location. This method is also invoked by Event objects on their owner-rule, which can cause complex conditions. Controls are built in which allow one to pick and choose the checks to be made. If the checks pass, return the new y-value, otherwise return the previous y-value. This method causes no changes to the rule or its location.
 
new_y
  new y-coordinate pending to which the rule will be moved
 
last_y
  last y-coordinate where the rule was previously located
 
checkcmd
  indicate which checks are to be made
  Use one or more of the letters in a list or a string in any order to indicate which check(s) are to be made
  allowed: p, n, s
    p check for Pe box (to the north implied)
    n check for other rules to the north
    s check for other rules to the south
 

<tag> checkMove 28 32 pns

constructor
  Use the itcl::class definition to create a Rule object.
copy
create   key pe_tag y ?<options>?
  A gui::Rule_ object is created with name <key> on Pe <pe_tag>. The initial placement is on the Pe stem, at y-coordinate <y>. A view of the object is shown on the current canvas.
  Graphical options can be passed in which will be used as default values for all subsequent views of the object which are displayed on any canvas. (Any graphical options not specified will use the class values set up during program start up.)
  The command is put onto the Hist/Undo stack.
 
key
  used to create a name for the object
  can be #auto, see documentation for itcl::class
 
pe_tag
  must be a valid Pe object
 
y
  y-value for initial placement of Rule on Pe stem
 
?<options>?
  graphical options (see options for more info)
cut
deactivate
  A selectbox on the object has been de-selected. Modify the appearance of the object to indicate this.
 
sbtag
  the tag of the released selectbox
delete
  Calls the 'destroy' method. The method is required to provide a standard method for the Menu system to call for any object to be removed.
deleteSelectBoxes
  Remove selectbox objects from the Rule.
deploy   y ?<options>?
  A view of the object is placed on the Rule's owner Pe stem at the y-coordinate specified in <y>. All events attached to the Rule also execute a 'deploy' method.
  Graphical options can be passed in, which will be used as default values for all subsequent views of the object which are displayed on any canvas. (Any graphical options not specified will use the class values set up during program start up.)
  The Gui does not directly call this method, as only a Pe is 'deploy'd directly. So a Pe deploy/recall records history, but Rule,Event,etc. should not. Doing so would also cause a mess because of implicit deployment done by 'update'.
 
y
  y-value for initial placement of view
 
?<options>?
  graphical options (see options for more info)
destroy
  After checking that architectural conditions are met, a gui::Rule_ is deleted and all views are undisplayed. The command is put onto the Hist/Undo stack.
destructor
  Undisplay all views of the object on any canvas and itcl::delete the object.
display
  Show the graphical items for this object on the current canvas.
drawQSystem
dump
fade
  Look up graphic components of Rule, and redraw them so the Rule looks faded.
findNeighbor
findNeighborEvents
getActions
  Return a list of all the action events associated with the given Rule. Events tags are returned in natural mid->end (top to bottom) order.
getCanvas
getCname
getCommand
  see command explanation here
  see graphical options here
getCoord
getGraphicsId
getGroupTag
getGuards   ?<options>?
  Return a list of all the guard events associated with the given Rule.
Order considerations:
- okay to use natural begin->mid (top to bottom) order
- list events with Msgs/Segs/Pins first
  Other guard expressions may want to compare param values delivered by the messages.
 
-deref <0/1>
  should any attached segment be dereferenced
 
-attach <0/1>
  should events with attachments be prioritized
getOptions
  see command explanation here
  see graphical options here
getParams
  Return a list of all the parameters seen on incoming messages.
getPcode
getProperties
getPropertyList
insert
invalidate
  Invalidate all Action events which are a part of this rule object.
isEditable
isInit
  Determine if the rule is an init-rule or not. If no msg, seg, or pin is detected on the Rule's guards, then it is an init-rule.
isOkToDelete
isSpaceforEvent   n_tag s_tag
  Make sure there is enough space between the given events, to insert a new event. Return 1 if there is room, 0 if not.
  The two events must be adjacent, with no other events physically located between.
 
n_tag
  tag of an event, on top (northerly)
 
s_tag
  tag of an event, below (southerly)
isTriggered
move   mode ?<optional args>?
  Move the y location of a Rule up and down on a Pe leg.
 
mode
  movement control
  allowed: start track end
    track No restrictions other than stay on the Pe, other rules have no effect on movement.
moveDist
optget
  see command explanation here
  see graphical options here
optmod
  see command explanation here
  see graphical options here
optset
paste
  Paste applicable objects in Istate(selected) to this binder. Valid objects to paste: Event_
raise
  Raises the view on the canvas and also causes a 'raise' for each attached event.
recall
  Any view of the object on the current canvas is undisplayed and all attached events also execute a 'recall' method. The command is put onto the Hist/Undo stack.
resize
  see here for more info
select
  A Rule view is selected, and we indicate it is selected by drawing "selectboxes" at key places
slide   mode ?mode dependent args?
  This rule needs to be moved on the Pe stem. This move can affect other rules, so neighbors may also get the slide call.
  This method used has three modes (unlike 'move' method there is no "start" mode used). The "insert" mode is typically used by the rule to make room for itself during its creation. A single 'slide insert' call is followed by a 'slide end'. The "direct" mode is used for mouse interaction, a series of 'slide direct' calls are concluded with a 'slide end'. This method is quite different from 'move' since it will propagate a 'slide' to other rules if it is necessary to move the rules out of the way. The history of any rule moved is recorded.
 
mode
  operation control
  allowed: insert, direct, end
 
?mode dependent args?
  mode determines which arguments are required
 
insert <dist>
  move rule to the south <dist>, also slide neighbors south if necessary
 
<dist>
  the distance to move the rule
 
direct <y>
  slide rule to location <y>, also slide neighbors if necessary
 
<y>
  y-location at which to place the rule
 
end
  used after a 'slide insert', or a series of 'slide direct' calls
undisplay
  Remove the graphical items from the canvas which comprise a "view" of the object.
 
view
  View tag which contains the object view to be undisplayed.
  if no View tag is given, try to remove a view of the object on the current canvas.
unfade
  Look up graphic components of Rule, and redraw them so the Rule looks normal
 
y
  a y-coordinate on the rule from where the search for neighboring events will be conducted
unselect
  Show the view of the Rule as unselected.
update   ?options?
  Bring the view of the Rule up-to-date with the Architecture. Architecture changes could have been made in other views that need to be reflected onto this view of the object.
 
?options?
  choose pieces to be updated (default is all)
 
-Label
  bring the Rule label in sync with state value
 
-events
  cause each attached event to receive a 'display' command

Private Methods

_checkPe dist  
_deployEvents    
_getHeight args  
_getOrigin dir  
_getWidth    
_initopts    
_setFont font  
_setHeight args  
_setLinewidth lw  
_setWidth w  

State

  Protection Type  
_id private variable  
_lview private variable  
_opt private variable  
_opti private variable  
_optList private variable  
_propertylist private common  
_sbList private variable  
_sequence private variable  
_store private variable  
_tag private variable  
_tag private variable  
BeginEvent public variable  
EndEvent public variable  
EventList public variable  
Label public variable  
MidEvent public variable  
Notes public variable  
PeTag public variable