Package org.apache.fop.afp.goca
Class GraphicsCharacterString
- java.lang.Object
-
- org.apache.fop.afp.modca.AbstractAFPObject
-
- org.apache.fop.afp.goca.AbstractGraphicsDrawingOrder
-
- org.apache.fop.afp.goca.AbstractGraphicsCoord
-
- org.apache.fop.afp.goca.GraphicsCharacterString
-
- All Implemented Interfaces:
Streamable,StructuredData
public class GraphicsCharacterString extends AbstractGraphicsCoord
A GOCA graphics string
-
-
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 CharacterSetcharSetThe character set encoding to useprotected static intMAX_STR_LENUp to 255 bytes of character dataprivate java.lang.Stringstrthe string to draw-
Fields inherited from class org.apache.fop.afp.goca.AbstractGraphicsCoord
coords, relative
-
Fields inherited from class org.apache.fop.afp.modca.AbstractAFPObject
LOG, SF_CLASS, SF_HEADER_LENGTH
-
-
Constructor Summary
Constructors Constructor Description GraphicsCharacterString(java.lang.String str, int x, int y, CharacterSet charSet)Constructor (absolute positioning)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetDataLength()Returns the data length of this structured field(package private) bytegetOrderCode()Returns the order code of this structured fieldprivate byte[]getStringAsBytes()Returns the text string as an encoded byte arrayjava.lang.StringtoString()voidwriteToStream(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.AbstractGraphicsCoord
addCoords, getCoordinateDataStartIndex, getData, isRelative
-
Methods 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 Detail
-
MAX_STR_LEN
protected static final int MAX_STR_LEN
Up to 255 bytes of character data- See Also:
- Constant Field Values
-
str
private final java.lang.String str
the string to draw
-
charSet
private final CharacterSet charSet
The character set encoding to use
-
-
Constructor Detail
-
GraphicsCharacterString
public GraphicsCharacterString(java.lang.String str, int x, int y, CharacterSet charSet)Constructor (absolute positioning)- Parameters:
str- the character stringx- the x coordinatey- the y coordinatecharSet- the character set
-
-
Method Detail
-
getOrderCode
byte getOrderCode()
Returns the order code of this structured field- Specified by:
getOrderCodein classAbstractGraphicsDrawingOrder- Returns:
- the order code of this structured field
-
getDataLength
public int getDataLength()
Returns the data length of this structured field- Specified by:
getDataLengthin interfaceStructuredData- Overrides:
getDataLengthin classAbstractGraphicsCoord- Returns:
- the data length of this structured field
-
writeToStream
public void writeToStream(java.io.OutputStream os) throws java.io.IOExceptionDataStream objects must implement the writeToStream() method to write its data to the given OutputStream- Specified by:
writeToStreamin interfaceStreamable- Overrides:
writeToStreamin classAbstractGraphicsCoord- Parameters:
os- the outputsteam stream- Throws:
java.io.IOException- an I/O exception of some sort has occurred.
-
getStringAsBytes
private byte[] getStringAsBytes() throws java.io.UnsupportedEncodingException, java.nio.charset.CharacterCodingExceptionReturns the text string as an encoded byte array- Returns:
- the text string as an encoded byte array
- Throws:
java.io.UnsupportedEncodingExceptionjava.nio.charset.CharacterCodingException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractGraphicsCoord
-
-