dirk_krause.tools
Class DkPrintClient

java.lang.Object
  extended by dirk_krause.tools.DkPrintClient

public class DkPrintClient
extends java.lang.Object

Objects of this class can be used to send print jobs to the print system. The job can be either a Printable or a String or a byte array containing PostScript. The webstart variant can handle Printable objects only.


Field Summary
protected  javax.print.attribute.PrintRequestAttributeSet asetPr
          Attribute set to print a Printable object.
protected  javax.print.attribute.PrintRequestAttributeSet asetPs
          Attribute set to print PS contents.
static java.lang.String[] def_t
          Default strings to show if not string file is found.
static javax.print.DocFlavor dfPr
          Document flavor for Printable documents.
static javax.print.DocFlavor dfPs
          Document flavor for PS documents.
protected  DkTool dkt
          General tool.
protected  java.lang.String[] psNamesPr
          Names of the print services for a Printable.
protected  java.lang.String[] psNamesPs
          Names of the print services for PS.
protected  javax.print.PrintService[] psPr
          Print services which can handle a Printable.
protected  javax.print.PrintService[] psPs
          Print services which can handle PS.
protected  int psSelPr
          Currently selected Printable printer.
protected  int psSelPs
          Currently selected PS printer.
static java.lang.String[] t
          Strings to show, either from file or the default strings.
 
Constructor Summary
DkPrintClient(DkTool d)
          Constructor.
 
Method Summary
 DkPrintResult handleJob(javax.swing.JFrame w, java.lang.String psData, java.awt.print.Printable pr)
          Submit one print job.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

def_t

public static final java.lang.String[] def_t
Default strings to show if not string file is found.


t

public static java.lang.String[] t
Strings to show, either from file or the default strings.


dkt

protected DkTool dkt
General tool.


dfPs

public static javax.print.DocFlavor dfPs
Document flavor for PS documents.


dfPr

public static javax.print.DocFlavor dfPr
Document flavor for Printable documents.


asetPs

protected javax.print.attribute.PrintRequestAttributeSet asetPs
Attribute set to print PS contents.


asetPr

protected javax.print.attribute.PrintRequestAttributeSet asetPr
Attribute set to print a Printable object.


psPs

protected javax.print.PrintService[] psPs
Print services which can handle PS.


psPr

protected javax.print.PrintService[] psPr
Print services which can handle a Printable.


psNamesPs

protected java.lang.String[] psNamesPs
Names of the print services for PS.


psNamesPr

protected java.lang.String[] psNamesPr
Names of the print services for a Printable.


psSelPs

protected int psSelPs
Currently selected PS printer.


psSelPr

protected int psSelPr
Currently selected Printable printer.

Constructor Detail

DkPrintClient

public DkPrintClient(DkTool d)
Constructor.

Parameters:
d - General tool.
Method Detail

handleJob

public DkPrintResult handleJob(javax.swing.JFrame w,
                               java.lang.String psData,
                               java.awt.print.Printable pr)
Submit one print job.

Parameters:
w - The window originating the request.
psData - PS data to print.
pr - Printable to print.
Returns:
Result object to indicate success/error and detailed information.