[kepler-dev] Documentation display in Kepler

Dan Higgins higgins at nceas.ucsb.edu
Thu Mar 16 09:38:03 PST 2006


Edward,

    Thanks again for setting me straight on the parameter 'DisplayName' 
issue.

    I have one suggested change to your DocViewer code as a result of 
looking into this question. Currently the DocViewer window shows the 
parameter Name when documentation is displayed. To make the display 
agree with what is displayed in the Configuration dialog, it would seem 
useful to change the 'parameter.getName()' statement (line 302 of 
DocViewer.java) in the _getParameterEntries method to 
'parameter.getDisplayName()' (and this should change nothing if there is 
no DisplayName)

Dan Higgins

Edward A. Lee wrote:

>
> Dan:
>
> The code you give isn't right...  The statement:
>
>    numYPixels = new StringParameter(this, "Number of Y pixels in image");
>
> is not setting the display name to "Number of Y pixels in image",
> but rather is creating a new parameter named "Number of Y pixels in 
> image".
> The right way to set the display name is:
>
>    numYPixels = new StringParameter(this, "numYPixels");
>    numYPixels.setDisplayName("Number of Y pixels in image");
>
> Note that the former code violates our coding standards, and as
> a consequence, the actor will not clone correctly.  After the clone()
> operation, the numYPixels field of the new actor will actually be a
> reference to the numYPixels parameter of the original actor. That is,
> both actors will refer to the same parameter.  If you insist on having
> a field name different from the parameter name, then you should override
> the clone(Workspace) method to correctly set the field of the clone.
>
> That said, I'm not sure whether the documentation infrastructure is
> properly reflecting the possible distinction between the parameter
> name and the display name. There may be an actual bug there...
>
> Edward
>
>
> At 02:26 PM 3/14/2006, Dan Higgins wrote:
>
>> Hi All,
>>
>>     In adding documentation to the RExpression actor, I discoved a
>> problem with the documentation display in Kepler (and perhaps in
>> Ptolemy, also).
>>
>> Consider one parameter defined in the RExpression actor -
>>
>>    /**
>>     * The height of the output graphics bitmap in pixels
>>     */
>>     public StringParameter numYPixels;
>>
>> But later on, this parameter is created with the statement
>>
>>         numYPixels = new StringParameter(this, "Number of Y pixels in
>> image");
>>
>> Note that the display string "Number of Y pixels in image" is not the
>> same as the varible name 'numYPixels'
>>
>> The doclet generated xml file has the proper association between the
>> property and value; i.e.
>>
>> <property name="numYPixels">The height of the output graphics bitmap in
>> pixels</property>
>>
>> But when I display the doc xml in Kepler using 'Get Documentation' the
>> result is
>>
>> "Number of Y pixels in image - No description"
>>
>> The code to display the xml file replaces the 'numYPixels' name with its
>> display string 'Number of Y pixels in image' but it then loses the
>> value! This seems to happen whenever the parameter name is different
>> than the display string; when they agree, the descriptions are shown
>> properly.
>>
>> Dan
>>
>>
>>
>> -- 
>> *******************************************************************
>> Dan Higgins                                  higgins at nceas.ucsb.edu
>> http://www.nceas.ucsb.edu/    Ph: 805-893-5127
>> National Center for Ecological Analysis and Synthesis (NCEAS) Marine 
>> Science Building - Room 3405
>> Santa Barbara, CA 93195
>> *******************************************************************
>>
>>
>> _______________________________________________
>> Kepler-dev mailing list
>> Kepler-dev at ecoinformatics.org
>> http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev
>
>
> ------------
> Edward A. Lee
> Professor, Chair of the EE Division, Associate Chair of EECS
> 231 Cory Hall, UC Berkeley, Berkeley, CA 94720
> phone: 510-642-0253 or 510-642-0455, fax: 510-642-2845
> eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal 



-- 
*******************************************************************
Dan Higgins                                  higgins at nceas.ucsb.edu
http://www.nceas.ucsb.edu/    Ph: 805-893-5127
National Center for Ecological Analysis and Synthesis (NCEAS) Marine Science Building - Room 3405
Santa Barbara, CA 93195
*******************************************************************




More information about the Kepler-dev mailing list