Home » openjdk-7 » javax » swing » text » [javadoc | source]
javax.swing.text
abstract public static class: GlyphView.GlyphPainter [javadoc | source]
java.lang.Object
   javax.swing.text.GlyphView$GlyphPainter

Direct Known Subclasses:
    GlyphPainter2, GlyphPainter1, DefaultGlyphPainter

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 Summary:
getAscent,   getBoundedPosition,   getDescent,   getHeight,   getNextVisualPositionFrom,   getPainter,   getSpan,   modelToView,   paint,   viewToModel
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.text.GlyphView$GlyphPainter Detail:
 abstract public float getAscent(GlyphView v)
 abstract public int getBoundedPosition(GlyphView v,
    int p0,
    float x,
    float len)
    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,
    int pos,
    Bias b,
    Shape a,
    int direction,
    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 model.
 public GlyphPainter getPainter(GlyphView v,
    int p0,
    int p1) 
    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,
    int p0,
    int p1,
    TabExpander e,
    float x)
    Determine the span the glyphs given a start location (for tab expansion).
 abstract public Shape modelToView(GlyphView v,
    int pos,
    Bias bias,
    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,
    Graphics g,
    Shape a,
    int p0,
    int p1)
    Paint the glyphs representing the given range.
 abstract public int viewToModel(GlyphView v,
    float x,
    float y,
    Shape a,
    Bias[] biasReturn)
    Provides a mapping from the view coordinate space to the logical coordinate space of the model.