[kepler-users] Multiple file selection

Christopher Brooks cxh at eecs.berkeley.edu
Tue Dec 4 08:05:54 PST 2007


One way is to use ptolemy.actor.lib.io.DirectoryListing, which is
"An actor that produces an array that lists the contents of a directory."

DirectoryListing can take a pattern to read in only certain actors.

http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIfaq.htm#kepler
says:
--start--
Concerning using Ptolemy actors within Kepler, Norbert Podhorszki
writes:

    If you find a Ptolemy actor useful, just remember its class name
    (e.g. ptolemy.actor.lib.Ramp). In Kepler, "Tools/Instantiate
    Component" menu allows you to type in the class name, which will
    put an actor instance on your canvas just as dragging one from the
    actor tree.

    The ptolemy jar is stored in the kepler.jar, so you have access to
    any Ptolemy actors and directors.

    If you want to use a director not in Kepler tree, you have to use
    the "Tools/Instantiate Attribute" menu. I use it to get a DDF
    director frequently (class
    ptolemy.domains.ddf.kernel.DDFDirector).

    I suppose, you can create a kar file for any ptolemy actor just as
    for kepler actors, if you want to add some of them into the Kepler
    actor tree. 

--end--

Another way would be to modify the chooser code.

In Ptolemy, the code that controls the file chooser is probably 
ptolemy/actor/gui/PtolemyQuery.java which extends
ptolemy/gui/Query.java which uses javax.swing.JFileChooser

I think for this to work 
JFileChooser.MULTI_SELECTION_ENABLED_CHANGED_PROPERTY
would need to be set and the code modified to return an
array of Strings.

The big issue here is going from returning one file name
to an array of file names.  This would definitely change
the model, so we would need to think about how to allow it.

_Christopher



--------

    Hi,
    
    I'm  trying to read a set of image files into kepler. However, the Image 
    Reader Actor only offers the selection of one file in the file selection. I
   s 
    there a way to handle this with common actors, which I haven't found out ye
   t, 
    or do I have to write my own image reader?
    
    Any Ideas?
    
    Kind Regards
    Jochen
    _______________________________________________
    Kepler-users mailing list
    Kepler-users at ecoinformatics.org
    http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-users
--------



More information about the Kepler-users mailing list