danger.text.span
Interface RightMarginSpan

All Superinterfaces:
MetricAffectingSpan, ParagraphSpan
All Known Implementing Classes:
RightMarginSpan.Standard


public interface RightMarginSpan
extends ParagraphSpan

Text covered by implementations of RightMarginSpan has a left margin.


Nested Class Summary
static class RightMarginSpan.Standard
          Standard right margin implementation.
 
Nested classes/interfaces inherited from interface danger.text.span.ParagraphSpan
ParagraphSpan.Set
 
Field Summary
 
Fields inherited from interface danger.text.span.ParagraphSpan
PARAGRAPH_SPAN_TYPE
 
Method Summary
 int drawRightMargin(Pen p, int x, int top, int baseline, int bottom, Object[] spans, CharSequence text, int parStart, int lineStart, int paragraphDistance, Object[] characterSpans)
          Draw the right margin.
 int modifyRightMargin(int margin, Object[] spans, Font f, CharSequence text, int parStart, int lineStart, int paragraphDistance)
          Return the new right margin after modification by this span.
 

Method Detail

modifyRightMargin

int modifyRightMargin(int margin,
                      Object[] spans,
                      Font f,
                      CharSequence text,
                      int parStart,
                      int lineStart,
                      int paragraphDistance)
Return the new right margin after modification by this span. This will generally be a number greater than or equal to the margin argument provided.


drawRightMargin

int drawRightMargin(Pen p,
                    int x,
                    int top,
                    int baseline,
                    int bottom,
                    Object[] spans,
                    CharSequence text,
                    int parStart,
                    int lineStart,
                    int paragraphDistance,
                    Object[] characterSpans)
Draw the right margin. If you just want a blank margin, use CharacterSpan.Set.drawBlank(danger.ui.Pen, int, int, int, int, int, java.lang.Object[]) to draw a blank at the specified position with the specified list of characterSpans. The return value is the width of the margin and must match the increment that modifyRightMargin(int, java.lang.Object[], danger.ui.Font, java.lang.CharSequence, int, int, int) adds to its return value. Note that the right margin draws to the left of x, not to right right of it, so you need to subtract the width from the x value that you pass to drawBlank().