|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Block
Instances of this class represent groupings of text at a specific position on a
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.
Method Summary | |
---|---|
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. |
Methods inherited from interface com.snowtide.pdf.layout.Region |
---|
area, endxpos, endypos, height, width, xpos, ypos |
Methods inherited from interface com.snowtide.pdf.layout.BlockParent |
---|
addChild, getChild, getChildCnt, removeAllChildren, removeChild, sortChildren |
Method Detail |
---|
java.util.List getLines()
Line
s held by this Block. The returned List is guaranteed to
offer efficient random access.
Line getLine(int idx)
Line
at the given index.
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 block
java.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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |