java.awt
Class JobAttributes

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.JobAttributes
All Implemented Interfaces:
Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

public final class JobAttributes
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

A set of attributes which control a print job.

Instances of this class control the number of copies, default selection, destination, print dialog, file and printer names, page ranges, multiple document handling (including collation), and multi-page imposition (such as duplex) of every print job which uses the instance. Attribute names are compliant with the Internet Printing Protocol (IPP) 1.1 where possible. Attribute values are partially compliant where possible.

To use a method which takes an inner class type, pass a reference to one of the constant fields of the inner class. Client code cannot create new instances of the inner class types because none of those classes has a public constructor. For example, to set the print dialog type to the cross-platform, pure Java print dialog, use the following code:

 import java.awt.JobAttributes;

 public class PureJavaPrintDialogExample {
     public void setPureJavaPrintDialog(JobAttributes jobAttributes) {
         jobAttributes.setDialog(JobAttributes.DialogType.COMMON);
     }
 }
 

Every IPP attribute which supports an attributeName-default value has a corresponding setattributeNameToDefault method. Default value fields are not provided.


Nested Class Summary
static class JobAttributes.DefaultSelectionType sample code for java.awt.JobAttributes.DefaultSelectionType definition code for java.awt.JobAttributes.DefaultSelectionType
          A type-safe enumeration of possible default selection states.
static class JobAttributes.DestinationType sample code for java.awt.JobAttributes.DestinationType definition code for java.awt.JobAttributes.DestinationType
          A type-safe enumeration of possible job destinations.
static class JobAttributes.DialogType sample code for java.awt.JobAttributes.DialogType definition code for java.awt.JobAttributes.DialogType
          A type-safe enumeration of possible dialogs to display to the user.
static class JobAttributes.MultipleDocumentHandlingType sample code for java.awt.JobAttributes.MultipleDocumentHandlingType definition code for java.awt.JobAttributes.MultipleDocumentHandlingType
          A type-safe enumeration of possible multiple copy handling states.
static class JobAttributes.SidesType sample code for java.awt.JobAttributes.SidesType definition code for java.awt.JobAttributes.SidesType
          A type-safe enumeration of possible multi-page impositions.
 
Constructor Summary
JobAttributes sample code for java.awt.JobAttributes.JobAttributes() definition code for java.awt.JobAttributes.JobAttributes() ()
          Constructs a JobAttributes instance with default values for every attribute.
JobAttributes sample code for java.awt.JobAttributes.JobAttributes(int, java.awt.JobAttributes.DefaultSelectionType, java.awt.JobAttributes.DestinationType, java.awt.JobAttributes.DialogType, java.lang.String, int, int, java.awt.JobAttributes.MultipleDocumentHandlingType, int[][], java.lang.String, java.awt.JobAttributes.SidesType) definition code for java.awt.JobAttributes.JobAttributes(int, java.awt.JobAttributes.DefaultSelectionType, java.awt.JobAttributes.DestinationType, java.awt.JobAttributes.DialogType, java.lang.String, int, int, java.awt.JobAttributes.MultipleDocumentHandlingType, int[][], java.lang.String, java.awt.JobAttributes.SidesType) (int copies, JobAttributes.DefaultSelectionType sample code for java.awt.JobAttributes.DefaultSelectionType definition code for java.awt.JobAttributes.DefaultSelectionType  defaultSelection, JobAttributes.DestinationType sample code for java.awt.JobAttributes.DestinationType definition code for java.awt.JobAttributes.DestinationType  destination, JobAttributes.DialogType sample code for java.awt.JobAttributes.DialogType definition code for java.awt.JobAttributes.DialogType  dialog, String sample code for java.lang.String definition code for java.lang.String  fileName, int maxPage, int minPage, JobAttributes.MultipleDocumentHandlingType sample code for java.awt.JobAttributes.MultipleDocumentHandlingType definition code for java.awt.JobAttributes.MultipleDocumentHandlingType  multipleDocumentHandling, int[][] pageRanges, String sample code for java.lang.String definition code for java.lang.String  printer, JobAttributes.SidesType sample code for java.awt.JobAttributes.SidesType definition code for java.awt.JobAttributes.SidesType  sides)
          Constructs a JobAttributes instance with the specified values for every attribute.
JobAttributes sample code for java.awt.JobAttributes.JobAttributes(java.awt.JobAttributes) definition code for java.awt.JobAttributes.JobAttributes(java.awt.JobAttributes) (JobAttributes sample code for java.awt.JobAttributes definition code for java.awt.JobAttributes  obj)
          Constructs a JobAttributes instance which is a copy of the supplied JobAttributes.
 
Method Summary
 Object sample code for java.lang.Object definition code for java.lang.Object clone sample code for java.awt.JobAttributes.clone() definition code for java.awt.JobAttributes.clone() ()
          Creates and returns a copy of this JobAttributes.
 boolean equals sample code for java.awt.JobAttributes.equals(java.lang.Object) definition code for java.awt.JobAttributes.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Determines whether two JobAttributes are equal to each other.
 int getCopies sample code for java.awt.JobAttributes.getCopies() definition code for java.awt.JobAttributes.getCopies() ()
          Returns the number of copies the application should render for jobs using these attributes.
 JobAttributes.DefaultSelectionType sample code for java.awt.JobAttributes.DefaultSelectionType definition code for java.awt.JobAttributes.DefaultSelectionType getDefaultSelection sample code for java.awt.JobAttributes.getDefaultSelection() definition code for java.awt.JobAttributes.getDefaultSelection() ()
          Specifies whether, for jobs using these attributes, the application should print all pages, the range specified by the return value of getPageRanges, or the current selection.
 JobAttributes.DestinationType sample code for java.awt.JobAttributes.DestinationType definition code for java.awt.JobAttributes.DestinationType getDestination sample code for java.awt.JobAttributes.getDestination() definition code for java.awt.JobAttributes.getDestination() ()
          Specifies whether output will be to a printer or a file for jobs using these attributes.
 JobAttributes.DialogType sample code for java.awt.JobAttributes.DialogType definition code for java.awt.JobAttributes.DialogType getDialog sample code for java.awt.JobAttributes.getDialog() definition code for java.awt.JobAttributes.getDialog() ()
          Returns whether, for jobs using these attributes, the user should see a print dialog in which to modify the print settings, and which type of print dialog should be displayed.
 String sample code for java.lang.String definition code for java.lang.String getFileName sample code for java.awt.JobAttributes.getFileName() definition code for java.awt.JobAttributes.getFileName() ()
          Specifies the file name for the output file for jobs using these attributes.
 int getFromPage sample code for java.awt.JobAttributes.getFromPage() definition code for java.awt.JobAttributes.getFromPage() ()
          Returns, for jobs using these attributes, the first page to be printed, if a range of pages is to be printed.
 int getMaxPage sample code for java.awt.JobAttributes.getMaxPage() definition code for java.awt.JobAttributes.getMaxPage() ()
          Specifies the maximum value the user can specify as the last page to be printed for jobs using these attributes.
 int getMinPage sample code for java.awt.JobAttributes.getMinPage() definition code for java.awt.JobAttributes.getMinPage() ()
          Specifies the minimum value the user can specify as the first page to be printed for jobs using these attributes.
 JobAttributes.MultipleDocumentHandlingType sample code for java.awt.JobAttributes.MultipleDocumentHandlingType definition code for java.awt.JobAttributes.MultipleDocumentHandlingType getMultipleDocumentHandling sample code for java.awt.JobAttributes.getMultipleDocumentHandling() definition code for java.awt.JobAttributes.getMultipleDocumentHandling() ()
          Specifies the handling of multiple copies, including collation, for jobs using these attributes.
 int[][] getPageRanges sample code for java.awt.JobAttributes.getPageRanges() definition code for java.awt.JobAttributes.getPageRanges() ()
          Specifies, for jobs using these attributes, the ranges of pages to be printed, if a range of pages is to be printed.
 String sample code for java.lang.String definition code for java.lang.String getPrinter sample code for java.awt.JobAttributes.getPrinter() definition code for java.awt.JobAttributes.getPrinter() ()
          Returns the destination printer for jobs using these attributes.
 JobAttributes.SidesType sample code for java.awt.JobAttributes.SidesType definition code for java.awt.JobAttributes.SidesType getSides sample code for java.awt.JobAttributes.getSides() definition code for java.awt.JobAttributes.getSides() ()
          Returns how consecutive pages should be imposed upon the sides of the print medium for jobs using these attributes.
 int getToPage sample code for java.awt.JobAttributes.getToPage() definition code for java.awt.JobAttributes.getToPage() ()
          Returns, for jobs using these attributes, the last page (inclusive) to be printed, if a range of pages is to be printed.
 int hashCode sample code for java.awt.JobAttributes.hashCode() definition code for java.awt.JobAttributes.hashCode() ()
          Returns a hash code value for this JobAttributes.
 void set sample code for java.awt.JobAttributes.set(java.awt.JobAttributes) definition code for java.awt.JobAttributes.set(java.awt.JobAttributes) (JobAttributes sample code for java.awt.JobAttributes definition code for java.awt.JobAttributes  obj)
          Sets all of the attributes of this JobAttributes to the same values as the attributes of obj.
 void setCopies sample code for java.awt.JobAttributes.setCopies(int) definition code for java.awt.JobAttributes.setCopies(int) (int copies)
          Specifies the number of copies the application should render for jobs using these attributes.
 void setCopiesToDefault sample code for java.awt.JobAttributes.setCopiesToDefault() definition code for java.awt.JobAttributes.setCopiesToDefault() ()
          Sets the number of copies the application should render for jobs using these attributes to the default.
 void setDefaultSelection sample code for java.awt.JobAttributes.setDefaultSelection(java.awt.JobAttributes.DefaultSelectionType) definition code for java.awt.JobAttributes.setDefaultSelection(java.awt.JobAttributes.DefaultSelectionType) (JobAttributes.DefaultSelectionType sample code for java.awt.JobAttributes.DefaultSelectionType definition code for java.awt.JobAttributes.DefaultSelectionType  defaultSelection)
          Specifies whether, for jobs using these attributes, the application should print all pages, the range specified by the return value of getPageRanges, or the current selection.
 void setDestination sample code for java.awt.JobAttributes.setDestination(java.awt.JobAttributes.DestinationType) definition code for java.awt.JobAttributes.setDestination(java.awt.JobAttributes.DestinationType) (JobAttributes.DestinationType sample code for java.awt.JobAttributes.DestinationType definition code for java.awt.JobAttributes.DestinationType  destination)
          Specifies whether output will be to a printer or a file for jobs using these attributes.
 void setDialog sample code for java.awt.JobAttributes.setDialog(java.awt.JobAttributes.DialogType) definition code for java.awt.JobAttributes.setDialog(java.awt.JobAttributes.DialogType) (JobAttributes.DialogType sample code for java.awt.JobAttributes.DialogType definition code for java.awt.JobAttributes.DialogType  dialog)
          Specifies whether, for jobs using these attributes, the user should see a print dialog in which to modify the print settings, and which type of print dialog should be displayed.
 void setFileName sample code for java.awt.JobAttributes.setFileName(java.lang.String) definition code for java.awt.JobAttributes.setFileName(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  fileName)
          Specifies the file name for the output file for jobs using these attributes.
 void setFromPage sample code for java.awt.JobAttributes.setFromPage(int) definition code for java.awt.JobAttributes.setFromPage(int) (int fromPage)
          Specifies, for jobs using these attributes, the first page to be printed, if a range of pages is to be printed.
 void setMaxPage sample code for java.awt.JobAttributes.setMaxPage(int) definition code for java.awt.JobAttributes.setMaxPage(int) (int maxPage)
          Specifies the maximum value the user can specify as the last page to be printed for jobs using these attributes.
 void setMinPage sample code for java.awt.JobAttributes.setMinPage(int) definition code for java.awt.JobAttributes.setMinPage(int) (int minPage)
          Specifies the minimum value the user can specify as the first page to be printed for jobs using these attributes.
 void setMultipleDocumentHandling sample code for java.awt.JobAttributes.setMultipleDocumentHandling(java.awt.JobAttributes.MultipleDocumentHandlingType) definition code for java.awt.JobAttributes.setMultipleDocumentHandling(java.awt.JobAttributes.MultipleDocumentHandlingType) (JobAttributes.MultipleDocumentHandlingType sample code for java.awt.JobAttributes.MultipleDocumentHandlingType definition code for java.awt.JobAttributes.MultipleDocumentHandlingType  multipleDocumentHandling)
          Specifies the handling of multiple copies, including collation, for jobs using these attributes.
 void setMultipleDocumentHandlingToDefault sample code for java.awt.JobAttributes.setMultipleDocumentHandlingToDefault() definition code for java.awt.JobAttributes.setMultipleDocumentHandlingToDefault() ()
          Sets the handling of multiple copies, including collation, for jobs using these attributes to the default.
 void setPageRanges sample code for java.awt.JobAttributes.setPageRanges(int[][]) definition code for java.awt.JobAttributes.setPageRanges(int[][]) (int[][] pageRanges)
          Specifies, for jobs using these attributes, the ranges of pages to be printed, if a range of pages is to be printed.
 void setPrinter sample code for java.awt.JobAttributes.setPrinter(java.lang.String) definition code for java.awt.JobAttributes.setPrinter(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  printer)
          Specifies the destination printer for jobs using these attributes.
 void setSides sample code for java.awt.JobAttributes.setSides(java.awt.JobAttributes.SidesType) definition code for java.awt.JobAttributes.setSides(java.awt.JobAttributes.SidesType) (JobAttributes.SidesType sample code for java.awt.JobAttributes.SidesType definition code for java.awt.JobAttributes.SidesType  sides)
          Specifies how consecutive pages should be imposed upon the sides of the print medium for jobs using these attributes.
 void setSidesToDefault sample code for java.awt.JobAttributes.setSidesToDefault() definition code for java.awt.JobAttributes.setSidesToDefault() ()
          Sets how consecutive pages should be imposed upon the sides of the print medium for jobs using these attributes to the default.
 void setToPage sample code for java.awt.JobAttributes.setToPage(int) definition code for java.awt.JobAttributes.setToPage(int) (int toPage)
          Specifies, for jobs using these attributes, the last page (inclusive) to be printed, if a range of pages is to be printed.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for java.awt.JobAttributes.toString() definition code for java.awt.JobAttributes.toString() ()
          Returns a string representation of this JobAttributes.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

JobAttributes sample code for java.awt.JobAttributes() definition code for java.awt.JobAttributes()

public JobAttributes()
Constructs a JobAttributes instance with default values for every attribute. The dialog defaults to DialogType.NATIVE. Min page defaults to 1. Max page defaults to Integer.MAX_VALUE. Destination defaults to DestinationType.PRINTER. Selection defaults to DefaultSelectionType.ALL. Number of copies defaults to 1. Multiple document handling defaults to MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES. Sides defaults to SidesType.ONE_SIDED. File name defaults to null.


JobAttributes sample code for java.awt.JobAttributes(java.awt.JobAttributes) definition code for java.awt.JobAttributes(java.awt.JobAttributes)

public JobAttributes(JobAttributes sample code for java.awt.JobAttributes definition code for java.awt.JobAttributes  obj)
Constructs a JobAttributes instance which is a copy of the supplied JobAttributes.

Parameters:
obj - the JobAttributes to copy

JobAttributes sample code for java.awt.JobAttributes(int, java.awt.JobAttributes.DefaultSelectionType, java.awt.JobAttributes.DestinationType, java.awt.JobAttributes.DialogType, java.lang.String, int, int, java.awt.JobAttributes.MultipleDocumentHandlingType, int[][], java.lang.String, java.awt.JobAttributes.SidesType) definition code for java.awt.JobAttributes(int, java.awt.JobAttributes.DefaultSelectionType, java.awt.JobAttributes.DestinationType, java.awt.JobAttributes.DialogType, java.lang.String, int, int, java.awt.JobAttributes.MultipleDocumentHandlingType, int[][], java.lang.String, java.awt.JobAttributes.SidesType)

public JobAttributes(int copies,
                     JobAttributes.DefaultSelectionType sample code for java.awt.JobAttributes.DefaultSelectionType definition code for java.awt.JobAttributes.DefaultSelectionType  defaultSelection,
                     JobAttributes.DestinationType sample code for java.awt.JobAttributes.DestinationType definition code for java.awt.JobAttributes.DestinationType  destination,
                     JobAttributes.DialogType sample code for java.awt.JobAttributes.DialogType definition code for java.awt.JobAttributes.DialogType  dialog,
                     String sample code for java.lang.String definition code for java.lang.String  fileName,
                     int maxPage,
                     int minPage,
                     JobAttributes.MultipleDocumentHandlingType sample code for java.awt.JobAttributes.MultipleDocumentHandlingType definition code for java.awt.JobAttributes.MultipleDocumentHandlingType  multipleDocumentHandling,
                     int[][] pageRanges,
                     String sample code for java.lang.String definition code for java.lang.String  printer,
                     JobAttributes.SidesType sample code for java.awt.JobAttributes.SidesType definition code for java.awt.JobAttributes.SidesType  sides)
Constructs a JobAttributes instance with the specified values for every attribute.

Parameters:
copies - an integer greater than 0
defaultSelection - DefaultSelectionType.ALL, DefaultSelectionType.RANGE, or DefaultSelectionType.SELECTION
destination - DesintationType.FILE or DesintationType.PRINTER
dialog - DialogType.COMMON, DialogType.NATIVE, or DialogType.NONE
fileName - the possibly null file name
maxPage - an integer greater than zero and greater than or equal to minPage
minPage - an integer greater than zero and less than or equal to maxPage
multipleDocumentHandling - MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES or MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES
pageRanges - an array of integer arrays of two elements; an array is interpreted as a range spanning all pages including and between the specified pages; ranges must be in ascending order and must not overlap; specified page numbers cannot be less than minPage nor greater than maxPage; for example:
                (new int[][] { new int[] { 1, 3 }, new int[] { 5, 5 },
                               new int[] { 15, 19 } }),
          
specifies pages 1, 2, 3, 5, 15, 16, 17, 18, and 19. Note that (new int[][] { new int[] { 1, 1 }, new int[] { 1, 2 } }), is an invalid set of page ranges because the two ranges overlap
printer - the possibly null printer name
sides - SidesType.ONE_SIDED, SidesType.TWO_SIDED_LONG_EDGE, or SidesType.TWO_SIDED_SHORT_EDGE
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if one or more of the above conditions is violated
Method Detail

clone sample code for java.awt.JobAttributes.clone() definition code for java.awt.JobAttributes.clone()

public Object sample code for java.lang.Object definition code for java.lang.Object  clone()
Creates and returns a copy of this JobAttributes.

Overrides:
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
the newly created copy; it is safe to cast this Object into a JobAttributes
See Also:
Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

set sample code for java.awt.JobAttributes.set(java.awt.JobAttributes) definition code for java.awt.JobAttributes.set(java.awt.JobAttributes)

public void set(JobAttributes sample code for java.awt.JobAttributes definition code for java.awt.JobAttributes  obj)
Sets all of the attributes of this JobAttributes to the same values as the attributes of obj.

Parameters:
obj - the JobAttributes to copy

getCopies sample code for java.awt.JobAttributes.getCopies() definition code for java.awt.JobAttributes.getCopies()

public int getCopies()
Returns the number of copies the application should render for jobs using these attributes. This attribute is updated to the value chosen by the user.

Returns:
an integer greater than 0.

setCopies sample code for java.awt.JobAttributes.setCopies(int) definition code for java.awt.JobAttributes.setCopies(int)

public void setCopies(int copies)
Specifies the number of copies the application should render for jobs using these attributes. Not specifying this attribute is equivalent to specifying 1.

Parameters:
copies - an integer greater than 0
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if copies is less than or equal to 0

setCopiesToDefault sample code for java.awt.JobAttributes.setCopiesToDefault() definition code for java.awt.JobAttributes.setCopiesToDefault()

public void setCopiesToDefault()
Sets the number of copies the application should render for jobs using these attributes to the default. The default number of copies is 1.


getDefaultSelection sample code for java.awt.JobAttributes.getDefaultSelection() definition code for java.awt.JobAttributes.getDefaultSelection()

public JobAttributes.DefaultSelectionType sample code for java.awt.JobAttributes.DefaultSelectionType definition code for java.awt.JobAttributes.DefaultSelectionType  getDefaultSelection()
Specifies whether, for jobs using these attributes, the application should print all pages, the range specified by the return value of getPageRanges, or the current selection. This attribute is updated to the value chosen by the user.

Returns:
DefaultSelectionType.ALL, DefaultSelectionType.RANGE, or DefaultSelectionType.SELECTION

setDefaultSelection sample code for java.awt.JobAttributes.setDefaultSelection(java.awt.JobAttributes.DefaultSelectionType) definition code for java.awt.JobAttributes.setDefaultSelection(java.awt.JobAttributes.DefaultSelectionType)

public void setDefaultSelection(JobAttributes.DefaultSelectionType sample code for java.awt.JobAttributes.DefaultSelectionType definition code for java.awt.JobAttributes.DefaultSelectionType  defaultSelection)
Specifies whether, for jobs using these attributes, the application should print all pages, the range specified by the return value of getPageRanges, or the current selection. Not specifying this attribute is equivalent to specifying DefaultSelectionType.ALL.

Parameters:
defaultSelection - DefaultSelectionType.ALL, DefaultSelectionType.RANGE, or DefaultSelectionType.SELECTION.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if defaultSelection is null

getDestination sample code for java.awt.JobAttributes.getDestination() definition code for java.awt.JobAttributes.getDestination()

public JobAttributes.DestinationType sample code for java.awt.JobAttributes.DestinationType definition code for java.awt.JobAttributes.DestinationType  getDestination()
Specifies whether output will be to a printer or a file for jobs using these attributes. This attribute is updated to the value chosen by the user.

Returns:
DesintationType.FILE or DesintationType.PRINTER

setDestination sample code for java.awt.JobAttributes.setDestination(java.awt.JobAttributes.DestinationType) definition code for java.awt.JobAttributes.setDestination(java.awt.JobAttributes.DestinationType)

public void setDestination(JobAttributes.DestinationType sample code for java.awt.JobAttributes.DestinationType definition code for java.awt.JobAttributes.DestinationType  destination)
Specifies whether output will be to a printer or a file for jobs using these attributes. Not specifying this attribute is equivalent to specifying DesintationType.PRINTER.

Parameters:
destination - DesintationType.FILE or DesintationType.PRINTER.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if destination is null.

getDialog sample code for java.awt.JobAttributes.getDialog() definition code for java.awt.JobAttributes.getDialog()

public JobAttributes.DialogType sample code for java.awt.JobAttributes.DialogType definition code for java.awt.JobAttributes.DialogType  getDialog()
Returns whether, for jobs using these attributes, the user should see a print dialog in which to modify the print settings, and which type of print dialog should be displayed. DialogType.COMMON denotes a cross- platform, pure Java print dialog. DialogType.NATIVE denotes the platform's native print dialog. If a platform does not support a native print dialog, the pure Java print dialog is displayed instead. DialogType.NONE specifies no print dialog (i.e., background printing). This attribute cannot be modified by, and is not subject to any limitations of, the implementation or the target printer.

Returns:
DialogType.COMMON, DialogType.NATIVE, or DialogType.NONE

setDialog sample code for java.awt.JobAttributes.setDialog(java.awt.JobAttributes.DialogType) definition code for java.awt.JobAttributes.setDialog(java.awt.JobAttributes.DialogType)

public void setDialog(JobAttributes.DialogType sample code for java.awt.JobAttributes.DialogType definition code for java.awt.JobAttributes.DialogType  dialog)
Specifies whether, for jobs using these attributes, the user should see a print dialog in which to modify the print settings, and which type of print dialog should be displayed. DialogType.COMMON denotes a cross- platform, pure Java print dialog. DialogType.NATIVE denotes the platform's native print dialog. If a platform does not support a native print dialog, the pure Java print dialog is displayed instead. DialogType.NONE specifies no print dialog (i.e., background printing). Not specifying this attribute is equivalent to specifying DialogType.NATIVE.

Parameters:
dialog - DialogType.COMMON, DialogType.NATIVE, or DialogType.NONE.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if dialog is null.

getFileName sample code for java.awt.JobAttributes.getFileName() definition code for java.awt.JobAttributes.getFileName()

public String sample code for java.lang.String definition code for java.lang.String  getFileName()
Specifies the file name for the output file for jobs using these attributes. This attribute is updated to the value chosen by the user.

Returns:
the possibly null file name

setFileName sample code for java.awt.JobAttributes.setFileName(java.lang.String) definition code for java.awt.JobAttributes.setFileName(java.lang.String)

public void setFileName(String sample code for java.lang.String definition code for java.lang.String  fileName)
Specifies the file name for the output file for jobs using these attributes. Default is platform-dependent and implementation-defined.

Parameters:
fileName - the possibly null file name.

getFromPage sample code for java.awt.JobAttributes.getFromPage() definition code for java.awt.JobAttributes.getFromPage()

public int getFromPage()
Returns, for jobs using these attributes, the first page to be printed, if a range of pages is to be printed. This attribute is updated to the value chosen by the user. An application should ignore this attribute on output, unless the return value of the getDefaultSelection method is DefaultSelectionType.RANGE. An application should honor the return value of getPageRanges over the return value of this method, if possible.

Returns:
an integer greater than zero and less than or equal to toPage and greater than or equal to minPage and less than or equal to maxPage.

setFromPage sample code for java.awt.JobAttributes.setFromPage(int) definition code for java.awt.JobAttributes.setFromPage(int)

public void setFromPage(int fromPage)
Specifies, for jobs using these attributes, the first page to be printed, if a range of pages is to be printed. If this attribute is not specified, then the values from the pageRanges attribute are used. If pageRanges and either or both of fromPage and toPage are specified, pageRanges takes precedence. Specifying none of pageRanges, fromPage, or toPage is equivalent to calling setPageRanges(new int[][] { new int[] { minPage } });

Parameters:
fromPage - an integer greater than zero and less than or equal to toPage and greater than or equal to minPage and less than or equal to maxPage.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if one or more of the above conditions is violated.

getMaxPage sample code for java.awt.JobAttributes.getMaxPage() definition code for java.awt.JobAttributes.getMaxPage()

public int getMaxPage()
Specifies the maximum value the user can specify as the last page to be printed for jobs using these attributes. This attribute cannot be modified by, and is not subject to any limitations of, the implementation or the target printer.

Returns:
an integer greater than zero and greater than or equal to minPage.

setMaxPage sample code for java.awt.JobAttributes.setMaxPage(int) definition code for java.awt.JobAttributes.setMaxPage(int)

public void setMaxPage(int maxPage)
Specifies the maximum value the user can specify as the last page to be printed for jobs using these attributes. Not specifying this attribute is equivalent to specifying Integer.MAX_VALUE.

Parameters:
maxPage - an integer greater than zero and greater than or equal to minPage
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if one or more of the above conditions is violated

getMinPage sample code for java.awt.JobAttributes.getMinPage() definition code for java.awt.JobAttributes.getMinPage()

public int getMinPage()
Specifies the minimum value the user can specify as the first page to be printed for jobs using these attributes. This attribute cannot be modified by, and is not subject to any limitations of, the implementation or the target printer.

Returns:
an integer greater than zero and less than or equal to maxPage.

setMinPage sample code for java.awt.JobAttributes.setMinPage(int) definition code for java.awt.JobAttributes.setMinPage(int)

public void setMinPage(int minPage)
Specifies the minimum value the user can specify as the first page to be printed for jobs using these attributes. Not specifying this attribute is equivalent to specifying 1.

Parameters:
minPage - an integer greater than zero and less than or equal to maxPage.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if one or more of the above conditions is violated.

getMultipleDocumentHandling sample code for java.awt.JobAttributes.getMultipleDocumentHandling() definition code for java.awt.JobAttributes.getMultipleDocumentHandling()

public JobAttributes.MultipleDocumentHandlingType sample code for java.awt.JobAttributes.MultipleDocumentHandlingType definition code for java.awt.JobAttributes.MultipleDocumentHandlingType  getMultipleDocumentHandling()
Specifies the handling of multiple copies, including collation, for jobs using these attributes. This attribute is updated to the value chosen by the user.

Returns:
MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES or MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES.

setMultipleDocumentHandling sample code for java.awt.JobAttributes.setMultipleDocumentHandling(java.awt.JobAttributes.MultipleDocumentHandlingType) definition code for java.awt.JobAttributes.setMultipleDocumentHandling(java.awt.JobAttributes.MultipleDocumentHandlingType)

public void setMultipleDocumentHandling(JobAttributes.MultipleDocumentHandlingType sample code for java.awt.JobAttributes.MultipleDocumentHandlingType definition code for java.awt.JobAttributes.MultipleDocumentHandlingType  multipleDocumentHandling)
Specifies the handling of multiple copies, including collation, for jobs using these attributes. Not specifying this attribute is equivalent to specifying MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES.

Parameters:
multipleDocumentHandling - MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES or MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if multipleDocumentHandling is null.

setMultipleDocumentHandlingToDefault sample code for java.awt.JobAttributes.setMultipleDocumentHandlingToDefault() definition code for java.awt.JobAttributes.setMultipleDocumentHandlingToDefault()

public void setMultipleDocumentHandlingToDefault()
Sets the handling of multiple copies, including collation, for jobs using these attributes to the default. The default handling is MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES.


getPageRanges sample code for java.awt.JobAttributes.getPageRanges() definition code for java.awt.JobAttributes.getPageRanges()

public int[][] getPageRanges()
Specifies, for jobs using these attributes, the ranges of pages to be printed, if a range of pages is to be printed. All range numbers are inclusive. This attribute is updated to the value chosen by the user. An application should ignore this attribute on output, unless the return value of the getDefaultSelection method is DefaultSelectionType.RANGE.

Returns:
an array of integer arrays of 2 elements. An array is interpreted as a range spanning all pages including and between the specified pages. Ranges must be in ascending order and must not overlap. Specified page numbers cannot be less than minPage nor greater than maxPage. For example: (new int[][] { new int[] { 1, 3 }, new int[] { 5, 5 }, new int[] { 15, 19 } }), specifies pages 1, 2, 3, 5, 15, 16, 17, 18, and 19.

setPageRanges sample code for java.awt.JobAttributes.setPageRanges(int[][]) definition code for java.awt.JobAttributes.setPageRanges(int[][])

public void setPageRanges(int[][] pageRanges)
Specifies, for jobs using these attributes, the ranges of pages to be printed, if a range of pages is to be printed. All range numbers are inclusive. If this attribute is not specified, then the values from the fromPage and toPages attributes are used. If pageRanges and either or both of fromPage and toPage are specified, pageRanges takes precedence. Specifying none of pageRanges, fromPage, or toPage is equivalent to calling setPageRanges(new int[][] { new int[] { minPage, minPage } });

Parameters:
pageRanges - an array of integer arrays of 2 elements. An array is interpreted as a range spanning all pages including and between the specified pages. Ranges must be in ascending order and must not overlap. Specified page numbers cannot be less than minPage nor greater than maxPage. For example: (new int[][] { new int[] { 1, 3 }, new int[] { 5, 5 }, new int[] { 15, 19 } }), specifies pages 1, 2, 3, 5, 15, 16, 17, 18, and 19. Note that (new int[][] { new int[] { 1, 1 }, new int[] { 1, 2 } }), is an invalid set of page ranges because the two ranges overlap.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if one or more of the above conditions is violated.

getPrinter sample code for java.awt.JobAttributes.getPrinter() definition code for java.awt.JobAttributes.getPrinter()

public String sample code for java.lang.String definition code for java.lang.String  getPrinter()
Returns the destination printer for jobs using these attributes. This attribute is updated to the value chosen by the user.

Returns:
the possibly null printer name.

setPrinter sample code for java.awt.JobAttributes.setPrinter(java.lang.String) definition code for java.awt.JobAttributes.setPrinter(java.lang.String)

public void setPrinter(String sample code for java.lang.String definition code for java.lang.String  printer)
Specifies the destination printer for jobs using these attributes. Default is platform-dependent and implementation-defined.

Parameters:
printer - the possibly null printer name.

getSides sample code for java.awt.JobAttributes.getSides() definition code for java.awt.JobAttributes.getSides()

public JobAttributes.SidesType sample code for java.awt.JobAttributes.SidesType definition code for java.awt.JobAttributes.SidesType  getSides()
Returns how consecutive pages should be imposed upon the sides of the print medium for jobs using these attributes. SidesType.ONE_SIDED imposes each consecutive page upon the same side of consecutive media sheets. This imposition is sometimes called simplex. SidesType.TWO_SIDED_LONG_EDGE imposes each consecutive pair of pages upon front and back sides of consecutive media sheets, such that the orientation of each pair of pages on the medium would be correct for the reader as if for binding on the long edge. This imposition is sometimes called duplex. SidesType.TWO_SIDED_SHORT_EDGE imposes each consecutive pair of pages upon front and back sides of consecutive media sheets, such that the orientation of each pair of pages on the medium would be correct for the reader as if for binding on the short edge. This imposition is sometimes called tumble. This attribute is updated to the value chosen by the user.

Returns:
SidesType.ONE_SIDED, SidesType.TWO_SIDED_LONG_EDGE, or SidesType.TWO_SIDED_SHORT_EDGE.

setSides sample code for java.awt.JobAttributes.setSides(java.awt.JobAttributes.SidesType) definition code for java.awt.JobAttributes.setSides(java.awt.JobAttributes.SidesType)

public void setSides(JobAttributes.SidesType sample code for java.awt.JobAttributes.SidesType definition code for java.awt.JobAttributes.SidesType  sides)
Specifies how consecutive pages should be imposed upon the sides of the print medium for jobs using these attributes. SidesType.ONE_SIDED imposes each consecutive page upon the same side of consecutive media sheets. This imposition is sometimes called simplex. SidesType.TWO_SIDED_LONG_EDGE imposes each consecutive pair of pages upon front and back sides of consecutive media sheets, such that the orientation of each pair of pages on the medium would be correct for the reader as if for binding on the long edge. This imposition is sometimes called duplex. SidesType.TWO_SIDED_SHORT_EDGE imposes each consecutive pair of pages upon front and back sides of consecutive media sheets, such that the orientation of each pair of pages on the medium would be correct for the reader as if for binding on the short edge. This imposition is sometimes called tumble. Not specifying this attribute is equivalent to specifying SidesType.ONE_SIDED.

Parameters:
sides - SidesType.ONE_SIDED, SidesType.TWO_SIDED_LONG_EDGE, or SidesType.TWO_SIDED_SHORT_EDGE.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if sides is null.

setSidesToDefault sample code for java.awt.JobAttributes.setSidesToDefault() definition code for java.awt.JobAttributes.setSidesToDefault()

public void setSidesToDefault()
Sets how consecutive pages should be imposed upon the sides of the print medium for jobs using these attributes to the default. The default imposition is SidesType.ONE_SIDED.


getToPage sample code for java.awt.JobAttributes.getToPage() definition code for java.awt.JobAttributes.getToPage()

public int getToPage()
Returns, for jobs using these attributes, the last page (inclusive) to be printed, if a range of pages is to be printed. This attribute is updated to the value chosen by the user. An application should ignore this attribute on output, unless the return value of the getDefaultSelection method is DefaultSelectionType.RANGE. An application should honor the return value of getPageRanges over the return value of this method, if possible.

Returns:
an integer greater than zero and greater than or equal to toPage and greater than or equal to minPage and less than or equal to maxPage.

setToPage sample code for java.awt.JobAttributes.setToPage(int) definition code for java.awt.JobAttributes.setToPage(int)

public void setToPage(int toPage)
Specifies, for jobs using these attributes, the last page (inclusive) to be printed, if a range of pages is to be printed. If this attribute is not specified, then the values from the pageRanges attribute are used. If pageRanges and either or both of fromPage and toPage are specified, pageRanges takes precedence. Specifying none of pageRanges, fromPage, or toPage is equivalent to calling setPageRanges(new int[][] { new int[] { minPage } });

Parameters:
toPage - an integer greater than zero and greater than or equal to fromPage and greater than or equal to minPage and less than or equal to maxPage.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if one or more of the above conditions is violated.

equals sample code for java.awt.JobAttributes.equals(java.lang.Object) definition code for java.awt.JobAttributes.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  obj)
Determines whether two JobAttributes are equal to each other.

Two JobAttributes are equal if and only if each of their attributes are equal. Attributes of enumeration type are equal if and only if the fields refer to the same unique enumeration object. A set of page ranges is equal if and only if the sets are of equal length, each range enumerates the same pages, and the ranges are in the same order.

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
obj - the object whose equality will be checked.
Returns:
whether obj is equal to this JobAttribute according to the above criteria.
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

hashCode sample code for java.awt.JobAttributes.hashCode() definition code for java.awt.JobAttributes.hashCode()

public int hashCode()
Returns a hash code value for this JobAttributes.

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
the hash code.
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

toString sample code for java.awt.JobAttributes.toString() definition code for java.awt.JobAttributes.toString()

public String sample code for java.lang.String definition code for java.lang.String  toString()
Returns a string representation of this JobAttributes.

Overrides:
toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
the string representation.