public class TextRun extends java.lang.Object implements java.lang.Cloneable, TextTypes, java.lang.CharSequence
Modifier and Type | Class and Description |
---|---|
class |
TextRun.CharsChange
A property change event for addChars/removeChars.
|
TextTypes.TabType
RMTypes.Align, RMTypes.AlignX, RMTypes.AlignY
TEXT_CHAR_SPACING, TEXT_COLOR, TEXT_FONT, TEXT_FORMAT, TEXT_LINK, TEXT_OUTLINE, TEXT_SCRIPTING, TEXT_UNDERLINE
Constructor and Description |
---|
TextRun() |
Modifier and Type | Method and Description |
---|---|
void |
addChars(java.lang.CharSequence theChars,
int anIndex)
Adds characters with style to this line at given index.
|
char |
charAt(int anIndex)
CharSequence method returning character at given index.
|
TextRun |
clone()
Returns a basic clone of this object.
|
boolean |
equals(java.lang.Object anObj)
Returns whether this run is equal to the given object.
|
protected void |
firePropertyChangeEvent(java.lang.String aPropName,
java.lang.Object oldVal,
java.lang.Object newVal,
int anIndex)
Fires a property change event.
|
double |
getCharAdvance(char aChar)
Returns the char advance for a given character.
|
float |
getCharSpacing()
Returns the char spacing.
|
SnapColor |
getColor()
Returns the color for this run.
|
int |
getEnd()
Returns the end character index for this run.
|
SnapFont |
getFont()
Returns the font for this run.
|
int |
getIndex()
Returns the run index.
|
double |
getLeading()
Returns the default distance between lines for this font.
|
TextLine |
getLine()
Returns the line that this run works for.
|
double |
getMaxAscent()
Returns the max distance above the baseline for this run font.
|
double |
getMaxDescent()
Returns the max distance below the baseline that this font goes.
|
TextRun |
getNext()
Returns the next run.
|
int |
getScripting()
Returns the scripting for this run (1=SuperScripting, -1=Subscripting, 0=none).
|
int |
getStart()
Returns the start character index for this run.
|
java.lang.String |
getString()
Returns the string for this run.
|
TextStyle |
getStyle()
Returns the run style.
|
int |
getUnderlineStyle()
Returns the underline style of this run.
|
static int |
getUnderlineStyle(java.util.Map attrs)
Returns the underline style of this run.
|
int |
hashCode()
Standard hashCode implementation.
|
boolean |
isUnderlined()
Returns whether this run is underlined.
|
int |
length()
Returns the length in characters for this run.
|
void |
removeChars(int aStart,
int anEnd)
Removes characters in given range.
|
protected void |
sendPropertyChange(java.beans.PropertyChangeEvent anEvent)
Sends a property change event.
|
void |
setStyle(TextStyle aStyle)
Sets the run style.
|
TextRun |
split(int anIndex)
Splits the run at the given index and returns a run containing the remaining characters (and identical attributes).
|
java.lang.CharSequence |
subSequence(int aStart,
int anEnd)
CharSequence method return character sequence for range.
|
java.lang.String |
toString()
Returns a string representation of this run.
|
public TextLine getLine()
public int getIndex()
public int getStart()
public int getEnd()
public int length()
length
in interface java.lang.CharSequence
public char charAt(int anIndex)
charAt
in interface java.lang.CharSequence
public java.lang.CharSequence subSequence(int aStart, int anEnd)
subSequence
in interface java.lang.CharSequence
public java.lang.String getString()
public void addChars(java.lang.CharSequence theChars, int anIndex)
public void removeChars(int aStart, int anEnd)
public TextStyle getStyle()
public void setStyle(TextStyle aStyle)
public SnapFont getFont()
public SnapColor getColor()
public boolean isUnderlined()
public int getUnderlineStyle()
public static int getUnderlineStyle(java.util.Map attrs)
public int getScripting()
public float getCharSpacing()
public double getCharAdvance(char aChar)
public double getMaxAscent()
public double getMaxDescent()
public double getLeading()
public TextRun getNext()
public TextRun split(int anIndex)
protected void firePropertyChangeEvent(java.lang.String aPropName, java.lang.Object oldVal, java.lang.Object newVal, int anIndex)
protected void sendPropertyChange(java.beans.PropertyChangeEvent anEvent)
public boolean equals(java.lang.Object anObj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public TextRun clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in interface java.lang.CharSequence
toString
in class java.lang.Object