public class AbstractTrack extends TypedAtomicActor implements Rejecting
Entity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
protected ResizablePolygonAttribute |
_shape
The shape.
|
Parameter |
broken
True if the track is broken.
|
TypedIOPort |
input
The input port.
|
Parameter |
lineSymbol
The line symbol.
|
TypedIOPort |
output
The output port.
|
Parameter |
trackId
The id of the track.
|
_typesValid
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
AbstractTrack(CompositeEntity container,
java.lang.String name)
Create a new actor in the specified container with the specified
name.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_changeIcon(java.lang.String symbol)
Change icon of the track from train shape to rectangle.
|
protected ArrayToken |
_setIcon(int id)
Determine the color of the track/train .
|
protected void |
_setIconForTrain(Token idOfTrain)
Change icon of the track from rectangle to icon of the train.
|
void |
attributeChanged(Attribute attribute)
This method handles changing in the broken and symbol parameter of the track.
|
void |
declareDelayDependency()
Set the dependency between all output ports and all input
ports of this actor.
|
void |
fire()
Do nothing.
|
void |
initialize()
Initialize this actor.
|
boolean |
reject(Token token,
IOPort port)
Return true if the token cannot be accepted at the specified port.
|
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate, wrapup
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
addInitializable, preinitialize, removeInitializable, wrapup
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public TypedIOPort input
public TypedIOPort output
public Parameter trackId
public Parameter lineSymbol
public Parameter broken
protected ResizablePolygonAttribute _shape
public AbstractTrack(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of this actor within the container.IllegalActionException
- If this actor cannot be contained
by the proposed container (see the setContainer() method).NameDuplicationException
- If the name coincides with
an entity already in the container.public boolean reject(Token token, IOPort port)
Rejecting
public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class NamedObj
attribute
- The attribute that changed.IllegalActionException
- If the change is not acceptable
to this container (not thrown in this base class).public void declareDelayDependency() throws IllegalActionException
AtomicActor
TimeDelay
,
where output ports depend on input ports with a time delay,
this method should be overridden.
Protected method _declareDelayDependency() should be used
to declare dependency between input and output ports for
this actor.declareDelayDependency
in class AtomicActor<TypedIOPort>
IllegalActionException
- Not thrown in this base
class, derived classes should throw this exception if the
delay dependency cannot be computed.AtomicActor.getCausalityInterface()
,
AtomicActor._declareDelayDependency(IOPort, IOPort, double)
public void fire() throws IllegalActionException
AtomicActor
fire
in interface Executable
fire
in class AtomicActor<TypedIOPort>
IllegalActionException
- Not thrown in this base class.public void initialize() throws IllegalActionException
AtomicActor
initialize
in interface Initializable
initialize
in class AtomicActor<TypedIOPort>
IllegalActionException
- If a derived class throws it.protected void _changeIcon(java.lang.String symbol) throws IllegalActionException
symbol
- The symbol of the line.IllegalActionException
protected void _setIconForTrain(Token idOfTrain) throws IllegalActionException
idOfTrain
- The id of the train .IllegalActionException
protected ArrayToken _setIcon(int id) throws IllegalActionException
id
- The train ID or -1 to indicate no train.IllegalActionException
- If thrown while getting the director.