public interface Block extends Region, BlockParent
Page
.
Blocks can contain Lines
and/or other Blocks (via the BlockParent
implementation). The current implementation generally will not allow a Block to contain
Blocks and Lines.Modifier and Type | Method and Description |
---|---|
Block |
crop(Region area)
Returns a
Block instance that contains only the content held by
this Block instance that intersects the given "query" area. |
Line |
getLine(int idx)
Returns the
Line at the given index. |
int |
getLineCnt()
Returns the number of
Line s held by this Block. |
java.util.List |
getLines()
Returns a List view of the
Line s held by this Block. |
void |
pipe(OutputHandler tgt)
Sends all text events associated with this Block to the given
OutputHandler . |
Line |
removeLine(int idx)
Removes the
Line at the given index from this Block, and returns it. |
area, endxpos, endypos, height, width, xpos, ypos
addChild, getChild, getChildCnt, removeAllChildren, removeChild, sortChildren
java.util.List getLines()
Line
s held by this Block. The returned List is guaranteed to
offer efficient random access.int getLineCnt()
Line
s held by this Block.Line removeLine(int idx)
Removes the Line
at the given index from this Block, and returns it.
Note that a block does not update its regional bounds after a line is removed. Doing so
would result in poor performance for applications that frequently executed this function.
A updateBounds()
function might be provided in the future for applications that
remove Lines from Blocks and also wish to have the Blocks update their bounds.
void pipe(OutputHandler tgt) throws java.io.IOException
OutputHandler
.tgt
- - the destination for all contents of this blockjava.io.IOException
Block crop(Region area)
Block
instance that contains only the content held by
this Block
instance that intersects the given "query" area.
If all of the content held by this instance is intersected by the query area, then this
instance may be returned unchanged. If no content in this Block
intersects the query area, then an empty Block
instance will be
returned.