|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents a block box. Block boxes are stacked one on top of another.
Method Summary | |
LineBox |
getFirstLine()
Returns the first LineBox contained by this block, or null if the block contains no lines. |
LineBox |
getLastLine()
Returns the last LineBox contained by this block, or null if the block contains no lines. |
int |
getLineEndOffset(int offset)
Returns the offset of the end of the line containing the given offset. |
int |
getLineStartOffset(int offset)
Returns the offset of the start of the line containing the given offset. |
int |
getMarginBottom()
Returns the bottom margin of this box. |
int |
getMarginTop()
Returns the top margin of this box. |
int |
getNextLineOffset(LayoutContext context,
int offset,
int x)
Returns the offset on the next line that is closest to the given x coordinate. |
int |
getPreviousLineOffset(LayoutContext context,
int offset,
int x)
Returns the offset on the previous line that is closest to the given x coordinate. |
void |
layout(LayoutContext context,
int width,
boolean force)
Layout this box. |
Methods inherited from interface net.sf.vex.layout.Box |
containsOffset, getCaretShapes, getChildren, getElement, getEndOffset, getHeight, getStartOffset, getWidth, getX, getY, hasContent, paint, setX, setY, viewToModel |
Method Detail |
public LineBox getFirstLine()
public LineBox getLastLine()
public int getLineEndOffset(int offset)
offset
- offset identifying the current line.public int getLineStartOffset(int offset)
offset
- offset identifying the current line.public int getMarginBottom()
public int getMarginTop()
public int getNextLineOffset(LayoutContext context, int offset, int x)
context
- LayoutContext used for the layoutoffset
- the current offsetx
- the x coordinatepublic int getPreviousLineOffset(LayoutContext context, int offset, int x)
context
- LayoutContext used for the layoutoffset
- the current offsetx
- the x coordinatepublic void layout(LayoutContext context, int width, boolean force)
Boxes with no children should simply calculate their width and height here
context
- The layout context to be used.width
- Width available for this box. This is typically ignored
by inline-formatted boxes.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |