Class Print

java.lang.Object
  |
  +--Print

public class Print
extends java.lang.Object


Constructor Summary
Print()
           
 
Method Summary
 void addPrintAListener(javax.print.PrintService service)
          Add PrintAttributeListener to the service. This monitors the changes in Print Service Attributes.
 void addPrintAListener(javax.print.PrintService[] service)
          Add PrintAttributeListener to the all Print services. This monitors the changes in Print Service Attributes.
 void addPrintJListener(javax.print.DocPrintJob job)
          Add printJobListeners to monitor the print job status. This monitors the changes in Print job status.
 void compromiseAttribute(int n)
          Removes the requested attributes from the set to get at least one Print Service
 javax.print.DocPrintJob createDocPrintJob(javax.print.PrintService ps)
          Creates a Print Job from one of the Print Services
 javax.print.Doc createFinalDoc()
          Create a Doc for printing
 java.lang.String[] getCompromised()
          Returns the name of compromised attribute
 javax.print.PrintService getDefaultPrintService()
          Discover the default printer Service
 void getDocProperies()
          Gets the document's requested attributes
 javax.print.PrintService[] getPrintServices()
          Discovers the printers that can print with requested attribute set
 javax.print.PrintService[] getServices()
          returns an array of printServices
 boolean isSupportedFileType(java.lang.String lfiletypestr)
          Check for the supported file types. File type is important for proper printing.
 javax.print.PrintService[] listPrinters()
          List all the services
 void loadFile(java.lang.String lfilename)
          Loads the file to print; this method doesn't check for correctness of file Type specified. It just loads the file from Input stream.
static void main(java.lang.String[] args)
           
static void printJob(javax.print.DocPrintJob dpj, javax.print.Doc d)
          Prints the Print Job to the specified printService
 void setDocFlavor()
          Sets Document Flavor Type (DocFlavor) which will be used by PrintServiceLookup and also to create a Doc for Print Service
 void setRequest()
          Creates the request for print service with specified attributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Print

public Print()
Method Detail

getDocProperies

public void getDocProperies()
Gets the document's requested attributes. This looks for the .props file in the current directory and throws a FileNotFoundException if it is not found.

Returns:
none
Throws:
java.io.FileNotFoundException

isSupportedFileType

public boolean isSupportedFileType(java.lang.String lfiletypestr)
Check for the supported file types. File type is important for proper printing.

Returns:
true or false

loadFile

public void loadFile(java.lang.String lfilename)
Loads the file to print; this method doesn't check for correctness of file Type specified. It just loads the file from Input stream.

Returns:
void

getDefaultPrintService

public javax.print.PrintService getDefaultPrintService()
Discover the default printer Service


listPrinters

public javax.print.PrintService[] listPrinters()
List all the services

Returns:
Array of Services

getPrintServices

public javax.print.PrintService[] getPrintServices()
Discovers the printers that can print with requested attribute set


createDocPrintJob

public javax.print.DocPrintJob createDocPrintJob(javax.print.PrintService ps)
Creates a Print Job from one of the Print Services

Returns:
DocprintJob

printJob

public static void printJob(javax.print.DocPrintJob dpj,
                            javax.print.Doc d)
Prints the Print Job to the specified printService

Returns:
void

setRequest

public void setRequest()
Creates the request for print service with specified attributes


setDocFlavor

public void setDocFlavor()
Sets Document Flavor Type (DocFlavor) which will be used by PrintServiceLookup and also to create a Doc for Print Service

Returns:
void

createFinalDoc

public javax.print.Doc createFinalDoc()
Create a Doc for printing; will use SimpleDoc for now

Returns:
Doc

addPrintAListener

public void addPrintAListener(javax.print.PrintService service)
Add PrintAttributeListener to the service. This monitors the changes in Print Service Attributes.

Returns:
void

addPrintAListener

public void addPrintAListener(javax.print.PrintService[] service)
Add PrintAttributeListener to the all Print services. This monitors the changes in Print Service Attributes.

Returns:
void

addPrintJListener

public void addPrintJListener(javax.print.DocPrintJob job)
Add printJobListeners to monitor the print job status. This monitors the changes in Print job status.

Returns:
void

compromiseAttribute

public void compromiseAttribute(int n)
Removes the requested attributes from the set to get at least one Print Service

Returns:
none

getCompromised

public java.lang.String[] getCompromised()
Returns the name of compromised attribute

Returns:
compromised attribute string

getServices

public javax.print.PrintService[] getServices()
returns a array of printServices

Returns:
PrintService[]

main

public static void main(java.lang.String[] args)