|
||||||||||
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.RootBox
A wrapper for the top level BlockElementBox
that applies
its margins.
Constructor Summary | |
RootBox()
Class constructor. |
Method Summary | |
java.awt.Shape[] |
getCaretShapes(LayoutContext context,
int offset)
Returns shapes for the primary and secondary carets for the given offset. |
Box[] |
getChildren()
Returns an array of this box's children. |
Element |
getElement()
Returns the Element with which this box is associated, or null if there is no such box. |
int |
getEndOffset()
Returns the offset of the end of the content that the box covers. |
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. |
int |
getStartOffset()
Returns the offset of the start of the content that the box covers. |
void |
layout(LayoutContext context,
int width,
boolean force)
Layout this box. |
void |
setChild(BlockElementBox childBox)
Sets the child of the root box. |
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.AbstractBox |
containsOffset, getHeight, getWidth, getX, getY, hasContent, paint, setHeight, setWidth, setX, setY, skipPaint |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.vex.layout.Box |
containsOffset, getHeight, getWidth, getX, getY, hasContent, paint, setX, setY |
Constructor Detail |
public RootBox()
Method Detail |
public java.awt.Shape[] getCaretShapes(LayoutContext context, int offset)
Box
getCaretShapes
in interface Box
getCaretShapes
in class AbstractBox
context
- LayoutContext to be usedoffset
- offset for which to retrieve the caret
Shape
objectspublic Box[] getChildren()
Box
getChildren
in interface Box
getChildren
in class AbstractBox
Box.getChildren()
public Element getElement()
Box
getElement
in interface Box
getElement
in class AbstractBox
Box.getElement()
public int getEndOffset()
Box
getEndOffset
in interface Box
getEndOffset
in class AbstractBox
Box.getEndOffset()
public LineBox getFirstLine()
BlockBox
getFirstLine
in interface BlockBox
BlockBox.getFirstLine()
public LineBox getLastLine()
BlockBox
getLastLine
in interface BlockBox
BlockBox.getLastLine()
public int getLineEndOffset(int offset)
BlockBox
getLineEndOffset
in interface BlockBox
offset
- offset identifying the current line.public int getLineStartOffset(int offset)
BlockBox
getLineStartOffset
in interface BlockBox
offset
- offset identifying the current line.public int getMarginBottom()
BlockBox
getMarginBottom
in interface BlockBox
BlockBox.getMarginBottom()
public int getMarginTop()
BlockBox
getMarginTop
in interface BlockBox
BlockBox.getMarginTop()
public int getNextLineOffset(LayoutContext context, int offset, int x)
BlockBox
getNextLineOffset
in interface BlockBox
context
- LayoutContext used for the layoutoffset
- the current offsetx
- the x coordinatepublic int getPreviousLineOffset(LayoutContext context, int offset, int x)
BlockBox
getPreviousLineOffset
in interface BlockBox
context
- LayoutContext used for the layoutoffset
- the current offsetx
- the x coordinatepublic int getStartOffset()
Box
getStartOffset
in interface Box
getStartOffset
in class AbstractBox
Box.getStartOffset()
public void layout(LayoutContext context, int width, boolean force)
BlockBox
Boxes with no children should simply calculate their width and height here
layout
in interface BlockBox
context
- The layout context to be used.width
- Width available for this box. This is typically ignored
by inline-formatted boxes.public void setChild(BlockElementBox childBox)
childBox
- The root's child.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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |