Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.swing.text
Class GlyphView.DefaultGlyphPainter  view GlyphView.DefaultGlyphPainter download GlyphView.DefaultGlyphPainter.java

java.lang.Object
  extended byjavax.swing.text.GlyphView.GlyphPainter
      extended byjavax.swing.text.GlyphView.DefaultGlyphPainter
Enclosing class:
GlyphView

static class GlyphView.DefaultGlyphPainter
extends GlyphView.GlyphPainter

The default GlyphPainter used in GlyphView.


Constructor Summary
(package private) GlyphView.DefaultGlyphPainter()
           
 
Method Summary
 float getAscent(GlyphView v)
          Returns the ascent of the text run that is rendered by this GlyphPainter.
 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.
 float getDescent(GlyphView v)
          Returns the descent of the text run that is rendered by this GlyphPainter.
 float getHeight(GlyphView view)
          Returns the full height of the rendered text.
 float getSpan(GlyphView view, int p0, int p1, TabExpander te, float x)
          Determine the span of the glyphs from location p0 to location p1.
 java.awt.Shape modelToView(GlyphView view, int pos, Position.Bias b, java.awt.Shape a)
          Maps a position in the document into the coordinate space of the View.
 void paint(GlyphView view, java.awt.Graphics g, java.awt.Shape a, int p0, int p1)
          Paints the glyphs.
 int viewToModel(GlyphView v, float x, float y, java.awt.Shape a, Position.Bias[] biasRet)
          Maps a visual position into a document location.
 
Methods inherited from class javax.swing.text.GlyphView.GlyphPainter
getNextVisualPositionFrom, getPainter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlyphView.DefaultGlyphPainter

GlyphView.DefaultGlyphPainter()
Method Detail

getHeight

public float getHeight(GlyphView view)
Returns the full height of the rendered text.

Specified by:
getHeight in class GlyphView.GlyphPainter

paint

public void paint(GlyphView view,
                  java.awt.Graphics g,
                  java.awt.Shape a,
                  int p0,
                  int p1)
Paints the glyphs.

Specified by:
paint in class GlyphView.GlyphPainter

modelToView

public java.awt.Shape modelToView(GlyphView view,
                                  int pos,
                                  Position.Bias b,
                                  java.awt.Shape a)
                           throws BadLocationException
Maps a position in the document into the coordinate space of the View. The output rectangle usually reflects the font height but has a width of zero.

Specified by:
modelToView in class GlyphView.GlyphPainter

getSpan

public float getSpan(GlyphView view,
                     int p0,
                     int p1,
                     TabExpander te,
                     float x)
Determine the span of the glyphs from location 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).

Specified by:
getSpan in class GlyphView.GlyphPainter

getAscent

public float getAscent(GlyphView v)
Returns the ascent of the text run that is rendered by this GlyphPainter.

Specified by:
getAscent in class GlyphView.GlyphPainter

getDescent

public float getDescent(GlyphView v)
Returns the descent of the text run that is rendered by this GlyphPainter.

Specified by:
getDescent in class GlyphView.GlyphPainter

getBoundedPosition

public 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.

Specified by:
getBoundedPosition in class GlyphView.GlyphPainter

viewToModel

public int viewToModel(GlyphView v,
                       float x,
                       float y,
                       java.awt.Shape a,
                       Position.Bias[] biasRet)
Maps a visual position into a document location.

Specified by:
viewToModel in class GlyphView.GlyphPainter