public class PrintRequestProperties
extends javax.print.attribute.HashPrintRequestAttributeSet
Because of the uninspired interface of the javax.print.attribute.EnumSyntax class it is necessary that several inner classes extend specific EnumSyntax classes from the javax.print.attribute.standard package here to get access to their enum values. This allows to access all values and be save for future changes. But some of the EnumSyntax are declared final, in which case we have to copy their values to access them and hope that they will never be extended.
Modifier and Type | Class and Description |
---|---|
static interface |
PrintRequestProperties.EnumAttributeFinder
Interface for finders of enum values.
|
Modifier and Type | Field and Description |
---|---|
static javax.print.attribute.standard.Chromaticity[] |
CHROMATICITY_VALUES
Possible values for chromaticity because some clever guy made the class final
so we cannot use our standard method on accessing enum values.
|
static PrintRequestProperties.EnumAttributeFinder |
JOB_SHEETS_FINDER
Accessor class for job sheets.
|
static PrintRequestProperties.EnumAttributeFinder[] |
MEDIA_FINDER
Accessor classes for media.
|
static javax.print.attribute.standard.OrientationRequested[] |
ORIENTATION_VALUES
Possible values for orientation because some clever guy made the class final
so we cannot use our standard method on accessing enum values.
|
static java.lang.String |
PREF_KEY_CHROMATICITY
Preference key for chromaticity.
|
static java.lang.String |
PREF_KEY_EXT_CLASS
The extension used for the class of an attribute.
|
static java.lang.String |
PREF_KEY_JOB_SHEETS
Preference key for job sheets.
|
static java.lang.String |
PREF_KEY_MEDIA
Preferences key for media.
|
static java.lang.String |
PREF_KEY_MEDIA_PRINTABLE_AREA_HEIGHT
Preferences key for media size height.
|
static java.lang.String |
PREF_KEY_MEDIA_PRINTABLE_AREA_WIDTH
Preferences key for media size width.
|
static java.lang.String |
PREF_KEY_MEDIA_PRINTABLE_AREA_X
Preferences key for media size x.
|
static java.lang.String |
PREF_KEY_MEDIA_PRINTABLE_AREA_Y
Preferences key for media size y.
|
static java.lang.String |
PREF_KEY_ORIENTATION
Preference key for orientation.
|
Constructor and Description |
---|
PrintRequestProperties()
Construct a new, empty print request attribute set.
|
PrintRequestProperties(java.util.prefs.Preferences preferences)
Construct a new print request attribute set,
trying to restore it from the preferences.
|
PrintRequestProperties(javax.print.attribute.PrintRequestAttribute attribute)
Construct a new print request attribute set,
initially populated with the given value.
|
PrintRequestProperties(javax.print.attribute.PrintRequestAttribute[] attributes)
Construct a new print request attribute set, initially populated with
the values from the given array.
|
PrintRequestProperties(javax.print.attribute.PrintRequestAttributeSet attributes)
Construct a new attribute set, initially populated with the
values from the given set where the members of the attribute set
are restricted to the
(PrintRequestAttributeSe interface. |
Modifier and Type | Method and Description |
---|---|
void |
loadFrom(java.util.prefs.Preferences preferences)
Load some of the preferences from the preferences.
|
void |
storeTo(java.util.prefs.Preferences preferences)
Save some of the preferences to the preferences.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
add, addAll, clear, containsKey, containsValue, equals, get, hashCode, isEmpty, remove, remove, size, toArray
public static final java.lang.String PREF_KEY_EXT_CLASS
public static final java.lang.String PREF_KEY_MEDIA
public static final PrintRequestProperties.EnumAttributeFinder[] MEDIA_FINDER
public static final java.lang.String PREF_KEY_MEDIA_PRINTABLE_AREA_X
public static final java.lang.String PREF_KEY_MEDIA_PRINTABLE_AREA_Y
public static final java.lang.String PREF_KEY_MEDIA_PRINTABLE_AREA_WIDTH
public static final java.lang.String PREF_KEY_MEDIA_PRINTABLE_AREA_HEIGHT
public static final java.lang.String PREF_KEY_JOB_SHEETS
public static final PrintRequestProperties.EnumAttributeFinder JOB_SHEETS_FINDER
public static final java.lang.String PREF_KEY_CHROMATICITY
public static final javax.print.attribute.standard.Chromaticity[] CHROMATICITY_VALUES
public static final java.lang.String PREF_KEY_ORIENTATION
public static final javax.print.attribute.standard.OrientationRequested[] ORIENTATION_VALUES
public PrintRequestProperties()
public PrintRequestProperties(@Nullable java.util.prefs.Preferences preferences)
preferences
- preferences object to restore fromloadFrom(java.util.prefs.Preferences)
public PrintRequestProperties(javax.print.attribute.PrintRequestAttribute attribute)
attribute
- Attribute value to add to the set.java.lang.NullPointerException
- (unchecked exception) Thrown if attribute
is null.public PrintRequestProperties(javax.print.attribute.PrintRequestAttribute[] attributes)
attributes
array to the set in
sequence, starting at index 0. Thus, later array elements may replace
earlier array elements if the array contains duplicate attribute
values or attribute categories.attributes
- Array of attribute values to add to the set.
If null, an empty attribute set is constructed.java.lang.NullPointerException
- (unchecked exception)
Thrown if any element of attributes
is null.public PrintRequestProperties(javax.print.attribute.PrintRequestAttributeSet attributes)
(PrintRequestAttributeSe
interface.attributes
- set of attribute values to initialise the set. If
null, an empty attribute set is constructed.java.lang.ClassCastException
- (unchecked exception) Thrown if any element of
attributes
is not an instance of
(PrintRequestAttributeSe
.public void storeTo(java.util.prefs.Preferences preferences)
preferences
- preferences to store the settingsloadFrom(java.util.prefs.Preferences)
public void loadFrom(java.util.prefs.Preferences preferences)
preferences
- preferences to load the settingsstoreTo(java.util.prefs.Preferences)
public java.lang.String toString()
toString
in class java.lang.Object