| 
org.netbeans.modules.editor.lib/1 1.14.0 3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.netbeans.editor.view.spi.ViewRenderingContext
public abstract class ViewRenderingContext
Context used for rendering of a view.
 It provides methods useful for measuring
 of the view contents.
 
 It also provides information about additional highlights
 that the view should respect when painting
 a particular text.
 
 A particular view can obtain an instance
 of ViewRenderingContext by using methods in
 RenderingContextView.
 
Only one thread at the time can safely use the rendering context. It does not have to be event dispatch thread.
| Constructor Summary | |
|---|---|
ViewRenderingContext()
 | 
|
| Method Summary | |
|---|---|
abstract  float | 
getAscent(View v)
 | 
abstract  int | 
getBoundedPosition(View v,
                   int p0,
                   float x,
                   float len)
Determines the model location that represents the maximum advance that fits within the given span.  | 
abstract  float | 
getDescent(View v)
 | 
abstract  float | 
getHeight(View v)
 | 
 int | 
getNextVisualPositionFrom(View v,
                          int pos,
                          Position.Bias b,
                          Shape a,
                          int direction,
                          Position.Bias[] biasRet)
Provides a way to determine the next visually represented model location that one might place a caret.  | 
abstract  float | 
getSpan(View v,
        int p0,
        int p1,
        TabExpander e,
        float x)
 | 
abstract  Shape | 
modelToView(View v,
            int pos,
            Position.Bias bias,
            Shape a)
Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it.  | 
static ViewRenderingContext | 
obtainContext(View v)
Find instance of the ViewRenderingContext
 for the given view. | 
abstract  void | 
paint(View v,
      Graphics g,
      Shape a,
      int p0,
      int p1)
Paint the glyphs representing the given range.  | 
abstract  int | 
viewToModel(View v,
            float x,
            float y,
            Shape a,
            Position.Bias[] biasReturn)
Provides a mapping from the view coordinate space to the logical coordinate space of the model.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public ViewRenderingContext()
| Method Detail | 
|---|
public static ViewRenderingContext obtainContext(View v)
ViewRenderingContext
 for the given view.
public abstract float getSpan(View v, int p0, int p1, TabExpander e, float x)
public abstract float getHeight(View v)
public abstract float getAscent(View v)
public abstract float getDescent(View v)
public abstract void paint(View v, Graphics g, Shape a, int p0, int p1)
public abstract Shape modelToView(View v, int pos, Position.Bias bias, Shape a) throws BadLocationException
pos - the position to converta - the allocated region to render intorightToLeft - true if the text is rendered right to left.
BadLocationException - if the given position does not represent a
   valid location in the associated documentView.modelToView(int, java.awt.Shape, javax.swing.text.Position.Bias)public abstract int viewToModel(View v, float x, float y, Shape a, Position.Bias[] biasReturn)
x - the X coordinatey - the Y coordinatea - the allocated region to render intorightToLeft - true if the text is rendered right to left
View.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])public abstract int getBoundedPosition(View v, int p0, float x, float len)
v - the view to find the model location to break at.p0 - the location in the model where the
  fragment should start it's representation >= 0.pos - the graphic location along the axis that the
  broken view would occupy >= 0.  This may be useful for
  things like tab calculations.len - specifies the distance into the view
  where a potential break is desired >= 0.
View.breakView(int, int, float, float)public int getNextVisualPositionFrom(View v, int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet) throws BadLocationException
v - the view to usepos - the position to convert >= 0a - the allocated region to render intodirection - the direction from the current position that can
  be thought of as the arrow keys typically found on a keyboard.
  This may be SwingConstants.WEST, SwingConstants.EAST, 
  SwingConstants.NORTH, or SwingConstants.SOUTH.
BadLocationException
IllegalArgumentException - for an invalid direction
  | 
org.netbeans.modules.editor.lib/1 1.14.0 3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||