Class Text

  • All Implemented Interfaces:
    Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, SizeOfHandler, AntiAliasingDrawOperation, Serializable

    public class Text
    extends AbstractColorDrawOperation
    implements AntiAliasingDrawOperation
    Draws text with a specified font at the given location.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -color <java.awt.Color> (property: color)
        The color of the pixel.
        default: #000000
     
    -x <int> (property: X)
        The X position of the top-left corner of the text (1-based).
        default: 1
        minimum: 1
     
    -y <int> (property: Y)
        The Y position of the top-left corner of the text (1-based).
        default: 1
        minimum: 1
     
    -y-increment <int> (property: YIncrement)
        The Y increment when outputting multiple lines of text.
        default: 16
        minimum: 1
     
    -font <java.awt.Font> (property: font)
        The font to use for the text.
        default: Monospaced-PLAIN-12
     
    -text <java.lang.String> (property: text)
        The text to draw; it is possible to multiple lines of text, simply use '
        \n' as line break.
        default: Hello World!
     
    -anti-aliasing-enabled <boolean> (property: antiAliasingEnabled)
        If enabled, uses anti-aliasing for drawing.
        default: true
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_X

        protected int m_X
        the X position of the text (1-based).
      • m_Y

        protected int m_Y
        the Y position of the text (1-based).
      • m_YIncrement

        protected int m_YIncrement
        the Y increment when outputting multiple lines.
      • m_Font

        protected Font m_Font
        the font to use.
      • m_Text

        protected String m_Text
        the text to draw.
      • m_AntiAliasingEnabled

        protected boolean m_AntiAliasingEnabled
        whether anti-aliasing is enabled.
    • Constructor Detail

      • Text

        public Text()
    • Method Detail

      • setX

        public void setX​(int value)
        Sets the X position of the text (top-left corner).
        Parameters:
        value - the position, 1-based
      • getX

        public int getX()
        Returns the X position of the text (top-left corner).
        Returns:
        the position, 1-based
      • XTipText

        public String XTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setY

        public void setY​(int value)
        Sets the Y position of the text (top-left corner).
        Parameters:
        value - the position, 1-based
      • getY

        public int getY()
        Returns the Y position of the text (top-left corner).
        Returns:
        the position, 1-based
      • YTipText

        public String YTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setYIncrement

        public void setYIncrement​(int value)
        Sets the Y increment when outputting multiple lines.
        Parameters:
        value - the increment
      • getYIncrement

        public int getYIncrement()
        Returns the Y increment when outputting multiple lines.
        Returns:
        the increment
      • YIncrementTipText

        public String YIncrementTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setFont

        public void setFont​(Font value)
        Sets the font to use.
        Parameters:
        value - the font
      • getFont

        public Font getFont()
        Returns the font in use.
        Returns:
        the font
      • fontTipText

        public String fontTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setText

        public void setText​(String value)
        Sets the text to draw. Use \n as line break.
        Parameters:
        value - the text, backquoted
      • getText

        public String getText()
        Returns the text to draw. Uses \n as line break.
        Returns:
        the text, backquoted
      • textTipText

        public String textTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setAntiAliasingEnabled

        public void setAntiAliasingEnabled​(boolean value)
        Sets whether to use anti-aliasing.
        Specified by:
        setAntiAliasingEnabled in interface AntiAliasingDrawOperation
        Parameters:
        value - if true then anti-aliasing is used
      • antiAliasingEnabledTipText

        public String antiAliasingEnabledTipText()
        Returns the tip text for this property.
        Specified by:
        antiAliasingEnabledTipText in interface AntiAliasingDrawOperation
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.