Class SVGIcon

    • Constructor Detail

      • SVGIcon

        public SVGIcon​(Workspace workspace,
                       java.lang.String name)
                throws IllegalActionException
        Construct an icon in the specified workspace and name. This constructor is typically used in conjunction with setContainerToBe() and createFigure() to create an icon and generate a figure without having to have write access to the workspace. If the workspace argument is null, then use the default workspace. The object is added to the directory of the workspace.
        Parameters:
        workspace - The workspace that will list the attribute.
        name - The name of this attribute.
        Throws:
        IllegalActionException - If the specified name contains a period.
        See Also:
        Increment the version number of the workspace.
      • SVGIcon

        public SVGIcon​(NamedObj container,
                       java.lang.String name)
                throws NameDuplicationException,
                       IllegalActionException
        Create a new icon with the given name in the given container. By default, the icon contains no graphic objects.
        Parameters:
        container - The container for this attribute.
        name - The name of this attribute.
        Throws:
        IllegalActionException - If thrown by the parent class or while setting an attribute.
        NameDuplicationException - If the name coincides with an attribute already in the container.
    • Method Detail

      • clone

        public java.lang.Object clone​(Workspace workspace)
                               throws java.lang.CloneNotSupportedException
        Clone the object into the specified workspace. The new object is not added to the directory of that workspace (you must do this yourself if you want it there). The result is an object with no container.
        Overrides:
        clone in class EditorIcon
        Parameters:
        workspace - The workspace for the cloned object.
        Returns:
        The new Attribute.
        Throws:
        java.lang.CloneNotSupportedException - Not thrown in this base class
        See Also:
        NamedObj.exportMoML(Writer, int, String), NamedObj.setDeferringChangeRequests(boolean)
      • setContainerToBe

        public void setContainerToBe​(NamedObj container)
        Indicate that the container of this icon will eventually be the specified object. This rather specialized method is used to create an icon and generate a figure without having to have write access to the workspace. To use it, use the constructor that takes a workspace and a name, then call this method to indicate what the container will be. You can then call createFigure() or createBackgroundFigure(), and the appropriate figure for the container specified here will be used. Then queue a ChangeRequest that sets the container to the same specified container. Once the container has been set by calling setContainer(), then the object specified to this method is no longer relevant.
        Overrides:
        setContainerToBe in class EditorIcon
        Parameters:
        container - The container that will eventually be set.
        See Also:
        EditorIcon.getContainerOrContainerToBe()
      • valueChanged

        public void valueChanged​(Settable settable)
        React to the fact that the value of an attribute named "_iconDescription" contained by the same container has changed value by redrawing the figure.
        Specified by:
        valueChanged in interface ValueListener
        Parameters:
        settable - The object that has changed value.