[kepler-users] support for list box?

Christopher Brooks cxh at eecs.berkeley.edu
Fri Apr 3 12:26:40 PDT 2009


Hi Ufuk,
I think you would need to extend ChoiceStyle so that it
had a way to optionally accept the selection of multiple choices
and then returned an array with the values of those choices.

The issue is that if you have a parameter that expects one value
and uses the ChoiceStyle and select one choice, then that will work
fine.  However, if you select multiple choices, then it will return
multiple values, which would probably be an array.  The model
would need to be aware of this, and not all models can handle an
array where a single value is expected.

Another problem is that ChoiceStyle uses JComboBox for rendering.
If you want multiple selections, you would probably need to use
JList.

See http://java.sun.com/docs/books/tutorial/uiswing/components/list.html

So, it would probably be better to add a ListStyle to
ptolemy.actor.gui.styles and add something that uses JList to
ptolemy.gui.Query.


_Christopher


Ufuk Utku Turuncoglu wrote:
> So, i can't select multiple values in that kind of parameter. I try some 
> known key combinations but it fail. I need to select multiple value from 
> that parameter.
> 
> Thanks for your help,
> 
> --ufuk
> 
> Christopher Brooks wrote:
>> Hi Ufuk,
>> Ptolemy Parameters have different styles, including a ChoiceStyle
>> http://ptolemy.berkeley.edu/ptolemyII/ptII7.0/ptII7.0.1/doc/codeDoc/ptolemy/actor/gui/style/ChoiceStyle.html 
>>
>> and an EditableChoiceStyle:
>> http://ptolemy.eecs.berkeley.edu/~ptII/ptolemyII/ptII4.0/ptII4.0.1/doc/codeDoc/ptolemy/actor/gui/style/EditableChoiceStyle.html 
>>
>>
>> For details, see
>> http://www.mail-archive.com/ptolemy-hackers@eecs.berkeley.edu/msg00771.html 
>>
>>
>> _Christopher
>>
>> Ufuk Utku Turuncoglu wrote:
>>> Hi,
>>>
>>> Does Kepler support listbox as a parameter field? If yes, how can i 
>>> implement that kind of parameter? Is there any example?
>>>
>>> Thanks,
>>>
>>> --ufuk
>>> _______________________________________________
>>> Kepler-users mailing list
>>> Kepler-users at kepler-project.org
>>> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
>>
> 

-- 
Christopher Brooks (cxh at eecs berkeley edu) University of California
CHESS Executive Director                      US Mail: 337 Cory Hall
Programmer/Analyst CHESS/Ptolemy/Trust        Berkeley, CA 94720-1774
ph: 510.643.9841 fax:510.642.2718	      (Office: 545Q Cory)
home: (F-Tu) 707.665.0131 (W-F) 510.655.5480



More information about the Kepler-users mailing list