java.lang.Object
com.aspose.words.LayoutEnumerator
public class LayoutEnumerator
- extends java.lang.Object
Enumerates page layout entities of a document.
You can use this class to walk over the page layout model. Available properties are type, geometry, text and page index where entity is rendered,
as well as overall structure and relationships. Use moveNode(com.aspose.words.Node) method to locate the entity which corresponds to a document node.
Property Getters/Setters Summary |
java.lang.Object | getCurrent() | |
void | setCurrent(java.lang.Object value) | |
|
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.
|
boolean | moveNode(Node node) | |
|
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.
|
void | reset() | |
Moves the enumerator to the first page of the document.
|
LayoutEnumerator
public LayoutEnumerator(Document document)
throws java.lang.Exception
-
Initializes new instance of this class.
If page layout model of the document hasn't been built the enumerator calls Document.updatePageLayout() to build it.
Whenever document is updated and new page layout model is created, a new enumerator must be used to access it.
- Parameters:
document
- A document whose page layout model to enumerate.
Property Getters/Setters Detail |
getCurrent/setCurrent | |
public java.lang.Object getCurrent() / public void setCurrent(java.lang.Object value)
|
-
Gets or sets current position in the page layout model.
This property returns an opaque object which corresponds to the current layout entity.
getDocument | |
public Document getDocument()
|
-
Gets document this instance enumerates.
getKind | |
public java.lang.String getKind()
|
-
Gets the kind of the current entity. This can be an empty string but never null.
This is a more specific type of the current entity, e.g. bookmark span has LayoutEntityType.SPAN type and
may have either a BOOKMARKSTART or BOOKMARKEND kind.
getPageIndex | |
public int getPageIndex()
|
-
Gets the 1-based index of a page which contains the current entity.
getRectangle | |
public java.awt.geom.Rectangle2D.Float getRectangle()
|
-
Returns the bounding rectangle of the current entity relative to the page top left corner (in points).
getText | |
public java.lang.String getText()
|
-
Gets text of the current span entity. Throws for other entity types.
getType | |
public int getType()
|
-
Gets the type of the current entity.
The value of the property is LayoutEntityType integer constant.
moveFirstChild | |
public boolean moveFirstChild()
throws java.lang.Exception |
-
Moves to the first child entity.
moveLastChild | |
public boolean moveLastChild() |
-
Moves to the last child entity.
moveNext | |
public boolean moveNext()
throws java.lang.Exception |
-
Moves to the next sibling entity.
moveNode | |
public boolean moveNode(Node node) |
-
moveParent | |
public boolean moveParent() |
-
Moves to the parent entity.
moveParent | |
public boolean moveParent(int types) |
-
Moves to the parent entity of the specified type.
This method is useful if you need to find the cell, column or header/footer parent of the entity.
- Parameters:
types
- A LayoutEntityType value. The parent entity type to move to. Use bitwise-OR to specify multiple parent types.
movePrevious | |
public boolean movePrevious()
throws java.lang.Exception |
-
Moves to the previous sibling entity.
reset | |
public void reset()
throws java.lang.Exception |
-
Moves the enumerator to the first page of the document.
See Also:
Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
Aspose.Words Support Forum - our preferred method of support.