This implementation is intended for operation under the JDK1.1 API of the Java Platform. Since the JDK is backward compatible with JDK1.1 API, this class will also function on Java 2. The JDK introduces improved API for rendering text however, so the GlyphPainter2 is recommended for the DK.
GlyphView
| Modifier and Type | Field and Description |
|---|---|
| pack-priv FontMetrics |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public float | getAscent(GlyphView v)
Implements abstract javax. Fetches the ascent above the baseline for the glyphs corresponding to the given range in the model. |
| public int | Returns: the model location desired for a breakthe view v, int the location in the model where the
fragment should start its representation >= 0 p0, float the graphic location along the axis that the
broken view would occupy >= 0; this may be useful for
things like tab calculations x, float specifies the distance into the view
where a potential break is desired >= 0 len)Implements abstract javax. Determines the best location (in the model) to break the given view. |
| public float | getDescent(GlyphView v)
Implements abstract javax. Fetches the descent below the baseline for the glyphs corresponding to the given range in the model. |
| public float | getHeight(GlyphView v)
Implements abstract javax. Returns of the height. |
| private int[] | getJustificationData(GlyphView v)
Returns: justificationData from the ParagraphRow this GlyphView
is in or |
| public float | getSpan(GlyphView v, int p0, int p1, TabExpander e, float x)
Implements abstract javax. Determine the span the glyphs given a start location (for tab expansion). |
| public Shape | modelToView(GlyphView v, int pos, Position.
Implements abstract javax. Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it. |
| public void | paint(GlyphView v, Graphics g, Shape a, int p0, int p1)
Implements abstract javax. Paints the glyphs representing the given range. |
| pack-priv void | |
| public int | Returns: the location within the model that best represents the given point in the viewthe view containing the view coordinates v, float the X coordinate x, float the Y coordinate y, Shape the allocated region to render into a, Position.always returns biasReturnPosition.Bias.Forward
as the zero-th element of this arrayImplements abstract javax. Provides a mapping from the view coordinate space to the logical coordinate space of the model. |
| metrics | back to summary |
|---|---|
| pack-priv FontMetrics metrics | |
| GlyphPainter1 | back to summary |
|---|---|
| pack-priv GlyphPainter1() | |
| getAscent | back to summary |
|---|---|
| public float getAscent(GlyphView v) Implements abstract javax. Fetches the ascent above the baseline for the glyphs corresponding to the given range in the model. | |
| getBoundedPosition | back to summary |
|---|---|
| public int getBoundedPosition(GlyphView v, int p0, float x, float len) Implements abstract javax. Determines the best location (in the model) to break the given view. This method attempts to break on a whitespace location. If a whitespace location can't be found, the nearest character location is returned.
| |
| getDescent | back to summary |
|---|---|
| public float getDescent(GlyphView v) Implements abstract javax. Fetches the descent below the baseline for the glyphs corresponding to the given range in the model. | |
| getHeight | back to summary |
|---|---|
| public float getHeight(GlyphView v) Implements abstract javax. Doc from javax. Returns of the height. | |
| getJustificationData | back to summary |
|---|---|
private int[] getJustificationData(GlyphView v)
| |
| getSpan | back to summary |
|---|---|
| public float getSpan(GlyphView v, int p0, int p1, TabExpander e, float x) Implements abstract javax. Determine the span the glyphs given a start location (for tab expansion). | |
| modelToView | back to summary |
|---|---|
| public Shape modelToView(GlyphView v, int pos, Position. Implements abstract javax. Doc from javax. 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.
| |
| paint | back to summary |
|---|---|
| public void paint(GlyphView v, Graphics g, Shape a, int p0, int p1) Implements abstract javax. Paints the glyphs representing the given range. | |
| sync | back to summary |
|---|---|
pack-priv void sync(GlyphView v)
| |
| viewToModel | back to summary |
|---|---|
| public int viewToModel(GlyphView v, float x, float y, Shape a, Position. Implements abstract javax. Provides a mapping from the view coordinate space to the logical coordinate space of the model.
| |