Package de.rototor.pdfbox.graphics2d
Class PdfBoxGraphics2D.PaintEnvImpl
- java.lang.Object
-
- de.rototor.pdfbox.graphics2d.PdfBoxGraphics2D.PaintEnvImpl
-
- All Implemented Interfaces:
IPdfBoxGraphics2DPaintApplier.IPaintEnv
- Enclosing class:
- PdfBoxGraphics2D
private class PdfBoxGraphics2D.PaintEnvImpl extends java.lang.Object implements IPdfBoxGraphics2DPaintApplier.IPaintEnv
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
hasShapeBeenWalked
private java.awt.Shape
shapeToDraw
private boolean
useEvenOdd
-
Constructor Summary
Constructors Modifier Constructor Description private
PaintEnvImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
ensureShapeIsWalked()
Call this to ensure that the current shape has been walked on the content stream.IPdfBoxGraphics2DColorMapper
getColorMapper()
java.awt.Composite
getComposite()
org.apache.pdfbox.pdmodel.PDDocument
getDocument()
PdfBoxGraphics2D
getGraphics2D()
IPdfBoxGraphics2DImageEncoder
getImageEncoder()
org.apache.pdfbox.pdmodel.PDResources
getResources()
java.awt.Shape
getShapeToDraw()
The shape information is need to be able to correctly render grandients.java.awt.Color
getXORMode()
-
-
-
Method Detail
-
getShapeToDraw
public java.awt.Shape getShapeToDraw()
Description copied from interface:IPdfBoxGraphics2DPaintApplier.IPaintEnv
The shape information is need to be able to correctly render grandients.- Specified by:
getShapeToDraw
in interfaceIPdfBoxGraphics2DPaintApplier.IPaintEnv
- Returns:
- get the shape which will be drawn or filled with this paint. Null is returned if no shape is known.
-
ensureShapeIsWalked
public void ensureShapeIsWalked() throws java.io.IOException
Description copied from interface:IPdfBoxGraphics2DPaintApplier.IPaintEnv
Call this to ensure that the current shape has been walked on the content stream. You are not allowed to do any graphics state changes after this, as this would be illegal in PDF. (But most PDF reader render this fine anyway...)
This mostly only needed for ShadedFills- Specified by:
ensureShapeIsWalked
in interfaceIPdfBoxGraphics2DPaintApplier.IPaintEnv
- Throws:
java.io.IOException
-
getColorMapper
public IPdfBoxGraphics2DColorMapper getColorMapper()
- Specified by:
getColorMapper
in interfaceIPdfBoxGraphics2DPaintApplier.IPaintEnv
- Returns:
- the color mapper
-
getImageEncoder
public IPdfBoxGraphics2DImageEncoder getImageEncoder()
- Specified by:
getImageEncoder
in interfaceIPdfBoxGraphics2DPaintApplier.IPaintEnv
- Returns:
- the image encoder
-
getDocument
public org.apache.pdfbox.pdmodel.PDDocument getDocument()
- Specified by:
getDocument
in interfaceIPdfBoxGraphics2DPaintApplier.IPaintEnv
- Returns:
- the document
-
getResources
public org.apache.pdfbox.pdmodel.PDResources getResources()
- Specified by:
getResources
in interfaceIPdfBoxGraphics2DPaintApplier.IPaintEnv
- Returns:
- the resource of the content stream
-
getComposite
public java.awt.Composite getComposite()
- Specified by:
getComposite
in interfaceIPdfBoxGraphics2DPaintApplier.IPaintEnv
- Returns:
- the
Graphics2D
Composite
-
getGraphics2D
public PdfBoxGraphics2D getGraphics2D()
- Specified by:
getGraphics2D
in interfaceIPdfBoxGraphics2DPaintApplier.IPaintEnv
- Returns:
- The PdfBoxGraphics2D
-
getXORMode
public java.awt.Color getXORMode()
- Specified by:
getXORMode
in interfaceIPdfBoxGraphics2DPaintApplier.IPaintEnv
- Returns:
- the
Graphics2D
XOR ModeColor
or null if paint mode is active.
-
-