Package org.apache.fop.afp.modca
Class PageObject
- All Implemented Interfaces:
Completable,Streamable
- Direct Known Subclasses:
Overlay
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, startedFields inherited from class org.apache.fop.afp.modca.AbstractPageObject
activeEnvironmentGroup, complete, factory, invokeMediumMaps, objects, rotationFields inherited from class org.apache.fop.afp.modca.AbstractNamedAFPObject
nameFields inherited from class org.apache.fop.afp.modca.AbstractTripletStructuredObject
tripletsFields inherited from class org.apache.fop.afp.modca.AbstractAFPObject
LOG, SF_CLASS, SF_HEADER_LENGTH -
Constructor Summary
ConstructorsConstructorDescriptionPageObject(Factory factory, 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
Modifier and TypeMethodDescriptionvoidAdds an AFP object reference to this pageprotected booleanReturns true if this object can be writtenvoidcreateIncludePageOverlay(String name, int x, int y, int orientation) Creates an IncludePageOverlay on the page.voidcreateShading(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).toString()protected voidHelper method to write the contents of the Object.protected voidwriteEnd(OutputStream os) Helper method to write the end of the Object.protected voidHelper method to write the start of the Object.Methods inherited from class org.apache.fop.afp.modca.AbstractResourceGroupContainer
getResourceCount, getResourceGroup, hasResources, writeObjects, writeObjects, writeToStreamMethods inherited from class org.apache.fop.afp.modca.AbstractPageObject
createFont, createIncludePageSegment, createInvokeMediumMap, createLine, createNoOperation, createTagLogicalElement, createText, endPage, endPresentationObject, getActiveEnvironmentGroup, getHeight, getPresentationTextObject, getRotation, getTagLogicalElements, getWidth, isComplete, setCompleteMethods inherited from class org.apache.fop.afp.modca.AbstractNamedAFPObject
copySF, getName, getNameBytes, getNameLength, setNameMethods inherited from class org.apache.fop.afp.modca.AbstractTripletStructuredObject
addTriplet, addTriplets, getFullyQualifiedName, getTripletDataLength, getTriplets, hasTriplet, hasTriplets, setComment, setFullyQualifiedName, setFullyQualifiedName, setObjectClassification, writeTripletsMethods inherited from class org.apache.fop.afp.modca.AbstractAFPObject
copySF, truncate, writeChunksToStream
-
Constructor Details
-
PageObject
public PageObject(Factory factory, 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 Details
-
createIncludePageOverlay
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
Helper method to write the start of the Object.- Overrides:
writeStartin classAbstractStructuredObject- Parameters:
os- The stream to write to- Throws:
IOException- throws an I/O exception if one occurred
-
writeContent
Helper method to write the contents of the Object.- Overrides:
writeContentin classAbstractPageObject- Parameters:
os- The stream to write to- Throws:
IOException- throws an I/O exception if one occurred
-
writeEnd
Helper method to write the end of the Object.- Overrides:
writeEndin classAbstractStructuredObject- Parameters:
os- The stream to write to- Throws:
IOException- an I/O exception if one occurred
-
addObject
Adds an AFP object reference to this page- Overrides:
addObjectin classAbstractPageObject- Parameters:
obj- an AFP object
-
toString
- Overrides:
toStringin classAbstractNamedAFPObject
-
canWrite
Returns true if this object can be written- Overrides:
canWritein classAbstractResourceGroupContainer- Parameters:
ao- an AFP object- Returns:
- true if this object can be written
-