modesteditor.core.stepsimulation
Class SequentialProcess

java.lang.Object
  extended by modesteditor.core.stepsimulation.SimulationNode
      extended by modesteditor.core.stepsimulation.SequentialProcess

public class SequentialProcess
extends SimulationNode

Class representing a sequential process in the step simulation tree. Possibly the root node of the simulation since the whole simulation is a sequential process.


Field Summary
 
Fields inherited from class modesteditor.core.stepsimulation.SimulationNode
alphabet, children, column, guard, hidden, isActive, length, line, newLabel, parent
 
Constructor Summary
SequentialProcess()
          Constructor for the root node which is definitively a sequential process.
SequentialProcess(int line, int column, SimulationNode parent)
          Default constructor.
 
Method Summary
 void addRelabeling(java.util.ArrayList<java.lang.String> relabel, java.util.ArrayList<java.lang.String> labelby)
          Method creates a relabeling map for process in case of a relabel statement.
 void childIsFinished(SimulationNode child)
          If the child is not the last child in the children list, the next one is set active.
 java.util.List<ParTransition> collectParTransitions()
          Method collects the transitions from the active child.
 java.util.List<SimulationNode> collectTransitions()
          Method collects the transitions from the active child.
 java.util.ArrayList<org.eclipse.core.resources.IMarker> createSimHighlighting(org.eclipse.core.resources.IResource resource, org.eclipse.jface.text.IDocument document, boolean isPalt)
          Method that creates the markers that do the highlighting in the step simulation.
 void exceptionThrown(ThrowNode exc)
          Method sets the notification parameter for an abort of the simulation due to an exception thrown if the process is the root.
 void extendAlphabet(java.util.ArrayList<java.lang.String> extend)
          Method sets the alphabet extension in case of an extend statement.
 void generateAlphabet()
          Generates the alphabet as a union of the alphabets of the children taking account of relabeling.
 void hideAlphabet(java.util.ArrayList<java.lang.String> hide)
          Method sets the alphabet to hide in case of a hide statement.
 boolean isExceptionAborted()
           
 void isFinished()
          Method called when the node is completely processed
 boolean isRoot()
          Check if this is the root node.
 boolean isStopped()
           
 void notificationOfChildActivity(SimulationNode child)
          Method which is called from the child in order to notify the parent that it is active.
 java.lang.String printTransition()
          Method that prints the SimulationNode TODO better incoporation in Eclipse
 void releaseTransitions()
          Method shall release the active transitions of the node an it's children in case a do loop is broken or a STOP occured ...
 void setActive()
          Sets the node active and the first child in the children list
 void setHighlightInfos(java.lang.String processName, int line, int column)
           
 void stopCalled()
          Method sets the notification parameter for an abort of the simulation due to a STOP if the process is the root.
 void takeTransition()
          Abstract method for taking a Transition, the node will care for itself how it organizes the transition.
 
Methods inherited from class modesteditor.core.stepsimulation.SimulationNode
addChild, breakTransitionTaken, getAlphabet, getColumn, getGuard, getLength, getLine, getName, getParent, getParentList, hide, isActive, isHidden, relabelNode, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequentialProcess

public SequentialProcess(int line,
                         int column,
                         SimulationNode parent)
Default constructor.

Parameters:
line -
column -
parent -

SequentialProcess

public SequentialProcess()
Constructor for the root node which is definitively a sequential process.

Method Detail

isRoot

public boolean isRoot()
Check if this is the root node.

Returns:
true if it is the root node

setActive

public void setActive()
Sets the node active and the first child in the children list

Overrides:
setActive in class SimulationNode

childIsFinished

public void childIsFinished(SimulationNode child)
If the child is not the last child in the children list, the next one is set active. Otherwise the process is finished.

Specified by:
childIsFinished in class SimulationNode

releaseTransitions

public void releaseTransitions()
Description copied from class: SimulationNode
Method shall release the active transitions of the node an it's children in case a do loop is broken or a STOP occured ...

Specified by:
releaseTransitions in class SimulationNode

isFinished

public void isFinished()
Description copied from class: SimulationNode
Method called when the node is completely processed

Overrides:
isFinished in class SimulationNode

collectTransitions

public java.util.List<SimulationNode> collectTransitions()
Method collects the transitions from the active child.

Specified by:
collectTransitions in class SimulationNode
Returns:
the list of transitions

collectParTransitions

public java.util.List<ParTransition> collectParTransitions()
Method collects the transitions from the active child.

Specified by:
collectParTransitions in class SimulationNode
Returns:
the list of parallel transitions

generateAlphabet

public void generateAlphabet()
Generates the alphabet as a union of the alphabets of the children taking account of relabeling.

Specified by:
generateAlphabet in class SimulationNode

takeTransition

public void takeTransition()
Description copied from class: SimulationNode
Abstract method for taking a Transition, the node will care for itself how it organizes the transition.

Specified by:
takeTransition in class SimulationNode

notificationOfChildActivity

public void notificationOfChildActivity(SimulationNode child)
Description copied from class: SimulationNode
Method which is called from the child in order to notify the parent that it is active.

Specified by:
notificationOfChildActivity in class SimulationNode

printTransition

public java.lang.String printTransition()
Description copied from class: SimulationNode
Method that prints the SimulationNode TODO better incoporation in Eclipse

Overrides:
printTransition in class SimulationNode

stopCalled

public void stopCalled()
Method sets the notification parameter for an abort of the simulation due to a STOP if the process is the root.

Overrides:
stopCalled in class SimulationNode

isStopped

public boolean isStopped()
Returns:
true if the root process of the simulation was stopped

exceptionThrown

public void exceptionThrown(ThrowNode exc)
Method sets the notification parameter for an abort of the simulation due to an exception thrown if the process is the root.

Overrides:
exceptionThrown in class SimulationNode

isExceptionAborted

public boolean isExceptionAborted()
Returns:
whether the simulation was aborted by an exception or not.

extendAlphabet

public void extendAlphabet(java.util.ArrayList<java.lang.String> extend)
Method sets the alphabet extension in case of an extend statement.

Parameters:
extend -

hideAlphabet

public void hideAlphabet(java.util.ArrayList<java.lang.String> hide)
Method sets the alphabet to hide in case of a hide statement.

Parameters:
hide -

addRelabeling

public void addRelabeling(java.util.ArrayList<java.lang.String> relabel,
                          java.util.ArrayList<java.lang.String> labelby)
Method creates a relabeling map for process in case of a relabel statement.

Parameters:
relabel - actions to relabel
labelby - new labelsfor the actions to relabel

setHighlightInfos

public void setHighlightInfos(java.lang.String processName,
                              int line,
                              int column)

createSimHighlighting

public java.util.ArrayList<org.eclipse.core.resources.IMarker> createSimHighlighting(org.eclipse.core.resources.IResource resource,
                                                                                     org.eclipse.jface.text.IDocument document,
                                                                                     boolean isPalt)
Description copied from class: SimulationNode
Method that creates the markers that do the highlighting in the step simulation. First creates the markers for itself and then for the parent hierarchy.

Overrides:
createSimHighlighting in class SimulationNode
Parameters:
resource - where to add the markers
document - needed in order to calculate the offsets
Returns:
a list of markers so that those can be disposed of when not needed anymore