Class PlotterBase

    • Field Detail

      • automaticRescale

        public Parameter automaticRescale
        If true, the plot will automatically rescale if necessary. This parameter has type BooleanToken, and default value false.
      • fillOnWrapup

        public Parameter fillOnWrapup
        If true, fill the plot when wrapup is called. This parameter has type BooleanToken, and default value true.
      • legend

        public StringAttribute legend
        A comma-separated list of labels to attach to each data set. This is always a string, with no enclosing quotation marks.
      • _base

        protected java.net.URL _base
        The base specified in configure().
      • _source

        protected java.lang.String _source
        The source specified in configure().
      • _text

        protected java.lang.String _text
        The text specified in configure().
    • Method Detail

      • cleanUp

        public void cleanUp()
        Free up memory when closing.
      • configure

        public void configure​(java.net.URL base,
                              java.lang.String source,
                              java.lang.String text)
                       throws java.lang.Exception
        Configure the object with data from the specified input source (a URL) and/or textual data, assumed to be in PlotML format. If this is called before the plotter has been created (by calling place() or initialize()), then the configuration is deferred until the plotter is created.
        Specified by:
        configure in interface Configurable
        Parameters:
        base - The base relative to which references within the input are found, or null if this is not known, or there is none.
        source - The input source, which specifies a URL.
        text - Configuration information given as text.
        Throws:
        java.lang.Exception - If the configuration source cannot be read or if the configuration information is incorrect.
      • getConfigureSource

        public java.lang.String getConfigureSource()
        Return the input source that was specified the last time the configure method was called.
        Specified by:
        getConfigureSource in interface Configurable
        Returns:
        The string representation of the input URL.
      • getConfigureText

        public java.lang.String getConfigureText()
        Return the text string that represents the current configuration of this object. Note that any configuration that was previously specified using the source attribute need not be returned here. This returns a null string if there is no associated plot.
        Specified by:
        getConfigureText in interface Configurable
        Returns:
        The text string that represent the current configuration.
      • place

        public void place​(PortableContainer container)
        Specify the container into which this plot should be placed. This method needs to be called before the first call to initialize(). Otherwise, the plot will be placed in its own frame. The size of the plot, unfortunately, cannot be effectively determined from the size of the container because the container may not yet be laid out (its size will be zero). Thus, you will have to explicitly set the size of the plot by calling plot.setSize(). The background of the plot is set equal to that of the container (unless it is null).

        If configure() has been called (prior to the plot getting created), then the configurations that it specified have been deferred. Those configurations are performed at this time.

        Specified by:
        place in interface PortablePlaceable
        Parameters:
        container - The container into which to place the plot, or null to specify that a new plot should be created.
      • setFrame

        public void setFrame​(java.lang.Object frame)
        Specify the associated frame and set its properties (size, etc.) to match those stored in the _windowProperties attribute.
        Parameters:
        frame - The associated frame.
      • setDisplayName

        public void setDisplayName​(java.lang.String name)
        Set a name to present to the user.

        If the Plot window has been rendered, then the title of the Plot window will be updated to the value of the name parameter.

        Overrides:
        setDisplayName in class NamedObj
        Parameters:
        name - A name to present to the user.
        See Also:
        NamedObj.getDisplayName()
      • _exportMoMLContents

        protected void _exportMoMLContents​(java.io.Writer output,
                                           int depth)
                                    throws java.io.IOException
        Write a MoML description of the contents of this object, which in this class is the configuration information. This method is called by exportMoML(). Each description is indented according to the specified depth and terminated with a newline character.
        Overrides:
        _exportMoMLContents in class Entity<TypedIOPort>
        Parameters:
        output - The output stream to write to.
        depth - The depth in the hierarchy, to determine indenting.
        Throws:
        java.io.IOException - If an I/O error occurs.
        See Also:
        NamedObj.exportMoML(Writer, int)
      • _getImplementation

        protected PlotterBaseInterface _getImplementation()
        Get the right instance of the implementation depending upon the of the dependency specified through dependency injection. If the instance has not been created, then it is created. If the instance already exists then return the same.

        This code is used as part of the dependency injection needed for the HandSimDroid project, see $PTII/ptserver. This code uses dependency inject to determine what implementation to use at runtime. This method eventually reads ptolemy/actor/ActorModule.properties. ActorModuleInitializer.initializeInjector() should be called before this method is called. If it is not called, then a message is printed and initializeInjector() is called.

        Returns:
        the implementation.
      • _implementDeferredConfigurations

        protected void _implementDeferredConfigurations()
        If configurations have been deferred, implement them now. Also, configure the plot legends, if appropriate.
      • _isMoMLSuppressed

        protected boolean _isMoMLSuppressed​(int depth)
        Override the base class to ensure that MoML is produced if there is configuration information to export.
        Overrides:
        _isMoMLSuppressed in class NamedObj
        Parameters:
        depth - The depth.
        Returns:
        True to export MoML.
      • _newPlot

        protected PlotBoxInterface _newPlot()
        Create a new plot. In this base class, it is an instance of Plot. In derived classes, it can be classes derived from Plot.
        Returns:
        A new plot object.
      • _propagateValue

        protected void _propagateValue​(NamedObj destination)
                                throws IllegalActionException
        Propagate the value of this object to the specified object. The specified object is required to be an instance of the same class as this one, or a ClassCastException will be thrown.
        Overrides:
        _propagateValue in class NamedObj
        Parameters:
        destination - Object to which to propagate the value.
        Throws:
        IllegalActionException - If the value cannot be propagated.