|
||||||||||
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.BlockPseudoElementBox
Implements a Block
Constructor Summary | |
BlockPseudoElementBox(LayoutContext context,
Element pseudoElement,
int width)
|
Method Summary | |
Box[] |
getChildren()
Provide children for AbstractBox.paint(net.sf.vex.layout.LayoutContext, int, int) . |
Element |
getElement()
Returns the Element with which this box is associated, or null if there is no such box. |
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. |
void |
paint(LayoutContext context,
int x,
int y)
Draw boxes before painting our child. |
Methods inherited from class net.sf.vex.layout.AbstractBox |
containsOffset, getCaretShapes, getEndOffset, getHeight, getStartOffset, getWidth, getX, getY, hasContent, setHeight, setWidth, setX, setY, skipPaint, viewToModel |
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, getCaretShapes, getEndOffset, getHeight, getStartOffset, getWidth, getX, getY, hasContent, setX, setY, viewToModel |
Constructor Detail |
public BlockPseudoElementBox(LayoutContext context, Element pseudoElement, int width)
Method Detail |
public Box[] getChildren()
AbstractBox.paint(net.sf.vex.layout.LayoutContext, int, int)
.
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 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.BlockBox.getLineEndOffset(int)
public int getLineStartOffset(int offset)
BlockBox
getLineStartOffset
in interface BlockBox
offset
- offset identifying the current line.BlockBox.getLineStartOffset(int)
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 coordinateBlockBox.getNextLineOffset(net.sf.vex.layout.LayoutContext, int, int)
public int getPreviousLineOffset(LayoutContext context, int offset, int x)
BlockBox
getPreviousLineOffset
in interface BlockBox
context
- LayoutContext used for the layoutoffset
- the current offsetx
- the x coordinateBlockBox.getPreviousLineOffset(net.sf.vex.layout.LayoutContext, int, int)
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.BlockBox.layout(net.sf.vex.layout.LayoutContext, int, boolean)
public void paint(LayoutContext context, int x, int y)
paint
in interface Box
paint
in class AbstractBox
context
- LayoutContext
containing the
Graphics
object into which the box should be
paintedx
- the x-offset at which the box should be paintedy
- the y-offset at which the box should be paintedBox.paint(net.sf.vex.layout.LayoutContext, int, int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |