Class TextString

java.lang.Object
quadbase.ChartAPI.swing.TextString
All Implemented Interfaces:
Cloneable, IText, ITextString

public class TextString extends Object implements ITextString
TextString

This class provides a simple implementation of the quadbase.util.ITextString interface. This is used to specify floating text in a chart component.

See Also:
  • Constructor Details

    • TextString

      public TextString(String text, Font font, Color color, int angle, float xratio, float yratio)
      Create a new TextString object
      Parameters:
      text - text string
      font - font size
      color - text color
      angle - text angle in degrees, measured anticlockwise
      xratio - x postion of text ralative to window width, from 0 to 1
      yratio - y postion of text ralative to window width, from 0 to 1
  • Method Details

    • getText

      @Deprecated public String getText()
      Deprecated.
      Get the text string
    • setText

      @Deprecated public void setText(String s)
      Deprecated.
      Set the text string
    • getxratio

      @Deprecated public float getxratio()
      Deprecated.
      Get the x ratio
    • getyratio

      @Deprecated public float getyratio()
      Deprecated.
      Get the y ratio
    • setxratio

      @Deprecated public void setxratio(float xratio)
      Deprecated.
      Set the x ratio
    • setyratio

      @Deprecated public void setyratio(float yratio)
      Deprecated.
      Set the y ratio
    • getValue

      public String getValue()
      Get the text string value
      Specified by:
      getValue in interface ITextString
      Returns:
      The value of the string as a String object.
    • setValue

      public void setValue(String value)
      Set the text string value
      Specified by:
      setValue in interface ITextString
      Parameters:
      value - The string value to set.
    • getOffset

      public Dimension getOffset()
      Get the offset
      Specified by:
      getOffset in interface ITextString
      Returns:
      The offset as a Dimension object.
    • setOffset

      public void setOffset(Dimension offset)
      Set the offset
      Specified by:
      setOffset in interface ITextString
      Parameters:
      offset - The Dimension object containing the horizontal and vertical offsets.
    • getPosition

      public Position getPosition()
      Get the text position
      Specified by:
      getPosition in interface ITextString
      Returns:
      The position object containing the x and y coordinates.
    • setPosition

      public void setPosition(Position pos)
      Set the text position
      Specified by:
      setPosition in interface ITextString
      Parameters:
      pos - The position object.
       Note that the x and y values in the position object should be
       between 0 and 1.
       
      See Also:
    • getColor

      public final Color getColor()
      Get the text color
      Specified by:
      getColor in interface IText
      Returns:
      The Color object containing the RGB color values for the text.
    • setColor

      public final void setColor(Color c)
      Set the text color
      Specified by:
      setColor in interface IText
      Parameters:
      c - The Color object.
    • getFont

      public final Font getFont()
      Get the text font
      Specified by:
      getFont in interface IText
      Returns:
      The Font object containing the text string font information.
    • setFont

      public final void setFont(Font f)
      Set the text font
      Specified by:
      setFont in interface IText
      Parameters:
      f - The input Font object.
    • getAngle

      public final int getAngle()
      Get the text angle
      Specified by:
      getAngle in interface IText
      Returns:
      The counterclockwise angle of the text string, in degrees.
    • setAngle

      public final void setAngle(int angle)
      Set the text angle in degree measured anticlockwise
      Specified by:
      setAngle in interface IText
      Parameters:
      angle - The angle, in degrees, of the text string.
    • equals

      public final boolean equals(Object textString)
      Description copied from interface: ITextString
      Returns true if the given object equals this one.
      Specified by:
      equals in interface ITextString
      Overrides:
      equals in class Object
      Parameters:
      textString - an object of type ITextString
      Returns:
      true if the given ITextString object is identical to this object, false otherwise.