GlyphView
public abstract static class GlyphView.GlyphPainter extends Object
Modifier | Constructor | Description |
---|---|---|
protected |
Constructor for subclasses to call. |
Modifier and Type | Method | Description |
---|---|---|
abstract float |
getAscent |
Returns of the ascent. |
abstract int |
getBoundedPosition |
Determines the model location that represents the maximum advance that fits within the given span. |
abstract float |
getDescent |
Returns of the descent. |
abstract float |
getHeight |
Returns of the height. |
int |
getNextVisualPositionFrom |
Provides a way to determine the next visually represented model location that one might place a caret. |
GlyphView.GlyphPainter |
getPainter |
Create a painter to use for the given GlyphView. |
abstract float |
getSpan |
Determine the span the glyphs given a start location (for tab expansion). |
abstract Shape |
modelToView |
Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it. |
abstract void |
paint |
Paint the glyphs representing the given range. |
abstract int |
viewToModel |
Provides a mapping from the view coordinate space to the logical coordinate space of the model. |
protected GlyphPainter()
public abstract float getSpan(GlyphView v, int p0, int p1, TabExpander e, float x)
v
- the GlyphView
p0
- the beginning positionp1
- the ending positione
- how to expand the tabs when encounteredx
- the X coordinatepublic abstract float getHeight(GlyphView v)
v
- the GlyphView
public abstract float getAscent(GlyphView v)
v
- the GlyphView
public abstract float getDescent(GlyphView v)
v
- the GlyphView
public abstract void paint(GlyphView v, Graphics g, Shape a, int p0, int p1)
v
- the GlyphView
g
- the graphics contexta
- the current allocation of the viewp0
- the beginning positionp1
- the ending positionpublic abstract Shape modelToView(GlyphView v, int pos, Position.Bias bias, Shape a) throws BadLocationException
v
- the GlyphView
containing the destination coordinate spacepos
- the position to convertbias
- either Position.Bias.Forward
or Position.Bias.Backward
a
- Bounds of the ViewBadLocationException
- if the given position does not represent a valid location in the associated documentpublic abstract int viewToModel(GlyphView v, float x, float y, Shape a, Position.Bias[] biasReturn)
v
- the GlyphView
to provide a mapping forx
- the X coordinatey
- the Y coordinatea
- the allocated region to render intobiasReturn
- either Position.Bias.Forward
or Position.Bias.Backward
is returned as the zero-th element of this arraypublic abstract int getBoundedPosition(GlyphView v, int p0, float x, float len)
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.public GlyphView.GlyphPainter getPainter(GlyphView v, int p0, int p1)
v
- the GlyphView
to provide a painter forp0
- the starting document offset >= 0p1
- the ending document offset >= p0public int getNextVisualPositionFrom(GlyphView v, int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet) throws BadLocationException
v
- the view to usepos
- the position to convert >= 0b
- either Position.Bias.Forward
or Position.Bias.Backward
a
- the allocated region to render intodirection
- 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 arrayBadLocationException
- for a bad location within a document modelIllegalArgumentException
- for an invalid direction
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/text/GlyphView.GlyphPainter.html