Package ptolemy.vergil.debugger
Class DebugController
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.kernel.util.ConfigurableAttribute
-
- ptolemy.kernel.util.SingletonConfigurableAttribute
-
- ptolemy.vergil.debugger.DebugController
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Configurable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
,Settable
,Singleton
public class DebugController extends SingletonConfigurableAttribute
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$
- Author:
- Elaine Cheong
- See Also:
DebugProfile
- Pt.AcceptedRating:
- Red (celaine)
- Pt.ProposedRating:
- Red (celaine)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
Nested classes/interfaces inherited from interface ptolemy.kernel.util.Settable
Settable.Visibility
-
-
Field Summary
-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
Fields inherited from interface ptolemy.kernel.util.Settable
EXPERT, FULL, NONE, NOT_EDITABLE
-
-
Constructor Summary
Constructors Constructor Description DebugController(NamedObj container, java.lang.String name)
Construct a debug listener with the given container and name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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, getValueAsString, getVisibility, removeValueListener, setExpression, setVisibility, validate, value
-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, 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
-
Methods inherited from interface ptolemy.kernel.util.Settable
getDisplayName
-
-
-
-
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 interfaceDebugListener
- Overrides:
event
in classNamedObj
- 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 interfaceDebugListener
- Overrides:
message
in classNamedObj
- 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.
-
-