|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.Port
ptolemy.kernel.ComponentPort
ptolemy.actor.IOPort
ptolemy.actor.TypedIOPort
ptolemy.actor.lib.hoc.MirrorPort
public class MirrorPort
This port mirrors the properties of an associated port. That is, if either this port or the associated port is changed by setInput(), setOutput(), setMultiport(), or if it is removed by setContainer(null), or its name is changed by setName(), then the mirror port gets the same changes. The changes are also applied to derived ports (ports that mirror this one because of the class mechanism).
Users of this class must override their clone(Workspace) method to re-establish appropriate port associations in the clone. Cloning this port results in a clone with no associations.
Red (neuendor) |
Yellow (eal) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
---|
NamedObj.ContainedObjectsIterator |
Field Summary | |
---|---|
private MirrorPort |
_associatedPort
The associated port, if there is one. |
private boolean |
_settingAssociatedPort
Flag indicating that we are setting the associated port. |
Fields inherited from class ptolemy.actor.TypedIOPort |
---|
TYPE |
Fields inherited from class ptolemy.actor.IOPort |
---|
_hasPortEventListeners, _portEventListeners, CONFIGURATION, RECEIVERS, REMOTERECEIVERS |
Fields inherited from class ptolemy.kernel.Port |
---|
_insideLinks, _relationsList |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Constructor Summary | |
---|---|
MirrorPort(ComponentEntity container,
java.lang.String name)
Create a new instance of a port. |
|
MirrorPort(Workspace workspace)
Construct a port in the specified workspace with an empty string as a name. |
Method Summary | |
---|---|
java.lang.Object |
clone(Workspace workspace)
Clone the object into the specified workspace. |
MirrorPort |
getAssociatedPort()
Return the associated port, or null if there is none. |
void |
setAssociatedPort(MirrorPort port)
Specify an associated port. |
void |
setContainer(Entity container)
Override the base class so that if the container is being set to null, then the associated port is also deleted (via a change request). |
void |
setInput(boolean isInput)
Override the base class to also set the associated port, if there is one. |
void |
setMultiport(boolean isMultiport)
Override the base class to also set the associated port, if there is one. |
void |
setName(java.lang.String name)
Override the base class to also set the associated port, if there is one. |
void |
setOutput(boolean isOutput)
Override the base class to also set the associated port, if there is one. |
Methods inherited from class ptolemy.actor.TypedIOPort |
---|
_checkContainer, _checkLiberalLink, _checkLink, _checkType, _description, addTypeListener, attributeChanged, broadcast, broadcast, convert, getType, getTypeTerm, isTypeAcceptable, removeTypeListener, send, send, sendInside, setTypeAtLeast, setTypeAtLeast, setTypeAtMost, setTypeEquals, setTypeSameAs, typeConstraintList, typeConstraints |
Methods inherited from class ptolemy.kernel.ComponentPort |
---|
_deepConnectedPortList, _deepConnectedPorts, _deepInsidePortList, _deepInsidePorts, _isInsideLinkable, deepConnectedPortList, deepConnectedPorts, deepInsidePortList, deepInsidePorts, insertInsideLink, insidePortList, insidePorts, insideRelationList, insideRelations, isDeeplyConnected, isInsideGroupLinked, isInsideLinked, isOpaque, numInsideLinks |
Methods inherited from class ptolemy.kernel.Port |
---|
_getContainedObject, _propagateExistence, connectedPortList, connectedPorts, getContainer, isGroupLinked, isLinked, linkedRelationList, linkedRelations, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, numLinks |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private MirrorPort _associatedPort
private boolean _settingAssociatedPort
Constructor Detail |
---|
public MirrorPort(Workspace workspace)
workspace
- The workspace that will list the port.public MirrorPort(ComponentEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container for the port.name
- The name of the port.
IllegalActionException
- If the container does not
implement TypedActor.
NameDuplicationException
- If the name matches that
of a port already in the container.Method Detail |
---|
public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class TypedIOPort
workspace
- The workspace for the new object.
java.lang.CloneNotSupportedException
- If any of the attributes
cannot be cloned.NamedObj.exportMoML(Writer, int, String)
public MirrorPort getAssociatedPort()
setAssociatedPort(MirrorPort)
public void setAssociatedPort(MirrorPort port)
port
- The associated port.getAssociatedPort()
public void setContainer(Entity container) throws IllegalActionException, NameDuplicationException
setContainer
in class IOPort
container
- The proposed container.
IllegalActionException
- If the proposed container is not a
ComponentEntity, doesn't implement Actor, or has no name,
or the port and container are not in the same workspace. Or
it's not null
NameDuplicationException
- If the container already has
a port with the name of this port.Port.getContainer()
,
Port._checkContainer(Entity)
public void setInput(boolean isInput) throws IllegalActionException
setInput
in class IOPort
isInput
- True to make this an input port.
IllegalActionException
- If changing the port status is
not permitted.public void setMultiport(boolean isMultiport) throws IllegalActionException
setMultiport
in class IOPort
isMultiport
- True to make this a multiport.
IllegalActionException
- If changing the port status is
not permitted.public void setName(java.lang.String name) throws IllegalActionException, NameDuplicationException
setName
in interface Nameable
setName
in class Port
name
- The new name.
IllegalActionException
- If the name has a period.
NameDuplicationException
- If there is already a port
with the same name in the container.NamedObj.getName()
,
NamedObj.getName(NamedObj)
public void setOutput(boolean isOutput) throws IllegalActionException
setOutput
in class IOPort
isOutput
- True to make this an output port.
IllegalActionException
- If changing the port status is
not permitted.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |