|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.vex.layout.AbstractBox | +--net.sf.vex.layout.TextBox | +--net.sf.vex.layout.DocumentTextBox
A TextBox that gets its text from the document.
Nested Class Summary |
Nested classes inherited from class net.sf.vex.layout.InlineBox |
InlineBox.Pair |
Constructor Summary | |
DocumentTextBox(LayoutContext context,
Element element,
int startRelative,
int length)
Class constructor. |
|
DocumentTextBox(LayoutContext context,
Element element,
Text text)
Class constructor, accepting a Text object. |
Method Summary | |
int |
getEndOffset()
Returns the offset of the end of the content that the box covers. |
int |
getStartOffset()
Returns the offset of the start of the content that the box covers. |
java.lang.String |
getText()
Return the text that comprises this text box. |
boolean |
hasContent()
Returns true if this box represents a portion of the XML document's content. |
void |
paint(LayoutContext context,
int x,
int y)
Draws the box's content in the given Graphics context. |
InlineBox.Pair |
splitAt(LayoutContext context,
int offset)
Return a pair of boxes representing a split at the given offset. |
int |
viewToModel(LayoutContext context,
int x,
int y)
Returns the offset in the content closest to the given view position. |
Methods inherited from class net.sf.vex.layout.TextBox |
calculateSize, canBreakAtEnd, getBaseline, getCaretShapes, getElement, isSplitChar, split, toString |
Methods inherited from class net.sf.vex.layout.AbstractBox |
containsOffset, getChildren, getHeight, getWidth, getX, getY, setHeight, setWidth, setX, setY, skipPaint |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.vex.layout.Box |
containsOffset, getChildren, getHeight, getWidth, getX, getY, setX, setY |
Constructor Detail |
public DocumentTextBox(LayoutContext context, Element element, Text text)
context
- LayoutContext in useelement
- Element being usedtext
- public DocumentTextBox(LayoutContext context, Element element, int startRelative, int length)
context
- LayoutContext used to calculate the box's size.element
- Element that directly contains the text.startRelative
- start offset of the text, relative to the start
offset of the elementlength
- length of the textMethod Detail |
public int getEndOffset()
Box
getEndOffset
in interface Box
getEndOffset
in class AbstractBox
Box.getEndOffset()
public int getStartOffset()
Box
getStartOffset
in interface Box
getStartOffset
in class AbstractBox
Box.getStartOffset()
public java.lang.String getText()
TextBox
getText
in class TextBox
TextBox.getText()
public boolean hasContent()
Box
hasContent
in interface Box
hasContent
in class AbstractBox
Box.hasContent()
public void paint(LayoutContext context, int x, int y)
Box
paint
in interface Box
paint
in class TextBox
Box.paint(net.sf.vex.layout.LayoutContext, int, int)
public InlineBox.Pair splitAt(LayoutContext context, int offset)
TextBox
splitAt
in class TextBox
context
- LayoutContext used to calculate the sizes of the resulting
boxes.offset
- location of the split, relative to the start of the
text box.
net.sf.vex.layout.TextBox#splitAt(int)
public int viewToModel(LayoutContext context, int x, int y)
Box
viewToModel
in interface Box
viewToModel
in class AbstractBox
context
- LayoutContext
for this box treex
- x offset of the view position for which the model
offset is to be determined.y
- y offset of the view position for which the model
offset is to be determined.Box.viewToModel(net.sf.vex.layout.LayoutContext, int, int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |