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).
|Method from javax.swing.text.GlyphView$GlyphPainter Detail:|
abstract public float getAscent(GlyphView v)
abstract public int getBoundedPosition(GlyphView v,
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.
abstract public float getDescent(GlyphView v)
abstract public float getHeight(GlyphView v)
public int getNextVisualPositionFrom(GlyphView v,
Bias biasRet) throws BadLocationException
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
public GlyphPainter getPainter(GlyphView v,
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.
abstract public float getSpan(GlyphView v,
Determine the span the glyphs given a start location
(for tab expansion).
abstract public Shape modelToView(GlyphView v,
Shape a) throws BadLocationException
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.
abstract public void paint(GlyphView v,
Paint the glyphs representing the given range.
abstract public int viewToModel(GlyphView v,
Provides a mapping from the view coordinate space to the logical
coordinate space of the model.