APIdia Launch Partner
Top Fields Constructors Methods
sun.print

public abstract Class PathGraphics

extends ProxyGraphics2D
Class Inheritance
Known Direct Subclasses
sun.print.PSPathGraphics
Imports
sun.awt.image.SunWritableRaster, .ToolkitImage, sun.font.CharToGlyphMapper, .CompositeFont, .Font2D, .Font2DHandle, .FontUtilities, java.awt.AlphaComposite, .Color, .Composite, .Font, .Graphics2D, .Image, .Paint, .Polygon, .Shape, java.awt.font.FontRenderContext, .GlyphVector, .TextAttribute, .TextLayout, java.awt.geom.AffineTransform, .Arc2D, .Ellipse2D, .Line2D, .Path2D, .PathIterator, .Point2D, .Rectangle2D, .RoundRectangle2D, java.awt.image.BufferedImage, .BufferedImageOp, .ColorModel, .DataBuffer, .DataBufferInt, .ImageObserver, .IndexColorModel, .MultiResolutionImage, .Raster, .RenderedImage, .SampleModel, .SinglePixelPackedSampleModel, .VolatileImage, java.awt.print.PageFormat, .Printable, .PrinterException, .PrinterJob, java.lang.ref.SoftReference, java.text.AttributedCharacterIterator, java.util.Hashtable, .Map

Field Summary

Modifier and TypeField and Description
protected static SoftReference<Hashtable<Font2DHandle, Object>>
private boolean
private PageFormat
private int
private Printable
protected boolean
Inherited from sun.print.ProxyGraphics2D:
mGraphicsmPrinterJob

Constructor Summary

AccessConstructor and Description
protected
PathGraphics(Graphics2D graphics, PrinterJob printerJob, Printable painter, PageFormat pageFormat, int pageIndex, boolean canRedraw)

Method Summary

Modifier and TypeMethod and Description
public boolean
canDoRedraws()

Return true if we are allowed to ask the application to redraw portions of the page.

protected boolean
public void
clearRect(int
the x coordinate of the rectangle to clear.
x
,
int
the y coordinate of the rectangle to clear.
y
,
int
the width of the rectangle to clear.
width
,
int
the height of the rectangle to clear.
height
)

Overrides sun.print.ProxyGraphics2D.clearRect.

Clears the specified rectangle by filling it with the background color of the current drawing surface.

protected BufferedImage
convertToBufferedImage(MultiResolutionImage multiResolutionImage, double width, double height)

protected abstract void
protected abstract void
deviceDrawLine(int xBegin, int yBegin, int xEnd, int yEnd, Color color)

protected abstract void
deviceFill(PathIterator pathIter, Color color)

Fill the path defined by pathIter with the specified color.

protected abstract void
deviceFillRect(int x, int y, int width, int height, Color color)

protected abstract void
deviceFrameRect(int x, int y, int width, int height, Color color)

public void
draw(Shape
The shape to be drawn.
s
)

Overrides sun.print.ProxyGraphics2D.draw.

Strokes the outline of a Shape using the settings of the current graphics state.

public void
drawArc(int
the x coordinate of the upper-left corner of the arc to be drawn.
x
,
int
the y coordinate of the upper-left corner of the arc to be drawn.
y
,
int
the width of the arc to be drawn.
width
,
int
the height of the arc to be drawn.
height
,
int
the beginning angle.
startAngle
,
int
the angular extent of the arc, relative to the start angle.
arcAngle
)

Overrides sun.print.ProxyGraphics2D.drawArc.

Draws the outline of a circular or elliptical arc covering the specified rectangle.

protected boolean
drawBitmaskImage(BufferedImage bufferedImage, AffineTransform xform, Color bgcolor, int srcX, int srcY, int srcWidth, int srcHeight)

public void
drawGlyphVector(GlyphVector
The GlyphVector to be drawn.
g
,
float x, float y)

Overrides sun.print.ProxyGraphics2D.drawGlyphVector.

Draws a GlyphVector.

public boolean
drawImage(Image
the specified image to be drawn.
img
,
int
the x coordinate.
x
,
int
the y coordinate.
y
,
ImageObserver
object to be notified as more of the image is converted.
observer
)

Overrides sun.print.ProxyGraphics2D.drawImage.

Draws as much of the specified image as is currently available.

public boolean
drawImage(Image
the specified image to be drawn.
img
,
int
the x coordinate.
x
,
int
the y coordinate.
y
,
int
the width of the rectangle.
width
,
int
the height of the rectangle.
height
,
ImageObserver
object to be notified as more of the image is converted.
observer
)

Overrides sun.print.ProxyGraphics2D.drawImage.

Draws as much of the specified image as has already been scaled to fit inside the specified rectangle.

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

Overrides sun.print.ProxyGraphics2D.drawImage.

Draws as much of the specified image as is currently available.

public boolean
drawImage(Image
the specified image to be drawn. This method does nothing if img is null.
img
,
int
the x coordinate.
x
,
int
the y coordinate.
y
,
int
the width of the rectangle.
width
,
int
the height of the rectangle.
height
,
Color
the background color to paint under the non-opaque portions of the image.
bgcolor
,
ImageObserver
object to be notified as more of the image is converted.
observer
)

Overrides sun.print.ProxyGraphics2D.drawImage.

Draws as much of the specified image as has already been scaled to fit inside the specified rectangle.

public boolean
drawImage(Image
the specified image to be drawn
img
,
int
the x coordinate of the first corner of the destination rectangle.
dx1
,
int
the y coordinate of the first corner of the destination rectangle.
dy1
,
int
the x coordinate of the second corner of the destination rectangle.
dx2
,
int
the y coordinate of the second corner of the destination rectangle.
dy2
,
int
the x coordinate of the first corner of the source rectangle.
sx1
,
int
the y coordinate of the first corner of the source rectangle.
sy1
,
int
the x coordinate of the second corner of the source rectangle.
sx2
,
int
the y coordinate of the second corner of the source rectangle.
sy2
,
ImageObserver
object to be notified as more of the image is scaled and converted.
observer
)

Overrides sun.print.ProxyGraphics2D.drawImage.

Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface.

public boolean
drawImage(Image
the specified image to be drawn This method does nothing if img is null.
img
,
int
the x coordinate of the first corner of the destination rectangle.
dx1
,
int
the y coordinate of the first corner of the destination rectangle.
dy1
,
int
the x coordinate of the second corner of the destination rectangle.
dx2
,
int
the y coordinate of the second corner of the destination rectangle.
dy2
,
int
the x coordinate of the first corner of the source rectangle.
sx1
,
int
the y coordinate of the first corner of the source rectangle.
sy1
,
int
the x coordinate of the second corner of the source rectangle.
sx2
,
int
the y coordinate of the second corner of the source rectangle.
sy2
,
Color
the background color to paint under the non-opaque portions of the image.
bgcolor
,
ImageObserver
object to be notified as more of the image is scaled and converted.
observer
)

Overrides sun.print.ProxyGraphics2D.drawImage.

Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface.

public boolean
drawImage(Image
The image to be drawn. This method does nothing if img is null.
img
,
AffineTransform
The transformation from image space into user space.
xform
,
ImageObserver
The image observer to be notified as more of the image is converted.
obs
)

Overrides sun.print.ProxyGraphics2D.drawImage.

Draws an image, applying a transform from image space into user space before drawing.

public void
drawImage(BufferedImage
The BufferedImage to be drawn. This method does nothing if img is null.
img
,
BufferedImageOp
The filter to be applied to the image before drawing.
op
,
int x, int y)

Overrides sun.print.ProxyGraphics2D.drawImage.

Draws a BufferedImage that is filtered with a BufferedImageOp.

protected abstract boolean
drawImageToPlatform(Image
The image to be drawn. This method does nothing if img is null.
img
,
AffineTransform
Used to transform the image before drawing. This can be null.
xform
,
Color
This color is drawn where the image has transparent pixels. If this parameter is null then the pixels already in the destination should show through.
bgcolor
,
int
With srcY this defines the upper-left corner of the portion of the image to be drawn.
srcX
,
int
With srcX this defines the upper-left corner of the portion of the image to be drawn.
srcY
,
int
The width of the portion of the image to be drawn.
srcWidth
,
int
The height of the portion of the image to be drawn.
srcHeight
,
boolean
if being recursively called to print opaque region of transparent image
handlingTransparency
)

The various drawImage() methods for PathGraphics are all decomposed into an invocation of drawImageToPlatform.

public void
drawLine(int
the first point's x coordinate.
x1
,
int
the first point's y coordinate.
y1
,
int
the second point's x coordinate.
x2
,
int
the second point's y coordinate.
y2
)

Overrides sun.print.ProxyGraphics2D.drawLine.

Draws a line, using the current color, between the points (x1, y1) and (x2, y2) in this graphics context's coordinate system.

public void
drawOval(int
the x coordinate of the upper left corner of the oval to be drawn.
x
,
int
the y coordinate of the upper left corner of the oval to be drawn.
y
,
int
the width of the oval to be drawn.
width
,
int
the height of the oval to be drawn.
height
)

Overrides sun.print.ProxyGraphics2D.drawOval.

Draws the outline of an oval.

public void
drawPolygon(int[]
an array of x coordinates.
xPoints
,
int[]
an array of y coordinates.
yPoints
,
int
the total number of points.
nPoints
)

Overrides sun.print.ProxyGraphics2D.drawPolygon.

Draws a closed polygon defined by arrays of x and y coordinates.

public void
drawPolygon(Polygon
the polygon to draw.
p
)

Overrides java.awt.Graphics.drawPolygon.

Draws the outline of a polygon defined by the specified Polygon object.

public void
drawPolyline(int[]
an array of x points
xPoints
,
int[]
an array of y points
yPoints
,
int
the total number of points
nPoints
)

Overrides sun.print.ProxyGraphics2D.drawPolyline.

Draws a sequence of connected lines defined by arrays of x and y coordinates.

public void
drawRect(int
the x coordinate of the rectangle to be drawn.
x
,
int
the y coordinate of the rectangle to be drawn.
y
,
int
the width of the rectangle to be drawn.
width
,
int
the height of the rectangle to be drawn.
height
)

Overrides java.awt.Graphics.drawRect.

Draws the outline of the specified rectangle.

public void
drawRenderedImage(RenderedImage
The image to be drawn. This method does nothing if img is null.
img
,
AffineTransform
The transformation from image space into user space.
xform
)

Overrides sun.print.ProxyGraphics2D.drawRenderedImage.

Draws an image, applying a transform from image space into user space before drawing.

public void
drawRoundRect(int
the x coordinate of the rectangle to be drawn.
x
,
int
the y coordinate of the rectangle to be drawn.
y
,
int
the width of the rectangle to be drawn.
width
,
int
the height of the rectangle to be drawn.
height
,
int
the horizontal diameter of the arc at the four corners.
arcWidth
,
int
the vertical diameter of the arc at the four corners.
arcHeight
)

Overrides sun.print.ProxyGraphics2D.drawRoundRect.

Draws an outlined round-cornered rectangle using this graphics context's current color.

public void
drawString(String
the string to be drawn.
str
,
int
the x coordinate.
x
,
int
the y coordinate.
y
)

Overrides sun.print.ProxyGraphics2D.drawString.

Draws the text given by the specified string, using this graphics context's current font and color.

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

Overrides sun.print.ProxyGraphics2D.drawString.

Draws a string of text.

protected void
drawString(String str, float x, float y, Font font, FontRenderContext frc, float w)

public void
drawString(AttributedCharacterIterator
the iterator whose text is to be drawn
iterator
,
int
the x coordinate.
x
,
int
the y coordinate.
y
)

Overrides sun.print.ProxyGraphics2D.drawString.

Draws the text given by the specified iterator, using this graphics context's current color.

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

Overrides sun.print.ProxyGraphics2D.drawString.

Draws the text given by the specified iterator, using this graphics context's current color.

public void
fill(Shape s)

Overrides sun.print.ProxyGraphics2D.fill.

Fills the interior of a Shape using the settings of the current graphics state.

public void
fill(Shape s, Color color)

public void
fillArc(int
the x coordinate of the upper-left corner of the arc to be filled.
x
,
int
the y coordinate of the upper-left corner of the arc to be filled.
y
,
int
the width of the arc to be filled.
width
,
int
the height of the arc to be filled.
height
,
int
the beginning angle.
startAngle
,
int
the angular extent of the arc, relative to the start angle.
arcAngle
)

Overrides sun.print.ProxyGraphics2D.fillArc.

Fills a circular or elliptical arc covering the specified rectangle.

public void
fillOval(int
the x coordinate of the upper left corner of the oval to be filled.
x
,
int
the y coordinate of the upper left corner of the oval to be filled.
y
,
int
the width of the oval to be filled.
width
,
int
the height of the oval to be filled.
height
)

Overrides sun.print.ProxyGraphics2D.fillOval.

Fills an oval bounded by the specified rectangle with the current color.

public void
fillPolygon(int[]
an array of x coordinates.
xPoints
,
int[]
an array of y coordinates.
yPoints
,
int
the total number of points.
nPoints
)

Overrides sun.print.ProxyGraphics2D.fillPolygon.

Fills a closed polygon defined by arrays of x and y coordinates.

public void
fillPolygon(Polygon
the polygon to fill.
p
)

Overrides java.awt.Graphics.fillPolygon.

Fills the polygon defined by the specified Polygon object with the graphics context's current color.

public void
fillRect(int
the x coordinate of the rectangle to be filled.
x
,
int
the y coordinate of the rectangle to be filled.
y
,
int
the width of the rectangle to be filled.
width
,
int
the height of the rectangle to be filled.
height
)

Overrides sun.print.ProxyGraphics2D.fillRect.

Fills the specified rectangle.

public void
fillRoundRect(int
the x coordinate of the rectangle to be filled.
x
,
int
the y coordinate of the rectangle to be filled.
y
,
int
the width of the rectangle to be filled.
width
,
int
the height of the rectangle to be filled.
height
,
int
the horizontal diameter of the arc at the four corners.
arcWidth
,
int
the vertical diameter of the arc at the four corners.
arcHeight
)

Overrides sun.print.ProxyGraphics2D.fillRoundRect.

Fills the specified rounded corner rectangle with the current color.

protected BufferedImage
private static char[]
protected PageFormat
getPageFormat()

Return the PageFormat associated with this page of Graphics.

protected int
getPageIndex()

Return the page index associated with this Graphics.

protected Printable
getPrintable()

Return the Printable instance responsible for drawing into this Graphics.

protected boolean
hasTransparentPixels(BufferedImage bufferedImage)

Return true if the BufferedImage argument has non-opaque bits in it and therefore can not be directly rendered by GDI.

protected boolean
protected boolean
protected int
pack-priv boolean
protected boolean
printGlyphVector(GlyphVector gv, float x, float y)

Default implementation returns false.

public abstract void
redrawRegion(Rectangle2D region, double scaleX, double scaleY, Shape clip, AffineTransform devTransform)

Redraw a rectangular area using a proxy graphics

private boolean
samePositions(GlyphVector gv, int[] gvcodes, int[] origCodes, float[] origPositions)

Inherited from sun.print.ProxyGraphics2D:
addRenderingHintsclipclipRectcopyAreacreatedisposedrawRenderableImagefinalizegetBackgroundgetClipgetClipBoundsgetColorgetCompositegetDelegategetDeviceConfigurationgetFontgetFontMetricsgetFontRenderContextgetPaintgetPrinterJobgetRenderingHintgetRenderingHintsgetStrokegetTransformhitrotaterotatescalesetBackgroundsetClipsetClipsetColorsetCompositesetDelegatesetFontsetPaintsetPaintModesetRenderingHintsetRenderingHintssetStrokesetTransformsetXORModesheartransformtranslatetranslate