java.lang.Object | |
↳ | javax.swing.text.Utilities |
A collection of methods to deal with various text related activities.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Draws the given text, expanding any tabs that are contained
using the given tab expansion technique.
| |||||||||||
Determine where to break the given text to fit
within the given span.
| |||||||||||
Determines the start of the next word for the given location.
| |||||||||||
Determines the element to use for a paragraph/line.
| |||||||||||
Determines the position in the model that is closest to the given
view location in the row above.
| |||||||||||
Determines the position in the model that is closest to the given
view location in the row below.
| |||||||||||
Determine the start of the prev word for the given location.
| |||||||||||
Determines the ending row model position of the row that contains
the specified model position.
| |||||||||||
Determines the starting row model position of the row that contains
the specified model position.
| |||||||||||
Determines the relative offset into the given text that
best represents the given span in the view coordinate
system.
| |||||||||||
Determines the width of the given segment of text taking tabs
into consideration.
| |||||||||||
Determines the end of a word for the given location.
| |||||||||||
Determines the start of a word for the given model location.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Draws the given text, expanding any tabs that are contained using the given tab expansion technique. This particular implementation renders in a 1.1 style coordinate system where ints are used and 72dpi is assumed.
s | the source of the text |
---|---|
x | the X origin >= 0 |
y | the Y origin >= 0 |
g | the graphics context |
e | how to expand the tabs. If this value is null, tabs will be expanded as a space character. |
startOffset | starting offset of the text in the document >= 0 |
Determine where to break the given text to fit within the given span. This tries to find a word boundary.
s | the source of the text |
---|---|
metrics | the font metrics to use for the calculation |
x0 | the starting view location representing the start of the given text. |
x | the target view location to translate to an offset into the text. |
e | how to expand the tabs. If this value is null, tabs will be expanded as a space character. |
startOffset | starting offset in the document of the text |
Determines the start of the next word for the given location. Uses BreakIterator.getWordInstance() to actually get the words.
c | the editor |
---|---|
offs | the offset in the document >= 0 |
BadLocationException | if the offset is out of range |
---|
Determines the element to use for a paragraph/line.
c | the editor |
---|---|
offs | the starting offset in the document >= 0 |
Determines the position in the model that is closest to the given view location in the row above. The component given must have a size to compute the result. If the component doesn't have a size a value of -1 will be returned.
c | the editor |
---|---|
offs | the offset in the document >= 0 |
x | the X coordinate >= 0 |
BadLocationException | if the offset is out of range |
---|
Determines the position in the model that is closest to the given view location in the row below. The component given must have a size to compute the result. If the component doesn't have a size a value of -1 will be returned.
c | the editor |
---|---|
offs | the offset in the document >= 0 |
x | the X coordinate >= 0 |
BadLocationException | if the offset is out of range |
---|
Determine the start of the prev word for the given location. Uses BreakIterator.getWordInstance() to actually get the words.
c | the editor |
---|---|
offs | the offset in the document >= 0 |
BadLocationException | if the offset is out of range |
---|
Determines the ending row model position of the row that contains the specified model position. The component given must have a size to compute the result. If the component doesn't have a size a value of -1 will be returned.
c | the editor |
---|---|
offs | the offset in the document >= 0 |
BadLocationException | if the offset is out of range |
---|
Determines the starting row model position of the row that contains the specified model position. The component given must have a size to compute the result. If the component doesn't have a size a value of -1 will be returned.
c | the editor |
---|---|
offs | the offset in the document >= 0 |
BadLocationException | if the offset is out of range |
---|
Determines the relative offset into the given text that best represents the given span in the view coordinate system. This is implemented in a 1.1 style coordinate system where ints are used and 72dpi is assumed.
s | the source of the text |
---|---|
metrics | the font metrics to use for the calculation |
x0 | the starting view location representing the start of the given text >= 0. |
x | the target view location to translate to an offset into the text >= 0. |
e | how to expand the tabs. If this value is null, tabs will be expanded as a space character. |
startOffset | starting offset of the text in the document >= 0 |
Determines the width of the given segment of text taking tabs into consideration. This is implemented in a 1.1 style coordinate system where ints are used and 72dpi is assumed.
s | the source of the text |
---|---|
metrics | the font metrics to use for the calculation |
x | the X origin >= 0 |
e | how to expand the tabs. If this value is null, tabs will be expanded as a space character. |
startOffset | starting offset of the text in the document >= 0 |
Determines the end of a word for the given location. Uses BreakIterator.getWordInstance() to actually get the words.
c | the editor |
---|---|
offs | the offset in the document >= 0 |
BadLocationException | if the offset is out of range |
---|
Determines the start of a word for the given model location. Uses BreakIterator.getWordInstance() to actually get the words.
c | the editor |
---|---|
offs | the offset in the document >= 0 |
BadLocationException | if the offset is out of range |
---|