Class PCLGraphics2D
java.lang.Object
java.awt.Graphics
java.awt.Graphics2D
org.apache.xmlgraphics.java2d.AbstractGraphics2D
org.apache.fop.render.pcl.PCLGraphics2D
- All Implemented Interfaces:
Cloneable
public class PCLGraphics2D
extends org.apache.xmlgraphics.java2d.AbstractGraphics2D
Graphics2D implementation implementing PCL and HP GL/2.
Note: This class cannot be used stand-alone to create full PCL documents.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate static final booleanprivate Graphics2DUsed to create proper font metricsprotected PCLGeneratorThe PCL generatorFields inherited from class org.apache.xmlgraphics.java2d.AbstractGraphics2D
gc, inPossibleRecursion, textAsShapes -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new PCLGraphics2D.Copy constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyPaint(Paint paint) Applies a new Paint object.protected voidapplyStroke(Stroke stroke) Applies a new Stroke object.private voidbezierAbsolute(double x1, double y1, double x2, double y2, double x3, double y3, StringBuffer sb) protected BufferedImagebuildBufferedImage(Dimension size) Creates a buffered image.voidcopyArea(int x, int y, int width, int height, int dx, int dy) create()voiddispose()voidbooleandrawImage(Image img, int x, int y, int width, int height, ImageObserver observer) booleandrawImage(Image img, int x, int y, ImageObserver observer) voiddrawRenderableImage(RenderableImage img, AffineTransform xform) voiddrawRenderedImage(RenderedImage img, AffineTransform xform) voiddrawString(String s, float x, float y) voiddrawString(AttributedCharacterIterator iterator, float x, float y) voidprivate voidfillPolygon(int windingRule, StringBuffer sb) voidCentral handler for IOExceptions for this class.protected voidRaises an UnsupportedOperationException if this instance is configured to do so and an unsupported feature has been requested.private voidpenDown(StringBuffer sb) private voidpenUp(StringBuffer sb) private voidplotAbsolute(double x, double y, StringBuffer sb) voidProcesses a path iterator generating the nexessary painting operations.voidProcesses a path iterator generating the nexessary painting operations.private voidquadraticBezierAbsolute(double originX, double originY, double x1, double y1, double x2, double y2, StringBuffer sb) voidsetClippingDisabled(boolean value) Allows to disable all clipping operations.voidsetGraphicContext(org.apache.xmlgraphics.java2d.GraphicContext c) Sets the GraphicContextvoidsetXORMode(Color c1) private voidMethods inherited from class org.apache.xmlgraphics.java2d.AbstractGraphics2D
addRenderingHints, clearRect, clip, clipRect, drawArc, drawGlyphVector, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawLine, drawOval, drawPolygon, drawPolyline, drawRect, drawRoundRect, drawString, drawString, fillArc, fillOval, fillPolygon, fillRect, fillRoundRect, getBackground, getClip, getClipBounds, getColor, getComposite, getFont, getFontRenderContext, getGraphicContext, getPaint, getRenderingHint, getRenderingHints, getStroke, getTransform, hit, rotate, rotate, scale, setBackground, setClip, setClip, setColor, setComposite, setFont, setPaint, setPaintMode, setRenderingHint, setRenderingHints, setStroke, setTransform, shear, transform, translate, translateMethods inherited from class Graphics2D
draw3DRect, fill3DRectMethods inherited from class Graphics
create, drawBytes, drawChars, drawPolygon, fillPolygon, finalize, getClipBounds, getClipRect, getFontMetrics, hitClip, toString
-
Field Details
-
gen
The PCL generator -
FAIL_ON_UNSUPPORTED_FEATURE
private static final boolean FAIL_ON_UNSUPPORTED_FEATURE- See Also:
-
clippingDisabled
private boolean clippingDisabled -
fmg
Used to create proper font metrics
-
-
Constructor Details
-
PCLGraphics2D
Create a new PCLGraphics2D.- Parameters:
gen- the PCL Generator to paint with
-
PCLGraphics2D
-
-
Method Details
-
create
-
dispose
-
setGraphicContext
public void setGraphicContext(org.apache.xmlgraphics.java2d.GraphicContext c) Sets the GraphicContext- Parameters:
c- GraphicContext to use
-
setClippingDisabled
public void setClippingDisabled(boolean value) Allows to disable all clipping operations.- Parameters:
value- true if clipping should be disabled.
-
handleIOException
Central handler for IOExceptions for this class.- Parameters:
ioe- IOException to handle
-
handleUnsupportedFeature
Raises an UnsupportedOperationException if this instance is configured to do so and an unsupported feature has been requested. Clients can make use of this to fall back to a more compatible way of painting a PCL graphic.- Parameters:
msg- the error message to be displayed
-
getDeviceConfiguration
- Specified by:
getDeviceConfigurationin classGraphics2D
-
applyStroke
Applies a new Stroke object.- Parameters:
stroke- Stroke object to use- Throws:
IOException- In case of an I/O problem
-
applyPaint
Applies a new Paint object.- Parameters:
paint- Paint object to use- Throws:
IOException- In case of an I/O problem
-
writeClip
- Throws:
IOException
-
draw
- Specified by:
drawin classGraphics2D
-
fill
- Specified by:
fillin classGraphics2D
-
processPathIteratorStroke
Processes a path iterator generating the nexessary painting operations.- Parameters:
iter- PathIterator to process- Throws:
IOException- In case of an I/O problem.
-
processPathIteratorFill
Processes a path iterator generating the nexessary painting operations.- Parameters:
iter- PathIterator to process- Throws:
IOException- In case of an I/O problem.
-
fillPolygon
-
plotAbsolute
-
bezierAbsolute
private void bezierAbsolute(double x1, double y1, double x2, double y2, double x3, double y3, StringBuffer sb) -
quadraticBezierAbsolute
private void quadraticBezierAbsolute(double originX, double originY, double x1, double y1, double x2, double y2, StringBuffer sb) -
penDown
-
penUp
-
drawString
- Specified by:
drawStringin classGraphics2D
-
drawString
- Overrides:
drawStringin classorg.apache.xmlgraphics.java2d.AbstractGraphics2D
-
drawRenderedImage
- Specified by:
drawRenderedImagein classGraphics2D
-
drawRenderableImage
- Specified by:
drawRenderableImagein classGraphics2D
-
drawImage
-
drawImage
-
copyArea
-
setXORMode
- Specified by:
setXORModein classGraphics
-
buildBufferedImage
Creates a buffered image.- Parameters:
size- dimensions of the image to be created- Returns:
- the buffered image
-
getFontMetrics
- Specified by:
getFontMetricsin classGraphics
-