APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.print

public Class PSPrinterJob

extends RasterPrinterJob
Class Inheritance
Imports
java.awt.Color, .Component, .Font, .FontMetrics, .GraphicsEnvironment, .Graphics, .Graphics2D, .HeadlessException, .Shape, java.awt.font.FontRenderContext, java.awt.geom.AffineTransform, .PathIterator, .Rectangle2D, java.awt.image.BufferedImage, java.awt.print.Pageable, .PageFormat, .Paper, .Printable, .PrinterException, .PrinterIOException, .PrinterJob, javax.print.PrintService, .StreamPrintService, javax.print.attribute.HashPrintRequestAttributeSet, .PrintRequestAttributeSet, .PrintServiceAttributeSet, .Attribute, javax.print.attribute.standard.PrinterName, .Copies, .Destination, .DialogTypeSelection, .JobName, .OutputBin, .Sides, .JobSheets, .Media, java.io.BufferedOutputStream, .BufferedReader, .File, .InputStream, .InputStreamReader, .IOException, .FileInputStream, .FileOutputStream, .OutputStream, .PrintStream, .PrintWriter, .StringWriter, java.util.ArrayList, .Locale, .Properties, sun.awt.CharsetString, .FontConfiguration, .OSInfo, .PlatformFont, .SunToolkit, sun.font.FontAccess, .FontUtilities, java.nio.charset.*, java.nio.CharBuffer, .ByteBuffer, java.nio.file.Files, java.lang.reflect.Method

A class which initiates and executes a PostScript printer job.
Author
Richard Blanchard

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
PSPrinterJob.GState

A stack of GStates is maintained to model the printer's gstate stack.

private class
private class

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
CLOSEPATH_STR

Close the current subpath by generating a line segment from the current position to the start of the subpath.

private static final String
private static final String
CURVETO_STR

This PostScript operator takes two control points and an ending point and using the current pen position as a starting point adds a bezier curve to the current path.

private static final String
private static final String
private static final String
EVEN_ODD_CLIP_STR

The PostScript to set the clip to be the current path using the even odd rule.

private static final String
EVEN_ODD_FILL_STR

The PostScript invocation to fill a path using the even-odd rule.

protected static final int
FILL_EVEN_ODD

Passed to the setFillMode method this value forces fills to be done using the even-odd fill rule.

protected static final int
FILL_WINDING

Passed to the setFillMode method this value forces fills to be done using the non-zero winding rule.

private static final String
GRESTORE_STR

The PostScript to pop a state off of the printer's gstate stack.

private static final String
GSAVE_STR

The PostScript to push a state on to the printer's gstate stack.

private static final String
private static final String
private static final String
private static boolean
private static final String
LINETO_STR

Expecting two numbers on the PostScript stack, this invocation draws a PS line from the current pen position to the point on the stack.

private static final int
private String
mClipOpStr

This string holds the PostScript operator to be used to clip to a path.

private String
private int
private String
mFillOpStr

This string holds the PostScript operator to be used to fill a path.

private static Properties
mFontProps

An optional mapping of fonts to PostScript names.

pack-priv ArrayList<PSPrinterJob.GState>
mGStateStack

A stack that represents the PostScript gstate stack.

private Shape
private Color
private Font
private AffineTransform
private boolean
private String
private static final String
MOVETO_STR

Expecting two numbers on the PostScript stack, this invocation moves the current pen position.

private float
mPenX

The x coordinate of the current pen position.

private float
mPenY

The y coordinate of the current pen position.

pack-priv PrintStream
mPSStream

The output stream to which the generated PostScript is written.

private float
mStartPathX

The x coordinate of the starting point of the current subpath.

private float
mStartPathY

The y coordinate of the starting point of the current subpath.

private static final String
NEWPATH_STR

Make the current PostScript path an empty path.

private static final String
private static final String
private static final String
private static final int
private static final int
private static final String
private static final String
private static final String
SETGRAY_STR

Use the top number on the stack to set the printer's current gray value.

private static final String
SETRGBCOLOR_STR

Use the three numbers on top of the PS operator stack to set the rgb color.

private static final String
pack-priv File
private static final String
WINDING_CLIP_STR

The PostScript to set the clip to be the current path using the non-zero winding rule.

private static final String
WINDING_FILL_STR

The PostScript invocation to fill a path using the non-zero winding rule.

private double
private double
Inherited from sun.print.RasterPrinterJob:
attributescollateAttReqdebugPrintdestinationAttrFILEforcePDLforceRasterlandscapeRotates270MAX_UNKNOWN_PAGESmDocumentmyServicenoJobSheetoutputBinAttrPD_ALLPAGESPD_NOSELECTIONPD_PAGENUMSPD_SELECTIONperformingPrintingPRINTERprinterResAttrshapeTextPropsidesAttrSTREAMuserCancelled

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
abortDoc()

Implements abstract sun.print.RasterPrinterJob.abortDoc.

Invoked if the application cancelled the printjob.

private byte[]
ascii85Encode(byte[] inArr)

protected void
beginPath()

Called to mark the start of a new path.

protected void
bezierTo(float control1x, float control1y, float control2x, float control2y, float endX, float endY)

Add to the current path a bezier curve formed by the current pen position and the method parameters which are two control points and an ending point.

protected void
closeSubpath()

Close the current subpath by appending a straight line from the current point to the subpath's starting point.

pack-priv void
convertToPSPath(PathIterator pathIter)

Given a Java2D PathIterator instance, this method translates that into a PostScript path..

protected Graphics2D
createPathGraphics(PeekGraphics peekGraphics, PrinterJob printerJob, Printable painter, PageFormat pageFormat, int pageIndex)

Overrides sun.print.RasterPrinterJob.createPathGraphics.

Examine the metrics captured by the PeekGraphics instance and if capable of directly converting this print job to the printer's control language or the native OS's graphics primitives, then return a PSPathGraphics to perform that conversion.

protected void
deviceFill(PathIterator pathIter, Color color, AffineTransform tx, Shape clip)

protected void
drawImageBGR(byte[] bgrData, float destX, float destY, float destWidth, float destHeight, float srcX, float srcY, float srcWidth, float srcHeight, int srcBitMapWidth, int srcBitMapHeight)

Convert the 24 bit BGR image buffer represented by image to PostScript.

protected void
endDoc()

Implements abstract sun.print.RasterPrinterJob.endDoc.

Invoked by the RasterPrintJob super class this method is called after that last page has been imaged.

protected void
endPage(PageFormat format, Printable painter, int index)

Implements abstract sun.print.RasterPrinterJob.endPage.

The RasterPrintJob super class calls this method at the end of each page.

protected void
fillPath()

Fill the current path using the current fill mode and color.

protected int
getCollatedCopies()

Overrides sun.print.RasterPrinterJob.getCollatedCopies.

Returns how many times the entire book should be printed by the PrintJob.

private String
private PSPrinterJob.GState
getGState()

Return the GState that is currently on top of the GState stack.

protected int
getNoncollatedCopies()

Overrides sun.print.RasterPrinterJob.getNoncollatedCopies.

Returns how many times each page in the book should be consecutively printed by PrintJob.

protected float
getPenX()

Return the x coordinate of the pen in the current path.

protected float
getPenY()

Return the y coordinate of the pen in the current path.

protected double
getPhysicalPageHeight(Paper p)

Implements abstract sun.print.RasterPrinterJob.getPhysicalPageHeight.

Must be obtained from the current printer.

protected double
getPhysicalPageWidth(Paper p)

Implements abstract sun.print.RasterPrinterJob.getPhysicalPageWidth.

Must be obtained from the current printer.

protected double
getPhysicalPrintableHeight(Paper p)

Implements abstract sun.print.RasterPrinterJob.getPhysicalPrintableHeight.

Must be obtained from the current printer.

protected double
getPhysicalPrintableWidth(Paper p)

Implements abstract sun.print.RasterPrinterJob.getPhysicalPrintableWidth.

Must be obtained from the current printer.

protected double
getPhysicalPrintableX(Paper p)

Implements abstract sun.print.RasterPrinterJob.getPhysicalPrintableX.

For PostScript the origin is in the upper-left of the paper not at the imageable area corner.

protected double
getPhysicalPrintableY(Paper p)

Implements abstract sun.print.RasterPrinterJob.getPhysicalPrintableY.

For PostScript the origin is in the upper-left of the paper not at the imageable area corner.

private int[]
getPSFontIndexArray(Font font, CharsetString[] charSet)

Given an array of CharsetStrings that make up a run of text, this routine converts each CharsetString to an index into our PostScript font list.

protected double
getXRes()

Implements abstract sun.print.RasterPrinterJob.getXRes.

Return the x resolution of the coordinates to be rendered.

protected double
getYRes()

Implements abstract sun.print.RasterPrinterJob.getYRes.

Return the y resolution of the coordinates to be rendered.

private void
grestore()

Emit a PostScript grestore command and remove a GState from our stack which represents the printer's gstate stack.

private void
gsave()

Emit a PostScript gsave command and add a new GState on to our stack which represents the printer's gstate stack.

private static Properties
private static void
private boolean
isOuterGState()

Return true if the current GState is the outermost GState and therefore should not be restored.

protected void
lineTo(float x, float y)

Generate PostScript to draw a line from the current pen position to (x, y).

private String
makeCharsetName(String name, char[] chs)

protected void
moveTo(float x, float y)

Generate PostScript to move the current pen position to (x, y).

protected int
private void
protected void
printBand(byte[] bgrData, int x, int y, int width, int height)

Implements abstract sun.print.RasterPrinterJob.printBand.

Prints the contents of the array of ints, 'data' to the current page.

public boolean

Returns:

false if the user cancels the dialog and true otherwise.
printDialog
()

Overrides sun.print.RasterPrinterJob.printDialog.

Presents the user a dialog for changing properties of the print job interactively.

private String[]
printExecCmd(String printer, String options, boolean noJobSheet, String jobTitle, int copies, String spoolFile)

private byte[]
rlEncode(byte[] inArr)

protected void
selectClipPath()

Intersect the gstate's current path with the current clip and make the result the new clip.

protected void
protected void
setClip(Shape clip)

protected void
setColor(Color color)

Set the printer's current color to be that defined by color

protected void
setFillMode(int fillRule)

Set the current path rule to be either FILL_EVEN_ODD (using the even-odd file rule) or FILL_WINDING (using the non-zero winding rule.)

protected boolean
setFont(Font font)

Set the current PostScript font.

protected void
protected void
setXYRes(double x, double y)

Overrides sun.print.RasterPrinterJob.setXYRes.

Set the resolution at which to print.

protected void
startDoc()

Implements abstract sun.print.RasterPrinterJob.startDoc.

Invoked by the RasterPrinterJob super class this method is called to mark the start of a document.

protected void
startPage(PageFormat pageFormat, Printable painter, int index, boolean paperChanged)

Implements abstract sun.print.RasterPrinterJob.startPage.

The RasterPrintJob super class calls this method at the start of each page.

private static int
swapBGRtoRGB(byte[] image, int index, byte[] dest)

protected boolean
textOut(Graphics g, String str, float x, float y, Font mLastFont, FontRenderContext frc, float width)

pack-priv String
trunc(float f)

Inherited from sun.print.RasterPrinterJob:
cancelcancelDoccreatePeekGraphicsdebug_printlndefaultPagegetCopiesgetCopiesIntgetDefaultPrintableAreagetFirstPagegetFromPageAttribgetJobNamegetJobNameIntgetLastPagegetMaxPageAttribgetMediaSizegetMinPageAttribgetOutputBinValuegetPageablegetPageFormatFromAttributesgetPrinterGraphicsConfiggetPrintServicegetSelectAttribgetToPageAttribgetUserNamegetUserNameIntinitPrinterinitPrinterGraphicsisCancelledisCollatedisSupportedValuelookupDefaultPrintServicepageDialogpageDialogprintprintprintDialogprintPageremoveControlCharssaveStatesetCollatedsetCopiessetGraphicsConfigInfosetJobNamesetPageablesetPageRangesetPrintablesetPrintablesetPrintServicespoolToServiceupdateAttributesWithPageFormatupdatePageAttributesvalidateDestinationvalidatePagevalidatePaper

Field Detail

ADOBE_PS_STRback to summary
private static final String ADOBE_PS_STR
CLOSEPATH_STRback to summary
private static final String CLOSEPATH_STR

Close the current subpath by generating a line segment from the current position to the start of the subpath. (closepath)

COPIESback to summary
private static final String COPIES
CURVETO_STRback to summary
private static final String CURVETO_STR

This PostScript operator takes two control points and an ending point and using the current pen position as a starting point adds a bezier curve to the current path. (curveto)

DrawStringNameback to summary
private static final String DrawStringName
EOF_COMMENTback to summary
private static final String EOF_COMMENT
EVEN_ODD_CLIP_STRback to summary
private static final String EVEN_ODD_CLIP_STR

The PostScript to set the clip to be the current path using the even odd rule. (eoclip)

EVEN_ODD_FILL_STRback to summary
private static final String EVEN_ODD_FILL_STR

The PostScript invocation to fill a path using the even-odd rule. (eofill)

FILL_EVEN_ODDback to summary
protected static final int FILL_EVEN_ODD

Passed to the setFillMode method this value forces fills to be done using the even-odd fill rule.

FILL_WINDINGback to summary
protected static final int FILL_WINDING

Passed to the setFillMode method this value forces fills to be done using the non-zero winding rule.

GRESTORE_STRback to summary
private static final String GRESTORE_STR

The PostScript to pop a state off of the printer's gstate stack. (grestore)

GSAVE_STRback to summary
private static final String GSAVE_STR

The PostScript to push a state on to the printer's gstate stack. (gsave)

IMAGE_RESTOREback to summary
private static final String IMAGE_RESTORE
IMAGE_SAVEback to summary
private static final String IMAGE_SAVE
IMAGE_STRback to summary
private static final String IMAGE_STR
isMacback to summary
private static boolean isMac
LINETO_STRback to summary
private static final String LINETO_STR

Expecting two numbers on the PostScript stack, this invocation draws a PS line from the current pen position to the point on the stack. (lineto)

MAX_PSSTRback to summary
private static final int MAX_PSSTR
mClipOpStrback to summary
private String mClipOpStr

This string holds the PostScript operator to be used to clip to a path. It can be changed by the setFillMode method.

mDestinationback to summary
private String mDestination

Hides sun.print.RasterPrinterJob.mDestination.

mDestTypeback to summary
private int mDestType

Hides sun.print.RasterPrinterJob.mDestType.

mFillOpStrback to summary
private String mFillOpStr

This string holds the PostScript operator to be used to fill a path. It can be changed by the setFillMode method.

mFontPropsback to summary
private static Properties mFontProps

An optional mapping of fonts to PostScript names.

mGStateStackback to summary
pack-priv ArrayList<PSPrinterJob.GState> mGStateStack

A stack that represents the PostScript gstate stack.

mLastClipback to summary
private Shape mLastClip
mLastColorback to summary
private Color mLastColor
mLastFontback to summary
private Font mLastFont
mLastTransformback to summary
private AffineTransform mLastTransform
mNoJobSheetback to summary
private boolean mNoJobSheet
mOptionsback to summary
private String mOptions
MOVETO_STRback to summary
private static final String MOVETO_STR

Expecting two numbers on the PostScript stack, this invocation moves the current pen position. (moveto)

mPenXback to summary
private float mPenX

The x coordinate of the current pen position.

mPenYback to summary
private float mPenY

The y coordinate of the current pen position.

mPSStreamback to summary
pack-priv PrintStream mPSStream

The output stream to which the generated PostScript is written.

mStartPathXback to summary
private float mStartPathX

The x coordinate of the starting point of the current subpath.

mStartPathYback to summary
private float mStartPathY

The y coordinate of the starting point of the current subpath.

NEWPATH_STRback to summary
private static final String NEWPATH_STR

Make the current PostScript path an empty path. (newpath)

PAGE_COMMENTback to summary
private static final String PAGE_COMMENT
PAGE_RESTOREback to summary
private static final String PAGE_RESTORE
PAGE_SAVEback to summary
private static final String PAGE_SAVE
PS_XRESback to summary
private static final int PS_XRES
PS_YRESback to summary
private static final int PS_YRES
READIMAGEPROCback to summary
private static final String READIMAGEPROC
SetFontNameback to summary
private static final String SetFontName
SETGRAY_STRback to summary
private static final String SETGRAY_STR

Use the top number on the stack to set the printer's current gray value. (setgray)

SETRGBCOLOR_STRback to summary
private static final String SETRGBCOLOR_STR

Use the three numbers on top of the PS operator stack to set the rgb color. (setrgbcolor)

SHOWPAGEback to summary
private static final String SHOWPAGE
spoolFileback to summary
pack-priv File spoolFile
WINDING_CLIP_STRback to summary
private static final String WINDING_CLIP_STR

The PostScript to set the clip to be the current path using the non-zero winding rule. (clip)

WINDING_FILL_STRback to summary
private static final String WINDING_FILL_STR

The PostScript invocation to fill a path using the non-zero winding rule. (fill)

xresback to summary
private double xres
yresback to summary
private double yres

Constructor Detail

PSPrinterJobback to summary
public PSPrinterJob()

Method Detail

abortDocback to summary
protected void abortDoc()

Implements abstract sun.print.RasterPrinterJob.abortDoc.

Invoked if the application cancelled the printjob.

ascii85Encodeback to summary
private byte[] ascii85Encode(byte[] inArr)
beginPathback to summary
protected void beginPath()

Called to mark the start of a new path.

bezierToback to summary
protected void bezierTo(float control1x, float control1y, float control2x, float control2y, float endX, float endY)

Add to the current path a bezier curve formed by the current pen position and the method parameters which are two control points and an ending point.

closeSubpathback to summary
protected void closeSubpath()

Close the current subpath by appending a straight line from the current point to the subpath's starting point.

convertToPSPathback to summary
pack-priv void convertToPSPath(PathIterator pathIter)

Given a Java2D PathIterator instance, this method translates that into a PostScript path..

createPathGraphicsback to summary
protected Graphics2D createPathGraphics(PeekGraphics peekGraphics, PrinterJob printerJob, Printable painter, PageFormat pageFormat, int pageIndex)

Overrides sun.print.RasterPrinterJob.createPathGraphics.

Examine the metrics captured by the PeekGraphics instance and if capable of directly converting this print job to the printer's control language or the native OS's graphics primitives, then return a PSPathGraphics to perform that conversion. If there is not an object capable of the conversion then return null. Returning null causes the print job to be rasterized.

deviceFillback to summary
protected void deviceFill(PathIterator pathIter, Color color, AffineTransform tx, Shape clip)
drawImageBGRback to summary
protected void drawImageBGR(byte[] bgrData, float destX, float destY, float destWidth, float destHeight, float srcX, float srcY, float srcWidth, float srcHeight, int srcBitMapWidth, int srcBitMapHeight)

Convert the 24 bit BGR image buffer represented by image to PostScript. The image is drawn at (destX, destY) in device coordinates. The image is scaled into a square of size specified by destWidth and destHeight. The portion of the source image copied into that square is specified by srcX, srcY, srcWidth, and srcHeight.

endDocback to summary
protected void endDoc() throws PrinterException

Implements abstract sun.print.RasterPrinterJob.endDoc.

Invoked by the RasterPrintJob super class this method is called after that last page has been imaged.

endPageback to summary
protected void endPage(PageFormat format, Printable painter, int index) throws PrinterException

Implements abstract sun.print.RasterPrinterJob.endPage.

The RasterPrintJob super class calls this method at the end of each page.

fillPathback to summary
protected void fillPath()

Fill the current path using the current fill mode and color.

getCollatedCopiesback to summary
protected int getCollatedCopies()

Overrides sun.print.RasterPrinterJob.getCollatedCopies.

Doc from sun.print.RasterPrinterJob.getCollatedCopies.

Returns how many times the entire book should be printed by the PrintJob. If the printer itself supports collation then this method should return 1 indicating that the entire book need only be printed once and the copies will be collated and made in the printer.

getCoordPrepback to summary
private String getCoordPrep()
getGStateback to summary
private PSPrinterJob.GState getGState()

Return the GState that is currently on top of the GState stack. There should always be a GState on top of the stack. If there isn't then this method will throw an IndexOutOfBounds exception.

getNoncollatedCopiesback to summary
protected int getNoncollatedCopies()

Overrides sun.print.RasterPrinterJob.getNoncollatedCopies.

Returns how many times each page in the book should be consecutively printed by PrintJob. If the printer makes copies itself then this method should return 1.

getPenXback to summary
protected float getPenX()

Return the x coordinate of the pen in the current path.

getPenYback to summary
protected float getPenY()

Return the y coordinate of the pen in the current path.

getPhysicalPageHeightback to summary
protected double getPhysicalPageHeight(Paper p)

Implements abstract sun.print.RasterPrinterJob.getPhysicalPageHeight.

Doc from sun.print.RasterPrinterJob.getPhysicalPageHeight.

Must be obtained from the current printer. Value is in device pixels. Not adjusted for orientation of the paper.

getPhysicalPageWidthback to summary
protected double getPhysicalPageWidth(Paper p)

Implements abstract sun.print.RasterPrinterJob.getPhysicalPageWidth.

Doc from sun.print.RasterPrinterJob.getPhysicalPageWidth.

Must be obtained from the current printer. Value is in device pixels. Not adjusted for orientation of the paper.

getPhysicalPrintableHeightback to summary
protected double getPhysicalPrintableHeight(Paper p)

Implements abstract sun.print.RasterPrinterJob.getPhysicalPrintableHeight.

Doc from sun.print.RasterPrinterJob.getPhysicalPrintableHeight.

Must be obtained from the current printer. Value is in device pixels. Not adjusted for orientation of the paper.

getPhysicalPrintableWidthback to summary
protected double getPhysicalPrintableWidth(Paper p)

Implements abstract sun.print.RasterPrinterJob.getPhysicalPrintableWidth.

Doc from sun.print.RasterPrinterJob.getPhysicalPrintableWidth.

Must be obtained from the current printer. Value is in device pixels. Not adjusted for orientation of the paper.

getPhysicalPrintableXback to summary
protected double getPhysicalPrintableX(Paper p)

Implements abstract sun.print.RasterPrinterJob.getPhysicalPrintableX.

For PostScript the origin is in the upper-left of the paper not at the imageable area corner.

getPhysicalPrintableYback to summary
protected double getPhysicalPrintableY(Paper p)

Implements abstract sun.print.RasterPrinterJob.getPhysicalPrintableY.

For PostScript the origin is in the upper-left of the paper not at the imageable area corner.

getPSFontIndexArrayback to summary
private int[] getPSFontIndexArray(Font font, CharsetString[] charSet)

Given an array of CharsetStrings that make up a run of text, this routine converts each CharsetString to an index into our PostScript font list. If one or more CharsetStrings can not be represented by a PostScript font, then this routine will return a null array.

getXResback to summary
protected double getXRes()

Implements abstract sun.print.RasterPrinterJob.getXRes.

Return the x resolution of the coordinates to be rendered.

getYResback to summary
protected double getYRes()

Implements abstract sun.print.RasterPrinterJob.getYRes.

Return the y resolution of the coordinates to be rendered.

grestoreback to summary
private void grestore()

Emit a PostScript grestore command and remove a GState from our stack which represents the printer's gstate stack.

gsaveback to summary
private void gsave()

Emit a PostScript gsave command and add a new GState on to our stack which represents the printer's gstate stack.

initPropsback to summary
private static Properties initProps()
initStaticback to summary
private static void initStatic()
isOuterGStateback to summary
private boolean isOuterGState()

Return true if the current GState is the outermost GState and therefore should not be restored.

lineToback to summary
protected void lineTo(float x, float y)

Generate PostScript to draw a line from the current pen position to (x, y).

makeCharsetNameback to summary
private String makeCharsetName(String name, char[] chs)
moveToback to summary
protected void moveTo(float x, float y)

Generate PostScript to move the current pen position to (x, y).

platformFontCountback to summary
protected int platformFontCount(Font font, String str)
prepDrawingback to summary
private void prepDrawing()
printBandback to summary
protected void printBand(byte[] bgrData, int x, int y, int width, int height) throws PrinterException

Implements abstract sun.print.RasterPrinterJob.printBand.

Prints the contents of the array of ints, 'data' to the current page. The band is placed at the location (x, y) in device coordinates on the page. The width and height of the band is specified by the caller. Currently the data is 24 bits per pixel in BGR format.

printDialogback to summary
public boolean printDialog() throws HeadlessException

Overrides sun.print.RasterPrinterJob.printDialog.

Presents the user a dialog for changing properties of the print job interactively.

Returns:boolean

false if the user cancels the dialog and true otherwise.

Exceptions
HeadlessException:
if GraphicsEnvironment.isHeadless() returns true.
See Also
java.awt.GraphicsEnvironment#isHeadless
printExecCmdback to summary
private String[] printExecCmd(String printer, String options, boolean noJobSheet, String jobTitle, int copies, String spoolFile)
rlEncodeback to summary
private byte[] rlEncode(byte[] inArr)
selectClipPathback to summary
protected void selectClipPath()

Intersect the gstate's current path with the current clip and make the result the new clip.

setAttributesback to summary
protected void setAttributes(PrintRequestAttributeSet attributes) throws PrinterException

Overrides sun.print.RasterPrinterJob.setAttributes.

Annotations
@Override
setClipback to summary
protected void setClip(Shape clip)
setColorback to summary
protected void setColor(Color color)

Set the printer's current color to be that defined by color

setFillModeback to summary
protected void setFillMode(int fillRule)

Set the current path rule to be either FILL_EVEN_ODD (using the even-odd file rule) or FILL_WINDING (using the non-zero winding rule.)

setFontback to summary
protected boolean setFont(Font font)

Set the current PostScript font. Taken from outFont in PSPrintStream.

setTransformback to summary
protected void setTransform(AffineTransform transform)
setXYResback to summary
protected void setXYRes(double x, double y)

Overrides sun.print.RasterPrinterJob.setXYRes.

Set the resolution at which to print.

startDocback to summary
protected void startDoc() throws PrinterException

Implements abstract sun.print.RasterPrinterJob.startDoc.

Invoked by the RasterPrinterJob super class this method is called to mark the start of a document.

startPageback to summary
protected void startPage(PageFormat pageFormat, Printable painter, int index, boolean paperChanged) throws PrinterException

Implements abstract sun.print.RasterPrinterJob.startPage.

The RasterPrintJob super class calls this method at the start of each page.

swapBGRtoRGBback to summary
private static int swapBGRtoRGB(byte[] image, int index, byte[] dest)
textOutback to summary
protected boolean textOut(Graphics g, String str, float x, float y, Font mLastFont, FontRenderContext frc, float width)
truncback to summary
pack-priv String trunc(float f)
sun.print back to summary

private Class PSPrinterJob.GState

extends Object
Class Inheritance

A stack of GStates is maintained to model the printer's gstate stack. Each GState holds information about the current graphics attributes.

Field Summary

Modifier and TypeField and Description
pack-priv Shape
pack-priv Color
pack-priv Font
pack-priv AffineTransform

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
pack-priv void
pack-priv void
pack-priv void
emitPSFont(int psFontIndex, float fontSize)

pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mClipback to summary
pack-priv Shape mClip
mColorback to summary
pack-priv Color mColor
mFontback to summary
pack-priv Font mFont
mTransformback to summary
pack-priv AffineTransform mTransform

Constructor Detail

GStateback to summary
pack-priv GState()
GStateback to summary
pack-priv GState(PSPrinterJob.GState copyGState)

Method Detail

canSetClipback to summary
pack-priv boolean canSetClip(Shape clip)
emitPSClipback to summary
pack-priv void emitPSClip(Shape clip)
emitPSColorback to summary
pack-priv void emitPSColor(Color color)
emitPSFontback to summary
pack-priv void emitPSFont(int psFontIndex, float fontSize)
emitTransformback to summary
pack-priv void emitTransform(AffineTransform transform)
sun.print back to summary

private Class PSPrinterJob.PrinterOpener

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv PrinterException
pack-priv OutputStream

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public OutputStream
run()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

pexback to summary
pack-priv PrinterException pex
resultback to summary
pack-priv OutputStream result

Constructor Detail

PrinterOpenerback to summary
private PrinterOpener()

Method Detail

runback to summary
public OutputStream run()
sun.print back to summary

private Class PSPrinterJob.PrinterSpooler

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv PrinterException

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
handleProcessFailure(final Process failedProcess, final String[] execCmd, final int result)

public Object
run()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

pexback to summary
pack-priv PrinterException pex

Constructor Detail

PrinterSpoolerback to summary
private PrinterSpooler()

Method Detail

handleProcessFailureback to summary
private void handleProcessFailure(final Process failedProcess, final String[] execCmd, final int result) throws IOException
runback to summary
public Object run()