Home » openjdk-7 » javax » swing » text » [javadoc | source]
javax.swing.text
class: GlyphPainter1 [javadoc | source]
java.lang.Object
   javax.swing.text.GlyphView.GlyphPainter
      javax.swing.text.GlyphPainter1
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 independent of a particular version of JVM and selection of capabilities (i.e. shaping for i18n, etc).

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.

Field Summary
 FontMetrics metrics     
Method from javax.swing.text.GlyphPainter1 Summary:
getAscent,   getBoundedPosition,   getDescent,   getHeight,   getSpan,   modelToView,   paint,   sync,   viewToModel
Methods from javax.swing.text.GlyphView$GlyphPainter:
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.GlyphPainter1 Detail:
 public float getAscent(GlyphView v) 
    Fetches the ascent above the baseline for the glyphs corresponding to the given range in the model.
 public int getBoundedPosition(GlyphView v,
    int p0,
    float x,
    float len) 
    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.
 public float getDescent(GlyphView v) 
    Fetches the descent below the baseline for the glyphs corresponding to the given range in the model.
 public float getHeight(GlyphView v) 
 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).
 public Shape modelToView(GlyphView v,
    int pos,
    Bias bias,
    Shape a) throws BadLocationException 
 public  void paint(GlyphView v,
    Graphics g,
    Shape a,
    int p0,
    int p1) 
    Paints the glyphs representing the given range.
  void sync(GlyphView v) 
 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.