[kepler-dev] Getting a handle on the TableauFrame

Edward A. Lee eal at eecs.berkeley.edu
Fri May 22 21:30:50 PDT 2009


You can use the following method of ptolemy.actor.gui.Configuration:

public static Effigy findEffigy(NamedObj model)

This will return an "effigy" which by MVC terminology, is the "model"
of the model.  There may be multiple views of the same model, each
represented by a Tableau contained by the effigy.  You would need to
identify which one you want and then, if the Tableau has a reference
to the TableauFrame, get it from there.

The following example is from ptolemy.actor.lib.database.DatabaseManager:

             Effigy effigy = Configuration.findEffigy(toplevel());
             JFrame frame = null;
             if (effigy != null) {
                 Tableau tableau = effigy.showTableaux();
                 if (tableau != null) {
                     frame = tableau.getFrame();
                 }
             }


Edward




Chad Berkley wrote:
> Hi,
> 
> I'm trying to access the menu items in the ptolemy menu bar from outside 
> of the ptolemy framework.  How can I get a handle to the TableauFrame 
> where the JMenuBar exists?  I've tried going through the Configuration 
> Effigies, but that doesn't seem to allow me to access the Tableau for 
> the main window.  Any ideas?
> 
> Thanks,
> chad
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eal.vcf
Type: text/x-vcard
Size: 351 bytes
Desc: not available
URL: <http://mercury.nceas.ucsb.edu/kepler/pipermail/kepler-dev/attachments/20090522/075e5d3c/attachment.vcf>


More information about the Kepler-dev mailing list