This implementation is intended for operation under the JDK. It uses the java.awt.font.TextLayout class to do i18n capable rendering.
GlyphView
| Modifier and Type | Field and Description |
|---|---|
| pack-priv TextLayout |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public float | getAscent(GlyphView v)
Implements abstract javax. Fetch the ascent above the baseline for the glyphs corresponding to the given range in the model. |
| public int | Returns: the maximum model location possible for a break.the view to find the model location to break at. v, int the location in the model where the
fragment should start it's 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 model location that represents the maximum advance that fits within the given span. |
| public float | getDescent(GlyphView v)
Implements abstract javax. Fetch 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. |
| public int | Returns: the location within the model that best represents the next location visual position.the view to use v, int the position to convert >= 0 pos, Position.the allocated region to render into a, int 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. direction, Position.Overrides javax. Provides a way to determine the next visually represented model location that one might place a caret. |
| public GlyphView. | getPainter(GlyphView v, int p0, int p1)
Overrides javax. Create a painter to use for the given GlyphView. |
| 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. Paint the glyphs for the given view. |
| public int | Returns: the location within the model that best represents the given point of 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.either biasReturnPosition.Bias.Forward
or Position.Bias.Backward is returned 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. |
| layout | back to summary |
|---|---|
| pack-priv TextLayout layout | |
| GlyphPainter2 | back to summary |
|---|---|
| public GlyphPainter2(TextLayout layout) | |
| getAscent | back to summary |
|---|---|
| public float getAscent(GlyphView v) Implements abstract javax. Fetch 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 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.
| |
| getDescent | back to summary |
|---|---|
| public float getDescent(GlyphView v) Implements abstract javax. Fetch 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. | |
| getNextVisualPositionFrom | back to summary |
|---|---|
| public int getNextVisualPositionFrom(GlyphView v, int pos, Position. Overrides javax. 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.
| |
| getPainter | back to summary |
|---|---|
| public GlyphView. Overrides javax. Create a painter to use for the given GlyphView. | |
| 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). This implementation assumes it has no tabs (i.e. TextLayout doesn't deal with 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. Paint the glyphs for the given view. This is implemented to only render if the Graphics is of type Graphics2D which is required by TextLayout (and this should be the case if running on the JDK). | |
| 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.
| |