Package org.apache.fop.afp.modca
Class PageObject
- java.lang.Object
-
- All Implemented Interfaces:
Completable
,Streamable
- Direct Known Subclasses:
Overlay
public class PageObject extends AbstractResourceGroupContainer
Pages contain the data objects that comprise a presentation document. Each page has a set of data objects associated with it. Each page within a document is independent from any other page, and each must establish its own environment parameters. The page is the level in the document component hierarchy that is used for printing or displaying a document's content. The data objects contained in the page envelope in the data stream are presented when the page is presented. Each data object has layout information associated with it that directs the placement and orientation of the data on the page. In addition, each page contains layout information that specifies the measurement units, page width, and page depth. A page is initiated by a begin page structured field and terminated by an end page structured field. Structured fields that define objects and active environment groups or that specify attributes of the page may be encountered in page state.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.fop.afp.modca.AbstractAFPObject
AbstractAFPObject.Category, AbstractAFPObject.Type
-
-
Field Summary
-
Fields inherited from class org.apache.fop.afp.modca.AbstractResourceGroupContainer
resourceGroup, started
-
Fields inherited from class org.apache.fop.afp.modca.AbstractPageObject
activeEnvironmentGroup, complete, factory, objects, rotation
-
Fields inherited from class org.apache.fop.afp.modca.AbstractNamedAFPObject
name
-
Fields inherited from class org.apache.fop.afp.modca.AbstractTripletStructuredObject
triplets
-
Fields inherited from class org.apache.fop.afp.modca.AbstractAFPObject
LOG, SF_CLASS, SF_HEADER_LENGTH
-
-
Constructor Summary
Constructors Constructor Description PageObject(Factory factory, java.lang.String name, int width, int height, int rotation, int widthRes, int heightRes)
Construct a new page object for the specified name argument, the page name should be an 8 character identifier.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addObject(java.lang.Object obj)
Adds an AFP object reference to this pageprotected boolean
canWrite(AbstractAFPObject ao)
Returns true if this object can be writtenvoid
createIncludePageOverlay(java.lang.String name, int x, int y, int orientation)
Creates an IncludePageOverlay on the page.void
createShading(int x, int y, int w, int h, int red, int green, int blue)
This method will create shading on the page using the specified coordinates (the shading contrast is controlled via the red, green blue parameters, by converting this to grayscale).java.lang.String
toString()
protected void
writeContent(java.io.OutputStream os)
Helper method to write the contents of the Object.protected void
writeEnd(java.io.OutputStream os)
Helper method to write the end of the Object.protected void
writeStart(java.io.OutputStream os)
Helper method to write the start of the Object.-
Methods inherited from class org.apache.fop.afp.modca.AbstractResourceGroupContainer
getResourceCount, getResourceGroup, hasResources, writeObjects, writeObjects, writeToStream
-
Methods inherited from class org.apache.fop.afp.modca.AbstractPageObject
createFont, createIncludePageSegment, createLine, createNoOperation, createTagLogicalElement, createText, endPage, endPresentationObject, getActiveEnvironmentGroup, getHeight, getPresentationTextObject, getRotation, getTagLogicalElements, getWidth, isComplete, setComplete
-
Methods inherited from class org.apache.fop.afp.modca.AbstractNamedAFPObject
copySF, getName, getNameBytes, getNameLength, setName
-
Methods inherited from class org.apache.fop.afp.modca.AbstractTripletStructuredObject
addTriplet, addTriplets, getFullyQualifiedName, getTripletDataLength, getTriplets, hasTriplet, hasTriplets, setComment, setFullyQualifiedName, setFullyQualifiedName, setObjectClassification, writeTriplets
-
Methods inherited from class org.apache.fop.afp.modca.AbstractAFPObject
copySF, truncate, writeChunksToStream
-
-
-
-
Constructor Detail
-
PageObject
public PageObject(Factory factory, java.lang.String name, int width, int height, int rotation, int widthRes, int heightRes)
Construct a new page object for the specified name argument, the page name should be an 8 character identifier.- Parameters:
factory
- the resource managername
- the name of the page.width
- the width of the page.height
- the height of the page.rotation
- the rotation of the page.widthRes
- the width resolution of the page.heightRes
- the height resolution of the page.
-
-
Method Detail
-
createIncludePageOverlay
public void createIncludePageOverlay(java.lang.String name, int x, int y, int orientation)
Creates an IncludePageOverlay on the page.- Parameters:
name
- the name of the overlayx
- the x position of the overlayy
- the y position of the overlayorientation
- the orientation required for the overlay
-
createShading
public void createShading(int x, int y, int w, int h, int red, int green, int blue)
This method will create shading on the page using the specified coordinates (the shading contrast is controlled via the red, green blue parameters, by converting this to grayscale).- Parameters:
x
- the x coordinate of the shadingy
- the y coordinate of the shadingw
- the width of the shaded areah
- the height of the shaded areared
- the red valuegreen
- the green valueblue
- the blue value
-
writeStart
protected void writeStart(java.io.OutputStream os) throws java.io.IOException
Helper method to write the start of the Object.- Overrides:
writeStart
in classAbstractStructuredObject
- Parameters:
os
- The stream to write to- Throws:
java.io.IOException
- throws an I/O exception if one occurred
-
writeContent
protected void writeContent(java.io.OutputStream os) throws java.io.IOException
Helper method to write the contents of the Object.- Overrides:
writeContent
in classAbstractPageObject
- Parameters:
os
- The stream to write to- Throws:
java.io.IOException
- throws an I/O exception if one occurred
-
writeEnd
protected void writeEnd(java.io.OutputStream os) throws java.io.IOException
Helper method to write the end of the Object.- Overrides:
writeEnd
in classAbstractStructuredObject
- Parameters:
os
- The stream to write to- Throws:
java.io.IOException
- an I/O exception if one occurred
-
addObject
public void addObject(java.lang.Object obj)
Adds an AFP object reference to this page- Overrides:
addObject
in classAbstractPageObject
- Parameters:
obj
- an AFP object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractNamedAFPObject
-
canWrite
protected boolean canWrite(AbstractAFPObject ao)
Returns true if this object can be written- Overrides:
canWrite
in classAbstractResourceGroupContainer
- Parameters:
ao
- an AFP object- Returns:
- true if this object can be written
-
-