Package snap.text
Class TextBoxToken
java.lang.Object
snap.text.TextBoxToken
A class to represent a word in a line of text.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTextBoxToken
(TextBoxLine aLine, TextStyle aStyle, int aStart, int anEnd) Creates a new Token for given box line, TextStyle and character start/end. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the end char index of token in line.getFont()
Returns the font for this token.double
Returns the height.getName()
Returns the token name.int
Returns the run's scripting.int
Returns the start char index of token in line.Returns the token string.double
Returns the max X.double
Returns the max Y.double
Returns the y position for this run text global coords.double
Returns the X location in text global coords.double
Returns the Y location.Returns the color for this token.Returns the TextBoxLine.Returns the TextStyle for token.double
getWidth()
Returns the width.double
getX()
Returns the X location in line coords.boolean
Returns whether this run has a hyphen at the end.boolean
Returns whether this run is underlined.void
setHyphenated
(boolean aFlag) Sets whether this run has a hyphen at the end.void
Sets the token name.void
setTextColor
(Color aColor) Sets the color for this token.void
setTextStyle
(TextStyle aStyle) Sets the TextStyle for token.void
setUnderlined
(boolean aValue) Sets whether this run is underlined.void
setWidth
(double aWidth) Sets the width.void
setX
(double aX) Sets the X location of token in line.toString()
Standard toString implementation.
-
Field Details
-
_shiftX
protected double _shiftX
-
-
Constructor Details
-
TextBoxToken
Creates a new Token for given box line, TextStyle and character start/end.
-
-
Method Details
-
getName
Returns the token name. -
setName
Sets the token name. -
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
Returns the TextStyle for token. -
setTextStyle
Sets the TextStyle for token. -
getFont
Returns the font for this token. -
getTextColor
Returns the color for this token. -
setTextColor
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
Returns the token string. -
toString
Standard toString implementation.
-