|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.text.GlyphView.GlyphPainter
public abstract static class GlyphView.GlyphPainter
An abstract base implementation for a glyph painter for
GlyphView.
| Constructor Summary | |
|---|---|
GlyphView.GlyphPainter()
Creates a new GlyphPainer. |
|
| Method Summary | |
|---|---|
abstract float |
getAscent(GlyphView v)
Returns the ascent of the font that is used by this glyph painter. |
abstract int |
getBoundedPosition(GlyphView v,
int p0,
float x,
float len)
Determines the model offset, so that the text between p0
and this offset fits within the span starting at x with
the length of len. |
abstract float |
getDescent(GlyphView v)
Returns the descent of the font that is used by this glyph painter. |
abstract float |
getHeight(GlyphView view)
Returns the full height of the rendered text. |
int |
getNextVisualPositionFrom(GlyphView v,
int pos,
Position.Bias b,
Shape a,
int direction,
Position.Bias[] biasRet)
Returns the model location that should be used to place a caret when moving the caret through the document. |
GlyphView.GlyphPainter |
getPainter(GlyphView v,
int p0,
int p1)
Returns a painter that can be used to render the specified glyph view. |
abstract float |
getSpan(GlyphView view,
int p0,
int p1,
TabExpander te,
float x)
Determine the span of the glyphs from location p0 to
location p1. |
abstract Shape |
modelToView(GlyphView view,
int pos,
Position.Bias b,
Shape a)
Maps a position in the document into the coordinate space of the View. |
abstract void |
paint(GlyphView view,
Graphics g,
Shape a,
int p0,
int p1)
Paints the glyphs. |
abstract int |
viewToModel(GlyphView v,
float x,
float y,
Shape a,
Position.Bias[] biasRet)
Maps a visual position into a document location. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GlyphView.GlyphPainter()
GlyphPainer.
| Method Detail |
|---|
public abstract float getAscent(GlyphView v)
v - the glyph view
public abstract float getDescent(GlyphView v)
v - the glyph view
public abstract float getHeight(GlyphView view)
public abstract int getBoundedPosition(GlyphView v,
int p0,
float x,
float len)
p0
and this offset fits within the span starting at x with
the length of len.
v - the glyph viewp0 - the starting offset in the modelx - the start location in the viewlen - the length of the span in the view
public abstract void paint(GlyphView view,
Graphics g,
Shape a,
int p0,
int p1)
view - the glyph view to paintg - the graphics context to use for paintinga - the allocation of the glyph viewp0 - the start position (in the model) from which to paintp1 - the end position (in the model) to which to paint
public abstract Shape modelToView(GlyphView view,
int pos,
Position.Bias b,
Shape a)
throws BadLocationException
view - the glyph viewpos - the position of the character in the modela - the area that is occupied by the viewb - either Position.Bias.Forward or
Position.Bias.Backward depending on the preferred
direction bias. If null this defaults to
Position.Bias.Forward
BadLocationException - if pos is invalid
IllegalArgumentException - if b is not one of the above listed
valid values
public abstract int viewToModel(GlyphView v,
float x,
float y,
Shape a,
Position.Bias[] biasRet)
v - the glyph viewx - the X coordinate of the visual positiony - the Y coordinate of the visual positiona - the allocated regionbiasRet - filled with the bias of the model location on method exit
public abstract float getSpan(GlyphView view,
int p0,
int p1,
TabExpander te,
float x)
p0 to
location p1. If te is not null,
then TABs are expanded using this TabExpander.
The parameter x is the location at which the view is
located (this is important when using TAB expansion).
view - the glyph viewp0 - the starting location in the document modelp1 - the end location in the document modelte - the tab expander to usex - the location at which the view is located
p0 to
location p1, possibly using TAB expansion
public int getNextVisualPositionFrom(GlyphView v,
int pos,
Position.Bias b,
Shape a,
int direction,
Position.Bias[] biasRet)
throws BadLocationException
v - the glyph viewpos - the current model locationb - the bias for pa - the allocated region for the glyph viewdirection - the direction from the current position; Must be one of
SwingConstants.EAST, SwingConstants.WEST,
SwingConstants.NORTH or SwingConstants.SOUTHbiasRet - filled with the bias of the resulting location when method
returns
BadLocationException - if pos is an invalid model
location
IllegalArgumentException - if d is invalid
public GlyphView.GlyphPainter getPainter(GlyphView v,
int p0,
int p1)
v - the glyph view for which to create a painterp0 - the start offset of the rendered areap1 - the end offset of the rendered area
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||