ptolemy.vergil.debugger
Class DebugController

java.lang.Object
  extended byptolemy.kernel.util.NamedObj
      extended byptolemy.kernel.util.Attribute
          extended byptolemy.kernel.util.ConfigurableAttribute
              extended byptolemy.kernel.util.SingletonConfigurableAttribute
                  extended byptolemy.vergil.debugger.DebugController
All Implemented Interfaces:
Changeable, java.lang.Cloneable, Configurable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Nameable, java.io.Serializable, Settable, Singleton

public class DebugController
extends SingletonConfigurableAttribute
implements DebugListener

An execution listener that suspends execution based on breakpoints. Instances of this class should be contained by a director. This class keeps a DebugProfile for each actor that belongs to that director and is being debugged. This attribute is not persistent by default.

Since:
Ptolemy II 2.0
Version:
$Id: DebugController.java,v 1.29 2004/04/13 05:12:50 cxh Exp $
Author:
Elaine Cheong
See Also:
DebugProfile, Serialized Form
Accepted Rating:
Red (celaine)
Proposed Rating:
Red (celaine)

Nested Class Summary
 
Nested classes inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Nested classes inherited from class ptolemy.kernel.util.Settable
Settable.Visibility
 
Field Summary
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Fields inherited from interface ptolemy.kernel.util.Settable
EXPERT, FULL, NONE, NOT_EDITABLE
 
Constructor Summary
DebugController(NamedObj container, java.lang.String name)
          Construct a debug listener with the given container and name.
 
Method Summary
 void clear()
          Clear the set of actors that are being debugged.
 void event(DebugEvent debugEvent)
          Respond to all FiringEvents.
 DebugProfile getDebugProfile(Executable actor)
          Get the profile for an actor that is being debugged.
 boolean isEnabled()
          Determine whether debugging is enabled on the set of actors.
 void message(java.lang.String string)
          React to a debug message from the director that we are listening to by ignoring the message.
 void putDebugProfile(Executable actor, DebugProfile profile)
          Add an actor to the set of actors that are being debugged.
 void removeDebugProfile(Executable actor)
          Remove an actor from the set of actors that are being debugged.
 void setEnabled(boolean enabled)
          Enable/disable debugging on the set of actors.
 
Methods inherited from class ptolemy.kernel.util.SingletonConfigurableAttribute
setContainer
 
Methods inherited from class ptolemy.kernel.util.ConfigurableAttribute
_exportMoMLContents, _propagateValue, addValueListener, clone, configure, getBase, getConfigureSource, getConfigureText, getDefaultExpression, getExpression, getVisibility, removeValueListener, setExpression, setVisibility, validate, value
 
Methods inherited from class ptolemy.kernel.util.Attribute
_getContainedObject, _propagateExistence, getContainer, setName
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _description, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getFullName, getName, getName, setName
 

Constructor Detail

DebugController

public DebugController(NamedObj container,
                       java.lang.String name)
                throws IllegalActionException,
                       NameDuplicationException
Construct a debug listener with the given container and name.

Parameters:
container - The container.
name - The name.
Throws:
IllegalActionException - If the container does not accept this entity (this should not occur).
NameDuplicationException - If the name coincides with an attribute already in the container.
Method Detail

clear

public void clear()
Clear the set of actors that are being debugged.


event

public void event(DebugEvent debugEvent)
Respond to all FiringEvents. If the DebugController has a DebugProfile containing a matching FiringEvent, then this method highlights the actor and invokes pauseOnBreakpoint() on the manager.

Specified by:
event in interface DebugListener
Overrides:
event in class NamedObj
Parameters:
debugEvent - The debug event.
See Also:
This is similar to doing animation., ActorViewerGraphController.event(ptolemy.kernel.util.DebugEvent)

getDebugProfile

public DebugProfile getDebugProfile(Executable actor)
Get the profile for an actor that is being debugged.

Parameters:
actor - The actor for which to retrieve the profile.
Returns:
The profile for the actor.

isEnabled

public boolean isEnabled()
Determine whether debugging is enabled on the set of actors.

Returns:
True if debugging is enabled.

message

public void message(java.lang.String string)
React to a debug message from the director that we are listening to by ignoring the message.

Specified by:
message in interface DebugListener
Overrides:
message in class NamedObj
Parameters:
string - Debug message.

putDebugProfile

public void putDebugProfile(Executable actor,
                            DebugProfile profile)
Add an actor to the set of actors that are being debugged.

Parameters:
actor - The actor to debug.
profile - The breakpoint configuration for this actor.

removeDebugProfile

public void removeDebugProfile(Executable actor)
Remove an actor from the set of actors that are being debugged.

Parameters:
actor - The actor to remove.

setEnabled

public void setEnabled(boolean enabled)
Enable/disable debugging on the set of actors.

Parameters:
enabled - True if debugging should be enabled.