Hi all,

I'm a Ptolemy rookie so please point me to FAQ or other documentation if
available.

I have written a TypedAtomicActor which has a few StringParameters to
control its behavour.  Also, I've written an EditorPaneFactory for this
actor which presents some custom configuration panes.  The factory
returns an object which derives from JPanel and uses code roughly like this:

public HelloWorldEditorPane( NamedObj container ) {
  super();
  parent = (HelloWorld) container;

  PtolemyQuery hostQuery = new PtolemyQuery( container );
  hostQuery.setTextWidth( 40 );
  hostQuery.addStyledEntry( parent.url );
  hostQuery.addStyledEntry( parent.user );
  hostQuery.addStyledEntry( parent.pass );

  this.add( hostQuery );

}

This code using the PtolemyQuery has been cribbed from the
ptolemy.actor.gui.EditorPaneFactory.createEditorPane() method.

The problem that I see, is the addStyledEntry() method (through the
PtolemyQuery.attachParameter() method ) ends up adding this to the
ValueListener list of the StringParameters such as parent.url.  Since
this list is implemented as a standard LinkedList, the StringParameter
hold on tightly to the PtolemyQuery object and that object is never
freed.  In order to remove this from the value listeners, I'd have to call

parent.url.removeValueListener( hostQuery )

when the hostQuery object is no longer needed (such as when the
configure window is closed).  But I don't think the Panel that I created
ever receives notification that the configure dialog has been closed.

Is there some way to work around this issue?  Is there some actor in
there which does this properly.

Thanks for the advice.

Kevin Ruland
University of Kansas.


----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to