[kepler-dev] Hidden Parameter/Field

Christopher Brooks cxh at eecs.berkeley.edu
Mon Jan 12 11:17:44 PST 2009


Hi Madhu,
I see two ways of doing what you want here:

1) You could add a new Parameter class that would
extend FileParameter.  One issue here is that if
there were any other parameters that needed similar
functionality (being different in the web interface)
then you would need to subclass those parameters.

2) You could add a parameter to the parameter that
meant that the parameter should be operated on specially.

For example, if you drag in a FileParameter, right click
and then select "Configure", you get the Edit Parameter
dialog for the FileParameter.   You could add an parameter
such as convertToText to the FileParameter and then
have your web services check for convertToText.

You could even make the convertToText parameter be a
checkbox by hitting the preferences button, setting
and setting it to a checkbox.

The xml will look like:
<property name="FileParameter" class="ptolemy.data.expr.FileParameter" 
value="">
         <property name="_hideName" 
class="ptolemy.kernel.util.SingletonAttribute">
         </property>
         <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
             <property name="_color" 
class="ptolemy.actor.gui.ColorAttribute" value="{0.0, 1.0, 0.0, 1.0}">
             </property>
         </property>
         <property name="_smallIconDescription" 
class="ptolemy.kernel.util.SingletonConfigurableAttribute">
             <configure>
       <svg>
         <text x="20" style="font-size:14; font-family:SansSerif; 
fill:#00BB00" y="20">-F-</text>
       </svg>
     </configure>
         </property>
         <property name="_editorFactory" 
class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
         </property>
         <property name="_location" class="ptolemy.kernel.util.Location" 
value="{340, 330}">
         </property>
         <property name="convertToText" 
class="ptolemy.data.expr.Parameter" value="true">
             <property name="style" 
class="ptolemy.actor.gui.style.CheckBoxStyle">
             </property>
         </property>
     </property>

The downside of this method is that it is not as easy for the user
to set the convertToText parameter as it could be.  One way would be
to have custom parameters that have convertToText already set.


BTW the Ptolemy parameter facility does have a way to
hide parameters.

See ptolemy/kernel/util/Settable.java and the EXPERT
field.

 From the UI, you can use the Ptolemy Edit Parameters dialog
to set the parameter of an actor to the hidden style by
using the preferences button and selecting "hidden"

This will result in the parameter having the following xml:
<property name="foo" class="ptolemy.data.expr.Parameter" value="1">
             <property name="style"
                      class="ptolemy.actor.gui.style.HiddenStyle">
             </property>
</property>

_Christopher

Unknown Madhusudan wrote:
> Hi there,
> 
> I am working with Ilkay Altintas at San Diego Supercomputer Center on 
> CAMERA project.
> In the scheme of CAMERA project, kepler workflows are executed through 
> the web interface using web services.  When the workflow is converted to 
> web interface, Parameters become the text fields and file parameters are 
> transformed to  file chooser etc. However, users of the CAMERA project 
> do not want to convert all the parameters to be converted to  the text 
> fields. They want to have a discretion over it. Hence there is need for 
> a new parameter, which has the functionality  of a parameter but need 
> not be displayed on the web interface. So i have two questions in this 
> regards
>  
>   1) Is there any existing Parameter variant I can use?
>   2) should I create a new Parameter variant that extends from 
> Parameters and meets needs of CAMERA project?
> 
> You suggestions will be greatly appreciated.
> 
> Thanks
> --Madhu
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Kepler-dev mailing list
> Kepler-dev at kepler-project.org
> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev

-- 
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-dev mailing list