APIdia Launch Partner
Top Description Inners Fields Constructors Methods
java.awt

public final Class JobAttributes

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
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.

Author
David Mendenhall
Since
1.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
JobAttributes.DefaultSelectionType

A type-safe enumeration of possible default selection states.

public static class
JobAttributes.DestinationType

A type-safe enumeration of possible job destinations.

public static class
JobAttributes.DialogType

A type-safe enumeration of possible dialogs to display to the user.

public static class
JobAttributes.MultipleDocumentHandlingType

A type-safe enumeration of possible multiple copy handling states.

public static class
JobAttributes.SidesType

A type-safe enumeration of possible multi-page impositions.

Field Summary

Modifier and TypeField and Description
private int
private JobAttributes.DefaultSelectionType
private JobAttributes.DestinationType
private JobAttributes.DialogType
private String
private int
private int
private int
private JobAttributes.MultipleDocumentHandlingType
private int[][]
private int
private String
private int
private JobAttributes.SidesType
private int

Constructor Summary

AccessConstructor and Description
public
JobAttributes()

Constructs a JobAttributes instance with default values for every attribute.

public
JobAttributes(JobAttributes
the JobAttributes to copy
obj
)

Constructs a JobAttributes instance which is a copy of the supplied JobAttributes.

public
JobAttributes(int
an integer greater than 0
copies
,
JobAttributes.DefaultSelectionType
DefaultSelectionType.ALL, DefaultSelectionType.RANGE, or DefaultSelectionType.SELECTION
defaultSelection
,
JobAttributes.DestinationType
DestinationType.FILE or DestinationType.PRINTER
destination
,
JobAttributes.DialogType
DialogType.COMMON, DialogType.NATIVE, or DialogType.NONE
dialog
,
String
the possibly null file name
fileName
,
int
an integer greater than zero and greater than or equal to minPage
maxPage
,
int
an integer greater than zero and less than or equal to maxPage
minPage
,
JobAttributes.MultipleDocumentHandlingType
MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES or MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES
multipleDocumentHandling
,
int[][]
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
pageRanges
,
String
the possibly null printer name
printer
,
JobAttributes.SidesType
SidesType.ONE_SIDED, SidesType.TWO_SIDED_LONG_EDGE, or SidesType.TWO_SIDED_SHORT_EDGE
sides
)

Constructs a JobAttributes instance with the specified values for every attribute.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the newly created copy; it is safe to cast this Object into a JobAttributes
clone
()

Overrides java.lang.Object.clone.

Creates and returns a copy of this JobAttributes.

public boolean

Returns:

whether obj is equal to this JobAttribute according to the above criteria.
equals
(Object
the object whose equality will be checked.
obj
)

Overrides java.lang.Object.equals.

Determines whether two JobAttributes are equal to each other.

public int

Returns:

an integer greater than 0.
getCopies
()

Returns the number of copies the application should render for jobs using these attributes.

public JobAttributes.DefaultSelectionType

Returns:

DefaultSelectionType.ALL, DefaultSelectionType.RANGE, or DefaultSelectionType.SELECTION
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.

public JobAttributes.DestinationType

Returns:

DestinationType.FILE or DestinationType.PRINTER
getDestination
()

Specifies whether output will be to a printer or a file for jobs using these attributes.

public JobAttributes.DialogType

Returns:

DialogType.COMMON, DialogType.NATIVE, or DialogType.NONE
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.

public String

Returns:

the possibly null file name
getFileName
()

Specifies the file name for the output file for jobs using these attributes.

public int

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.
getFromPage
()

Returns, for jobs using these attributes, the first page to be printed, if a range of pages is to be printed.

public int

Returns:

an integer greater than zero and greater than or equal to minPage.
getMaxPage
()

Specifies the maximum value the user can specify as the last page to be printed for jobs using these attributes.

public int

Returns:

an integer greater than zero and less than or equal to maxPage.
getMinPage
()

Specifies the minimum value the user can specify as the first page to be printed for jobs using these attributes.

public JobAttributes.MultipleDocumentHandlingType

Returns:

MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES or MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES.
getMultipleDocumentHandling
()

Specifies the handling of multiple copies, including collation, for jobs using these attributes.

public int[][]

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.
getPageRanges
()

Specifies, for jobs using these attributes, the ranges of pages to be printed, if a range of pages is to be printed.

public String

Returns:

the possibly null printer name.
getPrinter
()

Returns the destination printer for jobs using these attributes.

public JobAttributes.SidesType

Returns:

SidesType.ONE_SIDED, SidesType.TWO_SIDED_LONG_EDGE, or SidesType.TWO_SIDED_SHORT_EDGE.
getSides
()

Returns how consecutive pages should be imposed upon the sides of the print medium for jobs using these attributes.

public int

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.
getToPage
()

Returns, for jobs using these attributes, the last page (inclusive) to be printed, if a range of pages is to be printed.

public int

Returns:

the hash code.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this JobAttributes.

public void
set(JobAttributes
the JobAttributes to copy
obj
)

Sets all of the attributes of this JobAttributes to the same values as the attributes of obj.

public void
setCopies(int
an integer greater than 0
copies
)

Specifies the number of copies the application should render for jobs using these attributes.

public void
setCopiesToDefault()

Sets the number of copies the application should render for jobs using these attributes to the default.

public void
setDefaultSelection(JobAttributes.DefaultSelectionType
DefaultSelectionType.ALL, DefaultSelectionType.RANGE, or DefaultSelectionType.SELECTION.
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.

public void
setDestination(JobAttributes.DestinationType
DestinationType.FILE or DestinationType.PRINTER.
destination
)

Specifies whether output will be to a printer or a file for jobs using these attributes.

public void
setDialog(JobAttributes.DialogType
DialogType.COMMON, DialogType.NATIVE, or DialogType.NONE.
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.

public void
setFileName(String
the possibly null file name.
fileName
)

Specifies the file name for the output file for jobs using these attributes.

public void
setFromPage(int
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.
fromPage
)

Specifies, for jobs using these attributes, the first page to be printed, if a range of pages is to be printed.

public void
setMaxPage(int
an integer greater than zero and greater than or equal to minPage
maxPage
)

Specifies the maximum value the user can specify as the last page to be printed for jobs using these attributes.

public void
setMinPage(int
an integer greater than zero and less than or equal to maxPage.
minPage
)

Specifies the minimum value the user can specify as the first page to be printed for jobs using these attributes.

public void
setMultipleDocumentHandling(JobAttributes.MultipleDocumentHandlingType
MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES or MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES.
multipleDocumentHandling
)

Specifies the handling of multiple copies, including collation, for jobs using these attributes.

public void
setMultipleDocumentHandlingToDefault()

Sets the handling of multiple copies, including collation, for jobs using these attributes to the default.

public void
setPageRanges(int[][]
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.
pageRanges
)

Specifies, for jobs using these attributes, the ranges of pages to be printed, if a range of pages is to be printed.

public void
setPrinter(String
the possibly null printer name.
printer
)

Specifies the destination printer for jobs using these attributes.

public void
setSides(JobAttributes.SidesType
SidesType.ONE_SIDED, SidesType.TWO_SIDED_LONG_EDGE, or SidesType.TWO_SIDED_SHORT_EDGE.
sides
)

Specifies how consecutive pages should be imposed upon the sides of the print medium for jobs using these attributes.

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.

public void
setToPage(int
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.
toPage
)

Specifies, for jobs using these attributes, the last page (inclusive) to be printed, if a range of pages is to be printed.

public String

Returns:

the string representation.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of this JobAttributes.

Inherited from java.lang.Object:
finalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

copiesback to summary
private int copies
defaultSelectionback to summary
private JobAttributes.DefaultSelectionType defaultSelection
destinationback to summary
private JobAttributes.DestinationType destination
dialogback to summary
private JobAttributes.DialogType dialog
fileNameback to summary
private String fileName
fromPageback to summary
private int fromPage
maxPageback to summary
private int maxPage
minPageback to summary
private int minPage
multipleDocumentHandlingback to summary
private JobAttributes.MultipleDocumentHandlingType multipleDocumentHandling
pageRangesback to summary
private int[][] pageRanges
prFirstback to summary
private int prFirst
printerback to summary
private String printer
prLastback to summary
private int prLast
sidesback to summary
private JobAttributes.SidesType sides
toPageback to summary
private int toPage

Constructor Detail

JobAttributesback to summary
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.

JobAttributesback to summary
public JobAttributes(JobAttributes obj)

Constructs a JobAttributes instance which is a copy of the supplied JobAttributes.

Parameters
obj:JobAttributes

the JobAttributes to copy

JobAttributesback to summary
public JobAttributes(int copies, JobAttributes.DefaultSelectionType defaultSelection, JobAttributes.DestinationType destination, JobAttributes.DialogType dialog, String fileName, int maxPage, int minPage, JobAttributes.MultipleDocumentHandlingType multipleDocumentHandling, int[][] pageRanges, String printer, JobAttributes.SidesType sides)

Constructs a JobAttributes instance with the specified values for every attribute.

Parameters
copies:int

an integer greater than 0

defaultSelection:JobAttributes.DefaultSelectionType

DefaultSelectionType.ALL, DefaultSelectionType.RANGE, or DefaultSelectionType.SELECTION

destination:JobAttributes.DestinationType

DestinationType.FILE or DestinationType.PRINTER

dialog:JobAttributes.DialogType

DialogType.COMMON, DialogType.NATIVE, or DialogType.NONE

fileName:String

the possibly null file name

maxPage:int

an integer greater than zero and greater than or equal to minPage

minPage:int

an integer greater than zero and less than or equal to maxPage

multipleDocumentHandling:JobAttributes.MultipleDocumentHandlingType

MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES or MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES

pageRanges:int[][]

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:String

the possibly null printer name

sides:JobAttributes.SidesType

SidesType.ONE_SIDED, SidesType.TWO_SIDED_LONG_EDGE, or SidesType.TWO_SIDED_SHORT_EDGE

Exceptions
IllegalArgumentException:
if one or more of the above conditions is violated

Method Detail

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this JobAttributes.

Returns:Object

the newly created copy; it is safe to cast this Object into a JobAttributes

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

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.

Parameters
obj:Object

the object whose equality will be checked.

Returns:boolean

whether obj is equal to this JobAttribute according to the above criteria.

getCopiesback to summary
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:int

an integer greater than 0.

getDefaultSelectionback to summary
public 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:JobAttributes.DefaultSelectionType

DefaultSelectionType.ALL, DefaultSelectionType.RANGE, or DefaultSelectionType.SELECTION

getDestinationback to summary
public 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:JobAttributes.DestinationType

DestinationType.FILE or DestinationType.PRINTER

getDialogback to summary
public 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:JobAttributes.DialogType

DialogType.COMMON, DialogType.NATIVE, or DialogType.NONE

getFileNameback to summary
public 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:String

the possibly null file name

getFromPageback to summary
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:int

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.

getMaxPageback to summary
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:int

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

getMinPageback to summary
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:int

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

getMultipleDocumentHandlingback to summary
public 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:JobAttributes.MultipleDocumentHandlingType

MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES or MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES.

getPageRangesback to summary
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:int[][]

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.

getPrinterback to summary
public String getPrinter()

Returns the destination printer for jobs using these attributes. This attribute is updated to the value chosen by the user.

Returns:String

the possibly null printer name.

getSidesback to summary
public 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:JobAttributes.SidesType

SidesType.ONE_SIDED, SidesType.TWO_SIDED_LONG_EDGE, or SidesType.TWO_SIDED_SHORT_EDGE.

getToPageback to summary
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:int

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.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this JobAttributes.

Returns:int

the hash code.

setback to summary
public void set(JobAttributes obj)

Sets all of the attributes of this JobAttributes to the same values as the attributes of obj.

Parameters
obj:JobAttributes

the JobAttributes to copy

setCopiesback to summary
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:int

an integer greater than 0

Exceptions
IllegalArgumentException:
if copies is less than or equal to 0
setCopiesToDefaultback to summary
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.

setDefaultSelectionback to summary
public void setDefaultSelection(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:JobAttributes.DefaultSelectionType

DefaultSelectionType.ALL, DefaultSelectionType.RANGE, or DefaultSelectionType.SELECTION.

Exceptions
IllegalArgumentException:
if defaultSelection is null
setDestinationback to summary
public void setDestination(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 DestinationType.PRINTER.

Parameters
destination:JobAttributes.DestinationType

DestinationType.FILE or DestinationType.PRINTER.

Exceptions
IllegalArgumentException:
if destination is null.
setDialogback to summary
public void setDialog(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:JobAttributes.DialogType

DialogType.COMMON, DialogType.NATIVE, or DialogType.NONE.

Exceptions
IllegalArgumentException:
if dialog is null.
setFileNameback to summary
public void setFileName(String fileName)

Specifies the file name for the output file for jobs using these attributes. Default is platform-dependent and implementation-defined.

Parameters
fileName:String

the possibly null file name.

setFromPageback to summary
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:int

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.

Exceptions
IllegalArgumentException:
if one or more of the above conditions is violated.
setMaxPageback to summary
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:int

an integer greater than zero and greater than or equal to minPage

Exceptions
IllegalArgumentException:
if one or more of the above conditions is violated
setMinPageback to summary
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:int

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

Exceptions
IllegalArgumentException:
if one or more of the above conditions is violated.
setMultipleDocumentHandlingback to summary
public void setMultipleDocumentHandling(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:JobAttributes.MultipleDocumentHandlingType

MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES or MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES.

Exceptions
IllegalArgumentException:
if multipleDocumentHandling is null.
setMultipleDocumentHandlingToDefaultback to summary
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.

setPageRangesback to summary
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:int[][]

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.

Exceptions
IllegalArgumentException:
if one or more of the above conditions is violated.
setPrinterback to summary
public void setPrinter(String printer)

Specifies the destination printer for jobs using these attributes. Default is platform-dependent and implementation-defined.

Parameters
printer:String

the possibly null printer name.

setSidesback to summary
public void setSides(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:JobAttributes.SidesType

SidesType.ONE_SIDED, SidesType.TWO_SIDED_LONG_EDGE, or SidesType.TWO_SIDED_SHORT_EDGE.

Exceptions
IllegalArgumentException:
if sides is null.
setSidesToDefaultback to summary
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.

setToPageback to summary
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:int

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.

Exceptions
IllegalArgumentException:
if one or more of the above conditions is violated.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this JobAttributes.

Returns:String

the string representation.

java.awt back to summary

public final Class JobAttributes.DefaultSelectionType

extends AttributeValue
Class Inheritance

A type-safe enumeration of possible default selection states.
Since
1.3

Field Summary

Modifier and TypeField and Description
public static final JobAttributes.DefaultSelectionType
ALL

The DefaultSelectionType instance to use for specifying that all pages of the job should be printed.

private static final int
private static final int
private static final int
private static final String[]
public static final JobAttributes.DefaultSelectionType
RANGE

The DefaultSelectionType instance to use for specifying that a range of pages of the job should be printed.

public static final JobAttributes.DefaultSelectionType
SELECTION

The DefaultSelectionType instance to use for specifying that the current selection should be printed.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.awt.AttributeValue:
hashCodetoString

Field Detail

ALLback to summary
public static final JobAttributes.DefaultSelectionType ALL

The DefaultSelectionType instance to use for specifying that all pages of the job should be printed.

I_ALLback to summary
private static final int I_ALL
I_RANGEback to summary
private static final int I_RANGE
I_SELECTIONback to summary
private static final int I_SELECTION
NAMESback to summary
private static final String[] NAMES
RANGEback to summary
public static final JobAttributes.DefaultSelectionType RANGE

The DefaultSelectionType instance to use for specifying that a range of pages of the job should be printed.

SELECTIONback to summary
public static final JobAttributes.DefaultSelectionType SELECTION

The DefaultSelectionType instance to use for specifying that the current selection should be printed.

Constructor Detail

DefaultSelectionTypeback to summary
private DefaultSelectionType(int type)
java.awt back to summary

public final Class JobAttributes.DestinationType

extends AttributeValue
Class Inheritance

A type-safe enumeration of possible job destinations.
Since
1.3

Field Summary

Modifier and TypeField and Description
public static final JobAttributes.DestinationType
FILE

The DestinationType instance to use for specifying print to file.

private static final int
private static final int
private static final String[]
public static final JobAttributes.DestinationType
PRINTER

The DestinationType instance to use for specifying print to printer.

Constructor Summary

AccessConstructor and Description
private
DestinationType(int type)

Method Summary

Inherited from java.awt.AttributeValue:
hashCodetoString

Field Detail

FILEback to summary
public static final JobAttributes.DestinationType FILE

The DestinationType instance to use for specifying print to file.

I_FILEback to summary
private static final int I_FILE
I_PRINTERback to summary
private static final int I_PRINTER
NAMESback to summary
private static final String[] NAMES
PRINTERback to summary
public static final JobAttributes.DestinationType PRINTER

The DestinationType instance to use for specifying print to printer.

Constructor Detail

DestinationTypeback to summary
private DestinationType(int type)
java.awt back to summary

public final Class JobAttributes.DialogType

extends AttributeValue
Class Inheritance

A type-safe enumeration of possible dialogs to display to the user.
Since
1.3

Field Summary

Modifier and TypeField and Description
public static final JobAttributes.DialogType
COMMON

The DialogType instance to use for specifying the cross-platform, pure Java print dialog.

private static final int
private static final int
private static final int
private static final String[]
public static final JobAttributes.DialogType
NATIVE

The DialogType instance to use for specifying the platform's native print dialog.

public static final JobAttributes.DialogType
NONE

The DialogType instance to use for specifying no print dialog.

Constructor Summary

AccessConstructor and Description
private
DialogType(int type)

Method Summary

Inherited from java.awt.AttributeValue:
hashCodetoString

Field Detail

COMMONback to summary
public static final JobAttributes.DialogType COMMON

The DialogType instance to use for specifying the cross-platform, pure Java print dialog.

I_COMMONback to summary
private static final int I_COMMON
I_NATIVEback to summary
private static final int I_NATIVE
I_NONEback to summary
private static final int I_NONE
NAMESback to summary
private static final String[] NAMES
NATIVEback to summary
public static final JobAttributes.DialogType NATIVE

The DialogType instance to use for specifying the platform's native print dialog.

NONEback to summary
public static final JobAttributes.DialogType NONE

The DialogType instance to use for specifying no print dialog.

Constructor Detail

DialogTypeback to summary
private DialogType(int type)
java.awt back to summary

public final Class JobAttributes.MultipleDocumentHandlingType

extends AttributeValue
Class Inheritance

A type-safe enumeration of possible multiple copy handling states. It is used to control how the sheets of multiple copies of a single document are collated.
Since
1.3

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private static final String[]
public static final JobAttributes.MultipleDocumentHandlingType
SEPARATE_DOCUMENTS_COLLATED_COPIES

The MultipleDocumentHandlingType instance to use for specifying that the job should be divided into separate, collated copies.

public static final JobAttributes.MultipleDocumentHandlingType
SEPARATE_DOCUMENTS_UNCOLLATED_COPIES

The MultipleDocumentHandlingType instance to use for specifying that the job should be divided into separate, uncollated copies.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.awt.AttributeValue:
hashCodetoString

Field Detail

I_SEPARATE_DOCUMENTS_COLLATED_COPIESback to summary
private static final int I_SEPARATE_DOCUMENTS_COLLATED_COPIES
I_SEPARATE_DOCUMENTS_UNCOLLATED_COPIESback to summary
private static final int I_SEPARATE_DOCUMENTS_UNCOLLATED_COPIES
NAMESback to summary
private static final String[] NAMES
SEPARATE_DOCUMENTS_COLLATED_COPIESback to summary
public static final JobAttributes.MultipleDocumentHandlingType SEPARATE_DOCUMENTS_COLLATED_COPIES

The MultipleDocumentHandlingType instance to use for specifying that the job should be divided into separate, collated copies.

SEPARATE_DOCUMENTS_UNCOLLATED_COPIESback to summary
public static final JobAttributes.MultipleDocumentHandlingType SEPARATE_DOCUMENTS_UNCOLLATED_COPIES

The MultipleDocumentHandlingType instance to use for specifying that the job should be divided into separate, uncollated copies.

Constructor Detail

MultipleDocumentHandlingTypeback to summary
private MultipleDocumentHandlingType(int type)
java.awt back to summary

public final Class JobAttributes.SidesType

extends AttributeValue
Class Inheritance

A type-safe enumeration of possible multi-page impositions. These impositions are in compliance with IPP 1.1.
Since
1.3

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private static final int
private static final String[]
public static final JobAttributes.SidesType
ONE_SIDED

The SidesType instance to use for specifying that consecutive job pages should be printed upon the same side of consecutive media sheets.

public static final JobAttributes.SidesType
TWO_SIDED_LONG_EDGE

The SidesType instance to use for specifying that consecutive job pages should be printed 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.

public static final JobAttributes.SidesType
TWO_SIDED_SHORT_EDGE

The SidesType instance to use for specifying that consecutive job pages should be printed 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.

Constructor Summary

AccessConstructor and Description
private
SidesType(int type)

Method Summary

Inherited from java.awt.AttributeValue:
hashCodetoString

Field Detail

I_ONE_SIDEDback to summary
private static final int I_ONE_SIDED
I_TWO_SIDED_LONG_EDGEback to summary
private static final int I_TWO_SIDED_LONG_EDGE
I_TWO_SIDED_SHORT_EDGEback to summary
private static final int I_TWO_SIDED_SHORT_EDGE
NAMESback to summary
private static final String[] NAMES
ONE_SIDEDback to summary
public static final JobAttributes.SidesType ONE_SIDED

The SidesType instance to use for specifying that consecutive job pages should be printed upon the same side of consecutive media sheets.

TWO_SIDED_LONG_EDGEback to summary
public static final JobAttributes.SidesType TWO_SIDED_LONG_EDGE

The SidesType instance to use for specifying that consecutive job pages should be printed 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.

TWO_SIDED_SHORT_EDGEback to summary
public static final JobAttributes.SidesType TWO_SIDED_SHORT_EDGE

The SidesType instance to use for specifying that consecutive job pages should be printed 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.

Constructor Detail

SidesTypeback to summary
private SidesType(int type)