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 booleanhasShapeBeenWalkedprivate java.awt.ShapeshapeToDrawprivate booleanuseEvenOdd
-
Constructor Summary
Constructors Modifier Constructor Description privatePaintEnvImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidensureShapeIsWalked()Call this to ensure that the current shape has been walked on the content stream.IPdfBoxGraphics2DColorMappergetColorMapper()java.awt.CompositegetComposite()org.apache.pdfbox.pdmodel.PDDocumentgetDocument()PdfBoxGraphics2DgetGraphics2D()IPdfBoxGraphics2DImageEncodergetImageEncoder()org.apache.pdfbox.pdmodel.PDResourcesgetResources()java.awt.ShapegetShapeToDraw()The shape information is need to be able to correctly render grandients.java.awt.ColorgetXORMode()
-
-
-
Method Detail
-
getShapeToDraw
public java.awt.Shape getShapeToDraw()
Description copied from interface:IPdfBoxGraphics2DPaintApplier.IPaintEnvThe shape information is need to be able to correctly render grandients.- Specified by:
getShapeToDrawin 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.IOExceptionDescription copied from interface:IPdfBoxGraphics2DPaintApplier.IPaintEnvCall 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:
ensureShapeIsWalkedin interfaceIPdfBoxGraphics2DPaintApplier.IPaintEnv- Throws:
java.io.IOException
-
getColorMapper
public IPdfBoxGraphics2DColorMapper getColorMapper()
- Specified by:
getColorMapperin interfaceIPdfBoxGraphics2DPaintApplier.IPaintEnv- Returns:
- the color mapper
-
getImageEncoder
public IPdfBoxGraphics2DImageEncoder getImageEncoder()
- Specified by:
getImageEncoderin interfaceIPdfBoxGraphics2DPaintApplier.IPaintEnv- Returns:
- the image encoder
-
getDocument
public org.apache.pdfbox.pdmodel.PDDocument getDocument()
- Specified by:
getDocumentin interfaceIPdfBoxGraphics2DPaintApplier.IPaintEnv- Returns:
- the document
-
getResources
public org.apache.pdfbox.pdmodel.PDResources getResources()
- Specified by:
getResourcesin interfaceIPdfBoxGraphics2DPaintApplier.IPaintEnv- Returns:
- the resource of the content stream
-
getComposite
public java.awt.Composite getComposite()
- Specified by:
getCompositein interfaceIPdfBoxGraphics2DPaintApplier.IPaintEnv- Returns:
- the
Graphics2DComposite
-
getGraphics2D
public PdfBoxGraphics2D getGraphics2D()
- Specified by:
getGraphics2Din interfaceIPdfBoxGraphics2DPaintApplier.IPaintEnv- Returns:
- The PdfBoxGraphics2D
-
getXORMode
public java.awt.Color getXORMode()
- Specified by:
getXORModein interfaceIPdfBoxGraphics2DPaintApplier.IPaintEnv- Returns:
- the
Graphics2DXOR ModeColoror null if paint mode is active.
-
-