ConForM.CoopnTools.Simulator
Class Simulator

java.lang.Object
  |
  +--ConForM.CoopnTools.Simulator.Simulator
All Implemented Interfaces:
CoopnTool, GraphicalTool, java.lang.Runnable, SpecModuleObserver

public class Simulator
extends java.lang.Object
implements CoopnTool, GraphicalTool, SpecModuleObserver

CO-OPN Simulator. This tool allows to simulate CO-OPN spec. It display a scenario grpah for the semantics of a spceification, or a particular scenario, and let the user play wioth it. A simulator is a runnable. It is composed of a constructor, building the viewer, by a method run, implementing the tool itself, and a method main. Hence, a viewer can be started either from a command line, or by another CoopnTool. In this case, a viewer is likely to by started as a new thread.

See Also:
run

Field Summary
static java.lang.String TOOL
          Simulator tool name.
static java.lang.String VERSION
          Simulator version.
 
Constructor Summary
protected Simulator(SimulatorEnv env, SimulatorEnvMgr envMgr)
          Simple constructor.
 
Method Summary
 void clear(GraphicalVisualToolEditor editor)
          Clear.
 void detail(GraphicalVisualToolEditor editor)
          Detail.
 CoopnEnv getEnv()
          Get the environment.
static Simulator getTool(CoopnEnv env)
          Creates a new Simulator, based on an existing environment, or null if the tool cannot be created.
static Simulator getTool(SimulatorEnv env)
          Creates a new Simulator, based on an existing environment, or null if the tool cannot be created.
static void main(java.lang.String[] args)
          Main program.
 void next(GraphicalVisualToolEditor editor)
          Start a next request.
 void notifyEdition()
          Notification routine: the visual generated a new edition.
 void notifyQuit()
          Notification routine: the visual quit.
 void notifyRedo()
          Notification routine: the visual generated a new redo.
 void notifySave()
          Notification routine: the visual generated a save.
 void notifySaveAs(java.lang.String name)
          Notification routine: the visual generated a save.
 void notifySpecModuleChanged(java.lang.String specName, SpecModule module)
          Notification routine.
 void notifyUndo()
          Notification routine: the visual generated a new undo.
 void perform(GraphicalVisualToolEditor editor)
          Start a new simple request.
 void performInitial(GraphicalVisualToolEditor editor)
          Start a new request for initial marking.
 void performWithEvent(GraphicalVisualToolEditor editor)
          Start a new simple request.
 void run()
          Implementation of the evaluator.
 void setComment()
           
 void show()
          Show the tool's window, if the tool has its own GUI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
Simulator version.

TOOL

public static final java.lang.String TOOL
Simulator tool name.
Constructor Detail

Simulator

protected Simulator(SimulatorEnv env,
                    SimulatorEnvMgr envMgr)
Simple constructor.
Parameters:
env - the simple CoopnTools environment
Method Detail

getTool

public static Simulator getTool(CoopnEnv env)
Creates a new Simulator, based on an existing environment, or null if the tool cannot be created.

getTool

public static Simulator getTool(SimulatorEnv env)
Creates a new Simulator, based on an existing environment, or null if the tool cannot be created.

getEnv

public CoopnEnv getEnv()
Get the environment.
Specified by:
getEnv in interface CoopnTool

show

public void show()
Show the tool's window, if the tool has its own GUI. Do nothing else.
Specified by:
show in interface CoopnTool

run

public void run()
Implementation of the evaluator.
Specified by:
run in interface java.lang.Runnable

main

public static void main(java.lang.String[] args)
Main program. This method creates a new environment from the command line, creates a new evaluator according to the environment, and call its run method.

notifySpecModuleChanged

public void notifySpecModuleChanged(java.lang.String specName,
                                    SpecModule module)
Description copied from interface: SpecModuleObserver
Notification routine. This routine is called by the spec manager - if the file listener is registrated - each time the spec manager decides that the specification module is modified.
Specified by:
notifySpecModuleChanged in interface SpecModuleObserver
Following copied from interface: ConForM.CoopnTools.CoKer.SpecMgr.SpecModuleObserver
Parameters:
specName - the name of the spec module.
module - the modified specification module.

performInitial

public void performInitial(GraphicalVisualToolEditor editor)
Start a new request for initial marking.

perform

public void perform(GraphicalVisualToolEditor editor)
Start a new simple request.

performWithEvent

public void performWithEvent(GraphicalVisualToolEditor editor)
Start a new simple request.

next

public void next(GraphicalVisualToolEditor editor)
Start a next request.

detail

public void detail(GraphicalVisualToolEditor editor)
Detail.

clear

public void clear(GraphicalVisualToolEditor editor)
Clear.

setComment

public void setComment()

notifyQuit

public void notifyQuit()
Notification routine: the visual quit.
Specified by:
notifyQuit in interface GraphicalTool

notifySave

public void notifySave()
Notification routine: the visual generated a save.
Specified by:
notifySave in interface GraphicalTool

notifySaveAs

public void notifySaveAs(java.lang.String name)
                  throws java.lang.IllegalAccessException
Notification routine: the visual generated a save.
Specified by:
notifySaveAs in interface GraphicalTool

notifyEdition

public void notifyEdition()
Notification routine: the visual generated a new edition.
Specified by:
notifyEdition in interface GraphicalTool

notifyUndo

public void notifyUndo()
Notification routine: the visual generated a new undo.
Specified by:
notifyUndo in interface GraphicalTool

notifyRedo

public void notifyRedo()
Notification routine: the visual generated a new redo.
Specified by:
notifyRedo in interface GraphicalTool