Class HTMLImage

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

    public class HTMLImage
    extends WebContent
    Attribute for inserting an image into a web page. Drag this attribute onto an actor that produces a BasicGraphFrame (for example, ptolemy.actor.lib.gui.XYPlotter) and specify the caption for this image. By default, this image will be placed at the end of the HTML page, but you can change the position by setting the imagePosition parameter. You can also separately control what text is displayed in the model, or make the attribute disappear altogether in the model (for this, just set displayText to an empty string). Based on ptolemy.vergil.basic.export.web.HTMLText
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Beth Latronico
    See Also:
    ImageExportable, HTMLText, LinkToOpenTableaux
    Pt.AcceptedRating:
    Red (ltrnc)
    Pt.ProposedRating:
    Red (ltrnc)
    • Field Detail

      • imagePosition

        public HTMLTextPosition imagePosition
        Parameter specifying the position into which to export the image. The parameter offers the following possibilities:
        • end: Put the image at the end of the HTML file.
        • header: Put the image in the header section.
        • start: Put the image at the start of the body section.
        • anything_else: Put the image in a separate HTML file named anything_else.
        The default is "start".
    • Method Detail

      • getMimeType

        public java.lang.String getMimeType()
        Return image plus the appropriate file extension, e.g. image/gif
        Returns:
        image plus the appropriate file extension, e.g. image/gif
      • isOverwriteable

        public boolean isOverwriteable()
        Return true, since old images should be overwritten with new.
        Returns:
        True, since old images should be overwritten with new
      • _provideElements

        public void _provideElements​(WebExporter exporter)
                              throws IllegalActionException
        Generate the image file and a <table> element holding an <img/> element and a caption for the image..
        Overrides:
        _provideElements in class WebContent
        Parameters:
        exporter - The WebExporter to add content to
        Throws:
        IllegalActionException - If something is wrong generating the image file or generating the additional web content