Class HTMLViewerTableau

  • All Implemented Interfaces:
    java.lang.Cloneable, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
    Direct Known Subclasses:
    WelcomeWindowTableau

    public class HTMLViewerTableau
    extends Tableau
    A tableau representing a rendered HTML view in a toplevel window. The URL that is viewed is given by the url parameter, and can be either an absolute URL, a system fileName, or a resource that can be loaded relative to the classpath. For more information about how the URL is specified, see MoMLApplication.specToURL().

    The constructor of this class creates the window. The text window itself is an instance of HTMLViewer, and can be accessed using the getFrame() method. As with other tableaux, this is an entity that is contained by an effigy of a model. There can be any number of instances of this class in an effigy.

    Since:
    Ptolemy II 1.0
    Version:
    $Id$
    Author:
    Steve Neuendorffer and Edward A. Lee
    See Also:
    Effigy, HTMLViewer, ConfigurationApplication.specToURL(String)
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Yellow (eal)
    • Constructor Detail

      • HTMLViewerTableau

        public HTMLViewerTableau​(Effigy container,
                                 java.lang.String name)
                          throws IllegalActionException,
                                 NameDuplicationException
        Construct a new tableau for the model represented by the given effigy. This creates an instance of HTMLViewer. It does not make the frame visible. To do that, call show().
        Parameters:
        container - The container.
        name - The name.
        Throws:
        IllegalActionException - If the container does not accept this entity (this should not occur).
        NameDuplicationException - If the name coincides with an attribute already in the container.
    • Method Detail

      • attributeChanged

        public void attributeChanged​(Attribute attribute)
                              throws IllegalActionException
        If the argument is the url parameter, then open the specified URL and display its contents.
        Overrides:
        attributeChanged in class Tableau
        Parameters:
        attribute - The attribute that changed.
        Throws:
        IllegalActionException - If the URL cannot be opened, or if the base class throws it.
      • _absolutePTIIURLToJarURL

        public static java.net.URL _absolutePTIIURLToJarURL​(java.lang.String urlName)
                                                     throws java.net.URISyntaxException,
                                                            java.net.MalformedURLException
        If possible convert an absolute URL that refers to a file inside the $PTII tree to a jar URL.

        For example, if doc/codeDoc.jar is in the classpath, but the contents of codeDoc/ do not exist as files, then calling this method with: file:/C:/ptII/doc/codeDoc/ptolemy/util/package-summary.html#package_description] will return: jar:file:/C:/cxh/ptII/doc/codeDoc.jar!/doc/codeDoc/ptolemy/kernel/package-summary.html#package_description

        Parameters:
        urlName - The absolute URL to be converted.
        Returns:
        The jar url that refers to a file if the file can be found as a resource or null if the file cannot be found.
        Throws:
        java.net.URISyntaxException - If there are problems creating a URI.
        java.net.MalformedURLException - If there are problems creating a URL.