Package org.apache.fop.afp.goca
Class GraphicsData
- java.lang.Object
-
- All Implemented Interfaces:
Completable
,Startable
,Streamable
,StructuredData
public final class GraphicsData extends AbstractGraphicsDrawingOrderContainer
A GOCA graphics data
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.fop.afp.modca.AbstractAFPObject
AbstractAFPObject.Category, AbstractAFPObject.Type
-
-
Field Summary
Fields Modifier and Type Field Description private GraphicsChainedSegment
currentSegment
the graphics segmentstatic int
MAX_DATA_LEN
the maximum graphics data lengthprivate boolean
segmentedData
-
Fields inherited from class org.apache.fop.afp.goca.AbstractGraphicsDrawingOrderContainer
objects
-
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 GraphicsData()
Main constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addObject(StructuredData object)
Adds a given graphics object to this containervoid
addSegment(GraphicsChainedSegment segment)
Adds the given segment to this graphics datajava.lang.String
createSegmentName()
Returns a new segment nameint
getDataLength()
Returns the current data lengthGraphicsChainedSegment
newSegment()
Creates a new graphics segment.GraphicsChainedSegment
newSegment(boolean appended, boolean prologPresent)
Creates a new graphics segment.StructuredData
removeCurrentSegment()
Removes the current segment from this graphics datavoid
setSegmentedData(boolean segmented)
Sets the indicator that this instance is a part of a series of segmented data chunks.java.lang.String
toString()
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.goca.AbstractGraphicsDrawingOrderContainer
addAll, isComplete, isStarted, removeLast, setComplete, setStarted, writeContent, writeStart
-
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.AbstractStructuredObject
writeEnd
-
Methods inherited from class org.apache.fop.afp.modca.AbstractAFPObject
copySF, truncate, writeChunksToStream, writeObjects
-
-
-
-
Field Detail
-
MAX_DATA_LEN
public static final int MAX_DATA_LEN
the maximum graphics data length- See Also:
- Constant Field Values
-
currentSegment
private GraphicsChainedSegment currentSegment
the graphics segment
-
segmentedData
private boolean segmentedData
-
-
Method Detail
-
getDataLength
public int getDataLength()
Returns the current data length- Specified by:
getDataLength
in interfaceStructuredData
- Overrides:
getDataLength
in classAbstractGraphicsDrawingOrderContainer
- Returns:
- the current data length of this container including all enclosed objects (and their containers)
-
setSegmentedData
public void setSegmentedData(boolean segmented)
Sets the indicator that this instance is a part of a series of segmented data chunks. This indirectly sets the SegFlag on the SFI header.- Parameters:
segmented
- true if this data object is not the last of the series
-
createSegmentName
public java.lang.String createSegmentName()
Returns a new segment name- Returns:
- a new segment name
-
newSegment
public GraphicsChainedSegment newSegment()
Creates a new graphics segment.- Returns:
- a newly created graphics segment
-
newSegment
public GraphicsChainedSegment newSegment(boolean appended, boolean prologPresent)
Creates a new graphics segment.- Parameters:
appended
- true if this segment is appended to the previous oneprologPresent
- true if started with a prolog- Returns:
- a newly created graphics segment
-
addObject
public void addObject(StructuredData object)
Adds a given graphics object to this container- Overrides:
addObject
in classAbstractGraphicsDrawingOrderContainer
- Parameters:
object
- the structured data object
-
removeCurrentSegment
public StructuredData removeCurrentSegment()
Removes the current segment from this graphics data- Returns:
- the current segment from this graphics data
-
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 interfaceStreamable
- Overrides:
writeToStream
in classAbstractStructuredObject
- Parameters:
os
- the outputsteam stream- Throws:
java.io.IOException
- an I/O exception of some sort has occurred.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractNamedAFPObject
-
addSegment
public void addSegment(GraphicsChainedSegment segment)
Adds the given segment to this graphics data- Parameters:
segment
- a graphics chained segment
-
-