|
Modifier and Type |
Method and Description |
|
clone |
java.lang.Object clone()
Creates and returns a copy of this PageAttributes.
public java.lang.Object clone()
-
Creates and returns a copy of this PageAttributes.
- Overrides:
clone in class java.lang.Object
- Returns:
- the newly created copy. It is safe to cast this Object into
a PageAttributes.
- See Also:
Cloneable
|
|
equals |
boolean equals(java.lang.Object obj)
Determines whether two PageAttributes are equal to each other.
public boolean equals(java.lang.Object obj)
-
Determines whether two PageAttributes are equal to each other.
Two PageAttributes 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. This means that
an aliased media is equal to its underlying unique media. Printer
resolutions are equal if and only if the feed resolution, cross feed
resolution, and units are equal.
- Overrides:
equals in class java.lang.Object
- Parameters:
obj - the object whose equality will be checked.
- Returns:
- whether obj is equal to this PageAttribute according to the
above criteria.
- See Also:
Object.hashCode() ,
HashMap
|
|
getColor |
Returns whether pages using these attributes will be rendered in
color or monochrome.
-
Returns whether pages using these attributes will be rendered in
color or monochrome. This attribute is updated to the value chosen
by the user.
- Returns:
- ColorType.COLOR or ColorType.MONOCHROME.
|
|
getMedia |
Returns the paper size for pages using these attributes.
-
Returns the paper size for pages using these attributes. This
attribute is updated to the value chosen by the user.
- Returns:
- one of the constant fields of the MediaType class.
|
|
getOrientationRequested |
Returns the print orientation for pages using these attributes.
-
Returns the print orientation for pages using these attributes. This
attribute is updated to the value chosen by the user.
- Returns:
- OrientationRequestedType.PORTRAIT or
OrientationRequestedType.LANDSCAPE.
|
|
getOrigin |
Returns whether drawing at (0, 0) to pages using these attributes
draws at the upper-left corner of the physical page, or at the
upper-left corner of the printable area.
-
Returns whether drawing at (0, 0) to pages using these attributes
draws at the upper-left corner of the physical page, or at the
upper-left corner of the printable area. (Note that these locations
could be equivalent.) This attribute cannot be modified by,
and is not subject to any limitations of, the implementation or the
target printer.
- Returns:
- OriginType.PHYSICAL or OriginType.PRINTABLE
|
|
getPrinterResolution |
int[] getPrinterResolution()
Returns the print resolution for pages using these attributes.
public int[] getPrinterResolution()
-
Returns the print resolution for pages using these attributes.
Index 0 of the array specifies the cross feed direction resolution
(typically the horizontal resolution). Index 1 of the array specifies
the feed direction resolution (typically the vertical resolution).
Index 2 of the array specifies whether the resolutions are in dots per
inch or dots per centimeter. 3 denotes dots per inch.
4 denotes dots per centimeter.
- Returns:
- an integer array of 3 elements. The first
element must be greater than 0. The second element must be
must be greater than 0. The third element must be either
3 or 4 .
|
|
getPrintQuality |
Returns the print quality for pages using these attributes.
-
Returns the print quality for pages using these attributes. This
attribute is updated to the value chosen by the user.
- Returns:
- PrintQualityType.DRAFT, PrintQualityType.NORMAL, or
PrintQualityType.HIGH
|
|
hashCode |
int hashCode()
Returns a hash code value for this PageAttributes.
public int hashCode()
-
Returns a hash code value for this PageAttributes.
- Overrides:
hashCode in class java.lang.Object
- Returns:
- the hash code.
- See Also:
Object.equals(java.lang.Object) ,
System.identityHashCode(java.lang.Object)
|
|
set |
void set(PageAttributes obj)
Sets all of the attributes of this PageAttributes to the same values as
the attributes of obj.
-
Sets all of the attributes of this PageAttributes to the same values as
the attributes of obj.
- Parameters:
obj - the PageAttributes to copy.
|
|
setColor |
void setColor(PageAttributes.ColorType color)
Specifies whether pages using these attributes will be rendered in
color or monochrome.
-
Specifies whether pages using these attributes will be rendered in
color or monochrome. Not specifying this attribute is equivalent to
specifying ColorType.MONOCHROME.
- Parameters:
color - ColorType.COLOR or ColorType.MONOCHROME.
- Throws:
java.lang.IllegalArgumentException - if color is null.
|
|
setMedia |
void setMedia(PageAttributes.MediaType media)
Specifies the desired paper size for pages using these attributes.
-
Specifies the desired paper size for pages using these attributes. The
actual paper size will be determined by the limitations of the target
printer. If an exact match cannot be found, an implementation will
choose the closest possible match. Not specifying this attribute is
equivalent to specifying the default size for the default locale. The
default size for locales in the United States and Canada is
MediaType.NA_LETTER. The default size for all other locales is
MediaType.ISO_A4.
- Parameters:
media - one of the constant fields of the MediaType class.
- Throws:
java.lang.IllegalArgumentException - if media is null.
|
|
setMediaToDefault |
void setMediaToDefault()
Sets the paper size for pages using these attributes to the default
size for the default locale.
public void setMediaToDefault()
-
Sets the paper size for pages using these attributes to the default
size for the default locale. The default size for locales in the
United States and Canada is MediaType.NA_LETTER. The default size for
all other locales is MediaType.ISO_A4.
|
|
setOrientationRequested |
void setOrientationRequested(int orientationRequested)
Specifies the print orientation for pages using these attributes.
public void setOrientationRequested(int orientationRequested)
-
Specifies the print orientation for pages using these attributes.
Specifying 3 denotes portrait. Specifying 4
denotes landscape. Specifying any other value will generate an
IllegalArgumentException. Not specifying the property is equivalent
to calling setOrientationRequested(OrientationRequestedType.PORTRAIT).
- Parameters:
orientationRequested - 3 or 4
- Throws:
java.lang.IllegalArgumentException - if orientationRequested is not
3 or 4
|
|
setOrientationRequested |
void setOrientationRequested(PageAttributes.OrientationRequestedType orientationRequested)
Specifies the print orientation for pages using these attributes.
-
Specifies the print orientation for pages using these attributes. Not
specifying the property is equivalent to specifying
OrientationRequestedType.PORTRAIT.
- Parameters:
orientationRequested - OrientationRequestedType.PORTRAIT or
OrientationRequestedType.LANDSCAPE.
- Throws:
java.lang.IllegalArgumentException - if orientationRequested is null.
|
|
setOrientationRequestedToDefault |
void setOrientationRequestedToDefault()
Sets the print orientation for pages using these attributes to the
default.
public void setOrientationRequestedToDefault()
-
Sets the print orientation for pages using these attributes to the
default. The default orientation is portrait.
|
|
setOrigin |
void setOrigin(PageAttributes.OriginType origin)
Specifies whether drawing at (0, 0) to pages using these attributes
draws at the upper-left corner of the physical page, or at the
upper-left corner of the printable area.
-
Specifies whether drawing at (0, 0) to pages using these attributes
draws at the upper-left corner of the physical page, or at the
upper-left corner of the printable area. (Note that these locations
could be equivalent.) Not specifying the property is equivalent to
specifying OriginType.PHYSICAL.
- Parameters:
origin - OriginType.PHYSICAL or OriginType.PRINTABLE
- Throws:
java.lang.IllegalArgumentException - if origin is null.
|
|
setPrinterResolution |
void setPrinterResolution(int printerResolution)
Specifies the desired cross feed and feed print resolutions in dots per
inch for pages using these attributes.
public void setPrinterResolution(int printerResolution)
-
Specifies the desired cross feed and feed print resolutions in dots per
inch for pages using these attributes. The same value is used for both
resolutions. The actual resolutions will be determined by the
limitations of the implementation and the target printer. Not
specifying the property is equivalent to specifying 72 .
- Parameters:
printerResolution - an integer greater than 0.
- Throws:
java.lang.IllegalArgumentException - if printerResolution is less than or
equal to 0.
|
|
setPrinterResolution |
void setPrinterResolution(int[] printerResolution)
Specifies the desired print resolution for pages using these attributes.
public void setPrinterResolution(int[] printerResolution)
-
Specifies the desired print resolution for pages using these attributes.
The actual resolution will be determined by the limitations of the
implementation and the target printer. Index 0 of the array specifies
the cross feed direction resolution (typically the horizontal
resolution). Index 1 of the array specifies the feed direction
resolution (typically the vertical resolution). Index 2 of the array
specifies whether the resolutions are in dots per inch or dots per
centimeter. 3 denotes dots per inch. 4
denotes dots per centimeter. Note that the 1.1 printing implementation
(Toolkit.getPrintJob) requires that the feed and cross feed resolutions
be the same. Not specifying the property is equivalent to calling
setPrinterResolution(72).
- Parameters:
printerResolution - an integer array of 3 elements. The first
element must be greater than 0. The second element must be
must be greater than 0. The third element must be either
3 or 4 .
- Throws:
java.lang.IllegalArgumentException - if one or more of the above
conditions is violated.
|
|
setPrinterResolutionToDefault |
void setPrinterResolutionToDefault()
Sets the printer resolution for pages using these attributes to the
default.
public void setPrinterResolutionToDefault()
-
Sets the printer resolution for pages using these attributes to the
default. The default is 72 dpi for both the feed and cross feed
resolutions.
|
|
setPrintQuality |
void setPrintQuality(int printQuality)
Specifies the print quality for pages using these attributes.
public void setPrintQuality(int printQuality)
-
Specifies the print quality for pages using these attributes.
Specifying 3 denotes draft. Specifying 4
denotes normal. Specifying 5 denotes high. Specifying
any other value will generate an IllegalArgumentException. Not
specifying the property is equivalent to calling
setPrintQuality(PrintQualityType.NORMAL).
- Parameters:
printQuality - 3 , 4 , or 5
- Throws:
java.lang.IllegalArgumentException - if printQuality is not 3
, 4 , or 5
|
|
setPrintQuality |
void setPrintQuality(PageAttributes.PrintQualityType printQuality)
Specifies the print quality for pages using these attributes.
-
Specifies the print quality for pages using these attributes. Not
specifying the property is equivalent to specifying
PrintQualityType.NORMAL.
- Parameters:
printQuality - PrintQualityType.DRAFT, PrintQualityType.NORMAL,
or PrintQualityType.HIGH
- Throws:
java.lang.IllegalArgumentException - if printQuality is null.
|
|
setPrintQualityToDefault |
void setPrintQualityToDefault()
Sets the print quality for pages using these attributes to the default.
public void setPrintQualityToDefault()
-
Sets the print quality for pages using these attributes to the default.
The default print quality is normal.
|
|
toString |
java.lang.String toString()
Returns a string representation of this PageAttributes.
public java.lang.String toString()
-
Returns a string representation of this PageAttributes.
- Overrides:
toString in class java.lang.Object
- Returns:
- the string representation.
|