Hi, I need to know all ports that are connect to an actor regardless how the connections are established.
In the connectionsChanged() method, I used the connectedPortList () method of class Port to obtain ports that are connected with an entity, but it only works when I link this entity's ports "to" the others not "from" the others. I also tried the linkedRelationList() method but the result was the same. What method should I use? Thank you. Tung ----- Original Message ----- From: "Edward A. Lee" <[EMAIL PROTECTED]> To: "Tung NGUYEN" <[EMAIL PROTECTED]> Cc: <ptolemy-hackers@eecs.berkeley.edu> Sent: Friday, March 25, 2005 11:40 PM Subject: Re: Design time parser > At 05:06 PM 3/25/2005 +0700, Tung NGUYEN wrote: > > >Hi,<?xml:namespace prefix = o ns = > >"urn:schemas-microsoft-com:office:office" /> > > > >When designers create links between 2 actors, what methods will be called? > >I need to know what actors that the designers are trying to connect at the > >design time so that I can automatically update the corresponding > >parameters in these actors. > > > >Thanks > > > >Tung > > The Entity class, base class for all actors, has the following > method, which may be what you want: > > /** Notify this entity that the links to the specified port have > * been altered. The default implementation in this base class > * is to do nothing, but derived classes may want to react to new > * connections. > * @param port The port to which connections have changed. > */ > public void connectionsChanged(Port port) { > } > > Edward > > > > ------------ > Edward A. Lee > Professor, Chair of the EE Division, Associate Chair of EECS > 231 Cory Hall, UC Berkeley, Berkeley, CA 94720 > phone: 510-642-0253 or 510-642-0455, fax: 510-642-2845 > [EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal > > > -------------------------------------------------------------------------- -- > Posted to the ptolemy-hackers mailing list. Please send administrative > mail for this list to: [EMAIL PROTECTED] > ---------------------------------------------------------------------------- Posted to the ptolemy-hackers mailing list. Please send administrative mail for this list to: [EMAIL PROTECTED]