public class LayoutEnumerator
Constructor Summary |
---|
LayoutEnumerator(Document document)
Initializes new instance of this class. |
Property Getters/Setters Summary | ||
---|---|---|
java.lang.Object | getCurrent() | |
void | setCurrent(java.lang.Objectvalue) | |
Gets or sets current position in the page layout model. This property returns an opaque object which corresponds to the current layout entity. | ||
Document | getDocument() | |
Gets document this instance enumerates.
|
||
java.lang.String | getKind() | |
Gets the kind of the current entity. This can be an empty string but never null.
|
||
int | getPageIndex() | |
Gets the 1-based index of a page which contains the current entity.
|
||
java.awt.geom.Rectangle2D.Float | getRectangle() | |
Returns the bounding rectangle of the current entity relative to the page top left corner (in points).
|
||
java.lang.String | getText() | |
Gets text of the current span entity. Throws for other entity types.
|
||
int | getType() | |
Gets the type of the current entity.
The value of the property is LayoutEntityType integer constant. |
Method Summary | ||
---|---|---|
boolean | moveFirstChild() | |
Moves to the first child entity.
|
||
boolean | moveLastChild() | |
Moves to the last child entity.
|
||
boolean | moveNext() | |
Moves to the next sibling entity in visual order.
When iterating lines of a paragraph broken across pages this method
will not move to the next page but rather move to the next entity on the same page.
|
||
boolean | moveNextLogical() | |
Moves to the next sibling entity in a logical order.
When iterating lines of a paragraph broken across pages this method
will move to the next line even if it resides on another page.
|
||
boolean | moveParent() | |
Moves to the parent entity.
|
||
boolean | moveParent(int types) | |
Moves to the parent entity of the specified type.
|
||
boolean | movePrevious() | |
Moves to the previous sibling entity.
|
||
boolean | movePreviousLogical() | |
Moves to the previous sibling entity in a logical order.
When iterating lines of a paragraph broken across pages this method
will move to the previous line even if it resides on another page.
|
||
void | reset() | |
Moves the enumerator to the first page of the document.
|
public LayoutEnumerator(Document document) throws java.lang.Exception
If page layout model of the document hasn't been built the enumerator calls
Whenever document is updated and new page layout model is created, a new enumerator must be used to access it.
document
- A document whose page layout model to enumerate.public java.lang.Object getCurrent() / public void setCurrent(java.lang.Object value)
public Document getDocument()
public java.lang.String getKind()
public int getPageIndex()
public java.awt.geom.Rectangle2D.Float getRectangle()
public java.lang.String getText()
public int getType()
public boolean moveFirstChild() throws java.lang.Exception
public boolean moveLastChild()
public boolean moveNext() throws java.lang.Exception
public boolean moveNextLogical()
public boolean moveParent()
public boolean moveParent(int types)
types
- A public boolean movePrevious() throws java.lang.Exception
public boolean movePreviousLogical()
public void reset() throws java.lang.Exception