Class ParameterDisplayIconScript

  • All Implemented Interfaces:
    java.lang.Cloneable, HasTypeConstraints, Typeable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable, Settable, ValueListener, WebExportable

    public class ParameterDisplayIconScript
    extends DefaultIconScript
    A parameter specifying default JavaScript actions to associate with icons in model. Putting this into a model causes an action to be associated with each icon (as specified by the include and instancesOf parameters) that, on moving the mouse over the icon, displays in a table the parameters of the corresponding Ptolemy II object. The table is displayed in a tooltip.

    This parameter is designed to be included in a Configuration file to specify global default behavior for export to Web. Just put it in the top level of the Configuration, and this behavior will be provided by default.

    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Edward A. Lee
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Method Detail

      • isOverwriteable

        public boolean isOverwriteable()
        Override base class since content here should only be added if it does not exist already.
        Specified by:
        isOverwriteable in interface WebExportable
        Overrides:
        isOverwriteable in class Script
        Returns:
        False, since default content should only be added if no content already exists
      • getParameterTable

        public static java.lang.String getParameterTable​(NamedObj object)
        Get an HTML table describing the parameters of the object.
        Parameters:
        object - The Ptolemy object to return a table for.
        Returns:
        An HTML table displaying the parameter values for the specified object, or the string "Has no parameters" if the object has no parameters.
      • _provideDefaultAttributes

        protected void _provideDefaultAttributes​(NamedObj object,
                                                 WebExporter exporter)
                                          throws IllegalActionException
        Override the base class to provide the parameter table for the specified object. Provide default content to the specified web exporter to be included in a web page for the container of this object for objects that do not override onmouseover. This class provides an area attribute of type "onmouseover" that displays the parameter values of the object and one of type "onmouseout" that clears that display.
        Overrides:
        _provideDefaultAttributes in class DefaultIconScript
        Parameters:
        exporter - The exporter to which to provide the content.
        object - The object which provides the content.
        Throws:
        IllegalActionException - If there is a problem creating the content or if there is a name duplication with the created attributes
      • _provideElements

        protected void _provideElements​(WebExporter exporter)
                                 throws IllegalActionException
        Provide default content to the specified web exporter to be included in a web page for the container of this object for objects that do not override onmouseover. This class provides an HTML table containing parameter names and values, plus a placeholder <div> tag which the script writes information in upon onmouseover().
        Overrides:
        _provideElements in class IconScript
        Parameters:
        exporter - The exporter to which to provide the content.
        Throws:
        IllegalActionException - If evaluating the value of this parameter fails.