Top Description Inners Fields Constructors Methods
de.rototor.pdfbox.graphics2d

public Class PdfBoxGraphics2D

extends Graphics2D
Class Inheritance
Imports
de.rototor.pdfbox.graphics2d.IPdfBoxGraphics2DColorMapper.IColorMapperEnv, .IPdfBoxGraphics2DDrawControl.IDrawControlEnv, .IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv, .IPdfBoxGraphics2DPaintApplier.IPaintEnv, org.apache.pdfbox.cos.COSName, .COSStream, org.apache.pdfbox.pdmodel.PDDocument, .PDPageContentStream, .PDResources, org.apache.pdfbox.pdmodel.common.PDRectangle, org.apache.pdfbox.pdmodel.documentinterchange.markedcontent.PDPropertyList, org.apache.pdfbox.pdmodel.graphics.color.PDColor, .PDColorSpace, .PDPattern, org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject, org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject, org.apache.pdfbox.pdmodel.graphics.pattern.PDTilingPattern, org.apache.pdfbox.pdmodel.graphics.shading.PDShading, org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceStream, org.apache.pdfbox.util.Matrix, java.awt.*, .RenderingHints.Key, java.awt.font.FontRenderContext, .GlyphVector, .TextAttribute, .TextLayout, java.awt.geom.AffineTransform, .Arc2D, .Area, .Ellipse2D, .Line2D, .NoninvertibleTransformException, .Path2D, .Point2D, .PathIterator, .Rectangle2D, .RoundRectangle2D, java.awt.image.BufferedImage, .BufferedImageOp, .ImageObserver, .RenderedImage, .WritableRaster, java.awt.image.renderable.RenderableImage, java.io.IOException, java.text.AttributedCharacterIterator, .AttributedString, java.util.ArrayList, .HashMap, .List, .Map

Graphics 2D Adapter for PDFBox.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private class

Field Summary

Modifier and TypeField and Description
private Color
private final AffineTransform
pack-priv final PDRectangle
private final Graphics2D
private BufferedImage
private Shape
private IPdfBoxGraphics2DColorMapper
pack-priv final IPdfBoxGraphics2DColorMapper.IColorMapperEnv
private Composite
private final PDPageContentStream
private final PdfBoxGraphics2D.CopyInfo
private final List<PdfBoxGraphics2D.CopyInfo>
private PDDocument
private IPdfBoxGraphics2DDrawControl
private final IPdfBoxGraphics2DDrawControl.IDrawControlEnv
public static boolean
ENABLE_CHILD_CREATING_DEBUG

Global Flag: If set to true the Callstack when creating a context is recorded.

private static final boolean
ENABLE_DEBUG_INTERNAL_CLIP

Internal Debug flag.

private static final boolean
ENABLE_DEBUG_UNKOWN_STROKE

Interal debugflag to see if an unkown stroke is mapped

private Font
private final IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv
private IPdfBoxGraphics2DFontTextDrawer
private boolean
hasPathOnStream

Do we currently have an active path on the content stream, which has not been closed?

private IPdfBoxGraphics2DImageEncoder
pack-priv final IPdfBoxGraphics2DImageEncoder.IPdfBoxGraphics2DImageEncoderEnv
private Paint
private IPdfBoxGraphics2DPaintApplier
private final PdfBoxGraphics2D.PaintApplyResult
private final PdfBoxGraphics2D.PaintEnvImpl
private final Map<RenderingHints.Key, Object>
private int
private Stroke
private AffineTransform
private final PDFormXObject
private Color

Constructor Summary

AccessConstructor and Description
public
PdfBoxGraphics2D(PDDocument
The document the graphics should be used to create a XForm in.
document
,
int
the width in pixel of the drawing area.
pixelWidth
,
int
the height in pixel of the drawing area.
pixelHeight
)

Create a PDfBox Graphics2D.

public
PdfBoxGraphics2D(PDDocument
The document the graphics should be used to create a XForm in.
document
,
float
the width in pixel of the drawing area.
pixelWidth
,
float
the height in pixel of the drawing area.
pixelHeight
)

Create a PDfBox Graphics2D.

public
PdfBoxGraphics2D(PDDocument
The document the graphics should be used to create a XForm in.
document
,
PDRectangle
Bounding Box of the graphics
bbox
)

pack-priv
private

Method Summary

Modifier and TypeMethod and Description
public void
addRenderingHints(Map<?, ?>
the rendering hints to be set
hints
)

Implements abstract java.awt.Graphics2D.addRenderingHints.

Sets the values of an arbitrary number of preferences for the rendering algorithms.

private PdfBoxGraphics2D.PaintApplyResult
applyPaint(Shape shapeToDraw)

private PdfBoxGraphics2D.PaintApplyResult
applyPaint(Paint paintToApply, Shape shapeToDraw)

private void
private void
applyStroke(Stroke
the stroke we should apply on the stream
strokeToApply
)

Internal usage only!

private float
private void
public void
clearRect(int
the x coordinate of the rectangle to clear.
x
,
int
the y coordinate of the rectangle to clear.
y
,
int
the width of the rectangle to clear.
width
,
int
the height of the rectangle to clear.
height
)

Implements abstract java.awt.Graphics.clearRect.

Clears the specified rectangle by filling it with the background color of the current drawing surface.

public void
clip(Shape
the Shape to be intersected with the current Clip. This method updates the current Clip.
shape
)

Implements abstract java.awt.Graphics2D.clip.

Intersects the current Clip with the interior of the specified Shape and sets the Clip to the resulting intersection.

public void
clipRect(int
the x coordinate of the rectangle to intersect the clip with
x
,
int
the y coordinate of the rectangle to intersect the clip with
y
,
int
the width of the rectangle to intersect the clip with
width
,
int
the height of the rectangle to intersect the clip with
height
)

Implements abstract java.awt.Graphics.clipRect.

Intersects the current clip with the specified rectangle.

private void
private void
public void
copyArea(int
the x coordinate of the source rectangle.
x
,
int
the y coordinate of the source rectangle.
y
,
int
the width of the source rectangle.
width
,
int
the height of the source rectangle.
height
,
int
the horizontal distance to copy the pixels.
dx
,
int
the vertical distance to copy the pixels.
dy
)

Implements abstract java.awt.Graphics.copyArea.

Copies an area of the component by a distance specified by dx and dy.

public PdfBoxGraphics2D

Returns:

a copy of this Graphics.
create
()

Implements abstract java.awt.Graphics.create.

Creates a copy of this graphics object.

public PdfBoxGraphics2D
create(int
the x coordinate.
x
,
int
the y coordinate.
y
,
int
the width of the clipping rectangle.
width
,
int
the height of the clipping rectangle.
height
)

Overrides java.awt.Graphics.create.

Creates a new Graphics object based on this Graphics object, but with a new translation and clip area.

public void
dispose()

Implements abstract java.awt.Graphics.dispose.

Disposes of this graphics context and releases any system resources that it is using.

private static void
public void
disposeDanglingChildGraphics()

Sometimes the users of create() don't correctly dispose() the child graphics they create.

public void
draw(Shape
the Shape to be rendered
s
)

Implements abstract java.awt.Graphics2D.draw.

Strokes the outline of a Shape using the settings of the current Graphics2D context.

public void
drawArc(int
the x coordinate of the upper-left corner of the arc to be drawn.
x
,
int
the y coordinate of the upper-left corner of the arc to be drawn.
y
,
int
the width of the arc to be drawn.
width
,
int
the height of the arc to be drawn.
height
,
int
the beginning angle.
startAngle
,
int
the angular extent of the arc, relative to the start angle.
arcAngle
)

Implements abstract java.awt.Graphics.drawArc.

Draws the outline of a circular or elliptical arc covering the specified rectangle.

public void
drawGlyphVector(GlyphVector
the GlyphVector to be rendered
g
,
float
the x position in User Space where the glyphs should be rendered
x
,
float
the y position in User Space where the glyphs should be rendered
y
)

Implements abstract java.awt.Graphics2D.drawGlyphVector.

Renders the text of the specified GlyphVector using the Graphics2D context's rendering attributes.

public void
drawImage(BufferedImage
the specified BufferedImage to be rendered. This method does nothing if img is null.
img
,
BufferedImageOp
the filter to be applied to the image before rendering
op
,
int
the x coordinate of the location in user space where the upper left corner of the image is rendered
x
,
int
the y coordinate of the location in user space where the upper left corner of the image is rendered
y
)

Implements abstract java.awt.Graphics2D.drawImage.

Renders a BufferedImage that is filtered with a BufferedImageOp.

public boolean
drawImage(Image
the specified image to be drawn. This method does nothing if img is null.
img
,
int
the x coordinate.
x
,
int
the y coordinate.
y
,
ImageObserver
object to be notified as more of the image is converted.
observer
)

Implements abstract java.awt.Graphics.drawImage.

Draws as much of the specified image as is currently available.

public boolean
drawImage(Image
the specified image to be drawn. This method does nothing if img is null.
img
,
int
the x coordinate.
x
,
int
the y coordinate.
y
,
int
the width of the rectangle.
width
,
int
the height of the rectangle.
height
,
ImageObserver
object to be notified as more of the image is converted.
observer
)

Implements abstract java.awt.Graphics.drawImage.

Draws as much of the specified image as has already been scaled to fit inside the specified rectangle.

public boolean
drawImage(Image
the specified image to be drawn. This method does nothing if img is null.
img
,
int
the x coordinate.
x
,
int
the y coordinate.
y
,
Color
the background color to paint under the non-opaque portions of the image.
bgcolor
,
ImageObserver
object to be notified as more of the image is converted.
observer
)

Implements abstract java.awt.Graphics.drawImage.

Draws as much of the specified image as is currently available.

public boolean
drawImage(Image
the specified image to be drawn. This method does nothing if img is null.
img
,
int
the x coordinate.
x
,
int
the y coordinate.
y
,
int
the width of the rectangle.
width
,
int
the height of the rectangle.
height
,
Color
the background color to paint under the non-opaque portions of the image.
bgcolor
,
ImageObserver
object to be notified as more of the image is converted.
observer
)

Implements abstract java.awt.Graphics.drawImage.

Draws as much of the specified image as has already been scaled to fit inside the specified rectangle.

public boolean
drawImage(Image
the specified image to be drawn. This method does nothing if img is null.
img
,
int
the x coordinate of the first corner of the destination rectangle.
dx1
,
int
the y coordinate of the first corner of the destination rectangle.
dy1
,
int
the x coordinate of the second corner of the destination rectangle.
dx2
,
int
the y coordinate of the second corner of the destination rectangle.
dy2
,
int
the x coordinate of the first corner of the source rectangle.
sx1
,
int
the y coordinate of the first corner of the source rectangle.
sy1
,
int
the x coordinate of the second corner of the source rectangle.
sx2
,
int
the y coordinate of the second corner of the source rectangle.
sy2
,
ImageObserver
object to be notified as more of the image is scaled and converted.
observer
)

Implements abstract java.awt.Graphics.drawImage.

Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface.

public boolean
drawImage(Image
the specified image to be rendered. This method does nothing if img is null.
img
,
AffineTransform
the transformation from image space into user space
xform
,
ImageObserver
the ImageObserver to be notified as more of the Image is converted
obs
)

Implements abstract java.awt.Graphics2D.drawImage.

Renders an image, applying a transform from image space into user space before drawing.

public boolean
drawImage(Image
the specified image to be drawn. This method does nothing if img is null.
img
,
int
the x coordinate of the first corner of the destination rectangle.
dx1
,
int
the y coordinate of the first corner of the destination rectangle.
dy1
,
int
the x coordinate of the second corner of the destination rectangle.
dx2
,
int
the y coordinate of the second corner of the destination rectangle.
dy2
,
int
the x coordinate of the first corner of the source rectangle.
sx1
,
int
the y coordinate of the first corner of the source rectangle.
sy1
,
int
the x coordinate of the second corner of the source rectangle.
sx2
,
int
the y coordinate of the second corner of the source rectangle.
sy2
,
Color
the background color to paint under the non-opaque portions of the image.
bgcolor
,
ImageObserver
object to be notified as more of the image is scaled and converted.
observer
)

Implements abstract java.awt.Graphics.drawImage.

Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface.

public void
drawInMarkedContentSequence(COSName
A COSName for to tag the marked content
tagName
,
IPdfBoxGraphics2DMarkedContentDrawer
is called with a (child) graphics to draw on. Please do *not* dispose() this graphics. Just draw on it. Any state changes on the given graphics will be reset after the drawing is finished
drawer
)

Draw on the Graphics2D and enclose the drawing command with a BMC/EMC content marking pair.

public void
drawInMarkedContentSequence(COSName
A COSName for to tag the marked content
tagName
,
PDPropertyList
The properties to put by the marked sequence
properties
,
IPdfBoxGraphics2DMarkedContentDrawer
is called with a (child) graphics to draw on. Please do *not* dispose() this graphics. Just draw on it. Any state changes on the given graphics will be reset after the drawing is finished
drawer
)

Draw on the Graphics2D and enclose the drawing command with a BDC/EMC content marking pair.

public void
drawLine(int
the first point's x coordinate.
x1
,
int
the first point's y coordinate.
y1
,
int
the second point's x coordinate.
x2
,
int
the second point's y coordinate.
y2
)

Implements abstract java.awt.Graphics.drawLine.

Draws a line, using the current color, between the points (x1, y1) and (x2, y2) in this graphics context's coordinate system.

public void
drawOval(int
the x coordinate of the upper left corner of the oval to be drawn.
x
,
int
the y coordinate of the upper left corner of the oval to be drawn.
y
,
int
the width of the oval to be drawn.
width
,
int
the height of the oval to be drawn.
height
)

Implements abstract java.awt.Graphics.drawOval.

Draws the outline of an oval.

public void
drawPolygon(int[]
an array of x coordinates.
xPoints
,
int[]
an array of y coordinates.
yPoints
,
int
the total number of points.
nPoints
)

Implements abstract java.awt.Graphics.drawPolygon.

Draws a closed polygon defined by arrays of x and y coordinates.

public void
drawPolyline(int[]
an array of x points
xPoints
,
int[]
an array of y points
yPoints
,
int
the total number of points
nPoints
)

Implements abstract java.awt.Graphics.drawPolyline.

Draws a sequence of connected lines defined by arrays of x and y coordinates.

public void
drawRect(int
the x coordinate of the rectangle to be drawn.
x
,
int
the y coordinate of the rectangle to be drawn.
y
,
int
the width of the rectangle to be drawn.
width
,
int
the height of the rectangle to be drawn.
height
)

Overrides java.awt.Graphics.drawRect.

Draws the outline of the specified rectangle.

public void
drawRenderableImage(RenderableImage
the image to be rendered. This method does nothing if img is null.
img
,
AffineTransform
the transformation from image space into user space
xform
)

Implements abstract java.awt.Graphics2D.drawRenderableImage.

Renders a RenderableImage, applying a transform from image space into user space before drawing.

public void
drawRenderedImage(RenderedImage
the image to be rendered. This method does nothing if img is null.
img
,
AffineTransform
the transformation from image space into user space
xform
)

Implements abstract java.awt.Graphics2D.drawRenderedImage.

Renders a RenderedImage, applying a transform from image space into user space before drawing.

public void
drawRoundRect(int
the x coordinate of the rectangle to be drawn.
x
,
int
the y coordinate of the rectangle to be drawn.
y
,
int
the width of the rectangle to be drawn.
width
,
int
the height of the rectangle to be drawn.
height
,
int
the horizontal diameter of the arc at the four corners.
arcWidth
,
int
the vertical diameter of the arc at the four corners.
arcHeight
)

Implements abstract java.awt.Graphics.drawRoundRect.

Draws an outlined round-cornered rectangle using this graphics context's current color.

public void
drawString(String
the string to be rendered
str
,
int
the x coordinate of the location where the String should be rendered
x
,
int
the y coordinate of the location where the String should be rendered
y
)

Implements abstract java.awt.Graphics2D.drawString.

Renders the text of the specified String, using the current text attribute state in the Graphics2D context.

public void
drawString(String
the String to be rendered
str
,
float
the x coordinate of the location where the String should be rendered
x
,
float
the y coordinate of the location where the String should be rendered
y
)

Implements abstract java.awt.Graphics2D.drawString.

Renders the text specified by the specified String, using the current text attribute state in the Graphics2D context.

public void
drawString(AttributedCharacterIterator
the iterator whose text is to be rendered
iterator
,
int
the x coordinate where the iterator's text is to be rendered
x
,
int
the y coordinate where the iterator's text is to be rendered
y
)

Implements abstract java.awt.Graphics2D.drawString.

Renders the text of the specified iterator applying its attributes in accordance with the specification of the TextAttribute class.

public void
drawString(AttributedCharacterIterator
the iterator whose text is to be rendered
iterator
,
float
the x coordinate where the iterator's text is to be rendered
x
,
float
the y coordinate where the iterator's text is to be rendered
y
)

Implements abstract java.awt.Graphics2D.drawString.

Renders the text of the specified iterator applying its attributes in accordance with the specification of the TextAttribute class.

private void
private void
public void
fill(Shape
the Shape to be filled
s
)

Implements abstract java.awt.Graphics2D.fill.

Fills the interior of a Shape using the settings of the Graphics2D context.

private void
fill(boolean useEvenOdd)

public void
fillArc(int
the x coordinate of the upper-left corner of the arc to be filled.
x
,
int
the y coordinate of the upper-left corner of the arc to be filled.
y
,
int
the width of the arc to be filled.
width
,
int
the height of the arc to be filled.
height
,
int
the beginning angle.
startAngle
,
int
the angular extent of the arc, relative to the start angle.
arcAngle
)

Implements abstract java.awt.Graphics.fillArc.

Fills a circular or elliptical arc covering the specified rectangle.

public void
fillOval(int
the x coordinate of the upper left corner of the oval to be filled.
x
,
int
the y coordinate of the upper left corner of the oval to be filled.
y
,
int
the width of the oval to be filled.
width
,
int
the height of the oval to be filled.
height
)

Implements abstract java.awt.Graphics.fillOval.

Fills an oval bounded by the specified rectangle with the current color.

public void
fillPolygon(int[]
an array of x coordinates.
xPoints
,
int[]
an array of y coordinates.
yPoints
,
int
the total number of points.
nPoints
)

Implements abstract java.awt.Graphics.fillPolygon.

Fills a closed polygon defined by arrays of x and y coordinates.

public void
fillRect(int
the x coordinate of the rectangle to be filled.
x
,
int
the y coordinate of the rectangle to be filled.
y
,
int
the width of the rectangle to be filled.
width
,
int
the height of the rectangle to be filled.
height
)

Implements abstract java.awt.Graphics.fillRect.

Fills the specified rectangle.

public void
fillRoundRect(int
the x coordinate of the rectangle to be filled.
x
,
int
the y coordinate of the rectangle to be filled.
y
,
int
the width of the rectangle to be filled.
width
,
int
the height of the rectangle to be filled.
height
,
int
the horizontal diameter of the arc at the four corners.
arcWidth
,
int
the vertical diameter of the arc at the four corners.
arcHeight
)

Implements abstract java.awt.Graphics.fillRoundRect.

Fills the specified rounded corner rectangle with the current color.

private String
private static String
public Color
getBackground()

Implements abstract java.awt.Graphics2D.getBackground.

Returns the background color used for clearing a region.

public Shape
getClip()

Implements abstract java.awt.Graphics.getClip.

Gets the current clipping area.

public Rectangle
getClipBounds()

Implements abstract java.awt.Graphics.getClipBounds.

Returns the bounding rectangle of the current clipping area.

public Color
getColor()

Implements abstract java.awt.Graphics.getColor.

Gets this graphics context's current color.

public Composite
getComposite()

Implements abstract java.awt.Graphics2D.getComposite.

Returns the current Composite in the Graphics2D context.

private AffineTransform
public GraphicsConfiguration
getDeviceConfiguration()

Implements abstract java.awt.Graphics2D.getDeviceConfiguration.

Returns the device configuration associated with this Graphics2D.

public Font
getFont()

Implements abstract java.awt.Graphics.getFont.

Gets the current font.

public FontMetrics
getFontMetrics(Font
the specified font
f
)

Implements abstract java.awt.Graphics.getFontMetrics.

Gets the font metrics for the specified font.

public FontRenderContext
getFontRenderContext()

Implements abstract java.awt.Graphics2D.getFontRenderContext.

Get the rendering context of the Font within this Graphics2D context.

public Paint
getPaint()

Implements abstract java.awt.Graphics2D.getPaint.

Returns the current Paint of the Graphics2D context.

public Object
getRenderingHint(RenderingHints.Key
the key corresponding to the hint to get.
hintKey
)

Implements abstract java.awt.Graphics2D.getRenderingHint.

Returns the value of a single preference for the rendering algorithms.

public RenderingHints
getRenderingHints()

Implements abstract java.awt.Graphics2D.getRenderingHints.

Gets the preferences for the rendering algorithms.

public PDResources

Returns:

the PDResources of the resulting XForm
getResources
()

Sometimes you need to access the PDResources and add special resources to it for some stuff (e.g. patterns of embedded PDFs or simmilar).

public Stroke
getStroke()

Implements abstract java.awt.Graphics2D.getStroke.

Returns the current Stroke in the Graphics2D context.

public AffineTransform
getTransform()

Implements abstract java.awt.Graphics2D.getTransform.

Returns a copy of the current Transform in the Graphics2D context.

public PDFormXObject

Returns:

the PDFormXObject which resulted in this graphics
getXFormObject
()

*AFTER* you have disposed() this Graphics2D you can access the XForm

public boolean
hit(Rectangle
the area in device space to check for a hit
rect
,
Shape
the Shape to check for a hit
s
,
boolean
flag used to choose between testing the stroked or the filled shape. If the flag is true, the Stroke outline is tested. If the flag is false, the filled Shape is tested.
onStroke
)

Implements abstract java.awt.Graphics2D.hit.

Checks whether or not the specified Shape intersects the specified Rectangle, which is in device space.

pack-priv void
internalClip(boolean
true when we should use the evenOdd rule.
useEvenOdd
)

Perform a clip, but only if we really have an active clipping path

private static boolean
isFinite(float f)

Float#isFinite() is JDK 8+.

private static boolean

Returns:

true when all required values are finite
isFinite
(float[] coords, int count)

pack-priv void
markPathIsOnStream()

Set an internal flag that some path - which may be added from the paint applyer to the content stream or by walkShape() - is on the content stream.

public void
rotate(double
the angle of rotation in radians
theta
)

Implements abstract java.awt.Graphics2D.rotate.

Concatenates the current Graphics2D Transform with a rotation transform.

public void
rotate(double
the angle of rotation in radians
theta
,
double
the x coordinate of the origin of the rotation
x
,
double
the y coordinate of the origin of the rotation
y
)

Implements abstract java.awt.Graphics2D.rotate.

Concatenates the current Graphics2D Transform with a translated rotation transform.

public void
scale(double
the amount by which X coordinates in subsequent rendering operations are multiplied relative to previous rendering operations.
sx
,
double
the amount by which Y coordinates in subsequent rendering operations are multiplied relative to previous rendering operations.
sy
)

Implements abstract java.awt.Graphics2D.scale.

Concatenates the current Graphics2D Transform with a scaling transformation Subsequent rendering is resized according to the specified scaling factors relative to the previous scaling.

public void
setBackground(Color
the background color that is used in subsequent calls to clearRect
color
)

Implements abstract java.awt.Graphics2D.setBackground.

Sets the background color for the Graphics2D context.

public void
setClip(int
the x coordinate of the new clip rectangle.
x
,
int
the y coordinate of the new clip rectangle.
y
,
int
the width of the new clip rectangle.
width
,
int
the height of the new clip rectangle.
height
)

Implements abstract java.awt.Graphics.setClip.

Sets the current clip to the rectangle specified by the given coordinates.

public void
setClip(Shape
the Shape to use to set the clip. Passing null clears the current clip.
clip
)

Implements abstract java.awt.Graphics.setClip.

Sets the current clipping area to an arbitrary clip shape.

public void
setColor(Color
the new rendering color.
color
)

Implements abstract java.awt.Graphics.setColor.

Sets this graphics context's current color to the specified color.

public void
setColorMapper(IPdfBoxGraphics2DColorMapper
the color mapper which maps Color to PDColor.
colorMapper
)

Set a new color mapper.

public void
setComposite(Composite
the Composite object to be used for rendering
comp
)

Implements abstract java.awt.Graphics2D.setComposite.

Sets the Composite for the Graphics2D context.

public void
setDrawControl(IPdfBoxGraphics2DDrawControl
the draw control
drawControl
)

Set a new draw control.

public void
setFont(Font
the font.
font
)

Implements abstract java.awt.Graphics.setFont.

Sets this graphics context's font to the specified font.

public void
setFontTextDrawer(IPdfBoxGraphics2DFontTextDrawer
The text drawer, which can draw text using fonts
fontTextDrawer
)

Set an optional text drawer.

public void
setImageEncoder(IPdfBoxGraphics2DImageEncoder
the image encoder, which encodes an image as PDImageXForm.
imageEncoder
)

Set a new image encoder

public void
setPaint(Paint
the Paint object to be used to generate color during the rendering process, or null
paint
)

Implements abstract java.awt.Graphics2D.setPaint.

Sets the Paint attribute for the Graphics2D context.

public void
setPaintApplier(IPdfBoxGraphics2DPaintApplier
the paint applier responsible for mapping the paint correctly
paintApplier
)

Set a new paint applier.

public void
setPaintMode()

Implements abstract java.awt.Graphics.setPaintMode.

Sets the paint mode of this graphics context to overwrite the destination with this graphics context's current color.

public void
setRenderingHint(RenderingHints.Key
the key of the hint to be set.
hintKey
,
Object
the value indicating preferences for the specified hint category.
hintValue
)

Implements abstract java.awt.Graphics2D.setRenderingHint.

Sets the value of a single preference for the rendering algorithms.

public void
setRenderingHints(Map<?, ?>
the rendering hints to be set
hints
)

Implements abstract java.awt.Graphics2D.setRenderingHints.

Replaces the values of all preferences for the rendering algorithms with the specified hints.

public void
setStroke(Stroke
the Stroke object to be used to stroke a Shape during the rendering process
stroke
)

Implements abstract java.awt.Graphics2D.setStroke.

Sets the Stroke for the Graphics2D context.

public void
setTransform(AffineTransform
the AffineTransform that was retrieved from the getTransform method
Tx
)

Implements abstract java.awt.Graphics2D.setTransform.

Overwrites the Transform in the Graphics2D context.

public void
setXORMode(Color
the XORMode Color
c1
)

Implements abstract java.awt.Graphics.setXORMode.

XOR Mode is currently not implemented as it's not possible in PDF.

public void
shear(double
the multiplier by which coordinates are shifted in the positive X axis direction as a function of their Y coordinate
shx
,
double
the multiplier by which coordinates are shifted in the positive Y axis direction as a function of their X coordinate
shy
)

Implements abstract java.awt.Graphics2D.shear.

Concatenates the current Graphics2D Transform with a shearing transform.

pack-priv static <T> T
throwException(Exception
exception to rethrow
e
)

Internal helper function

public void
transform(AffineTransform
the AffineTransform object to be composed with the current Transform
Tx
)

Implements abstract java.awt.Graphics2D.transform.

Composes an AffineTransform object with the Transform in this Graphics2D according to the rule last-specified-first-applied.

public void
translate(int
the specified x coordinate
x
,
int
the specified y coordinate
y
)

Implements abstract java.awt.Graphics2D.translate.

Translates the origin of the Graphics2D context to the point (x, y) in the current coordinate system.

public void
translate(double
the distance to translate along the x-axis
tx
,
double
the distance to translate along the y-axis
ty
)

Implements abstract java.awt.Graphics2D.translate.

Concatenates the current Graphics2D Transform with a translation transform.

private void
private void
walkAndFillShape(Shape shapeToFill)

private boolean

Returns:

true if we need to use the even odd winding rule
walkShape
(Shape clip)

Walk the path and return true if we need to use the even odd winding rule.

Inherited from java.awt.Graphics2D:
draw3DRectfill3DRect