public final class DocumentPrintAttributeSet extends HashAttributeSet
Represents helper class with user-friednly interface to with AttributeSet.
Constructor and Description |
---|
DocumentPrintAttributeSet()
Initializes a new instance of
DocumentPrintAttributeSet . |
DocumentPrintAttributeSet(int copies)
Initializes a new instance of
DocumentPrintAttributeSet . |
DocumentPrintAttributeSet(String printerName)
Initializes a new instance of
DocumentPrintAttributeSet . |
DocumentPrintAttributeSet(String printerName,
int copies)
Initializes a new instance of
DocumentPrintAttributeSet . |
Modifier and Type | Method and Description |
---|---|
int |
getCopies() |
boolean |
getLandscape() |
String |
getPrinterName() |
void |
setCollate(boolean value)
Sets a value indicating whether document is collated.
|
void |
setCopies(int value)
Sets the number of copies to be printed.
|
void |
setDuplex(boolean value)
Sets the printer setting for double-side printing.
|
void |
setLandscape(boolean value)
Sets the orientation of the page.
|
void |
setPrinterName(String printerName)
The name of the printer to be used.
|
void |
setPrinterName(String printerName,
Locale locale)
The name of the printer to be used.
|
void |
setPrintRange(int page)
Sets the single page to be printed.
|
void |
setPrintRange(int from,
int to)
Sets the page range to be printed.
|
add, addAll, clear, containsKey, containsValue, equals, get, hashCode, isEmpty, remove, remove, size, toArray
public DocumentPrintAttributeSet(int copies)
Initializes a new instance of DocumentPrintAttributeSet
.
By default all document's pages are printed.
copies
- The number of document's copies to be printed.public DocumentPrintAttributeSet(String printerName, int copies)
Initializes a new instance of DocumentPrintAttributeSet
.
By default all document's pages are printed.
printerName
- The name of the printer.copies
- The number of document's copies to be printed.public DocumentPrintAttributeSet(String printerName)
Initializes a new instance of DocumentPrintAttributeSet
.
By default the only copy of every page.
printerName
- The name of the printer.public DocumentPrintAttributeSet()
Initializes a new instance of DocumentPrintAttributeSet
.
By default the only copy of every page.
public void setCollate(boolean value)
Sets a value indicating whether document is collated.
value
- true is equivalent to setting of SheetCollate.COLLATED
false is equivalent to setting of SheetCollate.UNCOLLATEDpublic int getCopies()
public void setCopies(int value)
Sets the number of copies to be printed.
value
- The number of copies to be printed.public void setDuplex(boolean value)
Sets the printer setting for double-side printing.
value
- true is equivalent to setting of Sides.DUPLEX
false is equivalent to setting of Sides.ONE_SIDEDpublic String getPrinterName()
public void setPrinterName(String printerName, Locale locale)
The name of the printer to be used.
printerName
- The name of the printer.locale
- printerName's locale.public void setPrinterName(String printerName)
The name of the printer to be used.
printerName
- The name of the printer.public boolean getLandscape()
public void setLandscape(boolean value)
Sets the orientation of the page.
value
- true is equivalent to setting of OrientationRequested.LANDSCAPE
false is equivalent to setting of OrientationRequested.PORTRAITpublic void setPrintRange(int from, int to)
Sets the page range to be printed.
from
- The first page.to
- The last page.public void setPrintRange(int page)
Sets the single page to be printed.
page
- The page to be printed.