Package org.apache.fop.afp.goca
Class AbstractGraphicsCoord
java.lang.Object
org.apache.fop.afp.modca.AbstractAFPObject
org.apache.fop.afp.goca.AbstractGraphicsDrawingOrder
org.apache.fop.afp.goca.AbstractGraphicsCoord
- All Implemented Interfaces:
Streamable
,StructuredData
- Direct Known Subclasses:
GraphicsBox
,GraphicsCharacterString
,GraphicsFillet
,GraphicsFullArc
,GraphicsLine
,GraphicsSetArcParameters
,GraphicsSetCurrentPosition
A base class encapsulating the structure of coordinate based GOCA objects
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.fop.afp.modca.AbstractAFPObject
AbstractAFPObject.Category, AbstractAFPObject.Type
-
Field Summary
Modifier and TypeFieldDescriptionprotected int[]
array of x/y coordinatesprotected boolean
if true, then uses relative drawing orderFields inherited from class org.apache.fop.afp.modca.AbstractAFPObject
LOG, SF_CLASS, SF_HEADER_LENGTH
-
Constructor Summary
ConstructorDescriptionAbstractGraphicsCoord
(int[] coords) ConstructorAbstractGraphicsCoord
(int[] coords, boolean relative) ConstructorAbstractGraphicsCoord
(int x, int y) ConstructorAbstractGraphicsCoord
(int x1, int y1, int x2, int y2) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addCoords
(byte[] data, int fromIndex) Adds the coordinates to the structured field dataint
Returns the data length of this structured fieldprotected boolean
Returns true if this is a relative drawing ordertoString()
void
DataStream objects must implement the writeToStream() method to write its data to the given OutputStreamMethods inherited from class org.apache.fop.afp.goca.AbstractGraphicsDrawingOrder
getName
Methods inherited from class org.apache.fop.afp.modca.AbstractAFPObject
copySF, copySF, truncate, writeChunksToStream, writeObjects
-
Field Details
-
coords
protected int[] coordsarray of x/y coordinates -
relative
protected boolean relativeif true, then uses relative drawing order
-
-
Constructor Details
-
AbstractGraphicsCoord
public AbstractGraphicsCoord(int[] coords) Constructor- Parameters:
coords
- the x/y coordinates for this object
-
AbstractGraphicsCoord
public AbstractGraphicsCoord(int[] coords, boolean relative) Constructor- Parameters:
coords
- the x/y coordinates for this objectrelative
- true if relative drawing order
-
AbstractGraphicsCoord
public AbstractGraphicsCoord(int x, int y) Constructor- Parameters:
x
- the x coordinate for this objecty
- the y coordinate for this object
-
AbstractGraphicsCoord
public AbstractGraphicsCoord(int x1, int y1, int x2, int y2) Constructor- Parameters:
x1
- the x1 coordinate for this objecty1
- the y1 coordinate for this objectx2
- the x2 coordinate for this objecty2
- the y2 coordinate for this object
-
-
Method Details
-
getDataLength
public int getDataLength()Returns the data length of this structured field- Returns:
- the data length of this structured field
-
writeToStream
DataStream objects must implement the writeToStream() method to write its data to the given OutputStream- Parameters:
os
- the outputsteam stream- Throws:
IOException
- an I/O exception of some sort has occurred.
-
addCoords
protected void addCoords(byte[] data, int fromIndex) Adds the coordinates to the structured field data- Parameters:
data
- the structured field datafromIndex
- the start index
-
toString
-
isRelative
protected boolean isRelative()Returns true if this is a relative drawing order- Returns:
- true if this is a relative drawing order
-