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

Quick Search    Search Deep

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

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

public abstract static class GlyphView.GlyphPainter
extends java.lang.Object

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, java.awt.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  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.
abstract  void paint(GlyphView view, java.awt.Graphics g, java.awt.Shape a, int p0, int p1)
          Paints the glyphs.
abstract  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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlyphView.GlyphPainter

public GlyphView.GlyphPainter()
Creates a new GlyphPainer.

Method Detail

getAscent

public abstract float getAscent(GlyphView v)
Returns the ascent of the font that is used by this glyph painter.


getDescent

public abstract float getDescent(GlyphView v)
Returns the descent of the font that is used by this glyph painter.


getHeight

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


getBoundedPosition

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


paint

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


modelToView

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


viewToModel

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


getSpan

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


getNextVisualPositionFrom

public int getNextVisualPositionFrom(GlyphView v,
                                     int pos,
                                     Position.Bias b,
                                     java.awt.Shape a,
                                     int direction,
                                     Position.Bias[] biasRet)
                              throws BadLocationException
Returns the model location that should be used to place a caret when moving the caret through the document.


getPainter

public GlyphView.GlyphPainter getPainter(GlyphView v,
                                         int p0,
                                         int p1)
Returns a painter that can be used to render the specified glyph view. If this glyph painter is stateful, then it should return a new instance. However, if this painter is stateless it should return itself. The default behaviour is to return itself.