org.apache.fop.afp.modca
Class PageObject
java.lang.Object
org.apache.fop.afp.modca.AbstractAFPObject
org.apache.fop.afp.modca.AbstractStructuredObject
org.apache.fop.afp.modca.AbstractTripletStructuredObject
org.apache.fop.afp.modca.AbstractNamedAFPObject
org.apache.fop.afp.modca.AbstractPageObject
org.apache.fop.afp.modca.AbstractResourceGroupContainer
org.apache.fop.afp.modca.PageObject
- 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.
Constructor Summary |
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 |
void |
addObject(java.lang.Object obj)
Adds an AFP object reference to this page |
protected boolean |
canWrite(AbstractAFPObject ao)
Returns true if this object can be written |
void |
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.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.AbstractTripletStructuredObject |
addTriplet, addTriplets, getFullyQualifiedName, getTripletDataLength, getTriplets, hasTriplet, hasTriplets, setComment, setFullyQualifiedName, setObjectClassification, writeTriplets |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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.
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 class AbstractStructuredObject
- 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 class AbstractPageObject
- 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 class AbstractStructuredObject
- 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 class AbstractPageObject
- Parameters:
obj
- an AFP object
toString
public java.lang.String toString()
-
- Overrides:
toString
in class AbstractNamedAFPObject
canWrite
protected boolean canWrite(AbstractAFPObject ao)
- Returns true if this object can be written
- Overrides:
canWrite
in class AbstractResourceGroupContainer
- Parameters:
ao
- an AFP object
- Returns:
- true if this object can be written
Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.