public class MTextDocument.Portion
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
boolean |
endsWith(char c)
Tests whether this text portion ends with the specified character.
|
double |
getAscent(java.awt.Graphics g,
java.awt.FontMetrics fm0)
Gets the ascent of this portion.
|
double |
getDescent(java.awt.Graphics g,
java.awt.FontMetrics fm0)
Gets the descent of this portion.
|
double |
getEndDx()
Gets the x shift at the end.
|
int |
getEndPos()
Gets the position of the last character + 1.
|
java.lang.String |
getPlainText()
Gets the selected text as a plain text string.
|
MTextDocument.Portion |
getPortion(int start,
int end)
Gets a portion of the text relative to this portion.
|
int |
getStartPos()
Gets the position of the first character.
|
int |
length()
Gets the number of characters.
|
double |
portionWidth(java.awt.Graphics g,
MFont dmfont,
java.awt.FontMetrics fm0)
Gets the width of this portion.
|
double |
portionXAdvance(java.awt.Graphics g,
MFont dmf,
java.awt.FontMetrics fm0)
Gets the x coordinate change from the beginning to the end of
this portion.
|
double |
portionXAdvance(java.awt.Graphics g,
MFont dmfont,
java.awt.FontMetrics fm0,
boolean lastxadv)
Gets the width of this portion.
|
java.lang.String |
toString()
Gets the string representation of the portion.
|
public final int getStartPos()
public final int getEndPos()
public final int length()
public final double portionWidth(java.awt.Graphics g, MFont dmfont, java.awt.FontMetrics fm0)
g
- the graphics context or nullfm0
- default font metricspublic final double portionXAdvance(java.awt.Graphics g, MFont dmf, java.awt.FontMetrics fm0)
g
- the graphics context or nullfm0
- default font metricspublic final double portionXAdvance(java.awt.Graphics g, MFont dmfont, java.awt.FontMetrics fm0, boolean lastxadv)
g
- the graphics context or nullfm0
- default font metricslastxadv
- whether to calculate the x advance for the
next section beginning at the last characterpublic final double getEndDx()
public final double getAscent(java.awt.Graphics g, java.awt.FontMetrics fm0)
g
- the graphics context or nullfm0
- default font metricspublic final double getDescent(java.awt.Graphics g, java.awt.FontMetrics fm0)
g
- the graphics context or nullfm0
- default font metricspublic final MTextDocument.Portion getPortion(int start, int end)
start
- relative start positionend
- relative end positionpublic final java.lang.String getPlainText()
public final java.lang.String toString()
toString
in class java.lang.Object
public boolean endsWith(char c)
c
- the character