org.apache.fop.render.pcl

Class PCLGraphics2D


public class PCLGraphics2D
extends AbstractGraphics2D

Graphics2D implementation implementing PCL and HP GL/2. Note: This class cannot be used stand-alone to create full PCL documents.

Field Summary

protected PCLGenerator
gen
The PCL generator

Constructor Summary

PCLGraphics2D(PCLGenerator gen)
Create a new PCLGraphics2D.
PCLGraphics2D(PCLGraphics2D g)
Copy constructor

Method Summary

protected 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)
Graphics
create()
void
dispose()
void
draw(Shape s)
boolean
drawImage(Image img, int x, int y, ImageObserver observer)
boolean
drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
void
drawRenderableImage(RenderableImage img, AffineTransform xform)
void
drawRenderedImage(RenderedImage img, AffineTransform xform)
void
drawString(AttributedCharacterIterator iterator, float x, float y)
void
drawString(String s, float x, float y)
void
fill(Shape s)
GraphicsConfiguration
getDeviceConfiguration()
java.awt.FontMetrics
getFontMetrics(java.awt.Font f)
void
handleIOException(IOException ioe)
Central handler for IOExceptions for this class.
protected void
handleUnsupportedFeature(String msg)
Raises an UnsupportedOperationException if this instance is configured to do so and an unsupported feature has been requested.
void
processPathIteratorFill(PathIterator iter)
Processes a path iterator generating the nexessary painting operations.
void
processPathIteratorStroke(PathIterator iter)
Processes a path iterator generating the nexessary painting operations.
void
setClippingDisabled(boolean value)
Allows to disable all clipping operations.
void
setGraphicContext(GraphicContext c)
Sets the GraphicContext
void
setXORMode(Color c1)

Field Details

gen

protected PCLGenerator gen
The PCL generator

Constructor Details

PCLGraphics2D

public PCLGraphics2D(PCLGenerator gen)
Create a new PCLGraphics2D.
Parameters:
gen - the PCL Generator to paint with

PCLGraphics2D

public PCLGraphics2D(PCLGraphics2D g)
Copy constructor
Parameters:
g - parent PCLGraphics2D

Method Details

applyPaint

protected void applyPaint(Paint paint)
            throws IOException
Applies a new Paint object.
Parameters:
paint - Paint object to use

applyStroke

protected void applyStroke(Stroke stroke)
            throws IOException
Applies a new Stroke object.
Parameters:
stroke - Stroke object to use

buildBufferedImage

protected BufferedImage buildBufferedImage(Dimension size)
Creates a buffered image.
Parameters:
size - dimensions of the image to be created
Returns:
the buffered image

copyArea

public void copyArea(int x,
                     int y,
                     int width,
                     int height,
                     int dx,
                     int dy)

create

public Graphics create()

dispose

public void dispose()

draw

public void draw(Shape s)

drawImage

public boolean drawImage(Image img,
                         int x,
                         int y,
                         ImageObserver observer)

drawImage

public boolean drawImage(Image img,
                         int x,
                         int y,
                         int width,
                         int height,
                         ImageObserver observer)

drawRenderableImage

public void drawRenderableImage(RenderableImage img,
                                AffineTransform xform)

drawRenderedImage

public void drawRenderedImage(RenderedImage img,
                              AffineTransform xform)

drawString

public void drawString(AttributedCharacterIterator iterator,
                       float x,
                       float y)

drawString

public void drawString(String s,
                       float x,
                       float y)

fill

public void fill(Shape s)

getDeviceConfiguration

public GraphicsConfiguration getDeviceConfiguration()

getFontMetrics

public java.awt.FontMetrics getFontMetrics(java.awt.Font f)

handleIOException

public void handleIOException(IOException ioe)
Central handler for IOExceptions for this class.
Parameters:
ioe - IOException to handle

handleUnsupportedFeature

protected void handleUnsupportedFeature(String msg)
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

processPathIteratorFill

public void processPathIteratorFill(PathIterator iter)
            throws IOException
Processes a path iterator generating the nexessary painting operations.
Parameters:
iter - PathIterator to process

processPathIteratorStroke

public void processPathIteratorStroke(PathIterator iter)
            throws IOException
Processes a path iterator generating the nexessary painting operations.
Parameters:
iter - PathIterator to process

setClippingDisabled

public void setClippingDisabled(boolean value)
Allows to disable all clipping operations.
Parameters:
value - true if clipping should be disabled.

setGraphicContext

public void setGraphicContext(GraphicContext c)
Sets the GraphicContext
Parameters:
c - GraphicContext to use

setXORMode

public void setXORMode(Color c1)

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.