java.lang.Object | |
↳ | javax.swing.text.GlyphView.GlyphPainter |
A class to perform rendering of the glyphs. This can be implemented to be stateless, or to hold some information as a cache to facilitate faster rendering and model/view translation. At a minimum, the GlyphPainter allows a View implementation to perform its duties independant of a particular version of JVM and selection of capabilities (i.e. shaping for i18n, etc).
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Determines the model location that represents the
maximum advance that fits within the given span.
| |||||||||||
Provides a way to determine the next visually represented model
location that one might place a caret.
| |||||||||||
Create a painter to use for the given GlyphView.
| |||||||||||
Determine the span the glyphs given a start location
(for tab expansion).
| |||||||||||
Provides a mapping from the document model coordinate space
to the coordinate space of the view mapped to it.
| |||||||||||
Paint the glyphs representing the given range.
| |||||||||||
Provides a mapping from the view coordinate space to the logical
coordinate space of the model.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Determines the model location that represents the maximum advance that fits within the given span. This could be used to break the given view. The result should be a location just shy of the given advance. This differs from viewToModel which returns the closest position which might be proud of the maximum advance.
v | the view to find the model location to break at. |
---|---|
p0 | the location in the model where the fragment should start it's representation >= 0. |
x | the graphic location along the axis that the broken view would occupy >= 0. This may be useful for things like tab calculations. |
len | specifies the distance into the view where a potential break is desired >= 0. |
Provides a way to determine the next visually represented model location that one might place a caret. Some views may not be visible, they might not be in the same order found in the model, or they just might not allow access to some of the locations in the model.
v | the view to use |
---|---|
pos | the position to convert >= 0 |
b | either Position.Bias.Forward
or Position.Bias.Backward |
a | the allocated region to render into |
direction | the direction from the current position that can be thought of as the arrow keys typically found on a keyboard. This may be SwingConstants.WEST, SwingConstants.EAST, SwingConstants.NORTH, or SwingConstants.SOUTH. |
biasRet | either Position.Bias.Forward
or Position.Bias.Backward
is returned as the zero-th element of this array |
BadLocationException | |
IllegalArgumentException | for an invalid direction |
BadLocationException |
Create a painter to use for the given GlyphView. If the painter carries state it can create another painter to represent a new GlyphView that is being created. If the painter doesn't hold any significant state, it can return itself. The default behavior is to return itself.
v | the GlyphView to provide a painter for |
---|---|
p0 | the starting document offset >= 0 |
p1 | the ending document offset >= p0 |
Determine the span the glyphs given a start location (for tab expansion).
Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it. This is shared by the broken views.
v | the GlyphView containing the
destination coordinate space |
---|---|
pos | the position to convert |
bias | either Position.Bias.Forward
or Position.Bias.Backward |
a | Bounds of the View |
BadLocationException | if the given position does not represent a valid location in the associated document |
---|
Paint the glyphs representing the given range.
Provides a mapping from the view coordinate space to the logical coordinate space of the model.
v | the GlyphView to provide a mapping for |
---|---|
x | the X coordinate |
y | the Y coordinate |
a | the allocated region to render into |
biasReturn | either Position.Bias.Forward
or Position.Bias.Backward
is returned as the zero-th element of this array |