Create a new relation and use it to connect two ports. It creates a new relation using newRelation() with an automatically generated name and uses it to link the specified ports. The order of the ports determines the order in which the links to the relation are established, but otherwise has no importance. The name is of the form "_Ri" where i is an integer. Level-crossing connections are not permitted unless allowLevelCrossingConnect() has been called with a true argument. Note that is rarely a good idea to permit level crossing connections, since they break modularity and cloning. A reference to the newly created relation is returned. To remove the relation, call its setContainer() method with a null argument. This method is write-synchronized on the workspace and increments its version number.
@param port1 The first port to connect.
@param port2 The second port to connect.
@return The ComponentRelation that is created to connect port1 andport2.
@exception IllegalActionException If one of the arguments is null, orif a disallowed level-crossing connection would result.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.