public class GraphicsObject extends AbstractDataObject
AbstractAFPObject.Category, AbstractAFPObject.Type
Modifier and Type | Field and Description |
---|---|
protected java.util.List |
objects
list of objects contained within this container
|
factory, objectEnvironmentGroup
name
triplets
log, SF_CLASS, SF_HEADER
Constructor and Description |
---|
GraphicsObject(Factory factory,
java.lang.String name)
Default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addBox(int[] coords)
Adds a box at the given coordinates
|
void |
addFillet(int[] coords)
Adds a fillet (curve) at the given coordinates
|
void |
addFillet(int[] coords,
boolean relative)
Adds a fillet (curve) at the given coordinates
|
void |
addFullArc(int x,
int y,
int mh,
int mhr)
Adds a full arc
|
void |
addImage(int x,
int y,
int width,
int height,
byte[] imgData)
Adds an image
|
void |
addLine(int[] coords)
Adds a line at the given x/y coordinates
|
void |
addLine(int[] coords,
boolean relative)
Adds a line at the given x/y coordinates
|
void |
addObject(StructuredData object) |
void |
addString(java.lang.String str,
int x,
int y)
Adds a string
|
void |
beginArea()
Begins a graphics area (start of fill)
|
void |
endArea()
Ends a graphics area (end of fill)
|
void |
newSegment()
Creates a new graphics segment
|
void |
setArcParams(int xmaj,
int ymin,
int xmin,
int ymaj)
Sets the arc parameters
|
void |
setCharacterSet(int characterSet)
Sets the character set to use
|
void |
setColor(java.awt.Color color)
Sets the current color
|
void |
setColorConverter(org.apache.xmlgraphics.java2d.color.ColorConverter colorConverter)
Sets the color converter
|
void |
setComplete(boolean complete)
Sets whether or not this object is complete or not
|
void |
setCurrentPosition(int[] coords)
Sets the current position
|
void |
setFill(boolean fill)
Sets whether the following shape is to be filled.
|
void |
setLineType(byte lineType)
Sets the line type
|
void |
setLineWidth(int lineWidth)
Sets the line width
|
void |
setPatternSymbol(byte patternSymbol)
Sets the fill pattern of the next shape.
|
void |
setViewport(AFPDataObjectInfo dataObjectInfo)
Sets the object view port (area position and size).
|
java.lang.String |
toString() |
protected void |
writeContent(java.io.OutputStream os)
Helper method to write the contents of the Object.
|
protected void |
writeEnd(java.io.OutputStream os)
Helper method to write the end of the Object.
|
protected void |
writeStart(java.io.OutputStream os)
Helper method to write the start of the Object.
|
getObjectEnvironmentGroup, isComplete, isStarted, setStarted
copySF, getName, getNameBytes, getNameLength, setName
addTriplet, addTriplets, getFullyQualifiedName, getTripletDataLength, getTriplets, hasTriplet, hasTriplets, setComment, setFullyQualifiedName, setObjectClassification, writeTriplets
writeToStream
copyChunks, copySF, truncate, writeChunksToStream, writeObjects
protected java.util.List objects
public GraphicsObject(Factory factory, java.lang.String name)
factory
- the object factoryname
- the name of graphics objectpublic void setViewport(AFPDataObjectInfo dataObjectInfo)
setViewport
in class AbstractDataObject
dataObjectInfo
- the object area infopublic void addObject(StructuredData object)
public void setColor(java.awt.Color color)
color
- the active color to usepublic void setColorConverter(org.apache.xmlgraphics.java2d.color.ColorConverter colorConverter)
colorConverter
- ColorConverter to filter the color
when creating a GraphicsSetProcessColor.public void setCurrentPosition(int[] coords)
coords
- the x and y coordinates of the current positionpublic void setLineWidth(int lineWidth)
lineWidth
- the line width multiplierpublic void setLineType(byte lineType)
lineType
- the line typepublic void setFill(boolean fill)
fill
- true if the following shape is to be filledpublic void setPatternSymbol(byte patternSymbol)
patternSymbol
- the fill pattern of the next shapepublic void setCharacterSet(int characterSet)
characterSet
- the character set (font) referencepublic void addLine(int[] coords)
coords
- the x/y coordinates (can be a series)public void addLine(int[] coords, boolean relative)
coords
- the x/y coordinates (can be a series)relative
- relative true for a line at current position (relative to)public void addBox(int[] coords)
coords
- the x/y coordinatespublic void addFillet(int[] coords)
coords
- the x/y coordinatespublic void addFillet(int[] coords, boolean relative)
coords
- the x/y coordinatesrelative
- relative true for a fillet (curve) at current position (relative to)public void setArcParams(int xmaj, int ymin, int xmin, int ymaj)
xmaj
- the maximum value of the x coordinateymin
- the minimum value of the y coordinatexmin
- the minimum value of the x coordinateymaj
- the maximum value of the y coordinatepublic void addFullArc(int x, int y, int mh, int mhr)
x
- the x coordinatey
- the y coordinatemh
- the integer portion of the multipliermhr
- the fractional portion of the multiplierpublic void addImage(int x, int y, int width, int height, byte[] imgData)
x
- the x coordinatey
- the y coordinatewidth
- the image widthheight
- the image heightimgData
- the image datapublic void addString(java.lang.String str, int x, int y)
str
- the stringx
- the x coordinatey
- the y coordinatepublic void beginArea()
public void endArea()
public java.lang.String toString()
toString
in class AbstractNamedAFPObject
public void newSegment()
public void setComplete(boolean complete)
setComplete
in interface Completable
setComplete
in class AbstractDataObject
complete
- true if this object is completeprotected void writeStart(java.io.OutputStream os) throws java.io.IOException
writeStart
in class AbstractDataObject
os
- The stream to write tojava.io.IOException
- throws an I/O exception if one occurredprotected void writeContent(java.io.OutputStream os) throws java.io.IOException
writeContent
in class AbstractDataObject
os
- The stream to write tojava.io.IOException
- throws an I/O exception if one occurredprotected void writeEnd(java.io.OutputStream os) throws java.io.IOException
writeEnd
in class AbstractStructuredObject
os
- The stream to write tojava.io.IOException
- an I/O exception if one occurredCopyright 1999-2010 The Apache Software Foundation. All Rights Reserved.