The Meta-Environment API

toolbus.viewer
Class Viewer

java.lang.Object
  extended by toolbus.viewer.Viewer
All Implemented Interfaces:
IViewer

public class Viewer
extends java.lang.Object
implements IViewer


Nested Class Summary
private  class Viewer.ButtonActionListener
           
private  class Viewer.TableSelectionListener
           
 
Field Summary
private  int breakHighlightedRow
           
protected  DebugToolBus debugToolBus
           
private static aterm.ATerm emptyTerm
           
private  javax.swing.JFrame frame
           
protected  javax.swing.JButton killButton
           
protected  javax.swing.JTextField lastExecutedProcessInstanceField
           
protected  javax.swing.JTextField lastExecutedStateElementField
           
private  javax.swing.table.DefaultTableModel noteQueueTableModel
           
private  javax.swing.JScrollPane processesScrollPane
           
protected  javax.swing.JTable processesTable
           
private  java.lang.String[] processesTableHeader
           
private  javax.swing.table.DefaultTableModel processesTableModel
           
protected  javax.swing.JButton runButton
           
protected  javax.swing.JTable stateTable
           
private  java.lang.String[] stateTableHeader
           
private  javax.swing.table.DefaultTableModel stateTableModel
           
private  javax.swing.JLabel status
           
protected  javax.swing.JButton stepButton
           
private  int stepHighlightedRow
           
protected  javax.swing.JButton stopButton
           
private  javax.swing.table.DefaultTableModel subscriptionsTableModel
           
private static TBTermFactory tbFactory
           
private  javax.swing.table.DefaultTableModel variablesTableModel
           
 
Constructor Summary
Viewer(java.lang.String[] args)
           
 
Method Summary
private  void clearNoteQueueTable()
           
private  void clearProcessTableModifications()
           
private  void clearStateTable()
           
private  void clearSubscriptionsTable()
           
private  void clearVariablesTable()
           
private  void fillProcessTables(ProcessInstance processInstance)
           
private  void fillVariables(StateElement stateElement)
           
 DebugToolBus getDebugToolBus()
           
private static java.lang.String getNoteSignature(aterm.ATerm term)
           
private static java.lang.String getSubscriptionSignature(aterm.ATerm term)
           
private static java.lang.String getVariableSignature(aterm.ATerm term)
           
static void main(java.lang.String[] args)
           
 void processBreakPointHit(ProcessInstance processInstance)
          Informs the viewer that a registered breakpoint on a process or process instance was hit.
 void processInstanceStarted(ProcessInstance processInstance)
          Fired when a new process instance is started.
 void processInstanceTerminated(ProcessInstance processInstance)
          Fired when a process instance is terminated.
 void sourceBreakPointHit(StateElement stateElement)
          Informs the viewer that a registered breakpoint on a sourcecode coordinate was hit.
 void stateElementBreakPointHit(StateElement stateElement)
          Informs the viewer that a registered breakpoint on a state element was hit.
 void stepExecuted(ProcessInstance processInstance, StateElement executedStateElement, ProcessInstance[] partners)
          Fired after the successfull completion of a step.
private static aterm.ATerm substituteTerm(aterm.ATerm term, int maxDept)
           
 void toolbusStarting()
          Fired right before the debug ToolBus starts executing the process logic.
 void toolbusTerminating()
          Fired right before then debug ToolBus shuts down.
 void updateState(int state)
          Informs the viewer about what the debug toolbus is currently doing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debugToolBus

protected final DebugToolBus debugToolBus

frame

private final javax.swing.JFrame frame

status

private final javax.swing.JLabel status

runButton

protected final javax.swing.JButton runButton

stopButton

protected final javax.swing.JButton stopButton

stepButton

protected final javax.swing.JButton stepButton

killButton

protected final javax.swing.JButton killButton

lastExecutedProcessInstanceField

protected final javax.swing.JTextField lastExecutedProcessInstanceField

lastExecutedStateElementField

protected final javax.swing.JTextField lastExecutedStateElementField

processesTable

protected final javax.swing.JTable processesTable

processesTableHeader

private final java.lang.String[] processesTableHeader

stateTable

protected final javax.swing.JTable stateTable

stateTableHeader

private final java.lang.String[] stateTableHeader

processesTableModel

private final javax.swing.table.DefaultTableModel processesTableModel

subscriptionsTableModel

private final javax.swing.table.DefaultTableModel subscriptionsTableModel

variablesTableModel

private final javax.swing.table.DefaultTableModel variablesTableModel

noteQueueTableModel

private final javax.swing.table.DefaultTableModel noteQueueTableModel

stateTableModel

private final javax.swing.table.DefaultTableModel stateTableModel

processesScrollPane

private final javax.swing.JScrollPane processesScrollPane

stepHighlightedRow

private volatile int stepHighlightedRow

breakHighlightedRow

private volatile int breakHighlightedRow

tbFactory

private static final TBTermFactory tbFactory

emptyTerm

private static final aterm.ATerm emptyTerm
Constructor Detail

Viewer

public Viewer(java.lang.String[] args)
Method Detail

getDebugToolBus

public DebugToolBus getDebugToolBus()

toolbusStarting

public void toolbusStarting()
Description copied from interface: IViewer
Fired right before the debug ToolBus starts executing the process logic.

Specified by:
toolbusStarting in interface IViewer

toolbusTerminating

public void toolbusTerminating()
Description copied from interface: IViewer
Fired right before then debug ToolBus shuts down.

Specified by:
toolbusTerminating in interface IViewer

stepExecuted

public void stepExecuted(ProcessInstance processInstance,
                         StateElement executedStateElement,
                         ProcessInstance[] partners)
Description copied from interface: IViewer
Fired after the successfull completion of a step.

Specified by:
stepExecuted in interface IViewer
Parameters:
processInstance - The process instance in which a state element was executed.
executedStateElement - The state element that was executed.
partners - All the process instances that cooperated during the execution of the state element.

updateState

public void updateState(int state)
Description copied from interface: IViewer
Informs the viewer about what the debug toolbus is currently doing. A list of possible states can be found in toolbus.viewer.IViewerConstants

Specified by:
updateState in interface IViewer
Parameters:
state - The state that identifies what the debug toolbus is currently doing.
See Also:
IViewerConstants

processInstanceStarted

public void processInstanceStarted(ProcessInstance processInstance)
Description copied from interface: IViewer
Fired when a new process instance is started.

Specified by:
processInstanceStarted in interface IViewer
Parameters:
processInstance - The process instance that was started.

processInstanceTerminated

public void processInstanceTerminated(ProcessInstance processInstance)
Description copied from interface: IViewer
Fired when a process instance is terminated.

Specified by:
processInstanceTerminated in interface IViewer
Parameters:
processInstance - The process instance that was terminated.

processBreakPointHit

public void processBreakPointHit(ProcessInstance processInstance)
Description copied from interface: IViewer
Informs the viewer that a registered breakpoint on a process or process instance was hit. The debug toolbus will not suspend it's execution by itself; the action that will be taken is completely up to the viewer implementation. In case the execution needs to be paused this will need to be done explicitly by calling the doStop method.

Specified by:
processBreakPointHit in interface IViewer
Parameters:
processInstance - The process instance that matches the breakpoint.

stateElementBreakPointHit

public void stateElementBreakPointHit(StateElement stateElement)
Description copied from interface: IViewer
Informs the viewer that a registered breakpoint on a state element was hit. The debug toolbus will not suspend it's execution by itself; the action that will be taken is completely up to the viewer implementation. In case the execution needs to be paused this will need to be done explicitly by calling the doStop method.

Specified by:
stateElementBreakPointHit in interface IViewer
Parameters:
stateElement - The state element on which the breakpoint was set.

sourceBreakPointHit

public void sourceBreakPointHit(StateElement stateElement)
Description copied from interface: IViewer
Informs the viewer that a registered breakpoint on a sourcecode coordinate was hit. The debug toolbus will not suspend it's execution by itself; the action that will be taken is completely up to the viewer implementation. In case the execution needs to be paused this will need to be done explicitly by calling the doStop method.

Specified by:
sourceBreakPointHit in interface IViewer
Parameters:
stateElement - The executed state element which's position information corresponded to a breakpoint set on a sourcecode coordinate.

clearSubscriptionsTable

private void clearSubscriptionsTable()

clearNoteQueueTable

private void clearNoteQueueTable()

clearStateTable

private void clearStateTable()

clearVariablesTable

private void clearVariablesTable()

fillProcessTables

private void fillProcessTables(ProcessInstance processInstance)

fillVariables

private void fillVariables(StateElement stateElement)

clearProcessTableModifications

private void clearProcessTableModifications()

substituteTerm

private static aterm.ATerm substituteTerm(aterm.ATerm term,
                                          int maxDept)

getSubscriptionSignature

private static java.lang.String getSubscriptionSignature(aterm.ATerm term)

getNoteSignature

private static java.lang.String getNoteSignature(aterm.ATerm term)

getVariableSignature

private static java.lang.String getVariableSignature(aterm.ATerm term)

main

public static void main(java.lang.String[] args)
                 throws ToolBusException
Throws:
ToolBusException

The Meta-Environment API