fop 1.0

org.apache.fop.afp.modca
Class AbstractResourceGroupContainer

java.lang.Object
  extended by org.apache.fop.afp.modca.AbstractAFPObject
      extended by org.apache.fop.afp.modca.AbstractStructuredObject
          extended by org.apache.fop.afp.modca.AbstractTripletStructuredObject
              extended by org.apache.fop.afp.modca.AbstractNamedAFPObject
                  extended by org.apache.fop.afp.modca.AbstractPageObject
                      extended by org.apache.fop.afp.modca.AbstractResourceGroupContainer
All Implemented Interfaces:
Completable, Streamable
Direct Known Subclasses:
AbstractResourceEnvironmentGroupContainer, PageObject

public abstract class AbstractResourceGroupContainer
extends AbstractPageObject
implements Streamable

An abstract container of resource objects


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.fop.afp.modca.AbstractAFPObject
AbstractAFPObject.Category, AbstractAFPObject.Type
 
Field Summary
protected  ResourceGroup resourceGroup
          the resource group object
protected  boolean started
          The container started state
 
Fields inherited from class org.apache.fop.afp.modca.AbstractPageObject
activeEnvironmentGroup, complete, factory, objects, rotation, tagLogicalElements
 
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
 
Constructor Summary
AbstractResourceGroupContainer(Factory factory)
          Default constructor
AbstractResourceGroupContainer(Factory factory, java.lang.String name)
          Named constructor
AbstractResourceGroupContainer(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
protected  boolean canWrite(AbstractAFPObject obj)
          Returns true if this object can be written
protected  int getResourceCount()
          Return the number of resources in this container
 ResourceGroup getResourceGroup()
          Returns the resource group in this resource group container
protected  boolean hasResources()
          Returns true if this resource group container contains resources
protected  void writeObjects(java.util.Collection objects, java.io.OutputStream os)
          Writes a collection of Streamable to the AFP Datastream.
protected  void writeObjects(java.util.Collection objects, java.io.OutputStream os, boolean forceWrite)
          Writes a collection of AbstractAFPObjects to the AFP Datastream.
 void writeToStream(java.io.OutputStream os)
          DataStream objects must implement the writeToStream() method to write its data to the given OutputStream
 
Methods inherited from class org.apache.fop.afp.modca.AbstractPageObject
addObject, createFont, createIncludePageSegment, createLine, createNoOperation, createTagLogicalElement, createText, endPage, endPresentationObject, getActiveEnvironmentGroup, getHeight, getPresentationTextObject, getRotation, getTagLogicalElements, getWidth, isComplete, setComplete, writeContent
 
Methods inherited from class org.apache.fop.afp.modca.AbstractNamedAFPObject
copySF, getName, getNameBytes, getNameLength, setName, toString
 
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 org.apache.fop.afp.modca.AbstractStructuredObject
writeEnd, writeStart
 
Methods inherited from class org.apache.fop.afp.modca.AbstractAFPObject
copyChunks, copySF, truncate, writeChunksToStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

started

protected boolean started
The container started state


resourceGroup

protected ResourceGroup resourceGroup
the resource group object

Constructor Detail

AbstractResourceGroupContainer

public AbstractResourceGroupContainer(Factory factory)
Default constructor

Parameters:
factory - the object factory

AbstractResourceGroupContainer

public AbstractResourceGroupContainer(Factory factory,
                                      java.lang.String name)
Named constructor

Parameters:
factory - the object factory
name - the name of this resource container

AbstractResourceGroupContainer

public AbstractResourceGroupContainer(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 object factory
name - 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

getResourceCount

protected int getResourceCount()
Return the number of resources in this container

Returns:
the number of resources in this container

hasResources

protected boolean hasResources()
Returns true if this resource group container contains resources

Returns:
true if this resource group container contains resources

getResourceGroup

public ResourceGroup getResourceGroup()
Returns the resource group in this resource group container

Returns:
the resource group in this resource group container

writeToStream

public void writeToStream(java.io.OutputStream os)
                   throws java.io.IOException
DataStream objects must implement the writeToStream() method to write its data to the given OutputStream

Specified by:
writeToStream in interface Streamable
Overrides:
writeToStream in class AbstractStructuredObject
Parameters:
os - the outputsteam stream
Throws:
java.io.IOException - an I/O exception of some sort has occurred.

writeObjects

protected void writeObjects(java.util.Collection objects,
                            java.io.OutputStream os)
                     throws java.io.IOException
Writes a collection of Streamable to the AFP Datastream.

Overrides:
writeObjects in class AbstractAFPObject
Parameters:
objects - a list of AFPObjects
os - The stream to write to
Throws:
java.io.IOException - an I/O exception of some sort has occurred.

writeObjects

protected void writeObjects(java.util.Collection objects,
                            java.io.OutputStream os,
                            boolean forceWrite)
                     throws java.io.IOException
Writes a collection of AbstractAFPObjects to the AFP Datastream.

Parameters:
objects - a list of AFPObjects
os - The stream to write to
forceWrite - true if writing should happen in any case
Throws:
java.io.IOException - an I/O exception of some sort has occurred.

canWrite

protected boolean canWrite(AbstractAFPObject obj)
Returns true if this object can be written

Parameters:
obj - an AFP object
Returns:
true if this object can be written

fop 1.0

Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.