[kepler-dev] custom query boxes in Ptolemy/Kepler

Peter Reutemann fracpete at waikato.ac.nz
Sun Aug 17 20:42:56 PDT 2008


> I guess the right solution would be to add a public method like
> addPair(), which would use _addPair(), but this would be tricky
> to get right. In particular, _addPair() populates the _entries
> hashtable with objects, and I'm not sure what would be the right
> sort of object to provide for a completely custom entry...
> There might be other gotcha's as well.
>
> Unfortunately, I don't have bandwidth for this sort of thing
> right now, but if you want to take a stab at modifying the Query
> class, I would be happy to take a look...

I had another go at the ptolemy.qui.Query class and my previous
modifications, once again based on today's subversion repository. See
link at end of post for downloads.

This post is also in response to Christopher's feedback:
  http://mercury.nceas.ucsb.edu/ecoinformatics/pipermail/kepler-dev/2008-August/006533.html

Here are the additional modifications:
- All inner classes of ptolemy.qui.Query are now public and static,
  in case one needs to use, e.g., a QueryActionListener in a package
  outside ptolemy.gui. They all contain a private member "_owner"
  of type ptolemy.gui.Query.

  --> ptolemy.gui.Query.diff

- An additional abstract superclass ptolemy.gui.QueryChooser
  (derived from javax.swing.Box) which enables derived classes to
  call _addPair and _notifyListeners of the ptolemy.gui.Query class,
  even if they're outside the ptolemy.gui package.
  (the QueryInputDialogChooser in the example below is now derived
  from this class)

  --> ptolemy-additional_classes.zip

- Updated example to demonstrate the changes. This time, there are
  no classes in the ptolemy... package hierarchy anymore. The example
  contains a simple actor with a parameter consisting of a text field
  and a button to pop up a dialog for entering a string (which is
  then displayed in the text field).

  --> examples.zip (example classes)
      examples.kar (Kepler archive)

Files mentioned above are available for download from this link:
  http://www.scms.waikato.ac.nz/~fracpete/downloads/ptolemy/custom_query_boxes2/

Hopefully, this all makes sense to you... ;-)

Cheers, Peter
-- 
Peter Reutemann, Dept. of Computer Science, University of Waikato, NZ
http://www.cs.waikato.ac.nz/~fracpete/ Ph. +64 (7) 858-5174


More information about the Kepler-dev mailing list