Package org.apache.fop.render.pcl
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
Fields inherited from class org.apache.xmlgraphics.java2d.AbstractGraphics2D
gc, inPossibleRecursion, textAsShapes
-
Constructor Summary
ConstructorDescriptionCreate a new PCLGraphics2D.Copy constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected void
applyPaint
(Paint paint) Applies a new Paint object.protected void
applyStroke
(Stroke stroke) Applies a new Stroke object.protected BufferedImage
buildBufferedImage
(Dimension size) Creates a buffered image.void
copyArea
(int x, int y, int width, int height, int dx, int dy) create()
void
dispose()
void
boolean
drawImage
(Image img, int x, int y, int width, int height, ImageObserver observer) boolean
drawImage
(Image img, int x, int y, ImageObserver observer) void
drawRenderableImage
(RenderableImage img, AffineTransform xform) void
drawRenderedImage
(RenderedImage img, AffineTransform xform) void
drawString
(String s, float x, float y) void
drawString
(AttributedCharacterIterator iterator, float x, float y) void
void
Central handler for IOExceptions for this class.protected void
Raises an UnsupportedOperationException if this instance is configured to do so and an unsupported feature has been requested.void
Processes a path iterator generating the nexessary painting operations.void
Processes a path iterator generating the nexessary painting operations.void
setClippingDisabled
(boolean value) Allows to disable all clipping operations.void
setGraphicContext
(org.apache.xmlgraphics.java2d.GraphicContext c) Sets the GraphicContextvoid
setXORMode
(Color c1) Methods 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, translate
Methods inherited from class java.awt.Graphics2D
draw3DRect, fill3DRect
Methods inherited from class java.awt.Graphics
create, drawBytes, drawChars, drawPolygon, fillPolygon, finalize, getClipBounds, getClipRect, getFontMetrics, hitClip, toString
-
Field Details
-
gen
The PCL generator
-
-
Constructor Details
-
PCLGraphics2D
Create a new PCLGraphics2D.- Parameters:
gen
- the PCL Generator to paint with
-
PCLGraphics2D
Copy constructor- Parameters:
g
- parent PCLGraphics2D
-
-
Method Details
-
create
-
dispose
public void 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:
getDeviceConfiguration
in 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
-
draw
- Specified by:
draw
in classGraphics2D
-
fill
- Specified by:
fill
in 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.
-
drawString
- Specified by:
drawString
in classGraphics2D
-
drawString
- Overrides:
drawString
in classorg.apache.xmlgraphics.java2d.AbstractGraphics2D
-
drawRenderedImage
- Specified by:
drawRenderedImage
in classGraphics2D
-
drawRenderableImage
- Specified by:
drawRenderableImage
in classGraphics2D
-
drawImage
-
drawImage
-
copyArea
public void copyArea(int x, int y, int width, int height, int dx, int dy) -
setXORMode
- Specified by:
setXORMode
in classGraphics
-
buildBufferedImage
Creates a buffered image.- Parameters:
size
- dimensions of the image to be created- Returns:
- the buffered image
-
getFontMetrics
- Specified by:
getFontMetrics
in classGraphics
-