Style Intelligence v12.0

inetsoft.report
Class Win32Printer

java.lang.Object
  extended by java.awt.Graphics
      extended by java.awt.Graphics2D
          extended by inetsoft.report.internal.j2d.Win32Graphics2D
              extended by inetsoft.report.Win32Printer
All Implemented Interfaces:
inetsoft.report.internal.CustomGraphics, PrinterGraphics, PrintGraphics, Cloneable

public class Win32Printer
extends inetsoft.report.internal.j2d.Win32Graphics2D
implements PrintGraphics

Win32Printer is a Graphics subclass that can be used to print to a printer on a Win32 (Win95, Win98, Win NT ...) platform.


Field Summary
static int CREATE_DEFAULT
          Create a printer object for the default printer.
static int CREATE_NEW
          Create a printer object for any available printer.
 
Fields inherited from class inetsoft.report.internal.j2d.Win32Graphics2D
wing
 
Fields inherited from interface inetsoft.report.internal.CustomGraphics
G_DASH_LINE, JPEG_EXPORT
 
Constructor Summary
protected Win32Printer()
          Win32Printer should not be created directly.
 
Method Summary
protected  int create0(int opt)
          Create the device context.
protected  int create1(String printername)
          Create the device context.
 String getJobName()
          Gets the name of the document to be printed.
 int getOrientation()
          Returns the orientation of this PageFormat.
static Win32Printer getPrinter(int opt)
          Create a Win32 printer object.
static Win32Printer getPrinter(String printername)
          Create a Win32 printer object of the named printer.
static Win32Printer getPrinter(String printername, String jobname)
          Create a Win32 printer object of the named printer.
 PrintJob getPrintJob()
          Get the printjob object associated with this object, which contains the page size and resolution information.
protected  int getResolution()
          Return the page resolution.
protected  void init()
          Initialize printer parameters.
 boolean isDuplex()
          Returns the duplex setting of this printer.
protected  void nextPage()
          Start printing of a new page.
 void setDuplex(boolean dup)
          Sets the duplex setting of this printer.
 void setJobName(String jobName)
          Sets the name of the document to be printed.
 void setOrientation(int orientation)
          Sets the page orientation.
 void setTray(int tray)
          Set the paper source on printer.
protected  int startDoc0(String jobname)
          Starting printing.
 
Methods inherited from class inetsoft.report.internal.j2d.Win32Graphics2D
addRenderingHints, clearRect, clip, clipRect, clipRect, close, copyArea, create, dispose, doImage, doImage, doImage, draw, drawArc, drawGlyphVector, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawLine, drawOval, drawPolygon, drawPolyline, drawRect, drawRenderableImage, drawRenderedImage, drawRoundRect, drawString, drawString, drawString, drawString, fill, fillArc, fillOval, fillPolygon, fillRect, fillRoundRect, getBackground, getClip, getClipBounds, getColor, getComposite, getCopies, getDeviceConfiguration, getFont, getFontMetrics, getFontRenderContext, getFromPage, getGraphics, getPageSize, getPaint, getPrinterJob, getRenderingHint, getRenderingHints, getStroke, getToPage, getTransform, hit, isPages, isSupported, printDialog, rotate, rotate, scale, setBackground, setClip, setClip, setClip, setColor, setComposite, setCopies, setFont, setPaint, setPaintMode, setPrinterJob, setRenderingHint, setRenderingHints, setStroke, setTransform, setXORMode, shear, startDoc, startPage, 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
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CREATE_DEFAULT

public static final int CREATE_DEFAULT
Create a printer object for the default printer. No printer dialog is used.

See Also:
Constant Field Values

CREATE_NEW

public static final int CREATE_NEW
Create a printer object for any available printer. Users make the selection through the printer dialog.

See Also:
Constant Field Values
Constructor Detail

Win32Printer

protected Win32Printer()
Win32Printer should not be created directly.

Method Detail

getPrinter

public static Win32Printer getPrinter(int opt)
Create a Win32 printer object. The option specifies whether to create using the default printer (without printer dialog interaction) or asking users to pick one from the printer dialog.

Parameters:
opt - CREATE_NEW or CREATE_DEFAULT.
Returns:
printer object.

getPrinter

public static Win32Printer getPrinter(String printername)
Create a Win32 printer object of the named printer.

Parameters:
printername - system printer name.
Returns:
printer object.

getPrinter

public static Win32Printer getPrinter(String printername,
                                      String jobname)
Create a Win32 printer object of the named printer.

Parameters:
printername - system printer name.
jobname - printer job name.
Returns:
printer object.

create0

protected int create0(int opt)
Create the device context. The option specifies whether to get the DC from default printer, printer dialog, or the current printer.

Parameters:
opt - option.
Returns:
0 if error.

create1

protected int create1(String printername)
Create the device context. The name must be a printer name on the system.

Parameters:
printername - system printer name.
Returns:
0 if error.

startDoc0

protected int startDoc0(String jobname)
Starting printing.


init

protected void init()
Initialize printer parameters.


nextPage

protected void nextPage()
Start printing of a new page.


getResolution

protected int getResolution()
Return the page resolution. Defaults to 72.


setJobName

public void setJobName(String jobName)
Sets the name of the document to be printed. The document name can not be null.

Parameters:
jobName - the name of the document to be printed

getJobName

public String getJobName()
Gets the name of the document to be printed.

Returns:
the name of the document to be printed.

setOrientation

public void setOrientation(int orientation)
Sets the page orientation. orientation must be one of the constants: PORTRAIT, LANDSCAPE.

Specified by:
setOrientation in interface inetsoft.report.internal.CustomGraphics
Overrides:
setOrientation in class inetsoft.report.internal.j2d.Win32Graphics2D
Parameters:
orientation - the new orientation for the page

getOrientation

public int getOrientation()
Returns the orientation of this PageFormat.

Overrides:
getOrientation in class inetsoft.report.internal.j2d.Win32Graphics2D
Returns:
this PageFormat object's orientation.

setTray

public void setTray(int tray)
Set the paper source on printer.

Overrides:
setTray in class inetsoft.report.internal.j2d.Win32Graphics2D
Parameters:
tray - one of the tray selector defined in StyleConstants or an user defined tray.

setDuplex

public void setDuplex(boolean dup)
Sets the duplex setting of this printer.

Overrides:
setDuplex in class inetsoft.report.internal.j2d.Win32Graphics2D
Parameters:
dup - true to enable duplex printing.

isDuplex

public boolean isDuplex()
Returns the duplex setting of this printer.

Overrides:
isDuplex in class inetsoft.report.internal.j2d.Win32Graphics2D
Returns:
true if duplex is enabled;

getPrintJob

public PrintJob getPrintJob()
Get the printjob object associated with this object, which contains the page size and resolution information.

Specified by:
getPrintJob in interface PrintGraphics
Returns:
print job object.

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.