Class TextIcon

    • 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 DynamicEditorIcon
        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)
      • createBackgroundFigure

        public Figure createBackgroundFigure()
        Create a new default background figure, which is the text set by setText, if it has been called, or default text if not. This must be called in the Swing thread, or a concurrent modification exception could occur.
        Overrides:
        createBackgroundFigure in class EditorIcon
        Returns:
        A figure representing the specified shape.
      • createIcon

        public javax.swing.Icon createIcon()
        Create a new Swing icon. This returns an icon with the text "-A-", or if it has been called, the text specified by setIconText().
        Overrides:
        createIcon in class EditorIcon
        Returns:
        A new Swing Icon.
        See Also:
        setIconText(String)
      • setAnchor

        public void setAnchor​(int anchor)
        Specify origin of the text. The anchor should be one of the constants defined in SwingConstants.
        Parameters:
        anchor - The anchor of the text.
      • setFont

        public void setFont​(java.awt.Font font)
        Specify the font to use. This is deferred and executed in the Swing thread.
        Parameters:
        font - The font to use.
      • setIconText

        public void setIconText​(java.lang.String text)
        Specify the text to display in the icon. If this is not called, then the text displayed is "-A-".
        Parameters:
        text - The text to display in the icon.
      • setText

        public void setText​(java.lang.String text)
        Specify text to display. This is deferred and executed in the Swing thread.
        Parameters:
        text - The text to display.
      • setTextColor

        public void setTextColor​(java.awt.Color textColor)
        Specify the text color to use. This is deferred and executed in the Swing thread.
        Parameters:
        textColor - The fill color to use.