slime.editor
Class ESFC

java.lang.Object
  extended byslime.editor.ESFC

public final class ESFC
extends java.lang.Object

An object of this class is used to add some functionality to the sfc.

Status: nearly complete, but i am not satisfied with it
Known bugs: update does not remove unused variables

Version:
$Id: ESFC.java,v 1.14 2002/07/17 22:18:44 swprakt Exp $
Author:
Andreas Niemann

Field Summary
 boolean inputvar
           
 boolean outputvar
           
 
Constructor Summary
protected ESFC(SFC sfc)
          Sets the colors for all steps and transitions for the given SFC.
 
Method Summary
protected  boolean actionNameExists(java.lang.String name)
          Returns true iff the given name is used for an action.
protected  void addAction(Action action)
          Adds the given action to this sfc.
protected  void addSourceStep(Step step)
          The given step will be added to the sourcelist if it is not already in and will be removed optinally from the targetlist.
protected  Step addStep(java.lang.String name, int x, int y)
          Adds a new step with the given name at the given position.
protected  void addTargetStep(Step step)
          The given step will be added to the targetlist if it is not already in and will be removed optinally from the sourcelist.
protected  void addTransition(java.util.LinkedList source, Expr expr, java.util.LinkedList target)
          Adds a new transition with the given source and target steps and the given expression as guard.
protected  void clearSourceSteps()
          Removes highlightning from all steps in the sourcelist and sets this sourcelist to an empty list.
protected  void clearTargetSteps()
          Removes highlightning from all steps in the sourcelist and sets this targetlist to an empty list.
protected  void deHighlight(java.lang.Object key)
          Set the color value
protected  boolean equals(Declaration a, Declaration b)
           
protected  boolean equals(Expr a, Expr b)
           
protected  boolean equals(Type a, Type b)
           
protected  boolean equals(Variable a, Variable b)
           
protected  void forAllActions(java.lang.Object o, java.lang.String method, java.lang.Object[] args)
          Invoces the given method on the given object for every action as the first argument together with the other given arguments.
protected  void forAllPositions(java.lang.Object o, java.lang.String method, java.lang.Object[] args)
          Invoces the given method on the given object for every position as the first argument together with the other given arguments.
protected  void forAllSteps(java.lang.Object o, java.lang.String method, java.lang.Object[] args)
          Invoces the given method on the given object for every step as the first argument together with the other given arguments.
protected  void forAllTransitions(java.lang.Object o, java.lang.String method, java.lang.Object[] args)
          Invoces the given method on the given object for every transition as the first argument together with the other given arguments.
protected  Action getAction(int i)
          Returns the i-th action of the action list.
protected  Action getAction(java.lang.String name)
          Returns the action with the given name.
protected  java.util.Hashtable getColorHashtable()
          Return the color hashtable used for this SFC.
protected  DrawBoard getDrawBoard()
          Returns the DrawBoard used by this ESFC.
protected  java.awt.Font getFont()
          Returns the font used by this ESFC.
protected  java.util.Hashtable getGuardPositions()
          Returns the guard positions represented by a hashtable.
protected  int getNumberOfSourceSteps()
          Returns the number of steps which are marked as source.
protected  int getNumberOfTargetSteps()
          Returns the number of steps which are marked as target.
protected  Position getPosition(int i)
          Returns the positon of the i-th step in the step list.
protected  java.lang.Object getSelectedObject()
          Returns the selected Object of this SFC.
protected  SFC getSFC()
          Returns the SFC of this ESFC.
protected  java.util.LinkedList getSourceSteps()
          Returns a list steps which are marked as source.
protected  Step getStep(int i)
          Returns the i-th step of the step list.
protected  java.util.LinkedList getTargetSteps()
          Returns a list steps which are marked as target.
protected  Transition getTransition(int i)
          Returns the i-th transition of the transition list.
protected static int getWidth(Step step)
          Returns the width of the name-box of the given step.
protected static int getWidthOfActionList(java.util.LinkedList actions)
           
protected  void highlight(java.lang.Object key, java.awt.Color color)
          Highlights the given object by setting the color value in the color hashtable for this object.
protected  boolean isChecked()
          Returns true if the SFC is cheched.
protected  boolean isLayouted()
          Returns true if the SFC is layouted.
protected  boolean isSourceStep(Step step)
          Returns true if the given step is a source step.
protected  boolean isTargetStep(Step step)
          Returns true if the given step is a target step.
protected static java.lang.String output(Action action)
           
protected static java.lang.String output(ActionQualifier aqf)
           
protected static java.lang.String output(Assign assign)
           
protected static java.lang.String output(B_expr bexpr)
           
protected static java.lang.String output(Constval constval)
           
protected static java.lang.String output(Declaration dec)
           
protected static java.lang.String output(Expr expr)
           
protected static java.lang.String output(Skip skip)
           
protected static java.lang.String output(Step step)
           
protected static java.lang.String output(StepAction stepaction)
           
protected static java.lang.String output(Stmt stmt)
           
protected static java.lang.String output(Transition transition)
           
protected static java.lang.String output(Type type)
           
protected static java.lang.String output(U_expr uexpr)
           
protected static java.lang.String output(Variable variable)
           
protected static java.lang.String print(Absynt absynt)
           
protected  void removeSourceStep(Step step)
          Removes the given step from the sourcelist.
protected  void removeStep(Step step)
          Removes the given step from this SFC and all transitions which are connected to this step.
protected  void removeTargetStep(Step step)
          Removes the given step from the targetlist.
protected  void removeTransition(Transition transition)
          Removes the given transition.
protected  void setChecked(boolean flag)
          Marks this ESFC as checked or unchecked.
protected  void setDrawBoard(DrawBoard drawBoard)
          Sets the DrawBoard for this ESFC.
protected  void setGuardPositions(java.util.Hashtable guardPositions)
          Sets the guard positions using the transition as key and a Position object as value.
protected  void setLayouted(boolean flag)
          Marks this ESFC as layouted or not layouted.
protected  void setSelectedObject(java.lang.Object o)
          Selects the given objekt of this SFC.
protected  void updateActions()
          Do not look at runtime complexity :-(
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inputvar

public boolean inputvar

outputvar

public boolean outputvar
Constructor Detail

ESFC

protected ESFC(SFC sfc)
Sets the colors for all steps and transitions for the given SFC.

Method Detail

setGuardPositions

protected void setGuardPositions(java.util.Hashtable guardPositions)
Sets the guard positions using the transition as key and a Position object as value.


getGuardPositions

protected java.util.Hashtable getGuardPositions()
Returns the guard positions represented by a hashtable.


getFont

protected java.awt.Font getFont()
Returns the font used by this ESFC.


getSFC

protected SFC getSFC()
Returns the SFC of this ESFC.


getSelectedObject

protected java.lang.Object getSelectedObject()
Returns the selected Object of this SFC.


setSelectedObject

protected void setSelectedObject(java.lang.Object o)
Selects the given objekt of this SFC. It does not check wether the objekt belongs to the SFC or not.


setDrawBoard

protected void setDrawBoard(DrawBoard drawBoard)
Sets the DrawBoard for this ESFC.


getDrawBoard

protected DrawBoard getDrawBoard()
Returns the DrawBoard used by this ESFC.


setChecked

protected void setChecked(boolean flag)
Marks this ESFC as checked or unchecked.


isChecked

protected boolean isChecked()
Returns true if the SFC is cheched.


setLayouted

protected void setLayouted(boolean flag)
Marks this ESFC as layouted or not layouted.


isLayouted

protected boolean isLayouted()
Returns true if the SFC is layouted.


getStep

protected Step getStep(int i)
Returns the i-th step of the step list.


getPosition

protected Position getPosition(int i)
Returns the positon of the i-th step in the step list.


getTransition

protected Transition getTransition(int i)
Returns the i-th transition of the transition list.


getAction

protected Action getAction(int i)
Returns the i-th action of the action list.


getAction

protected Action getAction(java.lang.String name)
Returns the action with the given name.


forAllSteps

protected void forAllSteps(java.lang.Object o,
                           java.lang.String method,
                           java.lang.Object[] args)
Invoces the given method on the given object for every step as the first argument together with the other given arguments.


forAllPositions

protected void forAllPositions(java.lang.Object o,
                               java.lang.String method,
                               java.lang.Object[] args)
Invoces the given method on the given object for every position as the first argument together with the other given arguments.


forAllTransitions

protected void forAllTransitions(java.lang.Object o,
                                 java.lang.String method,
                                 java.lang.Object[] args)
Invoces the given method on the given object for every transition as the first argument together with the other given arguments.


forAllActions

protected void forAllActions(java.lang.Object o,
                             java.lang.String method,
                             java.lang.Object[] args)
Invoces the given method on the given object for every action as the first argument together with the other given arguments.


getSourceSteps

protected java.util.LinkedList getSourceSteps()
Returns a list steps which are marked as source.


getTargetSteps

protected java.util.LinkedList getTargetSteps()
Returns a list steps which are marked as target.


getNumberOfSourceSteps

protected int getNumberOfSourceSteps()
Returns the number of steps which are marked as source.


getNumberOfTargetSteps

protected int getNumberOfTargetSteps()
Returns the number of steps which are marked as target.


clearSourceSteps

protected void clearSourceSteps()
Removes highlightning from all steps in the sourcelist and sets this sourcelist to an empty list.


clearTargetSteps

protected void clearTargetSteps()
Removes highlightning from all steps in the sourcelist and sets this targetlist to an empty list.


removeStep

protected void removeStep(Step step)
Removes the given step from this SFC and all transitions which are connected to this step. If neccessary it is removed from the sourcelist or the targetlist.


removeTransition

protected void removeTransition(Transition transition)
Removes the given transition.


removeSourceStep

protected void removeSourceStep(Step step)
Removes the given step from the sourcelist.


removeTargetStep

protected void removeTargetStep(Step step)
Removes the given step from the targetlist.


addSourceStep

protected void addSourceStep(Step step)
The given step will be added to the sourcelist if it is not already in and will be removed optinally from the targetlist. Otherwise it will be removed from the sourcelist.


addTargetStep

protected void addTargetStep(Step step)
The given step will be added to the targetlist if it is not already in and will be removed optinally from the sourcelist. Otherwise it will be removed from the targetlist.


isSourceStep

protected boolean isSourceStep(Step step)
Returns true if the given step is a source step.


isTargetStep

protected boolean isTargetStep(Step step)
Returns true if the given step is a target step.


addStep

protected Step addStep(java.lang.String name,
                       int x,
                       int y)
Adds a new step with the given name at the given position.


addTransition

protected void addTransition(java.util.LinkedList source,
                             Expr expr,
                             java.util.LinkedList target)
Adds a new transition with the given source and target steps and the given expression as guard.


addAction

protected void addAction(Action action)
Adds the given action to this sfc.


getColorHashtable

protected java.util.Hashtable getColorHashtable()
Return the color hashtable used for this SFC.


highlight

protected void highlight(java.lang.Object key,
                         java.awt.Color color)
Highlights the given object by setting the color value in the color hashtable for this object.


deHighlight

protected void deHighlight(java.lang.Object key)
Set the color value


getWidth

protected static int getWidth(Step step)
Returns the width of the name-box of the given step.


getWidthOfActionList

protected static int getWidthOfActionList(java.util.LinkedList actions)

actionNameExists

protected boolean actionNameExists(java.lang.String name)
Returns true iff the given name is used for an action.


equals

protected boolean equals(Declaration a,
                         Declaration b)

equals

protected boolean equals(Variable a,
                         Variable b)

equals

protected boolean equals(Type a,
                         Type b)

equals

protected boolean equals(Expr a,
                         Expr b)

updateActions

protected void updateActions()
Do not look at runtime complexity :-(


print

protected static java.lang.String print(Absynt absynt)

output

protected static java.lang.String output(Transition transition)

output

protected static java.lang.String output(Action action)

output

protected static java.lang.String output(StepAction stepaction)

output

protected static java.lang.String output(ActionQualifier aqf)

output

protected static java.lang.String output(Step step)

output

protected static java.lang.String output(Declaration dec)

output

protected static java.lang.String output(Skip skip)

output

protected static java.lang.String output(Stmt stmt)

output

protected static java.lang.String output(Variable variable)

output

protected static java.lang.String output(Assign assign)

output

protected static java.lang.String output(B_expr bexpr)

output

protected static java.lang.String output(Expr expr)

output

protected static java.lang.String output(U_expr uexpr)

output

protected static java.lang.String output(Constval constval)

output

protected static java.lang.String output(Type type)