danger.text.span
Interface DrawnSpan

All Superinterfaces:
CharacterHeightAffectingSpan, CharacterSpan, MetricAffectingSpan
All Known Implementing Classes:
BitmapSpan, HTML.Image


public interface DrawnSpan
extends CharacterSpan, CharacterHeightAffectingSpan

Implementations of DrawnSpan get their drawing and measuring functions called when text covered by them is drawn or measured. They can therefore replace text with arbitrary drawings.


Field Summary
 
Fields inherited from interface danger.text.span.CharacterHeightAffectingSpan
CHARACTER_HEIGHT_AFFECTING_SPAN_TYPE
 
Method Summary
 int drawText(Pen p, CharSequence text, int start, int len, int x, int top, int baseline, int bottom, Object[] characterSpans)
          Draw the specified text segment with the specified pen at the specified location.
 boolean findLineBreakCandidate(Font f, int wid_avail, CharSequence text, int end, LineBreakerArguments args, Object[] characterSpans)
          Find the next possible line break within the specified text segment.
 int getAdvance(Font f, CharSequence text, int offset, int len, Object[] characterSpans)
          Return the advance of the specified text segment.
 int getVerticalDimensions(Font f, CharSequence text, int start, int end, Object[] spans)
          Return the vertical dimensions of the specified text segment.
 int getWidth(Font f, CharSequence text, int start, int len, Object[] characterSpans)
          Return the width of the specified text segment.
 

Method Detail

drawText

int drawText(Pen p,
             CharSequence text,
             int start,
             int len,
             int x,
             int top,
             int baseline,
             int bottom,
             Object[] characterSpans)
Draw the specified text segment with the specified pen at the specified location.


getWidth

int getWidth(Font f,
             CharSequence text,
             int start,
             int len,
             Object[] characterSpans)
Return the width of the specified text segment.


getAdvance

int getAdvance(Font f,
               CharSequence text,
               int offset,
               int len,
               Object[] characterSpans)
Return the advance of the specified text segment.


findLineBreakCandidate

boolean findLineBreakCandidate(Font f,
                               int wid_avail,
                               CharSequence text,
                               int end,
                               LineBreakerArguments args,
                               Object[] characterSpans)
Find the next possible line break within the specified text segment.

XXX elaborate responsibilities


getVerticalDimensions

int getVerticalDimensions(Font f,
                          CharSequence text,
                          int start,
                          int end,
                          Object[] spans)
Return the vertical dimensions of the specified text segment. The top 16 bits of the return value are the line height; the low 16 bits are the descent.