public class PageViewport extends AreaTreeObject implements Resolvable
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
log
logging instance
|
extensionAttachments, foreignAttributes| Constructor and Description |
|---|
PageViewport(PageViewport original)
Copy constructor.
|
PageViewport(Rectangle viewArea,
int pageNumber,
String pageStr,
String simplePageMasterName,
boolean blank)
Constructor used by the area tree parser.
|
PageViewport(SimplePageMaster spm,
int pageNumber,
String pageStr,
boolean blank)
Create a page viewport.
|
PageViewport(SimplePageMaster spm,
int pageNumber,
String pageStr,
boolean blank,
boolean spanAll)
Create a page viewport.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addUnresolvedIDRef(String idref,
Resolvable res)
Add an idref to this page.
|
void |
clear()
Clear the page contents to save memory.
|
Object |
clone() |
Span |
createSpan(boolean spanAll)
Convenience method to create a new Span for this
this PageViewport.
|
void |
dumpMarkers()
Dumps the current marker data to the logger.
|
BodyRegion |
getBodyRegion()
Convenience method to get BodyRegion of this PageViewport
|
NormalFlow |
getCurrentFlow()
Convenience method to get the normal-flow-reference-area
currently being processed
|
Span |
getCurrentSpan()
Convenience method to get the span-reference-area currently
being processed
|
String[] |
getIDRefs()
Get the unresolved idrefs for this page.
|
String |
getKey()
Get the key for this page viewport.
|
Page |
getPage()
Get the page reference area with the contents.
|
int |
getPageIndex() |
int |
getPageNumber()
Get the page number of this page.
|
String |
getPageNumberString()
Get the page number of this page.
|
PageSequence |
getPageSequence() |
RegionReference |
getRegionReference(int id)
Convenience method to return a given region-reference-area,
keyed by the Constants class identifier for the corresponding
formatting object (ie.
|
String |
getSimplePageMasterName() |
Rectangle |
getViewArea()
Get the view area rectangle of this viewport.
|
boolean |
isBlank() |
boolean |
isFirstWithID(String id)
Check whether a certain id first appears on this page
|
boolean |
isResolved()
Check if this page has been fully resolved.
|
void |
loadPage(ObjectInputStream in)
Load the page contents from an object stream.
|
NormalFlow |
moveToNextFlow()
Convenience method to increment the Span to the
next NormalFlow to be processed, and to return that flow.
|
void |
registerMarkers(Map<String,Marker> marks,
boolean starting,
boolean isfirst,
boolean islast)
Register the markers for this page.
|
void |
replace(PageViewport oldViewPort)
Replace the old view port.
|
void |
resolveIDRef(String id,
List<PageViewport> pages)
This method allows the Resolvable object to resolve one of
its unresolved idrefs with the actual set of PageViewports
containing the target ID.
|
Marker |
resolveMarker(AbstractRetrieveMarker rm)
Resolve a marker from this page.
|
void |
savePage(ObjectOutputStream out)
Save the page contents to an object stream.
|
void |
setFirstWithID(String id)
Add an "ID-first" to this page.
|
void |
setKey(String key)
Sets the unique key for this PageViewport that will be used to reference this page.
|
void |
setPage(Page page)
Sets the page object for this PageViewport.
|
void |
setPageIndex(int index)
Sets the page index of the page in this rendering run.
|
void |
setPageSequence(PageSequence seq)
Sets the page sequence this page belongs to
|
void |
setWritingModeTraits(WritingModeTraitsGetter wmtg)
Sets the writing mode traits for the page associated with this viewport.
|
String |
toString() |
addExtensionAttachment, getExtensionAttachments, getForeignAttributes, getForeignAttributeValue, hasExtensionAttachments, setExtensionAttachments, setForeignAttribute, setForeignAttributespublic PageViewport(SimplePageMaster spm, int pageNumber, String pageStr, boolean blank, boolean spanAll)
spm - SimplePageMaster indicating the page and region dimensionspageNumber - the page numberpageStr - String representation of the page numberblank - true if this is a blank pagespanAll - true if the first span area spans all columnspublic PageViewport(SimplePageMaster spm, int pageNumber, String pageStr, boolean blank)
spm - SimplePageMaster indicating the page and region dimensionspageNumber - the page numberpageStr - String representation of the page numberblank - true if this is a blank pagepublic PageViewport(PageViewport original) throws FOPException
original - the original PageViewport to copy fromFOPException - when cloning of the page is not supportedpublic PageViewport(Rectangle viewArea, int pageNumber, String pageStr, String simplePageMasterName, boolean blank)
viewArea - the view areapageNumber - the page numberpageStr - String representation of the page numbersimplePageMasterName - name of the original simple-page-master that generated this pageblank - true if this is a blank pagepublic void setPageSequence(PageSequence seq)
seq - the page sequencepublic PageSequence getPageSequence()
public Rectangle getViewArea()
public Page getPage()
public void setPage(Page page)
page - the pagepublic int getPageNumber()
public String getPageNumberString()
public void setPageIndex(int index)
index - the page index (zero-based), -1 if it is undeterminedpublic int getPageIndex()
public void setKey(String key)
key - the unique key.public String getKey()
public void setFirstWithID(String id)
AreaTreeHandler when associating
an ID with a PageViewport.id - the id to be registered as first appearing on this pagepublic boolean isFirstWithID(String id)
id - the id to be checkedpublic void replace(PageViewport oldViewPort)
oldViewPort - old view portpublic void addUnresolvedIDRef(String idref, Resolvable res)
PageViewport are added
to unresolvedIDRefs, for subsequent resolution by AreaTreeHandler
calls to this object's resolveIDRef().idref - the idrefres - the child element of this page that needs this
idref resolvedpublic boolean isResolved()
isResolved in interface Resolvablepublic String[] getIDRefs()
getIDRefs in interface Resolvablepublic void resolveIDRef(String id, List<PageViewport> pages)
resolveIDRef in interface Resolvableid - an ID matching one of the Resolvable object's
unresolved idref's.pages - the list of PageViewports with the given IDpublic void registerMarkers(Map<String,Marker> marks, boolean starting, boolean isfirst, boolean islast)
marks - the map of markers to addstarting - if the area being added is starting or endingisfirst - if the area being added has is-first traitislast - if the area being added has is-last traitpublic Marker resolveMarker(AbstractRetrieveMarker rm)
rm - the retrieve-marker instancepublic void dumpMarkers()
public void savePage(ObjectOutputStream out) throws IOException
out - the object output stream to write the contentsIOException - in case of an I/O error while serializing the pagepublic void loadPage(ObjectInputStream in) throws IOException, ClassNotFoundException
in - the object input stream to read the page fromClassNotFoundException - if a class was not found while loading the pageIOException - if an I/O error occurred while loading the pagepublic Object clone() throws CloneNotSupportedException
clone in class AreaTreeObjectCloneNotSupportedExceptionpublic void clear()
public String getSimplePageMasterName()
public boolean isBlank()
public BodyRegion getBodyRegion()
public Span createSpan(boolean spanAll)
spanAll - whether this is a single-column spanpublic Span getCurrentSpan()
public NormalFlow getCurrentFlow()
public NormalFlow moveToNextFlow()
public RegionReference getRegionReference(int id)
id - the Constants class identifier for the region.public void setWritingModeTraits(WritingModeTraitsGetter wmtg)
wmtg - a WM traits getterCopyright © 2025 Apache Software Foundation. All rights reserved.