public class GraphicsObject extends AbstractDataObject
AbstractAFPObject.Category, AbstractAFPObject.Type
Modifier and Type | Field and Description |
---|---|
protected List<GraphicsData> |
objects
list of objects contained within this container
|
factory, objectEnvironmentGroup
name
triplets
LOG, SF_CLASS, SF_HEADER_LENGTH
Constructor and Description |
---|
GraphicsObject(Factory factory,
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(String str,
int x,
int y,
CharacterSet charSet)
Adds a string
|
void |
beginArea()
Begins a graphics area (start of fill)
|
void |
endArea()
Ends a graphics area (end of fill)
|
void |
endProlog()
Ends the prolog.
|
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(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(float lineWidth)
Sets the line width
|
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).
|
String |
toString() |
protected void |
writeContent(OutputStream os)
Helper method to write the contents of the Object.
|
protected void |
writeEnd(OutputStream os)
Helper method to write the end of the Object.
|
protected void |
writeStart(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, setFullyQualifiedName, setObjectClassification, writeTriplets
writeToStream
copySF, truncate, writeChunksToStream, writeObjects
protected List<GraphicsData> objects
public void setViewport(AFPDataObjectInfo dataObjectInfo)
setViewport
in class AbstractDataObject
dataObjectInfo
- the object area infopublic void addObject(StructuredData object)
object
- the structured datapublic void setColor(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 setLineWidth(float 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(String str, int x, int y, CharacterSet charSet)
str
- the stringx
- the x coordinatey
- the y coordinatecharSet
- the character set associated with the stringpublic void beginArea()
public void endArea()
public void endProlog()
public 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(OutputStream os) throws IOException
writeStart
in class AbstractDataObject
os
- The stream to write toIOException
- throws an I/O exception if one occurredprotected void writeContent(OutputStream os) throws IOException
writeContent
in class AbstractDataObject
os
- The stream to write toIOException
- throws an I/O exception if one occurredprotected void writeEnd(OutputStream os) throws IOException
writeEnd
in class AbstractStructuredObject
os
- The stream to write toIOException
- an I/O exception if one occurredCopyright © 2025 Apache Software Foundation. All rights reserved.