Package snap.text

Class TextBoxToken

java.lang.Object
snap.text.TextBoxToken

public class TextBoxToken extends Object
A class to represent a word in a line of text.
  • Field Details

    • _shiftX

      protected double _shiftX
  • Constructor Details

    • TextBoxToken

      public TextBoxToken(TextBoxLine aLine, TextStyle aStyle, int aStart, int anEnd)
      Creates a new Token for given box line, TextStyle and character start/end.
  • Method Details

    • getName

      public String getName()
      Returns the token name.
    • setName

      public void setName(String aName)
      Sets the token name.
    • getTextLine

      public TextBoxLine getTextLine()
      Returns the TextBoxLine.
    • getStartCharIndex

      public int getStartCharIndex()
      Returns the start char index of token in line.
    • getEndCharIndex

      public int getEndCharIndex()
      Returns the end char index of token in line.
    • getTextStyle

      public TextStyle getTextStyle()
      Returns the TextStyle for token.
    • setTextStyle

      public void setTextStyle(TextStyle aStyle)
      Sets the TextStyle for token.
    • getFont

      public Font getFont()
      Returns the font for this token.
    • getTextColor

      public Color getTextColor()
      Returns the color for this token.
    • setTextColor

      public void setTextColor(Color aColor)
      Sets the color for this token.
    • isUnderlined

      public boolean isUnderlined()
      Returns whether this run is underlined.
    • setUnderlined

      public void setUnderlined(boolean aValue)
      Sets whether this run is underlined.
    • getScripting

      public int getScripting()
      Returns the run's scripting.
    • isHyphenated

      public boolean isHyphenated()
      Returns whether this run has a hyphen at the end.
    • setHyphenated

      public void setHyphenated(boolean aFlag)
      Sets whether this run has a hyphen at the end.
    • getX

      public double getX()
      Returns the X location in line coords.
    • setX

      public void setX(double aX)
      Sets the X location of token in line.
    • getWidth

      public double getWidth()
      Returns the width.
    • setWidth

      public void setWidth(double aWidth)
      Sets the width.
    • getHeight

      public double getHeight()
      Returns the height.
    • getTextBoxX

      public double getTextBoxX()
      Returns the X location in text global coords.
    • getTextBoxY

      public double getTextBoxY()
      Returns the Y location.
    • getTextBoxStringY

      public double getTextBoxStringY()
      Returns the y position for this run text global coords.
    • getTextBoxMaxX

      public double getTextBoxMaxX()
      Returns the max X.
    • getTextBoxMaxY

      public double getTextBoxMaxY()
      Returns the max Y.
    • getString

      public String getString()
      Returns the token string.
    • toString

      public String toString()
      Standard toString implementation.
      Overrides:
      toString in class Object