My suggestion doesn't require any work at all in the actor...
Certainly I would not override NamedObject.executeChangeRequests().
It's just a change in when the edit parameters dialog issues the
change request.
Edward
At 10:22 AM 2/16/2006, Kevin Ruland wrote:
Then would I also override NamedObject.executeChangeRequests() or
would I have to have the actor implement ChangeListener then
register this as a change listener on this?
class MyActor extends Source implements ChangeListener {
public MyActor( CompositeEntity container, String name ) {
super(container, name);
addChangeListener(this);
}
public void changeExecuted( ChangeRequest change ) {
// Do extra validation & d/l, etc.
}
public void changeFailed( ChangeRequest change ) {
// nothing?
return;
}
}
I think I saw the NamedObj uses a list of WeakReferences for the
listeners so I don't have to unregister in a finalizer, right?
How would this work when reading in a moml which contains one of
these actors already configured? Would it still get only one change
request, or would it receive multiples?
Kevin
Edward A. Lee wrote:
As I recall, the current dialog pane issues the change request for
a parameter
change when the parameter's editing widget loses the focus. I believe the
reason for this was that there was because there are several ways that a
dialog might get closed, and Swing is not rigorous about notifications
(or, perhaps more likely, I found the documentation incomprehensible and
couldn't get it to work).
I'm open to a change in the dialog box that would issue the change
request only when an Apply or OK button is pressed... This would probably
solve the problem...
Edward
At 09:36 AM 2/16/2006, Kevin Ruland wrote:
To make matters worse, the output ports available depend on the
contents of this metadata. So the only way for the user to
construct the workflow would be to configure, run & wait for
failure, then construct the relationships and run again.
If I write my own parameter dialog pane would I have notification
of "commit"?
Kevin
Edward A. Lee wrote:
At 07:24 AM 2/16/2006, Kevin Ruland wrote:
Is there any way for the actor be notified when the user decides
all the changes are complete?
Not really... I'm not sure how one could do that...
You could check the parameters in preinitialize().
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
------------
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
------------
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]