[kepler-dev] Responding to AttributeChanged

Matt Jones jones at nceas.ucsb.edu
Tue Aug 9 16:15:03 PDT 2005


I think Ilkay also ran into this problem when trying to develop the menu 
of operations that are generated in the Web Service actor when the 
endpoint is changed.   Is that right Ilkay?  I'm pretty sure she 
concluded that the menu would only update after a MoMLChangeRequest was 
sent, which happens upon commit.  Manually submitting a MoML change 
request when focus leaves the 'X' field might do the trick, although 
IIRC the dialog doesn't get notified of the model change and needs to be 
recreated.  If the configuration dialog listened to change requests to 
the model then this could probably be fixed, which would benefit the Web 
Service actor too.

Matt

Nandita Mangal wrote:
> Hi there,
> 
> I am working on the development of an actor (it
> extends TypedAtomicActor) in Kepler in which I need to
> addChoices to another Parameter (say parameter Y)
> based on the value of parameter X in the
> EditParametersDialog.
> 
> Hence in the AttributeChanged method, I do the check
> if parameter X was indeed changed and then try to set
> the possible choices for Y parameter accordingly.
> However the choices for parameter Y are not shown
> instantly in the dialog (only after pressing commit
> with param X) and then re-clicking the actor again can
> I see the newly added Y param choices in the
> EditParametersDialog.
> 
> 
> public void attributeChanged(Attribute attribute)
>         throws IllegalActionException {
>             if(attribute == X) {
>                  if(!(X.getExpression().equals("")))
>                  {
>                       Y.addChoice("XY1");
>                       Y.addChoice("XY2");
>                       Y.addChoice("XY3");
> 
>                  }  
>             }
> }
> 
> After doing the above, Y param's new choices show only
> after pressing commit and then re-opening
> EditParametersDialog.
> 
> 
> Is there any way I can manually refresh/update the
> EditParametersDialog so that it can show the newly
> added choices for param Y in the same dailog before
> pressing commit.
> 
> 
> thanks for the help.
> nandita mangal.
> 
> 
> 
> 		
> __________________________________ 
> Yahoo! Mail 
> Stay connected, organized, and protected. Take the tour: 
> http://tour.mail.yahoo.com/mailtour.html 
> 
> 
> ----------------------------------------------------------------------------
> Posted to the ptolemy-hackers mailing list.  Please send administrative
> mail for this list to: ptolemy-hackers-request at ptolemy.eecs.berkeley.edu

-- 
-------------------------------------------------------------------
Matt Jones                                     jones at nceas.ucsb.edu
http://www.nceas.ucsb.edu/    Fax: 425-920-2439    Ph: 907-789-0496
National Center for Ecological Analysis and Synthesis (NCEAS)
University of California Santa Barbara
Interested in ecological informatics? http://www.ecoinformatics.org
-------------------------------------------------------------------


More information about the Kepler-dev mailing list