is new.
java.lang.Objectjavax.swing.text.Utilities
A collection of methods to deal with various text related activities.
| Constructor Summary | |
|---|---|
|
Utilities
() |
|
| Method Summary | |
|---|---|
| static int |
drawTabbedText
(
Segment
s, int x, int y,
Graphics
g,
TabExpander
e, int startOffset) Draws the given text, expanding any tabs that are contained using the given tab expansion technique. |
| static int |
getBreakLocation
(
Segment
s,
FontMetrics
metrics, int x0, int x,
TabExpander
Determine where to break the given text to fit within the
|
| static int |
getNextWord
(
JTextComponent
c, int offs) Determines the start of the next word for the given location. |
| static Element |
getParagraphElement
(
JTextComponent
c, int offs) Determines the element to use for a paragraph/line. |
| static int |
getPositionAbove
(
JTextComponent
c, int offs, int x) Determines the position in the model that is closest to the given view location in the row above. |
| static int |
getPositionBelow
(
JTextComponent
c, int offs, int x) Determines the position in the model that is closest to the given view location in the row below. |
| static int |
getPreviousWord
(
JTextComponent
c, int offs) Determine the start of the prev word for the given location. |
| static int |
getRowEnd
(
JTextComponent
c, int offs) Determines the ending row model position of the row that contains the specified model position. |
| static int |
getRowStart
(
JTextComponent
c, int offs) Determines the starting row model position of the row that contains the specified model position. |
| static int |
getTabbedTextOffset
(
Segment
s,
FontMetrics
metrics, int x0, int x,
TabExpander
e, int startOffset) Determines the relative offset into the given text that best represents the given span in the view coordinate system. |
| static int |
getTabbedTextOffset
(
Segment
s,
FontMetrics
metrics, int x0, int x,
TabExpander
e, int startOffset, boolean round) |
| static int |
getTabbedTextWidth
(
Segment
s,
FontMetrics
metrics, int x,
TabExpander
e, int startOffset) Determines the width of the given segment of text taking tabs into consideration. |
| static int |
getWordEnd
(
JTextComponent
c, int offs) Determines the end of a word for the given location. |
| static int |
getWordStart
(
JTextComponent
c, int offs) Determines the start of a word for the given model location. |
| Methods inherited from class java.lang. Object |
|---|
| clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
| Constructor Detail |
|---|
public Utilities()
| Method Detail |
|---|
public static final int drawTabbedText(Segment s,
int x,
int y,
Graphics g,
TabExpander e,
int startOffset)
public static final int getTabbedTextWidth(Segment s,
FontMetrics metrics,
int x,
TabExpander e,
int startOffset)
public static final int getTabbedTextOffset(Segment s,
FontMetrics metrics,
int x0,
int x,
TabExpander e,
int startOffset)
public static final int getTabbedTextOffset(Segment s,
FontMetrics metrics,
int x0,
int x,
TabExpander e,
int startOffset,
boolean round)
public static final int getBreakLocation(Segment s,
FontMetrics metrics,
int x0,
int x,
TabExpander e,
int startOffset)
word
public static final int getRowStart(JTextComponent c,
int offs)
throws BadLocationException
public static final int getRowEnd(JTextComponent c,
int offs)
throws BadLocationException
public static final int getPositionAbove(JTextComponent c,
int offs,
int x)
throws BadLocationException
public static final int getPositionBelow(JTextComponent c,
int offs,
int x)
throws BadLocationException
public static final int getWordStart(JTextComponent c,
int offs)
throws BadLocationException
public static final int getWordEnd(JTextComponent c,
int offs)
throws BadLocationException
public static final int getNextWord(JTextComponent c,
int offs)
throws BadLocationException
public static final int getPreviousWord(JTextComponent c,
int offs)
throws BadLocationException
public static final Element getParagraphElement(JTextComponent c,
int offs)