APIdia Launch Partner
Top Description Fields Constructors Methods
sun.print

public Class ProxyPrintGraphics

extends ProxyGraphics
implements PrintGraphics
Class Inheritance
All Implemented Interfaces
java.awt.PrintGraphics
Imports
java.awt.Graphics, .PrintGraphics, .PrintJob

A subclass of Graphics that can be printed to. The graphics calls are forwarded to another Graphics instance that does the actual rendering.

Field Summary

Modifier and TypeField and Description
private PrintJob

Constructor Summary

AccessConstructor and Description
public
ProxyPrintGraphics(Graphics graphics, PrintJob thePrintJob)

Method Summary

Modifier and TypeMethod and Description
public Graphics

Returns:

a new graphics context that is a copy of this graphics context.
create
()

Overrides sun.print.ProxyGraphics.create.

Creates a new Graphics object that is a copy of this Graphics object.

public Graphics

Returns:

a new graphics context.
create
(int
the x coordinate.
x
,
int
the y coordinate.
y
,
int
the width of the clipping rectangle.
width
,
int
the height of the clipping rectangle.
height
)

Overrides sun.print.ProxyGraphics.create.

Creates a new Graphics object based on this Graphics object, but with a new translation and clip area.

public void
dispose()

Overrides sun.print.ProxyGraphics.dispose.

Disposes of this graphics context and releases any system resources that it is using.

public Graphics
public PrintJob
getPrintJob()

Implements java.awt.PrintGraphics.getPrintJob.

Returns the PrintJob object from which this PrintGraphics object originated.

Inherited from sun.print.ProxyGraphics:
clearRectclipRectcopyAreadraw3DRectdrawArcdrawBytesdrawCharsdrawImagedrawImagedrawImagedrawImagedrawImagedrawImagedrawLinedrawOvaldrawPolygondrawPolygondrawPolylinedrawRectdrawRoundRectdrawStringdrawStringfill3DRectfillArcfillOvalfillPolygonfillPolygonfillRectfillRoundRectfinalizegetClipgetClipBoundsgetClipBoundsgetClipRectgetColorgetFontgetFontMetricsgetFontMetricshitClipsetClipsetClipsetColorsetFontsetPaintModesetXORModetoStringtranslate

Field Detail

printJobback to summary
private PrintJob printJob

Constructor Detail

ProxyPrintGraphicsback to summary
public ProxyPrintGraphics(Graphics graphics, PrintJob thePrintJob)

Method Detail

createback to summary
public Graphics create()

Overrides sun.print.ProxyGraphics.create.

Creates a new Graphics object that is a copy of this Graphics object.

Returns:Graphics

a new graphics context that is a copy of this graphics context.

createback to summary
public Graphics create(int x, int y, int width, int height)

Overrides sun.print.ProxyGraphics.create.

Creates a new Graphics object based on this Graphics object, but with a new translation and clip area. Refer to sun.print.ProxyGraphics#create(int, int, int, int) for a complete description of this method.

Parameters
x:int

the x coordinate.

y:int

the y coordinate.

width:int

the width of the clipping rectangle.

height:int

the height of the clipping rectangle.

Returns:Graphics

a new graphics context.

See Also
java.awt.Graphics#translate, java.awt.Graphics#clipRect
disposeback to summary
public void dispose()

Overrides sun.print.ProxyGraphics.dispose.

Doc from sun.print.ProxyGraphics.dispose.

Disposes of this graphics context and releases any system resources that it is using. A Graphics object cannot be used after dispose has been called.

When a Java program runs, a large number of Graphics objects can be created within a short time frame. Although the finalization process of the garbage collector also disposes of the same system resources, it is preferable to manually free the associated resources by calling this method rather than to rely on a finalization process which may not run to completion for a long period of time.

Graphics objects which are provided as arguments to the paint and update methods of components are automatically released by the system when those methods return. For efficiency, programmers should call dispose when finished using a Graphics object only if it was created directly from a component or another Graphics object.

getGraphicsback to summary
public Graphics getGraphics()

Overrides sun.print.ProxyGraphics.getGraphics.

getPrintJobback to summary
public PrintJob getPrintJob()

Implements java.awt.PrintGraphics.getPrintJob.

Returns the PrintJob object from which this PrintGraphics object originated.