feat(jdk8): move files to new folder to avoid resources compiled.

This commit is contained in:
2025-09-07 15:25:52 +08:00
parent 3f0047bf6f
commit 8c35cfb1c0
17415 changed files with 217 additions and 213 deletions

View File

@@ -0,0 +1,159 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class Chromaticity is a printing attribute class, an enumeration, that
* specifies monochrome or color printing. This is used by a print client
* to specify how the print data should be generated or processed. It is not
* descriptive of the color capabilities of the device. Query the service's
* {@link ColorSupported ColorSupported} attribute to determine if the device
* can be verified to support color printing.
* <P>
* The table below shows the effects of specifying a Chromaticity attribute of
* {@link #MONOCHROME MONOCHROME} or {@link #COLOR COLOR}
* for a monochrome or color document.
* <P>
* <TABLE BORDER=1 CELLPADDING=2 CELLSPACING=1 SUMMARY="Shows effects of specifying MONOCHROME or COLOR Chromaticity attributes">
* <TR>
* <TH>
* Chromaticity<BR>Attribute
* </TH>
* <TH>
* Effect on<BR>Monochrome Document
* </TH>
* <TH>
* Effect on<BR>Color Document
* </TH>
* </TR>
* <TR>
* <TD>
* {@link #MONOCHROME MONOCHROME}
* </TD>
* <TD>
* Printed as is, in monochrome
* </TD>
* <TD>
* Printed in monochrome, with colors converted to shades of gray
* </TD>
* </TR>
* <TR>
* <TD>
* {@link #COLOR COLOR}
* </TD>
* <TD>
* Printed as is, in monochrome
* </TD>
* <TD>
* Printed as is, in color
* </TD>
* </TR>
* </TABLE>
* <P>
* <P>
* <B>IPP Compatibility:</B> Chromaticity is not an IPP attribute at present.
* <P>
*
* @author Alan Kaminsky
*/
public final class Chromaticity extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = 4660543931355214012L;
/**
* Monochrome printing.
*/
public static final Chromaticity MONOCHROME = new Chromaticity(0);
/**
* Color printing.
*/
public static final Chromaticity COLOR = new Chromaticity(1);
/**
* Construct a new chromaticity enumeration value with the given integer
* value.
*
* @param value Integer value.
*/
protected Chromaticity(int value) {
super(value);
}
private static final String[] myStringTable = {"monochrome",
"color"};
private static final Chromaticity[] myEnumValueTable = {MONOCHROME,
COLOR};
/**
* Returns the string table for class Chromaticity.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
* Returns the enumeration value table for class Chromaticity.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class Chromaticity, the category is the class Chromaticity itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return Chromaticity.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class Chromaticity, the category name is <CODE>"chromaticity"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "chromaticity";
}
}

View File

@@ -0,0 +1,130 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintServiceAttribute;
/**
* Class ColorSupported is a printing attribute class, an enumeration, that
* identifies whether the device is capable of any type of color printing at
* all, including highlight color as well as full process color. All document
* instructions having to do with color are embedded within the print data (none
* are attributes attached to the job outside the print data).
* <P>
* Note: End users are able to determine the nature and details of the color
* support by querying the {@link PrinterMoreInfoManufacturer
* PrinterMoreInfoManufacturer} attribute.
* <P>
* Don't confuse the ColorSupported attribute with the {@link Chromaticity
* Chromaticity} attribute. {@link Chromaticity Chromaticity} is an attribute
* the client can specify for a job to tell the printer whether to print a
* document in monochrome or color, possibly causing the printer to print a
* color document in monochrome. ColorSupported is a printer description
* attribute that tells whether the printer can print in color regardless of how
* the client specifies to print any particular document.
* <P>
* <B>IPP Compatibility:</B> The IPP boolean value is "true" for SUPPORTED and
* "false" for NOT_SUPPORTED. The category name returned by
* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
* integer value is the IPP enum value. The <code>toString()</code> method
* returns the IPP string representation of the attribute value.
* <P>
*
* @author Alan Kaminsky
*/
public final class ColorSupported extends EnumSyntax
implements PrintServiceAttribute {
private static final long serialVersionUID = -2700555589688535545L;
/**
* The printer is not capable of any type of color printing.
*/
public static final ColorSupported NOT_SUPPORTED = new ColorSupported(0);
/**
* The printer is capable of some type of color printing, such as
* highlight color or full process color.
*/
public static final ColorSupported SUPPORTED = new ColorSupported(1);
/**
* Construct a new color supported enumeration value with the given
* integer value.
*
* @param value Integer value.
*/
protected ColorSupported(int value) {
super (value);
}
private static final String[] myStringTable = {"not-supported",
"supported"};
private static final ColorSupported[] myEnumValueTable = {NOT_SUPPORTED,
SUPPORTED};
/**
* Returns the string table for class ColorSupported.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
* Returns the enumeration value table for class ColorSupported.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class ColorSupported, the category is class ColorSupported itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return ColorSupported.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class ColorSupported, the category name is <CODE>"color-supported"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "color-supported";
}
}

View File

@@ -0,0 +1,134 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.DocAttribute;
/**
* Class Compression is a printing attribute class, an enumeration, that
* specifies how print data is compressed. Compression is an attribute of the
* print data (the doc), not of the Print Job. If a Compression attribute is not
* specified for a doc, the printer assumes the doc's print data is uncompressed
* (i.e., the default Compression value is always {@link #NONE
* NONE}).
* <P>
* <B>IPP Compatibility:</B> The category name returned by
* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
* integer value is the IPP enum value. The <code>toString()</code> method
* returns the IPP string representation of the attribute value.
* <P>
*
* @author Alan Kaminsky
*/
public class Compression extends EnumSyntax implements DocAttribute {
private static final long serialVersionUID = -5716748913324997674L;
/**
* No compression is used.
*/
public static final Compression NONE = new Compression(0);
/**
* ZIP public domain inflate/deflate compression technology.
*/
public static final Compression DEFLATE = new Compression(1);
/**
* GNU zip compression technology described in
* <A HREF="http://www.ietf.org/rfc/rfc1952.txt">RFC 1952</A>.
*/
public static final Compression GZIP = new Compression(2);
/**
* UNIX compression technology.
*/
public static final Compression COMPRESS = new Compression(3);
/**
* Construct a new compression enumeration value with the given integer
* value.
*
* @param value Integer value.
*/
protected Compression(int value) {
super(value);
}
private static final String[] myStringTable = {"none",
"deflate",
"gzip",
"compress"};
private static final Compression[] myEnumValueTable = {NONE,
DEFLATE,
GZIP,
COMPRESS};
/**
* Returns the string table for class Compression.
*/
protected String[] getStringTable() {
return (String[])myStringTable.clone();
}
/**
* Returns the enumeration value table for class Compression.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class Compression and any vendor-defined subclasses, the category is
* class Compression itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return Compression.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class Compression and any vendor-defined subclasses, the category
* name is <CODE>"compression"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "compression";
}
}

View File

@@ -0,0 +1,136 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class Copies is an integer valued printing attribute class that specifies the
* number of copies to be printed.
* <P>
* On many devices the supported number of collated copies will be limited by
* the number of physical output bins on the device, and may be different from
* the number of uncollated copies which can be supported.
* <P>
* The effect of a Copies attribute with a value of <I>n</I> on a multidoc print
* job (a job with multiple documents) depends on the (perhaps defaulted) value
* of the {@link MultipleDocumentHandling MultipleDocumentHandling} attribute:
* <UL>
* <LI>
* SINGLE_DOCUMENT -- The result will be <I>n</I> copies of a single output
* document comprising all the input docs.
* <P>
* <LI>
* SINGLE_DOCUMENT_NEW_SHEET -- The result will be <I>n</I> copies of a single
* output document comprising all the input docs, and the first impression of
* each input doc will always start on a new media sheet.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The result will be <I>n</I> copies of
* the first input document, followed by <I>n</I> copies of the second input
* document, . . . followed by <I>n</I> copies of the last input document.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_COLLATED_COPIES -- The result will be the first input
* document, the second input document, . . . the last input document, the group
* of documents being repeated <I>n</I> times.
* </UL>
* <P>
* <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
* category name returned by <CODE>getName()</CODE> gives the IPP attribute
* name.
* <P>
*
* @author David Mendenhall
* @author Alan Kamihensky
*/
public final class Copies extends IntegerSyntax
implements PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = -6426631521680023833L;
/**
* Construct a new copies attribute with the given integer value.
*
* @param value Integer value.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 1.
*/
public Copies(int value) {
super (value, 1, Integer.MAX_VALUE);
}
/**
* Returns whether this copies attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class Copies.
* <LI>
* This copies attribute's value and <CODE>object</CODE>'s value are
* equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this copies
* attribute, false otherwise.
*/
public boolean equals(Object object) {
return super.equals (object) && object instanceof Copies;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class Copies, the category is class Copies itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return Copies.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class Copies, the category name is <CODE>"copies"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "copies";
}
}

View File

@@ -0,0 +1,141 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.SetOfIntegerSyntax;
import javax.print.attribute.SupportedValuesAttribute;
/**
* Class CopiesSupported is a printing attribute class, a set of integers, that
* gives the supported values for a {@link Copies Copies} attribute. It is
* restricted to a single contiguous range of integers; multiple non-overlapping
* ranges are not allowed.
* <P>
* <B>IPP Compatibility:</B> The CopiesSupported attribute's canonical array
* form gives the lower and upper bound for the range of copies to be included
* in an IPP "copies-supported" attribute. See class {@link
* javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
* explanation of canonical array form. The category name returned by
* <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class CopiesSupported extends SetOfIntegerSyntax
implements SupportedValuesAttribute {
private static final long serialVersionUID = 6927711687034846001L;
/**
* Construct a new copies supported attribute containing a single integer.
* That is, only the one value of Copies is supported.
*
* @param member Set member.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>member</CODE> is less than 1.
*/
public CopiesSupported(int member) {
super (member);
if (member < 1) {
throw new IllegalArgumentException("Copies value < 1 specified");
}
}
/**
* Construct a new copies supported attribute containing a single range of
* integers. That is, only those values of Copies in the one range are
* supported.
*
* @param lowerBound Lower bound of the range.
* @param upperBound Upper bound of the range.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if a null range is specified or if a
* non-null range is specified with <CODE>lowerBound</CODE> less than
* 1.
*/
public CopiesSupported(int lowerBound, int upperBound) {
super(lowerBound, upperBound);
if (lowerBound > upperBound) {
throw new IllegalArgumentException("Null range specified");
} else if (lowerBound < 1) {
throw new IllegalArgumentException("Copies value < 1 specified");
}
}
/**
* Returns whether this copies supported attribute is equivalent to the
* passed in object. To be equivalent, all of the following conditions must
* be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class CopiesSupported.
* <LI>
* This copies supported attribute's members and <CODE>object</CODE>'s
* members are the same.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this copies
* supported attribute, false otherwise.
*/
public boolean equals(Object object) {
return super.equals (object) && object instanceof CopiesSupported;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class CopiesSupported, the category
* is class CopiesSupported itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return CopiesSupported.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class CopiesSupported, the category
* name is <CODE>"copies-supported"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "copies-supported";
}
}

View File

@@ -0,0 +1,125 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Date;
import javax.print.attribute.Attribute;
import javax.print.attribute.DateTimeSyntax;
import javax.print.attribute.PrintJobAttribute;
/**
* Class DateTimeAtCompleted is a printing attribute class, a date-time
* attribute, that indicates the date and time at which the Print Job completed
* (or was canceled or aborted).
* <P>
* To construct a DateTimeAtCompleted attribute from separate values of the
* year, month, day, hour, minute, and so on, use a {@link java.util.Calendar
* Calendar} object to construct a {@link java.util.Date Date} object, then use
* the {@link java.util.Date Date} object to construct the DateTimeAtCompleted
* attribute. To convert a DateTimeAtCompleted attribute to separate values of
* the year, month, day, hour, minute, and so on, create a {@link
* java.util.Calendar Calendar} object and set it to the {@link java.util.Date
* Date} from the DateTimeAtCompleted attribute.
* <P>
* <B>IPP Compatibility:</B> The information needed to construct an IPP
* "date-time-at-completed" attribute can be obtained as described above. The
* category name returned by <CODE>getName()</CODE> gives the IPP attribute
* name.
* <P>
*
* @author Alan Kaminsky
*/
public final class DateTimeAtCompleted extends DateTimeSyntax
implements PrintJobAttribute {
private static final long serialVersionUID = 6497399708058490000L;
/**
* Construct a new date-time at completed attribute with the given {@link
* java.util.Date Date} value.
*
* @param dateTime {@link java.util.Date Date} value.
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>dateTime</CODE> is null.
*/
public DateTimeAtCompleted(Date dateTime) {
super (dateTime);
}
/**
* Returns whether this date-time at completed attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class DateTimeAtCompleted.
* <LI>
* This date-time at completed attribute's {@link java.util.Date Date} value
* and <CODE>object</CODE>'s {@link java.util.Date Date} value are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this date-time
* at completed attribute, false otherwise.
*/
public boolean equals(Object object) {
return(super.equals (object) &&
object instanceof DateTimeAtCompleted);
}
// Exported operations inherited and implemented from interface Attribute.
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class DateTimeAtCompleted, the category is class
* DateTimeAtCompleted itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return DateTimeAtCompleted.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class DateTimeAtCompleted, the category name is
* <CODE>"date-time-at-completed"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "date-time-at-completed";
}
}

View File

@@ -0,0 +1,123 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Date;
import javax.print.attribute.Attribute;
import javax.print.attribute.DateTimeSyntax;
import javax.print.attribute.PrintJobAttribute;
/**
* Class DateTimeAtCreation is a printing attribute class, a date-time
* attribute, that indicates the date and time at which the Print Job was
* created.
* <P>
* To construct a DateTimeAtCreation attribute from separate values of the year,
* month, day, hour, minute, and so on, use a {@link java.util.Calendar
* Calendar} object to construct a {@link java.util.Date Date} object, then use
* the {@link java.util.Date Date} object to construct the DateTimeAtCreation
* attribute. To convert a DateTimeAtCreation attribute to separate values of
* the year, month, day, hour, minute, and so on, create a {@link
* java.util.Calendar Calendar} object and set it to the {@link java.util.Date
* Date} from the DateTimeAtCreation attribute.
* <P>
* <B>IPP Compatibility:</B> The information needed to construct an IPP
* "date-time-at-creation" attribute can be obtained as described above. The
* category name returned by <CODE>getName()</CODE> gives the IPP attribute
* name.
* <P>
*
* @author Alan Kaminsky
*/
public final class DateTimeAtCreation extends DateTimeSyntax
implements PrintJobAttribute {
private static final long serialVersionUID = -2923732231056647903L;
/**
* Construct a new date-time at creation attribute with the given {@link
* java.util.Date Date} value.
*
* @param dateTime {@link java.util.Date Date} value.
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>dateTime</CODE> is null.
*/
public DateTimeAtCreation(Date dateTime) {
super (dateTime);
}
/**
* Returns whether this date-time at creation attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class DateTimeAtCreation.
* <LI>
* This date-time at creation attribute's {@link java.util.Date Date} value
* and <CODE>object</CODE>'s {@link java.util.Date Date} value are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this date-time
* at creation attribute, false otherwise.
*/
public boolean equals(Object object) {
return(super.equals (object) &&
object instanceof DateTimeAtCreation);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class DateTimeAtCreation, the category is class
* DateTimeAtCreation itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return DateTimeAtCreation.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class DateTimeAtCreation, the category name is
* <CODE>"date-time-at-creation"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "date-time-at-creation";
}
}

View File

@@ -0,0 +1,124 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Date;
import javax.print.attribute.Attribute;
import javax.print.attribute.DateTimeSyntax;
import javax.print.attribute.PrintJobAttribute;
/**
* Class DateTimeAtProcessing is a printing attribute class, a date-time
* attribute, that indicates the date and time at which the Print Job first
* began processing.
* <P>
* To construct a DateTimeAtProcessing attribute from separate values of the
* year, month, day, hour, minute, and so on, use a {@link java.util.Calendar
* Calendar} object to construct a {@link java.util.Date Date} object, then use
* the {@link java.util.Date Date} object to construct the DateTimeAtProcessing
* attribute. To convert a DateTimeAtProcessing attribute to separate values of
* the year, month, day, hour, minute, and so on, create a {@link
* java.util.Calendar Calendar} object and set it to the {@link java.util.Date
* Date} from the DateTimeAtProcessing attribute.
* <P>
* <B>IPP Compatibility:</B> The information needed to construct an IPP
* "date-time-at-processing" attribute can be obtained as described above. The
* category name returned by <CODE>getName()</CODE> gives the IPP attribute
* name.
* <P>
*
* @author Alan Kaminsky
*/
public final class DateTimeAtProcessing extends DateTimeSyntax
implements PrintJobAttribute {
private static final long serialVersionUID = -3710068197278263244L;
/**
* Construct a new date-time at processing attribute with the given {@link
* java.util.Date Date} value.
*
* @param dateTime {@link java.util.Date Date} value.
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>dateTime</CODE> is null.
*/
public DateTimeAtProcessing(Date dateTime) {
super (dateTime);
}
/**
* Returns whether this date-time at processing attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class DateTimeAtProcessing.
* <LI>
* This date-time at processing attribute's {@link java.util.Date Date}
* value and <CODE>object</CODE>'s {@link java.util.Date Date} value
* are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this date-time
* at processing attribute, false otherwise.
*/
public boolean equals(Object object) {
return(super.equals (object) &&
object instanceof DateTimeAtProcessing);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class DateTimeAtProcessing, the category is class
* DateTimeAtProcessing itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return DateTimeAtProcessing.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class DateTimeAtProcessing, the category name is
* <CODE>"date-time-at-processing"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "date-time-at-processing";
}
}

View File

@@ -0,0 +1,123 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.net.URI;
import javax.print.attribute.Attribute;
import javax.print.attribute.URISyntax;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class Destination is a printing attribute class, a URI, that is used to
* indicate an alternate destination for the spooled printer formatted
* data. Many PrintServices will not support the notion of a destination
* other than the printer device, and so will not support this attribute.
* <p>
* A common use for this attribute will be applications which want
* to redirect output to a local disk file : eg."file:out.prn".
* Note that proper construction of "file:" scheme URI instances should
* be performed using the <code>toURI()</code> method of class
* {@link java.io.File File}.
* See the documentation on that class for more information.
* <p>
* If a destination URI is specified in a PrintRequest and it is not
* accessible for output by the PrintService, a PrintException will be thrown.
* The PrintException may implement URIException to provide a more specific
* cause.
* <P>
* <B>IPP Compatibility:</B> Destination is not an IPP attribute.
* <P>
*
* @author Phil Race.
*/
public final class Destination extends URISyntax
implements PrintJobAttribute, PrintRequestAttribute {
private static final long serialVersionUID = 6776739171700415321L;
/**
* Constructs a new destination attribute with the specified URI.
*
* @param uri URI.
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>uri</CODE> is null.
*/
public Destination(URI uri) {
super (uri);
}
/**
* Returns whether this destination attribute is equivalent to the
* passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class Destination.
* <LI>
* This destination attribute's URI and <CODE>object</CODE>'s URI
* are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this destination
* attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals(object) &&
object instanceof Destination);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class Destination, the category is class Destination itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return Destination.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class Destination, the category name is <CODE>"spool-data-destination"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "spool-data-destination";
}
}

View File

@@ -0,0 +1,131 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintRequestAttribute;
/**
* Class DialogTypeSelection is a printing attribute class, an enumeration,
* that indicates the user dialog type to be used for specifying
* printing options.
* If {@code NATIVE} is specified, then where available, a native
* platform dialog is displayed.
* If {@code COMMON} is specified, a cross-platform print dialog is displayed.
*
* This option to specify a native dialog for use with an IPP attribute
* set provides a standard way to reflect back of the setting and option
* changes made by a user to the calling application, and integrates
* the native dialog into the Java printing APIs.
* But note that some options and settings in a native dialog may not
* necessarily map to IPP attributes as they may be non-standard platform,
* or even printer specific options.
* <P>
* <B>IPP Compatibility:</B> This is not an IPP attribute.
* <P>
* @since 1.7
*
*/
public final class DialogTypeSelection extends EnumSyntax
implements PrintRequestAttribute {
private static final long serialVersionUID = 7518682952133256029L;
/**
*
*/
public static final DialogTypeSelection
NATIVE = new DialogTypeSelection(0);
/**
*
*/
public static final DialogTypeSelection
COMMON = new DialogTypeSelection(1);
/**
* Construct a new dialog type selection enumeration value with the
* given integer value.
*
* @param value Integer value.
*/
protected DialogTypeSelection(int value) {
super(value);
}
private static final String[] myStringTable = {
"native", "common"};
private static final DialogTypeSelection[] myEnumValueTable = {
NATIVE,
COMMON
};
/**
* Returns the string table for class DialogTypeSelection.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
* Returns the enumeration value table for class DialogTypeSelection.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class DialogTypeSelection the category is class
* DialogTypeSelection itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class getCategory() {
return DialogTypeSelection.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class DialogTypeSelection the category name is
* <CODE>"dialog-type-selection"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "dialog-type-selection";
}
}

View File

@@ -0,0 +1,121 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
import javax.print.attribute.TextSyntax;
import javax.print.attribute.DocAttribute;
/**
* Class DocumentName is a printing attribute class, a text attribute, that
* specifies the name of a document. DocumentName is an attribute of the print
* data (the doc), not of the Print Job. A document's name is an arbitrary
* string defined by the client.
* However if a JobName is not specified, the DocumentName should be used
* instead, which implies that supporting specification of DocumentName
* requires reporting of JobName and vice versa.
* See {@link JobName JobName} for more information.
* <P>
* <B>IPP Compatibility:</B> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class DocumentName extends TextSyntax implements DocAttribute {
private static final long serialVersionUID = 7883105848533280430L;
/**
* Constructs a new document name attribute with the given document name
* and locale.
*
* @param documentName Document name.
* @param locale Natural language of the text string. null
* is interpreted to mean the default locale as returned
* by <code>Locale.getDefault()</code>
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>documentName</CODE> is null.
*/
public DocumentName(String documentName, Locale locale) {
super (documentName, locale);
}
/**
* Returns whether this document name attribute is equivalent to the
* passed in object.
* To be equivalent, all of the following conditions must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class DocumentName.
* <LI>
* This document name attribute's underlying string and
* <CODE>object</CODE>'s underlying string are equal.
* <LI>
* This document name attribute's locale and <CODE>object</CODE>'s locale
* are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this document
* name attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals (object) && object instanceof DocumentName);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class DocumentName, the category is class DocumentName itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return DocumentName.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class DocumentName, the category name is <CODE>"document-name"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "document-name";
}
}

View File

@@ -0,0 +1,129 @@
/*
* Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
/**
* Class Fidelity is a printing attribute class, an enumeration,
* that indicates whether total fidelity to client supplied print request
* attributes is required.
* If FIDELITY_TRUE is specified and a service cannot print the job exactly
* as specified it must reject the job.
* If FIDELITY_FALSE is specified a reasonable attempt to print the job is
* acceptable. If not supplied the default is FIDELITY_FALSE.
*
* <P>
* <B>IPP Compatibility:</B> The IPP boolean value is "true" for FIDELITY_TRUE
* and "false" for FIDELITY_FALSE. The category name returned by
* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
* integer value is the IPP enum value. The <code>toString()</code> method
* returns the IPP string representation of the attribute value.
* See <a href="http://www.ietf.org/rfc/rfc2911.txt">RFC 2911</a> Section 15.1 for
* a fuller description of the IPP fidelity attribute.
* <P>
*
*/
public final class Fidelity extends EnumSyntax
implements PrintJobAttribute, PrintRequestAttribute {
private static final long serialVersionUID = 6320827847329172308L;
/**
* The job must be printed exactly as specified. or else rejected.
*/
public static final Fidelity
FIDELITY_TRUE = new Fidelity(0);
/**
* The printer should make reasonable attempts to print the job,
* even if it cannot print it exactly as specified.
*/
public static final Fidelity
FIDELITY_FALSE = new Fidelity(1);
/**
* Construct a new fidelity enumeration value with the
* given integer value.
*
* @param value Integer value.
*/
protected Fidelity(int value) {
super (value);
}
private static final String[] myStringTable = {
"true",
"false"
};
private static final Fidelity[] myEnumValueTable = {
FIDELITY_TRUE,
FIDELITY_FALSE
};
/**
* Returns the string table for class Fidelity.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
* Returns the enumeration value table for class Fidelity.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
} /**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class Fidelity the category is class Fidelity itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return Fidelity.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class Fidelity the category name is
* <CODE>"ipp-attribute-fidelity"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "ipp-attribute-fidelity";
}
}

View File

@@ -0,0 +1,477 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class Finishings is a printing attribute class, an enumeration, that
* identifies whether the printer applies a finishing operation of some kind
* of binding to each copy of each printed document in the job. For multidoc
* print jobs (jobs with multiple documents), the
* {@link MultipleDocumentHandling
* MultipleDocumentHandling} attribute determines what constitutes a "copy"
* for purposes of finishing.
* <P>
* Standard Finishings values are:
* <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100% SUMMARY="layout">
* <TR>
* <TD STYLE="WIDTH:10%">
* &nbsp;
* </TD>
* <TD STYLE="WIDTH:27%">
* {@link #NONE NONE}
* </TD>
* <TD STYLE="WIDTH:27%">
* {@link #STAPLE STAPLE}
* </TD>
* <TD STYLE="WIDTH:36%">
* {@link #EDGE_STITCH EDGE_STITCH}
* </TD>
* </TR>
* <TR>
* <TD>
* &nbsp;
* </TD>
* <TD>
* {@link #BIND BIND}
* </TD>
* <TD>
* {@link #SADDLE_STITCH SADDLE_STITCH}
* </TD>
* <TD>
* {@link #COVER COVER}
* </TD>
* <TD>
* &nbsp;
* </TD>
* </TR>
* </TABLE>
* <P>
* The following Finishings values are more specific; they indicate a
* corner or an edge as if the document were a portrait document:
* <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100% SUMMARY="layout">
* <TR>
* <TD STYLE="WIDTH:10%">
* &nbsp;
* </TD>
* <TD STYLE="WIDTH:27%">
* {@link #STAPLE_TOP_LEFT STAPLE_TOP_LEFT}
* </TD>
* <TD STYLE="WIDTH:27%">
* {@link #EDGE_STITCH_LEFT EDGE_STITCH_LEFT}
* </TD>
* <TD STYLE="WIDTH:27%">
* {@link #STAPLE_DUAL_LEFT STAPLE_DUAL_LEFT}
* </TD>
* <TD STYLE="WIDTH:9%">
* &nbsp;
* </TD>
* </TR>
* <TR>
* <TD STYLE="WIDTH:10%">
* &nbsp;
* </TD>
* <TD STYLE="WIDTH:27%">
* {@link #STAPLE_BOTTOM_LEFT STAPLE_BOTTOM_LEFT}
* </TD>
* <TD STYLE="WIDTH:27%">
* {@link #EDGE_STITCH_TOP EDGE_STITCH_TOP}
* </TD>
* <TD STYLE="WIDTH:27%">
* {@link #STAPLE_DUAL_TOP STAPLE_DUAL_TOP}
* </TD>
* <TD STYLE="WIDTH:9%">
* &nbsp;
* </TD>
* </TR>
* <TR>
* <TD STYLE="WIDTH:10%">
* &nbsp;
* </TD>
* <TD STYLE="WIDTH:27%">
* {@link #STAPLE_TOP_RIGHT STAPLE_TOP_RIGHT}
* </TD>
* <TD STYLE="WIDTH:27%">
* {@link #EDGE_STITCH_RIGHT EDGE_STITCH_RIGHT}
* </TD>
* <TD STYLE="WIDTH:27%">
* {@link #STAPLE_DUAL_RIGHT STAPLE_DUAL_RIGHT}
* </TD>
* <TD STYLE="WIDTH:9%">
* &nbsp;
* </TD>
* </TR>
* <TR>
* <TD STYLE="WIDTH:10%">
* &nbsp;
* </TD>
* <TD STYLE="WIDTH:27%">
* {@link #STAPLE_BOTTOM_RIGHT STAPLE_BOTTOM_RIGHT}
* </TD>
* <TD STYLE="WIDTH:27%">
* {@link #EDGE_STITCH_BOTTOM EDGE_STITCH_BOTTOM}
* </TD>
* <TD STYLE="WIDTH:27%">
* {@link #STAPLE_DUAL_BOTTOM STAPLE_DUAL_BOTTOM}
* </TD>
* <TD STYLE="WIDTH:9%">
* &nbsp;
* </TD>
* </TR>
* </TABLE>
* <P>
* The STAPLE_<I>XXX</I> values are specified with respect to the
* document as if the document were a portrait document. If the document is
* actually a landscape or a reverse-landscape document, the client supplies the
* appropriate transformed value. For example, to position a staple in the upper
* left hand corner of a landscape document when held for reading, the client
* supplies the STAPLE_BOTTOM_LEFT value (since landscape is
* defined as a +90 degree rotation from portrait, i.e., anti-clockwise). On the
* other hand, to position a staple in the upper left hand corner of a
* reverse-landscape document when held for reading, the client supplies the
* STAPLE_TOP_RIGHT value (since reverse-landscape is defined as a
* -90 degree rotation from portrait, i.e., clockwise).
* <P>
* The angle (vertical, horizontal, angled) of each staple with respect to the
* document depends on the implementation which may in turn depend on the value
* of the attribute.
* <P>
* The effect of a Finishings attribute on a multidoc print job (a job
* with multiple documents) depends on whether all the docs have the same
* binding specified or whether different docs have different bindings
* specified, and on the (perhaps defaulted) value of the {@link
* MultipleDocumentHandling MultipleDocumentHandling} attribute.
* <UL>
* <LI>
* If all the docs have the same binding specified, then any value of {@link
* MultipleDocumentHandling MultipleDocumentHandling} makes sense, and the
* printer's processing depends on the {@link MultipleDocumentHandling
* MultipleDocumentHandling} value:
* <UL>
* <LI>
* SINGLE_DOCUMENT -- All the input docs will be bound together as one output
* document with the specified binding.
* <P>
* <LI>
* SINGLE_DOCUMENT_NEW_SHEET -- All the input docs will be bound together as one
* output document with the specified binding, and the first impression of each
* input doc will always start on a new media sheet.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each input doc will be bound
* separately with the specified binding.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_COLLATED_COPIES -- Each input doc will be bound separately
* with the specified binding.
* </UL>
* <P>
* <LI>
* If different docs have different bindings specified, then only two values of
* {@link MultipleDocumentHandling MultipleDocumentHandling} make sense, and the
* printer reports an error when the job is submitted if any other value is
* specified:
* <UL>
* <LI>
* SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each input doc will be bound
* separately with its own specified binding.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_COLLATED_COPIES -- Each input doc will be bound separately
* with its own specified binding.
* </UL>
* </UL>
* <P>
* <B>IPP Compatibility:</B> Class Finishings encapsulates some of the
* IPP enum values that can be included in an IPP "finishings" attribute, which
* is a set of enums. The category name returned by
* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
* integer value is the IPP enum value. The <code>toString()</code> method
* returns the IPP string representation of the attribute value.
* In IPP Finishings is a multi-value attribute, this API currently allows
* only one binding to be specified.
*
* @author Alan Kaminsky
*/
public class Finishings extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = -627840419548391754L;
/**
* Perform no binding.
*/
public static final Finishings NONE = new Finishings(3);
/**
* Bind the document(s) with one or more staples. The exact number and
* placement of the staples is site-defined.
*/
public static final Finishings STAPLE = new Finishings(4);
/**
* This value is specified when it is desired to select a non-printed (or
* pre-printed) cover for the document. This does not supplant the
* specification of a printed cover (on cover stock medium) by the
* document itself.
*/
public static final Finishings COVER = new Finishings(6);
/**
* This value indicates that a binding is to be applied to the document;
* the type and placement of the binding is site-defined.
*/
public static final Finishings BIND = new Finishings(7);
/**
* Bind the document(s) with one or more staples (wire stitches) along the
* middle fold. The exact number and placement of the staples and the
* middle fold is implementation- and/or site-defined.
*/
public static final Finishings SADDLE_STITCH =
new Finishings(8);
/**
* Bind the document(s) with one or more staples (wire stitches) along one
* edge. The exact number and placement of the staples is implementation-
* and/or site- defined.
*/
public static final Finishings EDGE_STITCH =
new Finishings(9);
/**
* Bind the document(s) with one or more staples in the top left corner.
*/
public static final Finishings STAPLE_TOP_LEFT =
new Finishings(20);
/**
* Bind the document(s) with one or more staples in the bottom left
* corner.
*/
public static final Finishings STAPLE_BOTTOM_LEFT =
new Finishings(21);
/**
* Bind the document(s) with one or more staples in the top right corner.
*/
public static final Finishings STAPLE_TOP_RIGHT =
new Finishings(22);
/**
* Bind the document(s) with one or more staples in the bottom right
* corner.
*/
public static final Finishings STAPLE_BOTTOM_RIGHT =
new Finishings(23);
/**
* Bind the document(s) with one or more staples (wire stitches) along the
* left edge. The exact number and placement of the staples is
* implementation- and/or site-defined.
*/
public static final Finishings EDGE_STITCH_LEFT =
new Finishings(24);
/**
* Bind the document(s) with one or more staples (wire stitches) along the
* top edge. The exact number and placement of the staples is
* implementation- and/or site-defined.
*/
public static final Finishings EDGE_STITCH_TOP =
new Finishings(25);
/**
* Bind the document(s) with one or more staples (wire stitches) along the
* right edge. The exact number and placement of the staples is
* implementation- and/or site-defined.
*/
public static final Finishings EDGE_STITCH_RIGHT =
new Finishings(26);
/**
* Bind the document(s) with one or more staples (wire stitches) along the
* bottom edge. The exact number and placement of the staples is
* implementation- and/or site-defined.
*/
public static final Finishings EDGE_STITCH_BOTTOM =
new Finishings(27);
/**
* Bind the document(s) with two staples (wire stitches) along the left
* edge assuming a portrait document (see above).
*/
public static final Finishings STAPLE_DUAL_LEFT =
new Finishings(28);
/**
* Bind the document(s) with two staples (wire stitches) along the top
* edge assuming a portrait document (see above).
*/
public static final Finishings STAPLE_DUAL_TOP =
new Finishings(29);
/**
* Bind the document(s) with two staples (wire stitches) along the right
* edge assuming a portrait document (see above).
*/
public static final Finishings STAPLE_DUAL_RIGHT =
new Finishings(30);
/**
* Bind the document(s) with two staples (wire stitches) along the bottom
* edge assuming a portrait document (see above).
*/
public static final Finishings STAPLE_DUAL_BOTTOM =
new Finishings(31);
/**
* Construct a new finishings binding enumeration value with the given
* integer value.
*
* @param value Integer value.
*/
protected Finishings(int value) {
super(value);
}
private static final String[] myStringTable =
{"none",
"staple",
null,
"cover",
"bind",
"saddle-stitch",
"edge-stitch",
null, // The next ten enum values are reserved.
null,
null,
null,
null,
null,
null,
null,
null,
null,
"staple-top-left",
"staple-bottom-left",
"staple-top-right",
"staple-bottom-right",
"edge-stitch-left",
"edge-stitch-top",
"edge-stitch-right",
"edge-stitch-bottom",
"staple-dual-left",
"staple-dual-top",
"staple-dual-right",
"staple-dual-bottom"
};
private static final Finishings[] myEnumValueTable =
{NONE,
STAPLE,
null,
COVER,
BIND,
SADDLE_STITCH,
EDGE_STITCH,
null, // The next ten enum values are reserved.
null,
null,
null,
null,
null,
null,
null,
null,
null,
STAPLE_TOP_LEFT,
STAPLE_BOTTOM_LEFT,
STAPLE_TOP_RIGHT,
STAPLE_BOTTOM_RIGHT,
EDGE_STITCH_LEFT,
EDGE_STITCH_TOP,
EDGE_STITCH_RIGHT,
EDGE_STITCH_BOTTOM,
STAPLE_DUAL_LEFT,
STAPLE_DUAL_TOP,
STAPLE_DUAL_RIGHT,
STAPLE_DUAL_BOTTOM
};
/**
* Returns the string table for class Finishings.
*/
protected String[] getStringTable() {
return (String[])myStringTable.clone();
}
/**
* Returns the enumeration value table for class Finishings.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
/**
* Returns the lowest integer value used by class Finishings.
*/
protected int getOffset() {
return 3;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class Finishings and any vendor-defined subclasses, the
* category is class Finishings itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return Finishings.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class Finishings and any vendor-defined subclasses, the
* category name is <CODE>"finishings"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "finishings";
}
}

View File

@@ -0,0 +1,153 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Date;
import javax.print.attribute.Attribute;
import javax.print.attribute.DateTimeSyntax;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class JobHoldUntil is a printing attribute class, a date-time attribute, that
* specifies the exact date and time at which the job must become a candidate
* for printing.
* <P>
* If the value of this attribute specifies a date-time that is in the future,
* the printer should add the {@link JobStateReason JobStateReason} value of
* JOB_HOLD_UNTIL_SPECIFIED to the job's {@link JobStateReasons JobStateReasons}
* attribute, must move the job to the PENDING_HELD state, and must not schedule
* the job for printing until the specified date-time arrives.
* <P>
* When the specified date-time arrives, the printer must remove the {@link
* JobStateReason JobStateReason} value of JOB_HOLD_UNTIL_SPECIFIED from the
* job's {@link JobStateReasons JobStateReasons} attribute, if present. If there
* are no other job state reasons that keep the job in the PENDING_HELD state,
* the printer must consider the job as a candidate for processing by moving the
* job to the PENDING state.
* <P>
* If the specified date-time has already passed, the job must be a candidate
* for processing immediately. Thus, one way to make the job immediately become
* a candidate for processing is to specify a JobHoldUntil attribute constructed
* like this (denoting a date-time of January 1, 1970, 00:00:00 GMT):
* <PRE>
* JobHoldUntil immediately = new JobHoldUntil (new Date (0L));
* </PRE>
* <P>
* If the client does not supply this attribute in a Print Request and the
* printer supports this attribute, the printer must use its
* (implementation-dependent) default JobHoldUntil value at job submission time
* (unlike most job template attributes that are used if necessary at job
* processing time).
* <P>
* To construct a JobHoldUntil attribute from separate values of the year,
* month, day, hour, minute, and so on, use a {@link java.util.Calendar
* Calendar} object to construct a {@link java.util.Date Date} object, then use
* the {@link java.util.Date Date} object to construct the JobHoldUntil
* attribute. To convert a JobHoldUntil attribute to separate values of the
* year, month, day, hour, minute, and so on, create a {@link java.util.Calendar
* Calendar} object and set it to the {@link java.util.Date Date} from the
* JobHoldUntil attribute.
* <P>
* <B>IPP Compatibility:</B> Although IPP supports a "job-hold-until" attribute
* specified as a keyword, IPP does not at this time support a "job-hold-until"
* attribute specified as a date and time. However, the date and time can be
* converted to one of the standard IPP keywords with some loss of precision;
* for example, a JobHoldUntil value with today's date and 9:00pm local time
* might be converted to the standard IPP keyword "night". The category name
* returned by <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class JobHoldUntil extends DateTimeSyntax
implements PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = -1664471048860415024L;
/**
* Construct a new job hold until date-time attribute with the given
* {@link java.util.Date Date} value.
*
* @param dateTime {@link java.util.Date Date} value.
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>dateTime</CODE> is null.
*/
public JobHoldUntil(Date dateTime) {
super (dateTime);
}
/**
* Returns whether this job hold until attribute is equivalent to the
* passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class JobHoldUntil.
* <LI>
* This job hold until attribute's {@link java.util.Date Date} value and
* <CODE>object</CODE>'s {@link java.util.Date Date} value are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this job hold
* until attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof JobHoldUntil);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobHoldUntil, the category is class JobHoldUntil itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobHoldUntil.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobHoldUntil, the category name is <CODE>"job-hold-until"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-hold-until";
}
}

View File

@@ -0,0 +1,144 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class JobImpressions is an integer valued printing attribute class that
* specifies the total size in number of impressions of the document(s) being
* submitted. An "impression" is the image (possibly many print-stream pages in
* different configurations) imposed onto a single media page.
* <P>
* The JobImpressions attribute describes the size of the job. This attribute is
* not intended to be a counter; it is intended to be useful routing and
* scheduling information if known. The printer may try to compute the
* JobImpressions attribute's value if it is not supplied in the Print Request.
* Even if the client does supply a value for the JobImpressions attribute in
* the Print Request, the printer may choose to change the value if the printer
* is able to compute a value which is more accurate than the client supplied
* value. The printer may be able to determine the correct value for the
* JobImpressions attribute either right at job submission time or at any later
* point in time.
* <P>
* As with {@link JobKOctets JobKOctets}, the JobImpressions value must not
* include the multiplicative factors contributed by the number of copies
* specified by the {@link Copies Copies} attribute, independent of whether the
* device can process multiple copies without making multiple passes over the
* job or document data and independent of whether the output is collated or
* not. Thus the value is independent of the implementation and reflects the
* size of the document(s) measured in impressions independent of the number of
* copies.
* <P>
* As with {@link JobKOctets JobKOctets}, the JobImpressions value must also not
* include the multiplicative factor due to a copies instruction embedded in the
* document data. If the document data actually includes replications of the
* document data, this value will include such replication. In other words, this
* value is always the number of impressions in the source document data, rather
* than a measure of the number of impressions to be produced by the job.
* <P>
* <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
* category name returned by <CODE>getName()</CODE> gives the IPP attribute
* name.
* <P>
*
* @see JobImpressionsSupported
* @see JobImpressionsCompleted
* @see JobKOctets
* @see JobMediaSheets
*
* @author Alan Kaminsky
*/
public final class JobImpressions extends IntegerSyntax
implements PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = 8225537206784322464L;
/**
* Construct a new job impressions attribute with the given integer value.
*
* @param value Integer value.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
*/
public JobImpressions(int value) {
super(value, 0, Integer.MAX_VALUE);
}
/**
* Returns whether this job impressions attribute is equivalent to the
* passed in object. To be equivalent, all of the following conditions must
* be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class JobImpressions.
* <LI>
* This job impressions attribute's value and <CODE>object</CODE>'s value
* are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this job
* impressions attribute, false otherwise.
*/
public boolean equals(Object object) {
return super.equals (object) && object instanceof JobImpressions;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobImpressions, the category is class JobImpressions itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobImpressions.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobImpressions, the category name is
* <CODE>"job-impressions"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-impressions";
}
}

View File

@@ -0,0 +1,128 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintJobAttribute;
/**
* Class JobImpressionsCompleted is an integer valued printing attribute class
* that specifies the number of impressions completed for the job so far. For
* printing devices, the impressions completed includes interpreting, marking,
* and stacking the output.
* <P>
* The JobImpressionsCompleted attribute describes the progress of the job. This
* attribute is intended to be a counter. That is, the JobImpressionsCompleted
* value for a job that has not started processing must be 0. When the job's
* {@link JobState JobState} is PROCESSING or PROCESSING_STOPPED, the
* JobImpressionsCompleted value is intended to increase as the job is
* processed; it indicates the amount of the job that has been processed at the
* time the Print Job's attribute set is queried or at the time a print job
* event is reported. When the job enters the COMPLETED, CANCELED, or ABORTED
* states, the JobImpressionsCompleted value is the final value for the job.
* <P>
* <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
* category name returned by <CODE>getName()</CODE> gives the IPP attribute
* name.
* <P>
*
* @see JobImpressions
* @see JobImpressionsSupported
* @see JobKOctetsProcessed
* @see JobMediaSheetsCompleted
*
* @author Alan Kaminsky
*/
public final class JobImpressionsCompleted extends IntegerSyntax
implements PrintJobAttribute {
private static final long serialVersionUID = 6722648442432393294L;
/**
* Construct a new job impressions completed attribute with the given
* integer value.
*
* @param value Integer value.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
*/
public JobImpressionsCompleted(int value) {
super (value, 0, Integer.MAX_VALUE);
}
/**
* Returns whether this job impressions completed attribute is equivalent
* tp the passed in object. To be equivalent, all of the following
* conditions must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class JobImpressionsCompleted.
* <LI>
* This job impressions completed attribute's value and
* <CODE>object</CODE>'s value are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this job
* impressions completed attribute, false otherwise.
*/
public boolean equals(Object object) {
return(super.equals (object) &&
object instanceof JobImpressionsCompleted);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobImpressionsCompleted, the category is class
* JobImpressionsCompleted itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobImpressionsCompleted.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobImpressionsCompleted, the category name is
* <CODE>"job-impressions-completed"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-impressions-completed";
}
}

View File

@@ -0,0 +1,130 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.SetOfIntegerSyntax;
import javax.print.attribute.SupportedValuesAttribute;
/**
* Class JobImpressionsSupported is a printing attribute class, a set of
* integers, that gives the supported values for a {@link JobImpressions
* JobImpressions} attribute. It is restricted to a single contiguous range of
* integers; multiple non-overlapping ranges are not allowed. This gives the
* lower and upper bounds of the total sizes of print jobs in number of
* impressions that the printer will accept.
* <P>
* <B>IPP Compatibility:</B> The JobImpressionsSupported attribute's canonical
* array form gives the lower and upper bound for the range of values to be
* included in an IPP "job-impressions-supported" attribute. See class {@link
* javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
* explanation of canonical array form. The category name returned by
* <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class JobImpressionsSupported extends SetOfIntegerSyntax
implements SupportedValuesAttribute {
private static final long serialVersionUID = -4887354803843173692L;
/**
* Construct a new job impressions supported attribute containing a single
* range of integers. That is, only those values of JobImpressions in the
* one range are supported.
*
* @param lowerBound Lower bound of the range.
* @param upperBound Upper bound of the range.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if a null range is specified or if a
* non-null range is specified with <CODE>lowerBound</CODE> less than
* 0.
*/
public JobImpressionsSupported(int lowerBound, int upperBound) {
super (lowerBound, upperBound);
if (lowerBound > upperBound) {
throw new IllegalArgumentException("Null range specified");
} else if (lowerBound < 0) {
throw new IllegalArgumentException(
"Job K octets value < 0 specified");
}
}
/**
* Returns whether this job impressions supported attribute is equivalent
* to the passed in object. To be equivalent, all of the following
* conditions must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class JobImpressionsSupported.
* <LI>
* This job impressions supported attribute's members and
* <CODE>object</CODE>'s members are the same.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this job
* impressions supported attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals (object) &&
object instanceof JobImpressionsSupported);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobImpressionsSupported, the category is class
* JobImpressionsSupported itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobImpressionsSupported.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobImpressionsSupported, the category name is
* <CODE>"job-impressions-supported"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-impressions-supported";
}
}

View File

@@ -0,0 +1,194 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class JobKOctets is an integer valued printing attribute class that specifies
* the total size of the document(s) in K octets, i.e., in units of 1024 octets
* requested to be processed in the job. The value must be rounded up, so that a
* job between 1 and 1024 octets must be indicated as being 1K octets, 1025 to
* 2048 must be 2K octets, etc. For a multidoc print job (a job with multiple
* documents), the JobKOctets value is computed by adding up the individual
* documents' sizes in octets, then rounding up to the next K octets value.
* <P>
* The JobKOctets attribute describes the size of the job. This attribute is not
* intended to be a counter; it is intended to be useful routing and scheduling
* information if known. The printer may try to compute the JobKOctets
* attribute's value if it is not supplied in the Print Request. Even if the
* client does supply a value for the JobKOctets attribute in the Print Request,
* the printer may choose to change the value if the printer is able to compute
* a value which is more accurate than the client supplied value. The printer
* may be able to determine the correct value for the JobKOctets attribute
* either right at job submission time or at any later point in time.
* <P>
* The JobKOctets value must not include the multiplicative factors contributed
* by the number of copies specified by the {@link Copies Copies} attribute,
* independent of whether the device can process multiple copies without making
* multiple passes over the job or document data and independent of whether the
* output is collated or not. Thus the value is independent of the
* implementation and indicates the size of the document(s) measured in K octets
* independent of the number of copies.
* <P>
* The JobKOctets value must also not include the multiplicative factor due to a
* copies instruction embedded in the document data. If the document data
* actually includes replications of the document data, this value will include
* such replication. In other words, this value is always the size of the source
* document data, rather than a measure of the hardcopy output to be produced.
* <P>
* The size of a doc is computed based on the print data representation class as
* specified by the doc's {@link javax.print.DocFlavor DocFlavor}, as
* shown in the table below.
* <P>
* <TABLE BORDER=1 CELLPADDING=2 CELLSPACING=1 SUMMARY="Table showing computation of doc sizes">
* <TR>
* <TH>Representation Class</TH>
* <TH>Document Size</TH>
* </TR>
* <TR>
* <TD>byte[]</TD>
* <TD>Length of the byte array</TD>
* </TR>
* <TR>
* <TD>java.io.InputStream</TD>
* <TD>Number of bytes read from the stream</TD>
* </TR>
* <TR>
* <TD>char[]</TD>
* <TD>Length of the character array x 2</TD>
* </TR>
* <TR>
* <TD>java.lang.String</TD>
* <TD>Length of the string x 2</TD>
* </TR>
* <TR>
* <TD>java.io.Reader</TD>
* <TD>Number of characters read from the stream x 2</TD>
* </TR>
* <TR>
* <TD>java.net.URL</TD>
* <TD>Number of bytes read from the file at the given URL address</TD>
* </TR>
* <TR>
* <TD>java.awt.image.renderable.RenderableImage</TD>
* <TD>Implementation dependent&#42;</TD>
* </TR>
* <TR>
* <TD>java.awt.print.Printable</TD>
* <TD>Implementation dependent&#42;</TD>
* </TR>
* <TR>
* <TD>java.awt.print.Pageable</TD>
* <TD>Implementation dependent&#42;</TD>
* </TR>
* </TABLE>
* <P>
* &#42; In these cases the Print Service itself generates the print data sent
* to the printer. If the Print Service supports the JobKOctets attribute, for
* these cases the Print Service itself must calculate the size of the print
* data, replacing any JobKOctets value the client specified.
* <P>
* <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
* category name returned by <CODE>getName()</CODE> gives the IPP attribute
* name.
* <P>
*
* @see JobKOctetsSupported
* @see JobKOctetsProcessed
* @see JobImpressions
* @see JobMediaSheets
*
* @author Alan Kaminsky
*/
public final class JobKOctets extends IntegerSyntax
implements PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = -8959710146498202869L;
/**
* Construct a new job K octets attribute with the given integer value.
*
* @param value Integer value.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
*/
public JobKOctets(int value) {
super (value, 0, Integer.MAX_VALUE);
}
/**
* Returns whether this job K octets attribute is equivalent to the passed
* in object. To be equivalent, all of the following conditions must be
* true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class JobKOctets.
* <LI>
* This job K octets attribute's value and <CODE>object</CODE>'s value
* are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this job K
* octets attribute, false otherwise.
*/
public boolean equals(Object object) {
return super.equals(object) && object instanceof JobKOctets;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobKOctets, the category is class JobKOctets itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobKOctets.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobKOctets, the category name is <CODE>"job-k-octets"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-k-octets";
}
}

View File

@@ -0,0 +1,140 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintJobAttribute;
/**
* Class JobKOctetsProcessed is an integer valued printing attribute class that
* specifies the total number of print data octets processed so far in K octets,
* i.e., in units of 1024 octets. The value must be rounded up, so that a job
* between 1 and 1024 octets inclusive must be indicated as being 1K octets,
* 1025 to 2048 inclusive must be 2K, etc. For a multidoc print job (a job with
* multiple documents), the JobKOctetsProcessed value is computed by adding up
* the individual documents' number of octets processed so far, then rounding up
* to the next K octets value.
* <P>
* The JobKOctetsProcessed attribute describes the progress of the job. This
* attribute is intended to be a counter. That is, the JobKOctetsProcessed value
* for a job that has not started processing must be 0. When the job's {@link
* JobState JobState} is PROCESSING or PROCESSING_STOPPED, the
* JobKOctetsProcessed value is intended to increase as the job is processed; it
* indicates the amount of the job that has been processed at the time the Print
* Job's attribute set is queried or at the time a print job event is reported.
* When the job enters the COMPLETED, CANCELED, or ABORTED states, the
* JobKOctetsProcessed value is the final value for the job.
* <P>
* For implementations where multiple copies are produced by the interpreter
* with only a single pass over the data, the final value of the
* JobKOctetsProcessed attribute must be equal to the value of the {@link
* JobKOctets JobKOctets} attribute. For implementations where multiple copies
* are produced by the interpreter by processing the data for each copy, the
* final value must be a multiple of the value of the {@link JobKOctets
* JobKOctets} attribute.
* <P>
* <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
* category name returned by <CODE>getName()</CODE> gives the IPP attribute
* name.
* <P>
*
* @see JobKOctets
* @see JobKOctetsSupported
* @see JobImpressionsCompleted
* @see JobMediaSheetsCompleted
*
* @author Alan Kaminsky
*/
public final class JobKOctetsProcessed extends IntegerSyntax
implements PrintJobAttribute {
private static final long serialVersionUID = -6265238509657881806L;
/**
* Construct a new job K octets processed attribute with the given integer
* value.
*
* @param value Integer value.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
*/
public JobKOctetsProcessed(int value) {
super (value, 0, Integer.MAX_VALUE);
}
/**
* Returns whether this job K octets processed attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class JobKOctetsProcessed.
* <LI>
* This job K octets processed attribute's value and
* <CODE>object</CODE>'s value are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this job K
* octets processed attribute, false otherwise.
*/
public boolean equals(Object object) {
return(super.equals (object) &&
object instanceof JobKOctetsProcessed);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobKOctetsProcessed, the category is class
* JobKOctetsProcessed itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobKOctetsProcessed.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobKOctetsProcessed, the category name is
* <CODE>"job-k-octets-processed"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-k-octets-processed";
}
}

View File

@@ -0,0 +1,128 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.SetOfIntegerSyntax;
import javax.print.attribute.SupportedValuesAttribute;
/**
* Class JobKOctetsSupported is a printing attribute class, a set of integers,
* that gives the supported values for a {@link JobKOctets JobKOctets}
* attribute. It is restricted to a single contiguous range of integers;
* multiple non-overlapping ranges are not allowed. This gives the lower and
* upper bounds of the total sizes of print jobs in units of K octets (1024
* octets) that the printer will accept.
* <P>
* <B>IPP Compatibility:</B> The JobKOctetsSupported attribute's canonical array
* form gives the lower and upper bound for the range of values to be included
* in an IPP "job-k-octets-supported" attribute. See class {@link
* javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
* explanation of canonical array form. The category name returned by
* <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class JobKOctetsSupported extends SetOfIntegerSyntax
implements SupportedValuesAttribute {
private static final long serialVersionUID = -2867871140549897443L;
/**
* Construct a new job K octets supported attribute containing a single
* range of integers. That is, only those values of JobKOctets in the one
* range are supported.
*
* @param lowerBound Lower bound of the range.
* @param upperBound Upper bound of the range.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if a null range is specified or if a
* non-null range is specified with <CODE>lowerBound</CODE> less than
* 0.
*/
public JobKOctetsSupported(int lowerBound, int upperBound) {
super (lowerBound, upperBound);
if (lowerBound > upperBound) {
throw new IllegalArgumentException("Null range specified");
} else if (lowerBound < 0) {
throw new IllegalArgumentException
("Job K octets value < 0 specified");
}
}
/**
* Returns whether this job K octets supported attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class JobKOctetsSupported.
* <LI>
* This job K octets supported attribute's members and
* <CODE>object</CODE>'s members are the same.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this job K
* octets supported attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals (object) &&
object instanceof JobKOctetsSupported);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobKOctetsSupported, the category is class
* JobKOctetsSupported itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobKOctetsSupported.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobKOctetsSupported, the category name is
* <CODE>"job-k-octets-supported"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-k-octets-supported";
}
}

View File

@@ -0,0 +1,138 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class JobMediaSheets is an integer valued printing attribute class that
* specifies the total number of media sheets to be produced for this job.
* <P>
* The JobMediaSheets attribute describes the size of the job. This attribute is
* not intended to be a counter; it is intended to be useful routing and
* scheduling information if known. The printer may try to compute the
* JobMediaSheets attribute's value if it is not supplied in the Print Request.
* Even if the client does supply a value for the JobMediaSheets attribute in
* the Print Request, the printer may choose to change the value if the printer
* is able to compute a value which is more accurate than the client supplied
* value. The printer may be able to determine the correct value for the
* JobMediaSheets attribute either right at job submission time or at any later
* point in time.
* <P>
* Unlike the {@link JobKOctets JobKOctets} and {@link JobImpressions
* JobImpressions} attributes, the JobMediaSheets value must include the
* multiplicative factors contributed by the number of copies specified by the
* {@link Copies Copies} attribute and a "number of copies" instruction embedded
* in the document data, if any. This difference allows the system administrator
* to control the lower and upper bounds of both (1) the size of the document(s)
* with {@link JobKOctetsSupported JobKOctetsSupported} and {@link
* JobImpressionsSupported JobImpressionsSupported} and (2) the size of the job
* with {@link JobMediaSheetsSupported JobMediaSheetsSupported}.
* <P>
* <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
* category name returned by <CODE>getName()</CODE> gives the IPP attribute
* name.
* <P>
*
* @see JobMediaSheetsSupported
* @see JobMediaSheetsCompleted
* @see JobKOctets
* @see JobImpressions
*
* @author Alan Kaminsky
*/
public class JobMediaSheets extends IntegerSyntax
implements PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = 408871131531979741L;
/**
* Construct a new job media sheets attribute with the given integer
* value.
*
* @param value Integer value.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
*/
public JobMediaSheets(int value) {
super (value, 0, Integer.MAX_VALUE);
}
/**
* Returns whether this job media sheets attribute is equivalent to the
* passed in object. To be equivalent, all of the following conditions must
* be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class JobMediaSheets.
* <LI>
* This job media sheets attribute's value and <CODE>object</CODE>'s
* value are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this job media
* sheets attribute, false otherwise.
*/
public boolean equals(Object object) {
return super.equals(object) && object instanceof JobMediaSheets;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobMediaSheets and any vendor-defined subclasses, the category
* is class JobMediaSheets itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobMediaSheets.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobMediaSheets and any vendor-defined subclasses, the
* category name is <CODE>"job-media-sheets"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-media-sheets";
}
}

View File

@@ -0,0 +1,128 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintJobAttribute;
/**
* Class JobMediaSheetsCompleted is an integer valued printing attribute class
* that specifies the number of media sheets which have completed marking and
* stacking for the entire job so far, whether those sheets have been processed
* on one side or on both.
* <P>
* The JobMediaSheetsCompleted attribute describes the progress of the job. This
* attribute is intended to be a counter. That is, the JobMediaSheetsCompleted
* value for a job that has not started processing must be 0. When the job's
* {@link JobState JobState} is PROCESSING or PROCESSING_STOPPED, the
* JobMediaSheetsCompleted value is intended to increase as the job is
* processed; it indicates the amount of the job that has been processed at the
* time the Print Job's attribute set is queried or at the time a print job
* event is reported. When the job enters the COMPLETED, CANCELED, or ABORTED
* states, the JobMediaSheetsCompleted value is the final value for the job.
* <P>
* <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
* category name returned by <CODE>getName()</CODE> gives the IPP attribute
* name.
* <P>
*
* @see JobMediaSheets
* @see JobMediaSheetsSupported
* @see JobKOctetsProcessed
* @see JobImpressionsCompleted
*
* @author Alan Kaminsky
*/
public final class JobMediaSheetsCompleted extends IntegerSyntax
implements PrintJobAttribute {
private static final long serialVersionUID = 1739595973810840475L;
/**
* Construct a new job media sheets completed attribute with the given
* integer value.
*
* @param value Integer value.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
*/
public JobMediaSheetsCompleted(int value) {
super (value, 0, Integer.MAX_VALUE);
}
/**
* Returns whether this job media sheets completed attribute is equivalent
* to the passed in object. To be equivalent, all of the following
* conditions must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class JobMediaSheetsCompleted.
* <LI>
* This job media sheets completed attribute's value and
* <CODE>object</CODE>'s value are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this job media
* sheets completed attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals (object) &&
object instanceof JobMediaSheetsCompleted);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobMediaSheetsCompleted, the category is class
* JobMediaSheetsCompleted itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobMediaSheetsCompleted.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobMediaSheetsCompleted, the category name is
* <CODE>"job-media-sheets-completed"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-media-sheets-completed";
}
}

View File

@@ -0,0 +1,128 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.SetOfIntegerSyntax;
import javax.print.attribute.SupportedValuesAttribute;
/**
* Class JobMediaSheetsSupported is a printing attribute class, a set of
* integers, that gives the supported values for a {@link JobMediaSheets
* JobMediaSheets} attribute. It is restricted to a single contiguous range of
* integers; multiple non-overlapping ranges are not allowed. This gives the
* lower and upper bounds of the total sizes of print jobs in number of media
* sheets that the printer will accept.
* <P>
* <B>IPP Compatibility:</B> The JobMediaSheetsSupported attribute's canonical
* array form gives the lower and upper bound for the range of values to be
* included in an IPP "job-media-sheets-supported" attribute. See class {@link
* javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
* explanation of canonical array form. The category name returned by
* <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class JobMediaSheetsSupported extends SetOfIntegerSyntax
implements SupportedValuesAttribute {
private static final long serialVersionUID = 2953685470388672940L;
/**
* Construct a new job media sheets supported attribute containing a single
* range of integers. That is, only those values of JobMediaSheets in the
* one range are supported.
*
* @param lowerBound Lower bound of the range.
* @param upperBound Upper bound of the range.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if a null range is specified or if a
* non-null range is specified with <CODE>lowerBound</CODE> less than
* 0.
*/
public JobMediaSheetsSupported(int lowerBound, int upperBound) {
super (lowerBound, upperBound);
if (lowerBound > upperBound) {
throw new IllegalArgumentException("Null range specified");
} else if (lowerBound < 0) {
throw new IllegalArgumentException
("Job K octets value < 0 specified");
}
}
/**
* Returns whether this job media sheets supported attribute is equivalent
* to the passed in object. To be equivalent, all of the following
* conditions must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class JobMediaSheetsSupported.
* <LI>
* This job media sheets supported attribute's members and
* <CODE>object</CODE>'s members are the same.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this job media
* sheets supported attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals (object) &&
object instanceof JobMediaSheetsSupported);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobMediaSheetsSupported, the
* category is class JobMediaSheetsSupported itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobMediaSheetsSupported.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobMediaSheetsSupported, the
* category name is <CODE>"job-media-sheets-supported"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-media-sheets-supported";
}
}

View File

@@ -0,0 +1,129 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
import javax.print.attribute.TextSyntax;
import javax.print.attribute.PrintJobAttribute;
/**
* Class JobMessageFromOperator is a printing attribute class, a text attribute,
* that provides a message from an operator, system administrator, or
* "intelligent" process to indicate to the end user the reasons for
* modification or other management action taken on a job.
* <P>
* A Print Job's attribute set includes zero instances or one instance of a
* JobMessageFromOperator attribute, not more than one instance. A new
* JobMessageFromOperator attribute replaces an existing JobMessageFromOperator
* attribute, if any. In other words, JobMessageFromOperator is not intended to
* be a history log. If it wishes, the client can detect changes to a Print
* Job's JobMessageFromOperator attribute and maintain the client's own history
* log of the JobMessageFromOperator attribute values.
* <P>
* <B>IPP Compatibility:</B> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class JobMessageFromOperator extends TextSyntax
implements PrintJobAttribute {
private static final long serialVersionUID = -4620751846003142047L;
/**
* Constructs a new job message from operator attribute with the given
* message and locale.
*
* @param message Message.
* @param locale Natural language of the text string. null
* is interpreted to mean the default locale as returned
* by <code>Locale.getDefault()</code>
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>message</CODE> is null.
*/
public JobMessageFromOperator(String message, Locale locale) {
super (message, locale);
}
/**
* Returns whether this job message from operator attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class JobMessageFromOperator.
* <LI>
* This job message from operator attribute's underlying string and
* <CODE>object</CODE>'s underlying string are equal.
* <LI>
* This job message from operator attribute's locale and
* <CODE>object</CODE>'s locale are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this job
* message from operator attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals (object) &&
object instanceof JobMessageFromOperator);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobMessageFromOperator, the
* category is class JobMessageFromOperator itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobMessageFromOperator.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobMessageFromOperator, the
* category name is <CODE>"job-message-from-operator"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-message-from-operator";
}
}

View File

@@ -0,0 +1,125 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
import javax.print.attribute.TextSyntax;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class JobName is a printing attribute class, a text attribute, that specifies
* the name of a print job. A job's name is an arbitrary string defined by the
* client. It does not need to be unique between different jobs. A Print Job's
* JobName attribute is set to the value supplied by the client in the Print
* Request's attribute set. If, however, the client does not supply a JobName
* attribute in the Print Request, the printer, when it creates the Print Job,
* must generate a JobName. The printer should generate the value of the Print
* Job's JobName attribute from the first of the following sources that produces
* a value: (1) the {@link DocumentName DocumentName} attribute of the first (or
* only) doc in the job, (2) the URL of the first (or only) doc in the job, if
* the doc's print data representation object is a URL, or (3) any other piece
* of Print Job specific and/or document content information.
* <P>
* <B>IPP Compatibility:</B> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class JobName extends TextSyntax
implements PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = 4660359192078689545L;
/**
* Constructs a new job name attribute with the given job name and locale.
*
* @param jobName Job name.
* @param locale Natural language of the text string. null
* is interpreted to mean the default locale as returned
* by <code>Locale.getDefault()</code>
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>jobName</CODE> is null.
*/
public JobName(String jobName, Locale locale) {
super (jobName, locale);
}
/**
* Returns whether this job name attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class JobName.
* <LI>
* This job name attribute's underlying string and <CODE>object</CODE>'s
* underlying string are equal.
* <LI>
* This job name attribute's locale and <CODE>object</CODE>'s locale are
* equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this job name
* attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof JobName);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobName, the category is class JobName itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobName.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobName, the category name is <CODE>"job-name"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-name";
}
}

View File

@@ -0,0 +1,129 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
import javax.print.attribute.TextSyntax;
import javax.print.attribute.PrintJobAttribute;
/**
* Class JobOriginatingUserName is a printing attribute class, a text
* attribute, that contains the name of the end user that submitted the
* print job. If possible, the printer sets this attribute to the most
* authenticated printable user name that it can obtain from the
* authentication service that authenticated the submitted Print Request.
* If such is not available, the printer uses the value of the
* {@link RequestingUserName RequestingUserName}
* attribute supplied by the client in the Print Request's attribute set.
* If no authentication service is available, and the client did not supply
* a {@link RequestingUserName RequestingUserName} attribute,
* the printer sets the JobOriginatingUserName attribute to an empty
* (zero-length) string.
* <P>
* <B>IPP Compatibility:</B> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class JobOriginatingUserName extends TextSyntax
implements PrintJobAttribute {
private static final long serialVersionUID = -8052537926362933477L;
/**
* Constructs a new job originating user name attribute with the given
* user name and locale.
*
* @param userName User name.
* @param locale Natural language of the text string. null
* is interpreted to mean the default locale as returned
* by <code>Locale.getDefault()</code>
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>userName</CODE> is null.
*/
public JobOriginatingUserName(String userName, Locale locale) {
super (userName, locale);
}
/**
* Returns whether this job originating user name attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class JobOriginatingUserName.
* <LI>
* This job originating user name attribute's underlying string and
* <CODE>object</CODE>'s underlying string are equal.
* <LI>
* This job originating user name attribute's locale and
* <CODE>object</CODE>'s locale are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this job
* originating user name attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals (object) &&
object instanceof JobOriginatingUserName);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobOriginatingUserName, the
* category is class JobOriginatingUserName itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobOriginatingUserName.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobOriginatingUserName, the
* category name is <CODE>"job-originating-user-name"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-originating-user-name";
}
}

View File

@@ -0,0 +1,127 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class JobPriority is an integer valued printing attribute class that
* specifies a print job's priority.
* <P>
* If a JobPriority attribute is specified for a Print Job, it specifies a
* priority for scheduling the job. A higher value specifies a higher priority.
* The value 1 indicates the lowest possible priority. The value 100 indicates
* the highest possible priority. Among those jobs that are ready to print, a
* printer must print all jobs with a priority value of <I>n</I> before printing
* those with a priority value of <I>n</I>-1 for all <I>n.</I>
* <P>
* If the client does not specify a JobPriority attribute for a Print Job and
* the printer does support the JobPriority attribute, the printer must use an
* implementation-defined default JobPriority value.
* <P>
* The client can always specify any job priority value from 1 to 100 for a job.
* However, a Print Service instance may support fewer than 100 different
* job priority levels. If this is the case, the Print Service instance
* automatically maps the client-specified job priority value to one of the
* supported job priority levels, dividing the 100 job priority values equally
* among the available job priority levels.
* <P>
* <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
* category name returned by <CODE>getName()</CODE> gives the IPP attribute
* name.
* <P>
*
* @author Alan Kaminsky
*/
public final class JobPriority extends IntegerSyntax
implements PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = -4599900369040602769L;
/**
* Construct a new job priority attribute with the given integer value.
*
* @param value Integer value.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 1
* or greater than 100.
*/
public JobPriority(int value) {
super (value, 1, 100);
}
/**
* Returns whether this job priority attribute is equivalent to the passed
* in object. To be equivalent, all of the following conditions must be
* true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class JobPriority.
* <LI>
* This job priority attribute's value and <CODE>object</CODE>'s value
* are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this job
* priority attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals (object) && object instanceof JobPriority);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobPriority, the category is class JobPriority itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobPriority.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobPriority, the category name is <CODE>"job-priority"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-priority";
}
}

View File

@@ -0,0 +1,124 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.SupportedValuesAttribute;
/**
* Class JobPrioritySupported is an integer valued printing attribute class
* that specifies whether a Print Service instance supports the {@link
* JobPriority JobPriority} attribute and the number of different job priority
* levels supported.
* <P>
* The client can always specify any {@link JobPriority JobPriority} value
* from 1 to 100 for a job. However, the Print Service instance may support
* fewer than 100 different job priority levels. If this is the case, the
* Print Service instance automatically maps the client-specified job priority
* value to one of the supported job priority levels, dividing the 100 job
* priority values equally among the available job priority levels.
* <P>
* <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
* The category name returned by <CODE>getName()</CODE> gives the IPP
* attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class JobPrioritySupported extends IntegerSyntax
implements SupportedValuesAttribute {
private static final long serialVersionUID = 2564840378013555894L;
/**
* Construct a new job priority supported attribute with the given integer
* value.
*
* @param value Number of different job priority levels supported.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 1
* or greater than 100.
*/
public JobPrioritySupported(int value) {
super (value, 1, 100);
}
/**
* Returns whether this job priority supported attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class JobPrioritySupported.
* <LI>
* This job priority supported attribute's value and
* <CODE>object</CODE>'s value are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this job
* priority supported attribute, false otherwise.
*/
public boolean equals (Object object) {
return (super.equals(object) &&
object instanceof JobPrioritySupported);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobPrioritySupported, the
* category is class JobPrioritySupported itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobPrioritySupported.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobPrioritySupported, the
* category name is <CODE>"job-priority-supported"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-priority-supported";
}
}

View File

@@ -0,0 +1,134 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class JobSheets is a printing attribute class, an enumeration, that
* determines which job start and end sheets, if any, must be printed with a
* job. Class JobSheets declares keywords for standard job sheets values.
* Implementation- or site-defined names for a job sheets attribute may also be
* created by defining a subclass of class JobSheets.
* <P>
* The effect of a JobSheets attribute on multidoc print jobs (jobs with
* multiple documents) may be affected by the {@link MultipleDocumentHandling
* MultipleDocumentHandling} job attribute, depending on the meaning of the
* particular JobSheets value.
* <P>
* <B>IPP Compatibility:</B> The category name returned by
* <CODE>getName()</CODE> is the IPP attribute name. The
* enumeration's integer value is the IPP enum value. The
* <code>toString()</code> method returns the IPP string representation of
* the attribute value. For a subclass, the attribute value must be
* localized to give the IPP name and natural language values.
* <P>
*
* @author Alan Kaminsky
*/
public class JobSheets extends EnumSyntax
implements PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = -4735258056132519759L;
/**
* No job sheets are printed.
*/
public static final JobSheets NONE = new JobSheets(0);
/**
* One or more site specific standard job sheets are printed. e.g. a
* single start sheet is printed, or both start and end sheets are
* printed.
*/
public static final JobSheets STANDARD = new JobSheets(1);
/**
* Construct a new job sheets enumeration value with the given integer
* value.
*
* @param value Integer value.
*/
protected JobSheets(int value) {
super (value);
}
private static final String[] myStringTable = {
"none",
"standard"
};
private static final JobSheets[] myEnumValueTable = {
NONE,
STANDARD
};
/**
* Returns the string table for class JobSheets.
*/
protected String[] getStringTable() {
return (String[])myStringTable.clone();
}
/**
* Returns the enumeration value table for class JobSheets.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobSheets and any vendor-defined subclasses, the category is
* class JobSheets itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobSheets.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobSheets and any vendor-defined subclasses, the category
* name is <CODE>"job-sheets"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-sheets";
}
}

View File

@@ -0,0 +1,237 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintJobAttribute;
/**
* JobState is a printing attribute class, an enumeration, that identifies
* the current state of a print job. Class JobState defines standard job state
* values. A Print Service implementation only needs to report those job
* states which are appropriate for the particular implementation; it does not
* have to report every defined job state. The {@link JobStateReasons
* JobStateReasons} attribute augments the JobState attribute to give more
* detailed information about the job in the given job state.
* <P>
* <B>IPP Compatibility:</B> The category name returned by
* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
* integer value is the IPP enum value. The <code>toString()</code> method
* returns the IPP string representation of the attribute value.
* <P>
*
* @author Alan Kaminsky
*/
public class JobState extends EnumSyntax implements PrintJobAttribute {
private static final long serialVersionUID = 400465010094018920L;
/**
* The job state is unknown.
*/
public static final JobState UNKNOWN = new JobState(0);
/**
* The job is a candidate to start processing, but is not yet processing.
*/
public static final JobState PENDING = new JobState(3);
/**
* The job is not a candidate for processing for any number of reasons but
* will return to the PENDING state as soon as the reasons are no longer
* present. The job's {@link JobStateReasons JobStateReasons} attribute must
* indicate why the job is no longer a candidate for processing.
*/
public static final JobState PENDING_HELD = new JobState(4);
/**
* The job is processing. One or more of the following activities is
* occurring:
* <OL TYPE=1>
* <LI>
* The job is using, or is attempting to use, one or more purely software
* processes that are analyzing, creating, or interpreting a PDL, etc.
* <P>
* <LI>
* The job is using, or is attempting to use, one or more hardware
* devices that are interpreting a PDL, making marks on a medium, and/or
* performing finishing, such as stapling, etc.
* <P>
* <LI>
* The printer has made the job ready for printing, but the output
* device is not yet printing it, either because the job hasn't reached the
* output device or because the job is queued in the output device or some
* other spooler, awaiting the output device to print it.
* </OL>
* <P>
* When the job is in the PROCESSING state, the entire job state includes
* the detailed status represented in the printer's {@link PrinterState
* PrinterState} and {@link PrinterStateReasons PrinterStateReasons}
* attributes.
* <P>
* Implementations may, though they need not, include additional values in
* the job's {@link JobStateReasons JobStateReasons} attribute to indicate
* the progress of the job, such as adding the JOB_PRINTING value to
* indicate when the output device is actually making marks on paper and/or
* the PROCESSING_TO_STOP_POINT value to indicate that the printer is in the
* process of canceling or aborting the job.
*/
public static final JobState PROCESSING = new JobState (5);
/**
* The job has stopped while processing for any number of reasons and will
* return to the PROCESSING state as soon as the reasons are no longer
* present.
* <P>
* The job's {@link JobStateReasons JobStateReasons} attribute may indicate
* why the job has stopped processing. For example, if the output device is
* stopped, the PRINTER_STOPPED value may be included in the job's {@link
* JobStateReasons JobStateReasons} attribute.
* <P>
* <I>Note:</I> When an output device is stopped, the device usually
* indicates its condition in human readable form locally at the device. A
* client can obtain more complete device status remotely by querying the
* printer's {@link PrinterState PrinterState} and {@link
* PrinterStateReasons PrinterStateReasons} attributes.
*/
public static final JobState PROCESSING_STOPPED = new JobState (6);
/**
* The job has been canceled by some human agency, the printer has completed
* canceling the job, and all job status attributes have reached their final
* values for the job. While the printer is canceling the job, the job
* remains in its current state, but the job's {@link JobStateReasons
* JobStateReasons} attribute should contain the PROCESSING_TO_STOP_POINT
* value and one of the CANCELED_BY_USER, CANCELED_BY_OPERATOR, or
* CANCELED_AT_DEVICE values. When the job moves to the CANCELED state, the
* PROCESSING_TO_STOP_POINT value, if present, must be removed, but the
* CANCELED_BY_<I>xxx</I> value, if present, must remain.
*/
public static final JobState CANCELED = new JobState (7);
/**
* The job has been aborted by the system (usually while the job was in the
* PROCESSING or PROCESSING_STOPPED state), the printer has completed
* aborting the job, and all job status attributes have reached their final
* values for the job. While the printer is aborting the job, the job
* remains in its current state, but the job's {@link JobStateReasons
* JobStateReasons} attribute should contain the PROCESSING_TO_STOP_POINT
* and ABORTED_BY_SYSTEM values. When the job moves to the ABORTED state,
* the PROCESSING_TO_STOP_POINT value, if present, must be removed, but the
* ABORTED_BY_SYSTEM value, if present, must remain.
*/
public static final JobState ABORTED = new JobState (8);
/**
* The job has completed successfully or with warnings or errors after
* processing, all of the job media sheets have been successfully stacked in
* the appropriate output bin(s), and all job status attributes have reached
* their final values for the job. The job's {@link JobStateReasons
* JobStateReasons} attribute should contain one of these values:
* COMPLETED_SUCCESSFULLY, COMPLETED_WITH_WARNINGS, or
* COMPLETED_WITH_ERRORS.
*/
public static final JobState COMPLETED = new JobState (9);
// Hidden constructors.
/**
* Construct a new job state enumeration value with the given integer value.
*
* @param value Integer value.
*/
protected JobState(int value) {
super (value);
}
private static final String[] myStringTable =
{"unknown",
null,
null,
"pending",
"pending-held",
"processing",
"processing-stopped",
"canceled",
"aborted",
"completed"};
private static final JobState[] myEnumValueTable =
{UNKNOWN,
null,
null,
PENDING,
PENDING_HELD,
PROCESSING,
PROCESSING_STOPPED,
CANCELED,
ABORTED,
COMPLETED};
/**
* Returns the string table for class JobState.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
* Returns the enumeration value table for class JobState.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobState and any vendor-defined subclasses, the category is
* class JobState itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobState.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobState and any vendor-defined subclasses, the category
* name is <CODE>"job-state"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-state";
}
}

View File

@@ -0,0 +1,461 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.Attribute;
/**
* Class JobStateReason is a printing attribute class, an enumeration, that
* provides additional information about the job's current state, i.e.,
* information that augments the value of the job's {@link JobState JobState}
* attribute. Class JobStateReason defines standard job state reason values. A
* Print Service implementation only needs to report those job state
* reasons which are appropriate for the particular implementation; it does not
* have to report every defined job state reason.
* <P>
* Instances of JobStateReason do not appear in a Print Job's attribute set
* directly. Rather, a {@link JobStateReasons JobStateReasons} attribute appears
* in the Print Job's attribute set. The {@link JobStateReasons JobStateReasons}
* attribute contains zero, one, or more than one JobStateReason objects which
* pertain to the Print Job's status. The printer adds a JobStateReason object
* to the Print Job's {@link JobStateReasons JobStateReasons} attribute when the
* corresponding condition becomes true of the Print Job, and the printer
* removes the JobStateReason object again when the corresponding condition
* becomes false, regardless of whether the Print Job's overall {@link JobState
* JobState} also changed.
* <P>
* <B>IPP Compatibility:</B> The category name returned by
* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
* integer value is the IPP enum value. The <code>toString()</code> method
* returns the IPP string representation of the attribute value.
* <P>
*
* @author Alan Kaminsky
*/
public class JobStateReason extends EnumSyntax implements Attribute {
private static final long serialVersionUID = -8765894420449009168L;
/**
* The printer has created the Print Job, but the printer has not finished
* accessing or accepting all the print data yet.
*/
public static final JobStateReason
JOB_INCOMING = new JobStateReason(0);
/**
* The printer has created the Print Job, but the printer is expecting
* additional print data before it can move the job into the PROCESSING
* state. If a printer starts processing before it has received all data,
* the printer removes the JOB_DATA_INSUFFICIENT reason, but the
* JOB_INCOMING reason remains. If a printer starts processing after it
* has received all data, the printer removes the JOB_DATA_INSUFFICIENT
* and JOB_INCOMING reasons at the same time.
*/
public static final JobStateReason
JOB_DATA_INSUFFICIENT = new JobStateReason(1);
/**
* The Printer could not access one or more documents passed by reference
* (i.e., the print data representation object is a URL). This reason is
* intended to cover any file access problem,including file does not exist
* and access denied because of an access control problem. Whether the
* printer aborts the job and moves the job to the ABORTED job state or
* prints all documents that are accessible and moves the job to the
* COMPLETED job state and adds the COMPLETED_WITH_ERRORS reason to the
* job's {@link JobStateReasons JobStateReasons} attribute depends on
* implementation and/or site policy. This value should be supported if
* the printer supports doc flavors with URL print data representation
* objects.
*/
public static final JobStateReason
DOCUMENT_ACCESS_ERROR = new JobStateReason(2);
/**
* The job was not completely submitted for some unforeseen reason.
* Possibilities include (1) the printer has crashed before the job was
* fully submitted by the client, (2) the printer or the document transfer
* method has crashed in some non-recoverable way before the document data
* was entirely transferred to the printer, (3) the client crashed before
* the job was fully submitted.
*/
public static final JobStateReason
SUBMISSION_INTERRUPTED = new JobStateReason(3);
/**
* The printer is transmitting the job to the output device.
*/
public static final JobStateReason
JOB_OUTGOING = new JobStateReason(4);
/**
* The value of the job's {@link JobHoldUntil JobHoldUntil} attribute was
* specified with a date-time that is still in the future. The job must
* not be a candidate for processing until this reason is removed and
* there are
* no other reasons to hold the job. This value should be supported if the
* {@link JobHoldUntil JobHoldUntil} job template attribute is supported.
*/
public static final JobStateReason
JOB_HOLD_UNTIL_SPECIFIED = new JobStateReason(5);
/**
* At least one of the resources needed by the job, such as media, fonts,
* resource objects, etc., is not ready on any of the physical printers
* for which the job is a candidate. This condition may be detected
* when the job is accepted, or subsequently while the job is pending
* or processing, depending on implementation.
* The job may remain in its current state or
* be moved to the PENDING_HELD state, depending on implementation and/or
* job scheduling policy.
*/
public static final JobStateReason
RESOURCES_ARE_NOT_READY = new JobStateReason(6);
/**
* The value of the printer's {@link PrinterStateReasons
* PrinterStateReasons} attribute contains a {@link PrinterStateReason
* PrinterStateReason} value of STOPPED_PARTLY.
*/
public static final JobStateReason
PRINTER_STOPPED_PARTLY = new JobStateReason(7);
/**
* The value of the printer's {@link PrinterState PrinterState} attribute
* ia STOPPED.
*/
public static final JobStateReason
PRINTER_STOPPED = new JobStateReason(8);
/**
* The job is in the PROCESSING state, but more specifically, the printer
* ia interpreting the document data.
*/
public static final JobStateReason
JOB_INTERPRETING = new JobStateReason(9);
/**
* The job is in the PROCESSING state, but more specifically, the printer
* has queued the document data.
*/
public static final JobStateReason JOB_QUEUED = new JobStateReason(10);
/**
* The job is in the PROCESSING state, but more specifically, the printer
* is interpreting document data and producing another electronic
* representation.
*/
public static final JobStateReason
JOB_TRANSFORMING = new JobStateReason(11);
/**
* The job is in the PENDING_HELD, PENDING, or PROCESSING state, but more
* specifically, the printer has completed enough processing of the document
* to be able to start marking and the job is waiting for the marker.
* Systems that require human intervention to release jobs put the job into
* the PENDING_HELD job state. Systems that automatically select a job to
* use the marker put the job into the PENDING job state or keep the job
* in the PROCESSING job state while waiting for the marker, depending on
* implementation. All implementations put the job into (or back into) the
* PROCESSING state when marking does begin.
*/
public static final JobStateReason
JOB_QUEUED_FOR_MARKER = new JobStateReason(12);
/**
* The output device is marking media. This value is useful for printers
* which spend a great deal of time processing (1) when no marking is
* happening and then want to show that marking is now happening or (2) when
* the job is in the process of being canceled or aborted while the job
* remains in the PROCESSING state, but the marking has not yet stopped so
* that impression or sheet counts are still increasing for the job.
*/
public static final JobStateReason
JOB_PRINTING = new JobStateReason(13);
/**
* The job was canceled by the owner of the job, i.e., by a user whose
* authenticated identity is the same as the value of the originating user
* that created the Print Job, or by some other authorized end-user, such as
* a member of the job owner's security group. This value should be
* supported.
*/
public static final JobStateReason
JOB_CANCELED_BY_USER = new JobStateReason(14);
/**
* The job was canceled by the operator, i.e., by a user who has been
* authenticated as having operator privileges (whether local or remote). If
* the security policy is to allow anyone to cancel anyone's job, then this
* value may be used when the job is canceled by someone other than the
* owner of the job. For such a security policy, in effect, everyone is an
* operator as far as canceling jobs is concerned. This value should be
* supported if the implementation permits canceling by someone other than
* the owner of the job.
*/
public static final JobStateReason
JOB_CANCELED_BY_OPERATOR = new JobStateReason(15);
/**
* The job was canceled by an unidentified local user, i.e., a user at a
* console at the device. This value should be supported if the
* implementation supports canceling jobs at the console.
*/
public static final JobStateReason
JOB_CANCELED_AT_DEVICE = new JobStateReason(16);
/**
* The job was aborted by the system. Either the job (1) is in the process
* of being aborted, (2) has been aborted by the system and placed in the
* ABORTED state, or (3) has been aborted by the system and placed in the
* PENDING_HELD state, so that a user or operator can manually try the job
* again. This value should be supported.
*/
public static final JobStateReason
ABORTED_BY_SYSTEM = new JobStateReason(17);
/**
* The job was aborted by the system because the printer determined while
* attempting to decompress the document's data that the compression is
* actually not among those supported by the printer. This value must be
* supported, since {@link Compression Compression} is a required doc
* description attribute.
*/
public static final JobStateReason
UNSUPPORTED_COMPRESSION = new JobStateReason(18);
/**
* The job was aborted by the system because the printer encountered an
* error in the document data while decompressing it. If the printer posts
* this reason, the document data has already passed any tests that would
* have led to the UNSUPPORTED_COMPRESSION job state reason.
*/
public static final JobStateReason
COMPRESSION_ERROR = new JobStateReason(19);
/**
* The job was aborted by the system because the document data's document
* format (doc flavor) is not among those supported by the printer. If the
* client specifies a doc flavor with a MIME type of
* <CODE>"application/octet-stream"</CODE>, the printer may abort the job if
* the printer cannot determine the document data's actual format through
* auto-sensing (even if the printer supports the document format if
* specified explicitly). This value must be supported, since a doc flavor
* is required to be specified for each doc.
*/
public static final JobStateReason
UNSUPPORTED_DOCUMENT_FORMAT = new JobStateReason(20);
/**
* The job was aborted by the system because the printer encountered an
* error in the document data while processing it. If the printer posts this
* reason, the document data has already passed any tests that would have
* led to the UNSUPPORTED_DOCUMENT_FORMAT job state reason.
*/
public static final JobStateReason
DOCUMENT_FORMAT_ERROR = new JobStateReason(21);
/**
* The requester has canceled the job or the printer has aborted the job,
* but the printer is still performing some actions on the job until a
* specified stop point occurs or job termination/cleanup is completed.
* <P>
* If the implementation requires some measurable time to cancel the job in
* the PROCESSING or PROCESSING_STOPPED job states, the printer must use
* this reason to indicate that the printer is still performing some actions
* on the job while the job remains in the PROCESSING or PROCESSING_STOPPED
* state. After all the job's job description attributes have stopped
* incrementing, the printer moves the job from the PROCESSING state to the
* CANCELED or ABORTED job states.
*/
public static final JobStateReason
PROCESSING_TO_STOP_POINT = new JobStateReason(22);
/**
* The printer is off-line and accepting no jobs. All PENDING jobs are put
* into the PENDING_HELD state. This situation could be true if the
* service's or document transform's input is impaired or broken.
*/
public static final JobStateReason
SERVICE_OFF_LINE = new JobStateReason(23);
/**
* The job completed successfully. This value should be supported.
*/
public static final JobStateReason
JOB_COMPLETED_SUCCESSFULLY = new JobStateReason(24);
/**
* The job completed with warnings. This value should be supported if the
* implementation detects warnings.
*/
public static final JobStateReason
JOB_COMPLETED_WITH_WARNINGS = new JobStateReason(25);
/**
* The job completed with errors (and possibly warnings too). This value
* should be supported if the implementation detects errors.
*/
public static final JobStateReason
JOB_COMPLETED_WITH_ERRORS = new JobStateReason(26);
/**
* This job is retained and is currently able to be restarted. If
* JOB_RESTARTABLE is contained in the job's {@link JobStateReasons
* JobStateReasons} attribute, then the printer must accept a request to
* restart that job. This value should be supported if restarting jobs is
* supported. <I>[The capability for restarting jobs is not in the Java
* Print Service API at present.]</I>
*/
public static final JobStateReason
JOB_RESTARTABLE = new JobStateReason(27);
/**
* The job has been forwarded to a device or print system that is unable to
* send back status. The printer sets the job's {@link JobState JobState}
* attribute to COMPLETED and adds the QUEUED_IN_DEVICE reason to the job's
* {@link JobStateReasons JobStateReasons} attribute to indicate that the
* printer has no additional information about the job and never will have
* any better information.
*/
public static final JobStateReason
QUEUED_IN_DEVICE = new JobStateReason(28);
/**
* Construct a new job state reason enumeration value with the given
* integer value.
*
* @param value Integer value.
*/
protected JobStateReason(int value) {
super (value);
}
private static final String[] myStringTable = {
"job-incoming",
"job-data-insufficient",
"document-access-error",
"submission-interrupted",
"job-outgoing",
"job-hold-until-specified",
"resources-are-not-ready",
"printer-stopped-partly",
"printer-stopped",
"job-interpreting",
"job-queued",
"job-transforming",
"job-queued-for-marker",
"job-printing",
"job-canceled-by-user",
"job-canceled-by-operator",
"job-canceled-at-device",
"aborted-by-system",
"unsupported-compression",
"compression-error",
"unsupported-document-format",
"document-format-error",
"processing-to-stop-point",
"service-off-line",
"job-completed-successfully",
"job-completed-with-warnings",
"job-completed-with-errors",
"job-restartable",
"queued-in-device"};
private static final JobStateReason[] myEnumValueTable = {
JOB_INCOMING,
JOB_DATA_INSUFFICIENT,
DOCUMENT_ACCESS_ERROR,
SUBMISSION_INTERRUPTED,
JOB_OUTGOING,
JOB_HOLD_UNTIL_SPECIFIED,
RESOURCES_ARE_NOT_READY,
PRINTER_STOPPED_PARTLY,
PRINTER_STOPPED,
JOB_INTERPRETING,
JOB_QUEUED,
JOB_TRANSFORMING,
JOB_QUEUED_FOR_MARKER,
JOB_PRINTING,
JOB_CANCELED_BY_USER,
JOB_CANCELED_BY_OPERATOR,
JOB_CANCELED_AT_DEVICE,
ABORTED_BY_SYSTEM,
UNSUPPORTED_COMPRESSION,
COMPRESSION_ERROR,
UNSUPPORTED_DOCUMENT_FORMAT,
DOCUMENT_FORMAT_ERROR,
PROCESSING_TO_STOP_POINT,
SERVICE_OFF_LINE,
JOB_COMPLETED_SUCCESSFULLY,
JOB_COMPLETED_WITH_WARNINGS,
JOB_COMPLETED_WITH_ERRORS,
JOB_RESTARTABLE,
QUEUED_IN_DEVICE};
/**
* Returns the string table for class JobStateReason.
*/
protected String[] getStringTable() {
return (String[])myStringTable.clone();
}
/**
* Returns the enumeration value table for class JobStateReason.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobStateReason and any vendor-defined subclasses, the
* category is class JobStateReason itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobStateReason.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobStateReason and any vendor-defined subclasses, the
* category name is <CODE>"job-state-reason"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-state-reason";
}
}

View File

@@ -0,0 +1,181 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Collection;
import java.util.HashSet;
import javax.print.attribute.Attribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class JobStateReasons is a printing attribute class, a set of enumeration
* values, that provides additional information about the job's current state,
* i.e., information that augments the value of the job's {@link JobState
* JobState} attribute.
* <P>
* Instances of {@link JobStateReason JobStateReason} do not appear in a Print
* Job's attribute set directly. Rather, a JobStateReasons attribute appears in
* the Print Job's attribute set. The JobStateReasons attribute contains zero,
* one, or more than one {@link JobStateReason JobStateReason} objects which
* pertain to the Print Job's status. The printer adds a {@link JobStateReason
* JobStateReason} object to the Print Job's JobStateReasons attribute when the
* corresponding condition becomes true of the Print Job, and the printer
* removes the {@link JobStateReason JobStateReason} object again when the
* corresponding condition becomes false, regardless of whether the Print Job's
* overall {@link JobState JobState} also changed.
* <P>
* Class JobStateReasons inherits its implementation from class {@link
* java.util.HashSet java.util.HashSet}. Unlike most printing attributes which
* are immutable once constructed, class JobStateReasons is designed to be
* mutable; you can add {@link JobStateReason JobStateReason} objects to an
* existing JobStateReasons object and remove them again. However, like class
* {@link java.util.HashSet java.util.HashSet}, class JobStateReasons is not
* multiple thread safe. If a JobStateReasons object will be used by multiple
* threads, be sure to synchronize its operations (e.g., using a synchronized
* set view obtained from class {@link java.util.Collections
* java.util.Collections}).
* <P>
* <B>IPP Compatibility:</B> The string value returned by each individual {@link
* JobStateReason JobStateReason} object's <CODE>toString()</CODE> method gives
* the IPP keyword value. The category name returned by <CODE>getName()</CODE>
* gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class JobStateReasons
extends HashSet<JobStateReason> implements PrintJobAttribute {
private static final long serialVersionUID = 8849088261264331812L;
/**
* Construct a new, empty job state reasons attribute; the underlying hash
* set has the default initial capacity and load factor.
*/
public JobStateReasons() {
super();
}
/**
* Construct a new, empty job state reasons attribute; the underlying hash
* set has the given initial capacity and the default load factor.
*
* @param initialCapacity Initial capacity.
* @throws IllegalArgumentException if the initial capacity is less
* than zero.
*/
public JobStateReasons(int initialCapacity) {
super (initialCapacity);
}
/**
* Construct a new, empty job state reasons attribute; the underlying hash
* set has the given initial capacity and load factor.
*
* @param initialCapacity Initial capacity.
* @param loadFactor Load factor.
* @throws IllegalArgumentException if the initial capacity is less
* than zero.
*/
public JobStateReasons(int initialCapacity, float loadFactor) {
super (initialCapacity, loadFactor);
}
/**
* Construct a new job state reasons attribute that contains the same
* {@link JobStateReason JobStateReason} objects as the given collection.
* The underlying hash set's initial capacity and load factor are as
* specified in the superclass constructor {@link
* java.util.HashSet#HashSet(java.util.Collection)
* HashSet(Collection)}.
*
* @param collection Collection to copy.
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>collection</CODE> is null or
* if any element in <CODE>collection</CODE> is null.
* @throws ClassCastException
* (unchecked exception) Thrown if any element in
* <CODE>collection</CODE> is not an instance of class {@link
* JobStateReason JobStateReason}.
*/
public JobStateReasons(Collection<JobStateReason> collection) {
super (collection);
}
/**
* Adds the specified element to this job state reasons attribute if it is
* not already present. The element to be added must be an instance of class
* {@link JobStateReason JobStateReason}. If this job state reasons
* attribute already contains the specified element, the call leaves this
* job state reasons attribute unchanged and returns <tt>false</tt>.
*
* @param o Element to be added to this job state reasons attribute.
*
* @return <tt>true</tt> if this job state reasons attribute did not
* already contain the specified element.
*
* @throws NullPointerException
* (unchecked exception) Thrown if the specified element is null.
* @throws ClassCastException
* (unchecked exception) Thrown if the specified element is not an
* instance of class {@link JobStateReason JobStateReason}.
* @since 1.5
*/
public boolean add(JobStateReason o) {
if (o == null) {
throw new NullPointerException();
}
return super.add ((JobStateReason) o);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class JobStateReasons, the category is class JobStateReasons itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return JobStateReasons.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class JobStateReasons, the category
* name is <CODE>"job-state-reasons"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "job-state-reasons";
}
}

View File

@@ -0,0 +1,123 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class Media is a printing attribute class that specifies the
* medium on which to print.
* <p>
* Media may be specified in different ways.
* <ul>
* <li> it may be specified by paper source - eg paper tray
* <li> it may be specified by a standard size - eg "A4"
* <li> it may be specified by a name - eg "letterhead"
* </ul>
* Each of these corresponds to the IPP "media" attribute.
* The current API does not support describing media by characteristics
* (eg colour, opacity).
* This may be supported in a later revision of the specification.
* <p>
* A Media object is constructed with a value which represents
* one of the ways in which the Media attribute can be specified.
* <p>
* <B>IPP Compatibility:</B> The category name returned by
* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
* integer value is the IPP enum value. The <code>toString()</code> method
* returns the IPP string representation of the attribute value.
* <P>
*
* @author Phil Race
*/
public abstract class Media extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = -2823970704630722439L;
/**
* Constructs a new media attribute specified by name.
*
* @param value a value
*/
protected Media(int value) {
super (value);
}
/**
* Returns whether this media attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is of the same subclass of Media as this object.
* <LI>
* The values are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this media
* attribute, false otherwise.
*/
public boolean equals(Object object) {
return(object != null && object instanceof Media &&
object.getClass() == this.getClass() &&
((Media)object).getValue() == this.getValue());
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class Media and any vendor-defined subclasses, the category is
* class Media itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return Media.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class Media and any vendor-defined subclasses, the category name is
* <CODE>"media"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "media";
}
}

View File

@@ -0,0 +1,113 @@
/*
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
/**
* Class MediaName is a subclass of Media, a printing attribute class (an
* enumeration) that specifies the media for a print job as a name.
* <P>
* This attribute can be used instead of specifying MediaSize or MediaTray.
* <p>
* Class MediaName currently declares a few standard media names.
* Implementation- or site-defined names for a media name attribute may also
* be created by defining a subclass of class MediaName.
* <P>
* <B>IPP Compatibility:</B> MediaName is a representation class for
* values of the IPP "media" attribute which names media.
* <P>
*
*/
public class MediaName extends Media implements Attribute {
private static final long serialVersionUID = 4653117714524155448L;
/**
* white letter paper.
*/
public static final MediaName NA_LETTER_WHITE = new MediaName(0);
/**
* letter transparency.
*/
public static final MediaName NA_LETTER_TRANSPARENT = new MediaName(1);
/**
* white A4 paper.
*/
public static final MediaName ISO_A4_WHITE = new MediaName(2);
/**
* A4 transparency.
*/
public static final MediaName ISO_A4_TRANSPARENT= new MediaName(3);
/**
* Constructs a new media name enumeration value with the given integer
* value.
*
* @param value Integer value.
*/
protected MediaName(int value) {
super (value);
}
private static final String[] myStringTable = {
"na-letter-white",
"na-letter-transparent",
"iso-a4-white",
"iso-a4-transparent"
};
private static final MediaName[] myEnumValueTable = {
NA_LETTER_WHITE,
NA_LETTER_TRANSPARENT,
ISO_A4_WHITE,
ISO_A4_TRANSPARENT
};
/**
* Returns the string table for class MediaTray.
* @return the String table.
*/
protected String[] getStringTable()
{
return (String[])myStringTable.clone();
}
/**
* Returns the enumeration value table for class MediaTray.
* @return the enumeration value table.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
}

View File

@@ -0,0 +1,335 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
/**
* Class MediaPrintableArea is a printing attribute used to distinguish
* the printable and non-printable areas of media.
* <p>
* The printable area is specified to be a rectangle, within the overall
* dimensions of a media.
* <p>
* Most printers cannot print on the entire surface of the media, due
* to printer hardware limitations. This class can be used to query
* the acceptable values for a supposed print job, and to request an area
* within the constraints of the printable area to be used in a print job.
* <p>
* To query for the printable area, a client must supply a suitable context.
* Without specifying at the very least the size of the media being used
* no meaningful value for printable area can be obtained.
* <p>
* The attribute is not described in terms of the distance from the edge
* of the paper, in part to emphasise that this attribute is not independent
* of a particular media, but must be described within the context of a
* choice of other attributes. Additionally it is usually more convenient
* for a client to use the printable area.
* <p>
* The hardware's minimum margins is not just a property of the printer,
* but may be a function of the media size, orientation, media type, and
* any specified finishings.
* <code>PrintService</code> provides the method to query the supported
* values of an attribute in a suitable context :
* See {@link javax.print.PrintService#getSupportedAttributeValues(Class,DocFlavor, AttributeSet) PrintService.getSupportedAttributeValues()}
* <p>
* The rectangular printable area is defined thus:
* The (x,y) origin is positioned at the top-left of the paper in portrait
* mode regardless of the orientation specified in the requesting context.
* For example a printable area for A4 paper in portrait or landscape
* orientation will have height {@literal >} width.
* <p>
* A printable area attribute's values are stored
* internally as integers in units of micrometers (&#181;m), where 1 micrometer
* = 10<SUP>-6</SUP> meter = 1/1000 millimeter = 1/25400 inch. This permits
* dimensions to be represented exactly to a precision of 1/1000 mm (= 1
* &#181;m) or 1/100 inch (= 254 &#181;m). If fractional inches are expressed in
* negative powers of two, this permits dimensions to be represented exactly to
* a precision of 1/8 inch (= 3175 &#181;m) but not 1/16 inch (because 1/16 inch
* does not equal an integral number of &#181;m).
* <p>
* <B>IPP Compatibility:</B> MediaPrintableArea is not an IPP attribute.
*/
public final class MediaPrintableArea
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
private int x, y, w, h;
private int units;
private static final long serialVersionUID = -1597171464050795793L;
/**
* Value to indicate units of inches (in). It is actually the conversion
* factor by which to multiply inches to yield &#181;m (25400).
*/
public static final int INCH = 25400;
/**
* Value to indicate units of millimeters (mm). It is actually the
* conversion factor by which to multiply mm to yield &#181;m (1000).
*/
public static final int MM = 1000;
/**
* Constructs a MediaPrintableArea object from floating point values.
* @param x printable x
* @param y printable y
* @param w printable width
* @param h printable height
* @param units in which the values are expressed.
*
* @exception IllegalArgumentException
* Thrown if {@code x < 0} or {@code y < 0}
* or {@code w <= 0} or {@code h <= 0} or
* {@code units < 1}.
*/
public MediaPrintableArea(float x, float y, float w, float h, int units) {
if ((x < 0.0) || (y < 0.0) || (w <= 0.0) || (h <= 0.0) ||
(units < 1)) {
throw new IllegalArgumentException("0 or negative value argument");
}
this.x = (int) (x * units + 0.5f);
this.y = (int) (y * units + 0.5f);
this.w = (int) (w * units + 0.5f);
this.h = (int) (h * units + 0.5f);
}
/**
* Constructs a MediaPrintableArea object from integer values.
* @param x printable x
* @param y printable y
* @param w printable width
* @param h printable height
* @param units in which the values are expressed.
*
* @exception IllegalArgumentException
* Thrown if {@code x < 0} or {@code y < 0}
* or {@code w <= 0} or {@code h <= 0} or
* {@code units < 1}.
*/
public MediaPrintableArea(int x, int y, int w, int h, int units) {
if ((x < 0) || (y < 0) || (w <= 0) || (h <= 0) ||
(units < 1)) {
throw new IllegalArgumentException("0 or negative value argument");
}
this.x = x * units;
this.y = y * units;
this.w = w * units;
this.h = h * units;
}
/**
* Get the printable area as an array of 4 values in the order
* x, y, w, h. The values returned are in the given units.
* @param units
* Unit conversion factor, e.g. {@link #INCH INCH} or
* {@link #MM MM}.
*
* @return printable area as array of x, y, w, h in the specified units.
*
* @exception IllegalArgumentException
* (unchecked exception) Thrown if {@code units < 1}.
*/
public float[] getPrintableArea(int units) {
return new float[] { getX(units), getY(units),
getWidth(units), getHeight(units) };
}
/**
* Get the x location of the origin of the printable area in the
* specified units.
* @param units
* Unit conversion factor, e.g. {@link #INCH INCH} or
* {@link #MM MM}.
*
* @return x location of the origin of the printable area in the
* specified units.
*
* @exception IllegalArgumentException
* (unchecked exception) Thrown if {@code units < 1}.
*/
public float getX(int units) {
return convertFromMicrometers(x, units);
}
/**
* Get the y location of the origin of the printable area in the
* specified units.
* @param units
* Unit conversion factor, e.g. {@link #INCH INCH} or
* {@link #MM MM}.
*
* @return y location of the origin of the printable area in the
* specified units.
*
* @exception IllegalArgumentException
* (unchecked exception) Thrown if {@code units < 1}.
*/
public float getY(int units) {
return convertFromMicrometers(y, units);
}
/**
* Get the width of the printable area in the specified units.
* @param units
* Unit conversion factor, e.g. {@link #INCH INCH} or
* {@link #MM MM}.
*
* @return width of the printable area in the specified units.
*
* @exception IllegalArgumentException
* (unchecked exception) Thrown if {@code units < 1}.
*/
public float getWidth(int units) {
return convertFromMicrometers(w, units);
}
/**
* Get the height of the printable area in the specified units.
* @param units
* Unit conversion factor, e.g. {@link #INCH INCH} or
* {@link #MM MM}.
*
* @return height of the printable area in the specified units.
*
* @exception IllegalArgumentException
* (unchecked exception) Thrown if {@code units < 1}.
*/
public float getHeight(int units) {
return convertFromMicrometers(h, units);
}
/**
* Returns whether this media margins attribute is equivalent to the passed
* in object.
* To be equivalent, all of the following conditions must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class MediaPrintableArea.
* <LI>
* The origin and dimensions are the same.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this media margins
* attribute, false otherwise.
*/
public boolean equals(Object object) {
boolean ret = false;
if (object instanceof MediaPrintableArea) {
MediaPrintableArea mm = (MediaPrintableArea)object;
if (x == mm.x && y == mm.y && w == mm.w && h == mm.h) {
ret = true;
}
}
return ret;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class MediaPrintableArea, the category is
* class MediaPrintableArea itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return MediaPrintableArea.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class MediaPrintableArea,
* the category name is <CODE>"media-printable-area"</CODE>.
* <p>This is not an IPP V1.1 attribute.
*
* @return Attribute category name.
*/
public final String getName() {
return "media-printable-area";
}
/**
* Returns a string version of this rectangular size attribute in the
* given units.
*
* @param units
* Unit conversion factor, e.g. {@link #INCH INCH} or
* {@link #MM MM}.
* @param unitsName
* Units name string, e.g. <CODE>"in"</CODE> or <CODE>"mm"</CODE>. If
* null, no units name is appended to the result.
*
* @return String version of this two-dimensional size attribute.
*
* @exception IllegalArgumentException
* (unchecked exception) Thrown if {@code units < 1}.
*/
public String toString(int units, String unitsName) {
if (unitsName == null) {
unitsName = "";
}
float []vals = getPrintableArea(units);
String str = "("+vals[0]+","+vals[1]+")->("+vals[2]+","+vals[3]+")";
return str + unitsName;
}
/**
* Returns a string version of this rectangular size attribute in mm.
*/
public String toString() {
return(toString(MM, "mm"));
}
/**
* Returns a hash code value for this attribute.
*/
public int hashCode() {
return x + 37*y + 43*w + 47*h;
}
private static float convertFromMicrometers(int x, int units) {
if (units < 1) {
throw new IllegalArgumentException("units is < 1");
}
return ((float)x) / ((float)units);
}
}

View File

@@ -0,0 +1,856 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.HashMap;
import java.util.Vector;
import javax.print.attribute.Size2DSyntax;
import javax.print.attribute.Attribute;
/**
* Class MediaSize is a two-dimensional size valued printing attribute class
* that indicates the dimensions of the medium in a portrait orientation, with
* the X dimension running along the bottom edge and the Y dimension running
* along the left edge. Thus, the Y dimension must be greater than or equal to
* the X dimension. Class MediaSize declares many standard media size
* values, organized into nested classes for ISO, JIS, North American,
* engineering, and other media.
* <P>
* MediaSize is not yet used to specify media. Its current role is
* as a mapping for named media (see {@link MediaSizeName MediaSizeName}).
* Clients can use the mapping method
* <code>MediaSize.getMediaSizeForName(MediaSizeName)</code>
* to find the physical dimensions of the MediaSizeName instances
* enumerated in this API. This is useful for clients which need this
* information to format {@literal &} paginate printing.
* <P>
*
* @author Phil Race, Alan Kaminsky
*/
public class MediaSize extends Size2DSyntax implements Attribute {
private static final long serialVersionUID = -1967958664615414771L;
private MediaSizeName mediaName;
private static HashMap mediaMap = new HashMap(100, 10);
private static Vector sizeVector = new Vector(100, 10);
/**
* Construct a new media size attribute from the given floating-point
* values.
*
* @param x X dimension.
* @param y Y dimension.
* @param units
* Unit conversion factor, e.g. <CODE>Size2DSyntax.INCH</CODE> or
* <CODE>Size2DSyntax.MM</CODE>.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
* {@code units < 1} or {@code x > y}.
*/
public MediaSize(float x, float y,int units) {
super (x, y, units);
if (x > y) {
throw new IllegalArgumentException("X dimension > Y dimension");
}
sizeVector.add(this);
}
/**
* Construct a new media size attribute from the given integer values.
*
* @param x X dimension.
* @param y Y dimension.
* @param units
* Unit conversion factor, e.g. <CODE>Size2DSyntax.INCH</CODE> or
* <CODE>Size2DSyntax.MM</CODE>.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
* {@code units < 1} or {@code x > y}.
*/
public MediaSize(int x, int y,int units) {
super (x, y, units);
if (x > y) {
throw new IllegalArgumentException("X dimension > Y dimension");
}
sizeVector.add(this);
}
/**
* Construct a new media size attribute from the given floating-point
* values.
*
* @param x X dimension.
* @param y Y dimension.
* @param units
* Unit conversion factor, e.g. <CODE>Size2DSyntax.INCH</CODE> or
* <CODE>Size2DSyntax.MM</CODE>.
* @param media a media name to associate with this MediaSize
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
* {@code units < 1} or {@code x > y}.
*/
public MediaSize(float x, float y,int units, MediaSizeName media) {
super (x, y, units);
if (x > y) {
throw new IllegalArgumentException("X dimension > Y dimension");
}
if (media != null && mediaMap.get(media) == null) {
mediaName = media;
mediaMap.put(mediaName, this);
}
sizeVector.add(this);
}
/**
* Construct a new media size attribute from the given integer values.
*
* @param x X dimension.
* @param y Y dimension.
* @param units
* Unit conversion factor, e.g. <CODE>Size2DSyntax.INCH</CODE> or
* <CODE>Size2DSyntax.MM</CODE>.
* @param media a media name to associate with this MediaSize
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
* {@code units < 1} or {@code x > y}.
*/
public MediaSize(int x, int y,int units, MediaSizeName media) {
super (x, y, units);
if (x > y) {
throw new IllegalArgumentException("X dimension > Y dimension");
}
if (media != null && mediaMap.get(media) == null) {
mediaName = media;
mediaMap.put(mediaName, this);
}
sizeVector.add(this);
}
/**
* Get the media name, if any, for this size.
*
* @return the name for this media size, or null if no name was
* associated with this size (an anonymous size).
*/
public MediaSizeName getMediaSizeName() {
return mediaName;
}
/**
* Get the MediaSize for the specified named media.
*
* @param media - the name of the media for which the size is sought
* @return size of the media, or null if this media is not associated
* with any size.
*/
public static MediaSize getMediaSizeForName(MediaSizeName media) {
return (MediaSize)mediaMap.get(media);
}
/**
* The specified dimensions are used to locate a matching MediaSize
* instance from amongst all the standard MediaSize instances.
* If there is no exact match, the closest match is used.
* <p>
* The MediaSize is in turn used to locate the MediaSizeName object.
* This method may return null if the closest matching MediaSize
* has no corresponding Media instance.
* <p>
* This method is useful for clients which have only dimensions and
* want to find a Media which corresponds to the dimensions.
* @param x - X dimension
* @param y - Y dimension.
* @param units
* Unit conversion factor, e.g. <CODE>Size2DSyntax.INCH</CODE> or
* <CODE>Size2DSyntax.MM</CODE>
* @return MediaSizeName matching these dimensions, or null.
* @exception IllegalArgumentException if {@code x <= 0},
* {@code y <= 0}, or {@code units < 1}.
*
*/
public static MediaSizeName findMedia(float x, float y, int units) {
MediaSize match = MediaSize.ISO.A4;
if (x <= 0.0f || y <= 0.0f || units < 1) {
throw new IllegalArgumentException("args must be +ve values");
}
double ls = x * x + y * y;
double tmp_ls;
float []dim;
float diffx = x;
float diffy = y;
for (int i=0; i < sizeVector.size() ; i++) {
MediaSize mediaSize = (MediaSize)sizeVector.elementAt(i);
dim = mediaSize.getSize(units);
if (x == dim[0] && y == dim[1]) {
match = mediaSize;
break;
} else {
diffx = x - dim[0];
diffy = y - dim[1];
tmp_ls = diffx * diffx + diffy * diffy;
if (tmp_ls < ls) {
ls = tmp_ls;
match = mediaSize;
}
}
}
return match.getMediaSizeName();
}
/**
* Returns whether this media size attribute is equivalent to the passed
* in object.
* To be equivalent, all of the following conditions must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class MediaSize.
* <LI>
* This media size attribute's X dimension is equal to
* <CODE>object</CODE>'s X dimension.
* <LI>
* This media size attribute's Y dimension is equal to
* <CODE>object</CODE>'s Y dimension.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this media size
* attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof MediaSize);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class MediaSize and any vendor-defined subclasses, the category is
* class MediaSize itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return MediaSize.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class MediaSize and any vendor-defined subclasses, the category
* name is <CODE>"media-size"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "media-size";
}
/**
* Class MediaSize.ISO includes {@link MediaSize MediaSize} values for ISO
* media.
* <P>
*/
public final static class ISO {
/**
* Specifies the ISO A0 size, 841 mm by 1189 mm.
*/
public static final MediaSize
A0 = new MediaSize(841, 1189, Size2DSyntax.MM, MediaSizeName.ISO_A0);
/**
* Specifies the ISO A1 size, 594 mm by 841 mm.
*/
public static final MediaSize
A1 = new MediaSize(594, 841, Size2DSyntax.MM, MediaSizeName.ISO_A1);
/**
* Specifies the ISO A2 size, 420 mm by 594 mm.
*/
public static final MediaSize
A2 = new MediaSize(420, 594, Size2DSyntax.MM, MediaSizeName.ISO_A2);
/**
* Specifies the ISO A3 size, 297 mm by 420 mm.
*/
public static final MediaSize
A3 = new MediaSize(297, 420, Size2DSyntax.MM, MediaSizeName.ISO_A3);
/**
* Specifies the ISO A4 size, 210 mm by 297 mm.
*/
public static final MediaSize
A4 = new MediaSize(210, 297, Size2DSyntax.MM, MediaSizeName.ISO_A4);
/**
* Specifies the ISO A5 size, 148 mm by 210 mm.
*/
public static final MediaSize
A5 = new MediaSize(148, 210, Size2DSyntax.MM, MediaSizeName.ISO_A5);
/**
* Specifies the ISO A6 size, 105 mm by 148 mm.
*/
public static final MediaSize
A6 = new MediaSize(105, 148, Size2DSyntax.MM, MediaSizeName.ISO_A6);
/**
* Specifies the ISO A7 size, 74 mm by 105 mm.
*/
public static final MediaSize
A7 = new MediaSize(74, 105, Size2DSyntax.MM, MediaSizeName.ISO_A7);
/**
* Specifies the ISO A8 size, 52 mm by 74 mm.
*/
public static final MediaSize
A8 = new MediaSize(52, 74, Size2DSyntax.MM, MediaSizeName.ISO_A8);
/**
* Specifies the ISO A9 size, 37 mm by 52 mm.
*/
public static final MediaSize
A9 = new MediaSize(37, 52, Size2DSyntax.MM, MediaSizeName.ISO_A9);
/**
* Specifies the ISO A10 size, 26 mm by 37 mm.
*/
public static final MediaSize
A10 = new MediaSize(26, 37, Size2DSyntax.MM, MediaSizeName.ISO_A10);
/**
* Specifies the ISO B0 size, 1000 mm by 1414 mm.
*/
public static final MediaSize
B0 = new MediaSize(1000, 1414, Size2DSyntax.MM, MediaSizeName.ISO_B0);
/**
* Specifies the ISO B1 size, 707 mm by 1000 mm.
*/
public static final MediaSize
B1 = new MediaSize(707, 1000, Size2DSyntax.MM, MediaSizeName.ISO_B1);
/**
* Specifies the ISO B2 size, 500 mm by 707 mm.
*/
public static final MediaSize
B2 = new MediaSize(500, 707, Size2DSyntax.MM, MediaSizeName.ISO_B2);
/**
* Specifies the ISO B3 size, 353 mm by 500 mm.
*/
public static final MediaSize
B3 = new MediaSize(353, 500, Size2DSyntax.MM, MediaSizeName.ISO_B3);
/**
* Specifies the ISO B4 size, 250 mm by 353 mm.
*/
public static final MediaSize
B4 = new MediaSize(250, 353, Size2DSyntax.MM, MediaSizeName.ISO_B4);
/**
* Specifies the ISO B5 size, 176 mm by 250 mm.
*/
public static final MediaSize
B5 = new MediaSize(176, 250, Size2DSyntax.MM, MediaSizeName.ISO_B5);
/**
* Specifies the ISO B6 size, 125 mm by 176 mm.
*/
public static final MediaSize
B6 = new MediaSize(125, 176, Size2DSyntax.MM, MediaSizeName.ISO_B6);
/**
* Specifies the ISO B7 size, 88 mm by 125 mm.
*/
public static final MediaSize
B7 = new MediaSize(88, 125, Size2DSyntax.MM, MediaSizeName.ISO_B7);
/**
* Specifies the ISO B8 size, 62 mm by 88 mm.
*/
public static final MediaSize
B8 = new MediaSize(62, 88, Size2DSyntax.MM, MediaSizeName.ISO_B8);
/**
* Specifies the ISO B9 size, 44 mm by 62 mm.
*/
public static final MediaSize
B9 = new MediaSize(44, 62, Size2DSyntax.MM, MediaSizeName.ISO_B9);
/**
* Specifies the ISO B10 size, 31 mm by 44 mm.
*/
public static final MediaSize
B10 = new MediaSize(31, 44, Size2DSyntax.MM, MediaSizeName.ISO_B10);
/**
* Specifies the ISO C3 size, 324 mm by 458 mm.
*/
public static final MediaSize
C3 = new MediaSize(324, 458, Size2DSyntax.MM, MediaSizeName.ISO_C3);
/**
* Specifies the ISO C4 size, 229 mm by 324 mm.
*/
public static final MediaSize
C4 = new MediaSize(229, 324, Size2DSyntax.MM, MediaSizeName.ISO_C4);
/**
* Specifies the ISO C5 size, 162 mm by 229 mm.
*/
public static final MediaSize
C5 = new MediaSize(162, 229, Size2DSyntax.MM, MediaSizeName.ISO_C5);
/**
* Specifies the ISO C6 size, 114 mm by 162 mm.
*/
public static final MediaSize
C6 = new MediaSize(114, 162, Size2DSyntax.MM, MediaSizeName.ISO_C6);
/**
* Specifies the ISO Designated Long size, 110 mm by 220 mm.
*/
public static final MediaSize
DESIGNATED_LONG = new MediaSize(110, 220, Size2DSyntax.MM,
MediaSizeName.ISO_DESIGNATED_LONG);
/**
* Hide all constructors.
*/
private ISO() {
}
}
/**
* Class MediaSize.JIS includes {@link MediaSize MediaSize} values for JIS
* (Japanese) media. *
*/
public final static class JIS {
/**
* Specifies the JIS B0 size, 1030 mm by 1456 mm.
*/
public static final MediaSize
B0 = new MediaSize(1030, 1456, Size2DSyntax.MM, MediaSizeName.JIS_B0);
/**
* Specifies the JIS B1 size, 728 mm by 1030 mm.
*/
public static final MediaSize
B1 = new MediaSize(728, 1030, Size2DSyntax.MM, MediaSizeName.JIS_B1);
/**
* Specifies the JIS B2 size, 515 mm by 728 mm.
*/
public static final MediaSize
B2 = new MediaSize(515, 728, Size2DSyntax.MM, MediaSizeName.JIS_B2);
/**
* Specifies the JIS B3 size, 364 mm by 515 mm.
*/
public static final MediaSize
B3 = new MediaSize(364, 515, Size2DSyntax.MM, MediaSizeName.JIS_B3);
/**
* Specifies the JIS B4 size, 257 mm by 364 mm.
*/
public static final MediaSize
B4 = new MediaSize(257, 364, Size2DSyntax.MM, MediaSizeName.JIS_B4);
/**
* Specifies the JIS B5 size, 182 mm by 257 mm.
*/
public static final MediaSize
B5 = new MediaSize(182, 257, Size2DSyntax.MM, MediaSizeName.JIS_B5);
/**
* Specifies the JIS B6 size, 128 mm by 182 mm.
*/
public static final MediaSize
B6 = new MediaSize(128, 182, Size2DSyntax.MM, MediaSizeName.JIS_B6);
/**
* Specifies the JIS B7 size, 91 mm by 128 mm.
*/
public static final MediaSize
B7 = new MediaSize(91, 128, Size2DSyntax.MM, MediaSizeName.JIS_B7);
/**
* Specifies the JIS B8 size, 64 mm by 91 mm.
*/
public static final MediaSize
B8 = new MediaSize(64, 91, Size2DSyntax.MM, MediaSizeName.JIS_B8);
/**
* Specifies the JIS B9 size, 45 mm by 64 mm.
*/
public static final MediaSize
B9 = new MediaSize(45, 64, Size2DSyntax.MM, MediaSizeName.JIS_B9);
/**
* Specifies the JIS B10 size, 32 mm by 45 mm.
*/
public static final MediaSize
B10 = new MediaSize(32, 45, Size2DSyntax.MM, MediaSizeName.JIS_B10);
/**
* Specifies the JIS Chou ("long") #1 envelope size, 142 mm by 332 mm.
*/
public static final MediaSize CHOU_1 = new MediaSize(142, 332, Size2DSyntax.MM);
/**
* Specifies the JIS Chou ("long") #2 envelope size, 119 mm by 277 mm.
*/
public static final MediaSize CHOU_2 = new MediaSize(119, 277, Size2DSyntax.MM);
/**
* Specifies the JIS Chou ("long") #3 envelope size, 120 mm by 235 mm.
*/
public static final MediaSize CHOU_3 = new MediaSize(120, 235, Size2DSyntax.MM);
/**
* Specifies the JIS Chou ("long") #4 envelope size, 90 mm by 205 mm.
*/
public static final MediaSize CHOU_4 = new MediaSize(90, 205, Size2DSyntax.MM);
/**
* Specifies the JIS Chou ("long") #30 envelope size, 92 mm by 235 mm.
*/
public static final MediaSize CHOU_30 = new MediaSize(92, 235, Size2DSyntax.MM);
/**
* Specifies the JIS Chou ("long") #40 envelope size, 90 mm by 225 mm.
*/
public static final MediaSize CHOU_40 = new MediaSize(90, 225, Size2DSyntax.MM);
/**
* Specifies the JIS Kaku ("square") #0 envelope size, 287 mm by 382 mm.
*/
public static final MediaSize KAKU_0 = new MediaSize(287, 382, Size2DSyntax.MM);
/**
* Specifies the JIS Kaku ("square") #1 envelope size, 270 mm by 382 mm.
*/
public static final MediaSize KAKU_1 = new MediaSize(270, 382, Size2DSyntax.MM);
/**
* Specifies the JIS Kaku ("square") #2 envelope size, 240 mm by 332 mm.
*/
public static final MediaSize KAKU_2 = new MediaSize(240, 332, Size2DSyntax.MM);
/**
* Specifies the JIS Kaku ("square") #3 envelope size, 216 mm by 277 mm.
*/
public static final MediaSize KAKU_3 = new MediaSize(216, 277, Size2DSyntax.MM);
/**
* Specifies the JIS Kaku ("square") #4 envelope size, 197 mm by 267 mm.
*/
public static final MediaSize KAKU_4 = new MediaSize(197, 267, Size2DSyntax.MM);
/**
* Specifies the JIS Kaku ("square") #5 envelope size, 190 mm by 240 mm.
*/
public static final MediaSize KAKU_5 = new MediaSize(190, 240, Size2DSyntax.MM);
/**
* Specifies the JIS Kaku ("square") #6 envelope size, 162 mm by 229 mm.
*/
public static final MediaSize KAKU_6 = new MediaSize(162, 229, Size2DSyntax.MM);
/**
* Specifies the JIS Kaku ("square") #7 envelope size, 142 mm by 205 mm.
*/
public static final MediaSize KAKU_7 = new MediaSize(142, 205, Size2DSyntax.MM);
/**
* Specifies the JIS Kaku ("square") #8 envelope size, 119 mm by 197 mm.
*/
public static final MediaSize KAKU_8 = new MediaSize(119, 197, Size2DSyntax.MM);
/**
* Specifies the JIS Kaku ("square") #20 envelope size, 229 mm by 324 mm.
*/
public static final MediaSize KAKU_20 = new MediaSize(229, 324, Size2DSyntax.MM);
/**
* Specifies the JIS Kaku ("square") A4 envelope size, 228 mm by 312 mm.
*/
public static final MediaSize KAKU_A4 = new MediaSize(228, 312, Size2DSyntax.MM);
/**
* Specifies the JIS You ("Western") #1 envelope size, 120 mm by 176 mm.
*/
public static final MediaSize YOU_1 = new MediaSize(120, 176, Size2DSyntax.MM);
/**
* Specifies the JIS You ("Western") #2 envelope size, 114 mm by 162 mm.
*/
public static final MediaSize YOU_2 = new MediaSize(114, 162, Size2DSyntax.MM);
/**
* Specifies the JIS You ("Western") #3 envelope size, 98 mm by 148 mm.
*/
public static final MediaSize YOU_3 = new MediaSize(98, 148, Size2DSyntax.MM);
/**
* Specifies the JIS You ("Western") #4 envelope size, 105 mm by 235 mm.
*/
public static final MediaSize YOU_4 = new MediaSize(105, 235, Size2DSyntax.MM);
/**
* Specifies the JIS You ("Western") #5 envelope size, 95 mm by 217 mm.
*/
public static final MediaSize YOU_5 = new MediaSize(95, 217, Size2DSyntax.MM);
/**
* Specifies the JIS You ("Western") #6 envelope size, 98 mm by 190 mm.
*/
public static final MediaSize YOU_6 = new MediaSize(98, 190, Size2DSyntax.MM);
/**
* Specifies the JIS You ("Western") #7 envelope size, 92 mm by 165 mm.
*/
public static final MediaSize YOU_7 = new MediaSize(92, 165, Size2DSyntax.MM);
/**
* Hide all constructors.
*/
private JIS() {
}
}
/**
* Class MediaSize.NA includes {@link MediaSize MediaSize} values for North
* American media.
*/
public final static class NA {
/**
* Specifies the North American letter size, 8.5 inches by 11 inches.
*/
public static final MediaSize
LETTER = new MediaSize(8.5f, 11.0f, Size2DSyntax.INCH,
MediaSizeName.NA_LETTER);
/**
* Specifies the North American legal size, 8.5 inches by 14 inches.
*/
public static final MediaSize
LEGAL = new MediaSize(8.5f, 14.0f, Size2DSyntax.INCH,
MediaSizeName.NA_LEGAL);
/**
* Specifies the North American 5 inch by 7 inch paper.
*/
public static final MediaSize
NA_5X7 = new MediaSize(5, 7, Size2DSyntax.INCH,
MediaSizeName.NA_5X7);
/**
* Specifies the North American 8 inch by 10 inch paper.
*/
public static final MediaSize
NA_8X10 = new MediaSize(8, 10, Size2DSyntax.INCH,
MediaSizeName.NA_8X10);
/**
* Specifies the North American Number 9 business envelope size,
* 3.875 inches by 8.875 inches.
*/
public static final MediaSize
NA_NUMBER_9_ENVELOPE =
new MediaSize(3.875f, 8.875f, Size2DSyntax.INCH,
MediaSizeName.NA_NUMBER_9_ENVELOPE);
/**
* Specifies the North American Number 10 business envelope size,
* 4.125 inches by 9.5 inches.
*/
public static final MediaSize
NA_NUMBER_10_ENVELOPE =
new MediaSize(4.125f, 9.5f, Size2DSyntax.INCH,
MediaSizeName.NA_NUMBER_10_ENVELOPE);
/**
* Specifies the North American Number 11 business envelope size,
* 4.5 inches by 10.375 inches.
*/
public static final MediaSize
NA_NUMBER_11_ENVELOPE =
new MediaSize(4.5f, 10.375f, Size2DSyntax.INCH,
MediaSizeName.NA_NUMBER_11_ENVELOPE);
/**
* Specifies the North American Number 12 business envelope size,
* 4.75 inches by 11 inches.
*/
public static final MediaSize
NA_NUMBER_12_ENVELOPE =
new MediaSize(4.75f, 11.0f, Size2DSyntax.INCH,
MediaSizeName.NA_NUMBER_12_ENVELOPE);
/**
* Specifies the North American Number 14 business envelope size,
* 5 inches by 11.5 inches.
*/
public static final MediaSize
NA_NUMBER_14_ENVELOPE =
new MediaSize(5.0f, 11.5f, Size2DSyntax.INCH,
MediaSizeName.NA_NUMBER_14_ENVELOPE);
/**
* Specifies the North American 6 inch by 9 inch envelope size.
*/
public static final MediaSize
NA_6X9_ENVELOPE = new MediaSize(6.0f, 9.0f, Size2DSyntax.INCH,
MediaSizeName.NA_6X9_ENVELOPE);
/**
* Specifies the North American 7 inch by 9 inch envelope size.
*/
public static final MediaSize
NA_7X9_ENVELOPE = new MediaSize(7.0f, 9.0f, Size2DSyntax.INCH,
MediaSizeName.NA_7X9_ENVELOPE);
/**
* Specifies the North American 9 inch by 11 inch envelope size.
*/
public static final MediaSize
NA_9x11_ENVELOPE = new MediaSize(9.0f, 11.0f, Size2DSyntax.INCH,
MediaSizeName.NA_9X11_ENVELOPE);
/**
* Specifies the North American 9 inch by 12 inch envelope size.
*/
public static final MediaSize
NA_9x12_ENVELOPE = new MediaSize(9.0f, 12.0f, Size2DSyntax.INCH,
MediaSizeName.NA_9X12_ENVELOPE);
/**
* Specifies the North American 10 inch by 13 inch envelope size.
*/
public static final MediaSize
NA_10x13_ENVELOPE = new MediaSize(10.0f, 13.0f, Size2DSyntax.INCH,
MediaSizeName.NA_10X13_ENVELOPE);
/**
* Specifies the North American 10 inch by 14 inch envelope size.
*/
public static final MediaSize
NA_10x14_ENVELOPE = new MediaSize(10.0f, 14.0f, Size2DSyntax.INCH,
MediaSizeName.NA_10X14_ENVELOPE);
/**
* Specifies the North American 10 inch by 15 inch envelope size.
*/
public static final MediaSize
NA_10X15_ENVELOPE = new MediaSize(10.0f, 15.0f, Size2DSyntax.INCH,
MediaSizeName.NA_10X15_ENVELOPE);
/**
* Hide all constructors.
*/
private NA() {
}
}
/**
* Class MediaSize.Engineering includes {@link MediaSize MediaSize} values
* for engineering media.
*/
public final static class Engineering {
/**
* Specifies the engineering A size, 8.5 inch by 11 inch.
*/
public static final MediaSize
A = new MediaSize(8.5f, 11.0f, Size2DSyntax.INCH,
MediaSizeName.A);
/**
* Specifies the engineering B size, 11 inch by 17 inch.
*/
public static final MediaSize
B = new MediaSize(11.0f, 17.0f, Size2DSyntax.INCH,
MediaSizeName.B);
/**
* Specifies the engineering C size, 17 inch by 22 inch.
*/
public static final MediaSize
C = new MediaSize(17.0f, 22.0f, Size2DSyntax.INCH,
MediaSizeName.C);
/**
* Specifies the engineering D size, 22 inch by 34 inch.
*/
public static final MediaSize
D = new MediaSize(22.0f, 34.0f, Size2DSyntax.INCH,
MediaSizeName.D);
/**
* Specifies the engineering E size, 34 inch by 44 inch.
*/
public static final MediaSize
E = new MediaSize(34.0f, 44.0f, Size2DSyntax.INCH,
MediaSizeName.E);
/**
* Hide all constructors.
*/
private Engineering() {
}
}
/**
* Class MediaSize.Other includes {@link MediaSize MediaSize} values for
* miscellaneous media.
*/
public final static class Other {
/**
* Specifies the executive size, 7.25 inches by 10.5 inches.
*/
public static final MediaSize
EXECUTIVE = new MediaSize(7.25f, 10.5f, Size2DSyntax.INCH,
MediaSizeName.EXECUTIVE);
/**
* Specifies the ledger size, 11 inches by 17 inches.
*/
public static final MediaSize
LEDGER = new MediaSize(11.0f, 17.0f, Size2DSyntax.INCH,
MediaSizeName.LEDGER);
/**
* Specifies the tabloid size, 11 inches by 17 inches.
* @since 1.5
*/
public static final MediaSize
TABLOID = new MediaSize(11.0f, 17.0f, Size2DSyntax.INCH,
MediaSizeName.TABLOID);
/**
* Specifies the invoice size, 5.5 inches by 8.5 inches.
*/
public static final MediaSize
INVOICE = new MediaSize(5.5f, 8.5f, Size2DSyntax.INCH,
MediaSizeName.INVOICE);
/**
* Specifies the folio size, 8.5 inches by 13 inches.
*/
public static final MediaSize
FOLIO = new MediaSize(8.5f, 13.0f, Size2DSyntax.INCH,
MediaSizeName.FOLIO);
/**
* Specifies the quarto size, 8.5 inches by 10.83 inches.
*/
public static final MediaSize
QUARTO = new MediaSize(8.5f, 10.83f, Size2DSyntax.INCH,
MediaSizeName.QUARTO);
/**
* Specifies the Italy envelope size, 110 mm by 230 mm.
*/
public static final MediaSize
ITALY_ENVELOPE = new MediaSize(110, 230, Size2DSyntax.MM,
MediaSizeName.ITALY_ENVELOPE);
/**
* Specifies the Monarch envelope size, 3.87 inch by 7.5 inch.
*/
public static final MediaSize
MONARCH_ENVELOPE = new MediaSize(3.87f, 7.5f, Size2DSyntax.INCH,
MediaSizeName.MONARCH_ENVELOPE);
/**
* Specifies the Personal envelope size, 3.625 inch by 6.5 inch.
*/
public static final MediaSize
PERSONAL_ENVELOPE = new MediaSize(3.625f, 6.5f, Size2DSyntax.INCH,
MediaSizeName.PERSONAL_ENVELOPE);
/**
* Specifies the Japanese postcard size, 100 mm by 148 mm.
*/
public static final MediaSize
JAPANESE_POSTCARD = new MediaSize(100, 148, Size2DSyntax.MM,
MediaSizeName.JAPANESE_POSTCARD);
/**
* Specifies the Japanese Double postcard size, 148 mm by 200 mm.
*/
public static final MediaSize
JAPANESE_DOUBLE_POSTCARD = new MediaSize(148, 200, Size2DSyntax.MM,
MediaSizeName.JAPANESE_DOUBLE_POSTCARD);
/**
* Hide all constructors.
*/
private Other() {
}
}
/* force loading of all the subclasses so that the instances
* are created and inserted into the hashmap.
*/
static {
MediaSize ISOA4 = ISO.A4;
MediaSize JISB5 = JIS.B5;
MediaSize NALETTER = NA.LETTER;
MediaSize EngineeringC = Engineering.C;
MediaSize OtherEXECUTIVE = Other.EXECUTIVE;
}
}

View File

@@ -0,0 +1,565 @@
/*
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.Attribute;
/**
* Class MediaSizeName is a subclass of Media.
* <P>
* This attribute can be used instead of specifying MediaName or MediaTray.
* <p>
* Class MediaSizeName currently declares a few standard media
* name values.
* <P>
* <B>IPP Compatibility:</B> MediaSizeName is a representation class for
* values of the IPP "media" attribute which names media sizes.
* The names of the media sizes correspond to those in the IPP 1.1 RFC
* <a HREF="http://www.ietf.org/rfc/rfc2911.txt">RFC 2911</a>
* <P>
*
*/
public class MediaSizeName extends Media {
private static final long serialVersionUID = 2778798329756942747L;
/**
* A0 size.
*/
public static final MediaSizeName ISO_A0 = new MediaSizeName(0);
/**
* A1 size.
*/
public static final MediaSizeName ISO_A1 = new MediaSizeName(1);
/**
* A2 size.
*/
public static final MediaSizeName ISO_A2 = new MediaSizeName(2);
/**
* A3 size.
*/
public static final MediaSizeName ISO_A3 = new MediaSizeName(3);
/**
* A4 size.
*/
public static final MediaSizeName ISO_A4 = new MediaSizeName(4);
/**
* A5 size.
*/
public static final MediaSizeName ISO_A5 = new MediaSizeName(5);
/**
* A6 size.
*/
public static final MediaSizeName ISO_A6 = new MediaSizeName(6);
/**
* A7 size.
*/
public static final MediaSizeName ISO_A7 = new MediaSizeName(7);
/**
* A8 size.
*/
public static final MediaSizeName ISO_A8 = new MediaSizeName(8);
/**
* A9 size.
*/
public static final MediaSizeName ISO_A9 = new MediaSizeName(9);
/**
* A10 size.
*/
public static final MediaSizeName ISO_A10 = new MediaSizeName(10);
/**
* ISO B0 size.
*/
public static final MediaSizeName ISO_B0 = new MediaSizeName(11);
/**
* ISO B1 size.
*/
public static final MediaSizeName ISO_B1 = new MediaSizeName(12);
/**
* ISO B2 size.
*/
public static final MediaSizeName ISO_B2 = new MediaSizeName(13);
/**
* ISO B3 size.
*/
public static final MediaSizeName ISO_B3 = new MediaSizeName(14);
/**
* ISO B4 size.
*/
public static final MediaSizeName ISO_B4 = new MediaSizeName(15);
/**
* ISO B5 size.
*/
public static final MediaSizeName ISO_B5 = new MediaSizeName(16);
/**
* ISO B6 size.
*/
public static final MediaSizeName ISO_B6 = new MediaSizeName(17);
/**
* ISO B7 size.
*/
public static final MediaSizeName ISO_B7 = new MediaSizeName(18);
/**
* ISO B8 size.
*/
public static final MediaSizeName ISO_B8 = new MediaSizeName(19);
/**
* ISO B9 size.
*/
public static final MediaSizeName ISO_B9 = new MediaSizeName(20);
/**
* ISO B10 size.
*/
public static final MediaSizeName ISO_B10 = new MediaSizeName(21);
/**
* JIS B0 size.
*/
public static final MediaSizeName JIS_B0 = new MediaSizeName(22);
/**
* JIS B1 size.
*/
public static final MediaSizeName JIS_B1 = new MediaSizeName(23);
/**
* JIS B2 size.
*/
public static final MediaSizeName JIS_B2 = new MediaSizeName(24);
/**
* JIS B3 size.
*/
public static final MediaSizeName JIS_B3 = new MediaSizeName(25);
/**
* JIS B4 size.
*/
public static final MediaSizeName JIS_B4 = new MediaSizeName(26);
/**
* JIS B5 size.
*/
public static final MediaSizeName JIS_B5 = new MediaSizeName(27);
/**
* JIS B6 size.
*/
public static final MediaSizeName JIS_B6 = new MediaSizeName(28);
/**
* JIS B7 size.
*/
public static final MediaSizeName JIS_B7 = new MediaSizeName(29);
/**
* JIS B8 size.
*/
public static final MediaSizeName JIS_B8 = new MediaSizeName(30);
/**
* JIS B9 size.
*/
public static final MediaSizeName JIS_B9 = new MediaSizeName(31);
/**
* JIS B10 size.
*/
public static final MediaSizeName JIS_B10 = new MediaSizeName(32);
/**
* ISO C0 size.
*/
public static final MediaSizeName ISO_C0 = new MediaSizeName(33);
/**
* ISO C1 size.
*/
public static final MediaSizeName ISO_C1 = new MediaSizeName(34);
/**
* ISO C2 size.
*/
public static final MediaSizeName ISO_C2 = new MediaSizeName(35);
/**
* ISO C3 size.
*/
public static final MediaSizeName ISO_C3 = new MediaSizeName(36);
/**
* ISO C4 size.
*/
public static final MediaSizeName ISO_C4 = new MediaSizeName(37);
/**
* ISO C5 size.
*/
public static final MediaSizeName ISO_C5 = new MediaSizeName(38);
/**
* letter size.
*/
public static final MediaSizeName ISO_C6 = new MediaSizeName(39);
/**
* letter size.
*/
public static final MediaSizeName NA_LETTER = new MediaSizeName(40);
/**
* legal size .
*/
public static final MediaSizeName NA_LEGAL = new MediaSizeName(41);
/**
* executive size .
*/
public static final MediaSizeName EXECUTIVE = new MediaSizeName(42);
/**
* ledger size .
*/
public static final MediaSizeName LEDGER = new MediaSizeName(43);
/**
* tabloid size .
*/
public static final MediaSizeName TABLOID = new MediaSizeName(44);
/**
* invoice size .
*/
public static final MediaSizeName INVOICE = new MediaSizeName(45);
/**
* folio size .
*/
public static final MediaSizeName FOLIO = new MediaSizeName(46);
/**
* quarto size .
*/
public static final MediaSizeName QUARTO = new MediaSizeName(47);
/**
* Japanese Postcard size.
*/
public static final MediaSizeName
JAPANESE_POSTCARD = new MediaSizeName(48);
/**
* Japanese Double Postcard size.
*/
public static final MediaSizeName
JAPANESE_DOUBLE_POSTCARD = new MediaSizeName(49);
/**
* A size .
*/
public static final MediaSizeName A = new MediaSizeName(50);
/**
* B size .
*/
public static final MediaSizeName B = new MediaSizeName(51);
/**
* C size .
*/
public static final MediaSizeName C = new MediaSizeName(52);
/**
* D size .
*/
public static final MediaSizeName D = new MediaSizeName(53);
/**
* E size .
*/
public static final MediaSizeName E = new MediaSizeName(54);
/**
* ISO designated long size .
*/
public static final MediaSizeName
ISO_DESIGNATED_LONG = new MediaSizeName(55);
/**
* Italy envelope size .
*/
public static final MediaSizeName
ITALY_ENVELOPE = new MediaSizeName(56); // DESIGNATED_LONG?
/**
* monarch envelope size .
*/
public static final MediaSizeName
MONARCH_ENVELOPE = new MediaSizeName(57);
/**
* personal envelope size .
*/
public static final MediaSizeName
PERSONAL_ENVELOPE = new MediaSizeName(58);
/**
* number 9 envelope size .
*/
public static final MediaSizeName
NA_NUMBER_9_ENVELOPE = new MediaSizeName(59);
/**
* number 10 envelope size .
*/
public static final MediaSizeName
NA_NUMBER_10_ENVELOPE = new MediaSizeName(60);
/**
* number 11 envelope size .
*/
public static final MediaSizeName
NA_NUMBER_11_ENVELOPE = new MediaSizeName(61);
/**
* number 12 envelope size .
*/
public static final MediaSizeName
NA_NUMBER_12_ENVELOPE = new MediaSizeName(62);
/**
* number 14 envelope size .
*/
public static final MediaSizeName
NA_NUMBER_14_ENVELOPE = new MediaSizeName(63);
/**
* 6x9 North American envelope size.
*/
public static final MediaSizeName
NA_6X9_ENVELOPE = new MediaSizeName(64);
/**
* 7x9 North American envelope size.
*/
public static final MediaSizeName
NA_7X9_ENVELOPE = new MediaSizeName(65);
/**
* 9x11 North American envelope size.
*/
public static final MediaSizeName
NA_9X11_ENVELOPE = new MediaSizeName(66);
/**
* 9x12 North American envelope size.
*/
public static final MediaSizeName
NA_9X12_ENVELOPE = new MediaSizeName(67);
/**
* 10x13 North American envelope size .
*/
public static final MediaSizeName
NA_10X13_ENVELOPE = new MediaSizeName(68);
/**
* 10x14North American envelope size .
*/
public static final MediaSizeName
NA_10X14_ENVELOPE = new MediaSizeName(69);
/**
* 10x15 North American envelope size.
*/
public static final MediaSizeName
NA_10X15_ENVELOPE = new MediaSizeName(70);
/**
* 5x7 North American paper.
*/
public static final MediaSizeName
NA_5X7 = new MediaSizeName(71);
/**
* 8x10 North American paper.
*/
public static final MediaSizeName
NA_8X10 = new MediaSizeName(72);
/**
* Construct a new media size enumeration value with the given integer
* value.
*
* @param value Integer value.
*/
protected MediaSizeName(int value) {
super (value);
}
private static final String[] myStringTable = {
"iso-a0",
"iso-a1",
"iso-a2",
"iso-a3",
"iso-a4",
"iso-a5",
"iso-a6",
"iso-a7",
"iso-a8",
"iso-a9",
"iso-a10",
"iso-b0",
"iso-b1",
"iso-b2",
"iso-b3",
"iso-b4",
"iso-b5",
"iso-b6",
"iso-b7",
"iso-b8",
"iso-b9",
"iso-b10",
"jis-b0",
"jis-b1",
"jis-b2",
"jis-b3",
"jis-b4",
"jis-b5",
"jis-b6",
"jis-b7",
"jis-b8",
"jis-b9",
"jis-b10",
"iso-c0",
"iso-c1",
"iso-c2",
"iso-c3",
"iso-c4",
"iso-c5",
"iso-c6",
"na-letter",
"na-legal",
"executive",
"ledger",
"tabloid",
"invoice",
"folio",
"quarto",
"japanese-postcard",
"oufuko-postcard",
"a",
"b",
"c",
"d",
"e",
"iso-designated-long",
"italian-envelope",
"monarch-envelope",
"personal-envelope",
"na-number-9-envelope",
"na-number-10-envelope",
"na-number-11-envelope",
"na-number-12-envelope",
"na-number-14-envelope",
"na-6x9-envelope",
"na-7x9-envelope",
"na-9x11-envelope",
"na-9x12-envelope",
"na-10x13-envelope",
"na-10x14-envelope",
"na-10x15-envelope",
"na-5x7",
"na-8x10",
};
private static final MediaSizeName[] myEnumValueTable = {
ISO_A0,
ISO_A1,
ISO_A2,
ISO_A3,
ISO_A4,
ISO_A5,
ISO_A6,
ISO_A7,
ISO_A8,
ISO_A9,
ISO_A10,
ISO_B0,
ISO_B1,
ISO_B2,
ISO_B3,
ISO_B4,
ISO_B5,
ISO_B6,
ISO_B7,
ISO_B8,
ISO_B9,
ISO_B10,
JIS_B0,
JIS_B1,
JIS_B2,
JIS_B3,
JIS_B4,
JIS_B5,
JIS_B6,
JIS_B7,
JIS_B8,
JIS_B9,
JIS_B10,
ISO_C0,
ISO_C1,
ISO_C2,
ISO_C3,
ISO_C4,
ISO_C5,
ISO_C6,
NA_LETTER,
NA_LEGAL,
EXECUTIVE,
LEDGER,
TABLOID,
INVOICE,
FOLIO,
QUARTO,
JAPANESE_POSTCARD,
JAPANESE_DOUBLE_POSTCARD,
A,
B,
C,
D,
E,
ISO_DESIGNATED_LONG,
ITALY_ENVELOPE,
MONARCH_ENVELOPE,
PERSONAL_ENVELOPE,
NA_NUMBER_9_ENVELOPE,
NA_NUMBER_10_ENVELOPE,
NA_NUMBER_11_ENVELOPE,
NA_NUMBER_12_ENVELOPE,
NA_NUMBER_14_ENVELOPE,
NA_6X9_ENVELOPE,
NA_7X9_ENVELOPE,
NA_9X11_ENVELOPE,
NA_9X12_ENVELOPE,
NA_10X13_ENVELOPE,
NA_10X14_ENVELOPE,
NA_10X15_ENVELOPE,
NA_5X7,
NA_8X10,
};
/**
* Returns the string table for class MediaSizeName.
*/
protected String[] getStringTable()
{
return (String[])myStringTable.clone();
}
/**
* Returns the enumeration value table for class MediaSizeName.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
}

View File

@@ -0,0 +1,140 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
/**
* Class MediaTray is a subclass of Media.
* Class MediaTray is a printing attribute class, an enumeration, that
* specifies the media tray or bin for the job.
* This attribute can be used instead of specifying MediaSize or MediaName.
* <p>
* Class MediaTray declares keywords for standard media kind values.
* Implementation- or site-defined names for a media kind attribute may also
* be created by defining a subclass of class MediaTray.
* <P>
* <B>IPP Compatibility:</B> MediaTray is a representation class for
* values of the IPP "media" attribute which name paper trays.
* <P>
*
*/
public class MediaTray extends Media implements Attribute {
private static final long serialVersionUID = -982503611095214703L;
/**
* The top input tray in the printer.
*/
public static final MediaTray TOP = new MediaTray(0);
/**
* The middle input tray in the printer.
*/
public static final MediaTray MIDDLE = new MediaTray(1);
/**
* The bottom input tray in the printer.
*/
public static final MediaTray BOTTOM = new MediaTray(2);
/**
* The envelope input tray in the printer.
*/
public static final MediaTray ENVELOPE = new MediaTray(3);
/**
* The manual feed input tray in the printer.
*/
public static final MediaTray MANUAL = new MediaTray(4);
/**
* The large capacity input tray in the printer.
*/
public static final MediaTray LARGE_CAPACITY = new MediaTray(5);
/**
* The main input tray in the printer.
*/
public static final MediaTray MAIN = new MediaTray(6);
/**
* The side input tray.
*/
public static final MediaTray SIDE = new MediaTray(7);
/**
* Construct a new media tray enumeration value with the given integer
* value.
*
* @param value Integer value.
*/
protected MediaTray(int value) {
super (value);
}
private static final String[] myStringTable ={
"top",
"middle",
"bottom",
"envelope",
"manual",
"large-capacity",
"main",
"side"
};
private static final MediaTray[] myEnumValueTable = {
TOP,
MIDDLE,
BOTTOM,
ENVELOPE,
MANUAL,
LARGE_CAPACITY,
MAIN,
SIDE
};
/**
* Returns the string table for class MediaTray.
*/
protected String[] getStringTable()
{
return (String[])myStringTable.clone();
}
/**
* Returns the enumeration value table for class MediaTray.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
}

View File

@@ -0,0 +1,268 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class MultipleDocumentHandling is a printing attribute class, an enumeration,
* that controls finishing operations and the placement of one or more
* print-stream pages into impressions and onto media sheets. When the value of
* the {@link Copies Copies} attribute exceeds 1, MultipleDocumentHandling also
* controls the order in which the copies that result from processing the
* documents are produced. This attribute is relevant only for a multidoc print
* job consisting of two or more individual docs.
* <P>
* Briefly, MultipleDocumentHandling determines the relationship between the
* multiple input (electronic) documents fed into a multidoc print job and the
* output (physical) document or documents produced by the multidoc print job.
* There are two possibilities:
* <UL>
* <LI>
* The multiple input documents are combined into a single output document.
* Finishing operations ({@link Finishings Finishings}),
* are performed on this single output
* document. The {@link Copies Copies} attribute tells how many copies of this
* single output document to produce. The MultipleDocumentHandling values
* SINGLE_DOCUMENT and SINGLE_DOCUMENT_NEW_SHEET specify two variations of
* this possibility.
* <P>
* <LI>
* The multiple input documents remain separate output documents. Finishing
* operations ({@link Finishings Finishings}),
* are performed on each output document
* separately. The {@link Copies Copies} attribute tells how many copies of each
* separate output document to produce. The MultipleDocumentHandling values
* SEPARATE_DOCUMENTS_UNCOLLATED_COPIES and SEPARATE_DOCUMENTS_COLLATED_COPIES
* specify two variations of this possibility.
* </UL>
* <P>
* In the detailed explanations below, if "<CODE>a</CODE>" represents an
* instance of document data, then the result of processing the data in
* document "<CODE>a</CODE>" is a sequence of media sheets represented by
* "<CODE>a(*)</CODE>".
* <P>
* The standard MultipleDocumentHandling values are:
* <UL>
* <LI>
* <A NAME="sdfi">{@link #SINGLE_DOCUMENT
* <B>SINGLE_DOCUMENT</B>}</A>. If a print job has multiple
* documents -- say, the document data is called <CODE>a</CODE> and
* <CODE>b</CODE> -- then the result of processing all the document data
* (<CODE>a</CODE> and then <CODE>b</CODE>) must be treated as a single sequence
* of media sheets for finishing operations; that is, finishing would be
* performed on the concatenation of the sequences <CODE>a(*),b(*)</CODE>. The
* printer must not force the data in each document instance to be formatted
* onto a new print-stream page, nor to start a new impression on a new media
* sheet. If more than one copy is made, the ordering of the sets of media
* sheets resulting from processing the document data must be
* <CODE>a(*),b(*),a(*),b(*),...</CODE>, and the printer object must force
* each copy (<CODE>a(*),b(*)</CODE>) to start on a new media sheet.
* <P>
* <LI>
* <A NAME="sducfi">{@link #SEPARATE_DOCUMENTS_UNCOLLATED_COPIES
* <B>SEPARATE_DOCUMENTS_UNCOLLATED_COPIES</B>}</A>. If a print job
* has multiple documents -- say, the document data is called <CODE>a</CODE> and
* <CODE>b</CODE> -- then the result of processing the data in each document
* instance must be treated as a single sequence of media sheets for finishing
* operations; that is, the sets <CODE>a(*)</CODE> and <CODE>b(*)</CODE> would
* each be finished separately. The printer must force each copy of the result
* of processing the data in a single document to start on a new media sheet.
* If more than one copy is made, the ordering of the sets of media sheets
* resulting from processing the document data must be
* <CODE>a(*),a(*),...,b(*),b(*)...</CODE>.
* <P>
* <LI>
* <A NAME="sdccfi">{@link #SEPARATE_DOCUMENTS_COLLATED_COPIES
* <B>SEPARATE_DOCUMENTS_COLLATED_COPIES</B>}</A>. If a print job
* has multiple documents -- say, the document data is called <CODE>a</CODE> and
* <CODE>b</CODE> -- then the result of processing the data in each document
* instance must be treated as a single sequence of media sheets for finishing
* operations; that is, the sets <CODE>a(*)</CODE> and <CODE>b(*)</CODE> would
* each be finished separately. The printer must force each copy of the result
* of processing the data in a single document to start on a new media sheet.
* If more than one copy is made, the ordering of the sets of media sheets
* resulting from processing the document data must be
* <CODE>a(*),b(*),a(*),b(*),...</CODE>.
* <P>
* <LI>
* <A NAME="sdnsfi">{@link #SINGLE_DOCUMENT_NEW_SHEET
* <B>SINGLE_DOCUMENT_NEW_SHEET</B>}</A>. Same as SINGLE_DOCUMENT,
* except that the printer must ensure that the first impression of each
* document instance in the job is placed on a new media sheet. This value
* allows multiple documents to be stapled together with a single staple where
* each document starts on a new sheet.
* </UL>
* <P>
* SINGLE_DOCUMENT is the same as SEPARATE_DOCUMENTS_COLLATED_COPIES with
* respect to ordering of print-stream pages, but not media sheet generation,
* since SINGLE_DOCUMENT will put the first page of the next document on the
* back side of a sheet if an odd number of pages have been produced so far
* for the job, while SEPARATE_DOCUMENTS_COLLATED_COPIES always forces the
* next document or document copy on to a new sheet.
* <P>
* In addition, if a {@link Finishings Finishings} attribute of
* {@link Finishings#STAPLE STAPLE} is specified, then:
* <UL>
* <LI>
* With SINGLE_DOCUMENT, documents <CODE>a</CODE> and <CODE>b</CODE> are
* stapled together as a single document with no regard to new sheets.
* <P>
* <LI>
* With SINGLE_DOCUMENT_NEW_SHEET, documents <CODE>a</CODE> and <CODE>b</CODE>
* are stapled together as a single document, but document <CODE>b</CODE>
* starts on a new sheet.
* <P>
* <LI>
* With SEPARATE_DOCUMENTS_UNCOLLATED_COPIES and
* SEPARATE_DOCUMENTS_COLLATED_COPIES, documents <CODE>a</CODE> and
* <CODE>b</CODE> are stapled separately.
* </UL>
* <P>
* <I>Note:</I> None of these values provide means to produce uncollated
* sheets within a document, i.e., where multiple copies of sheet <I>n</I>
* are produced before sheet <I>n</I>+1 of the same document.
* To specify that, see the {@link SheetCollate SheetCollate} attribute.
* <P>
* <B>IPP Compatibility:</B> The category name returned by
* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
* integer value is the IPP enum value. The <code>toString()</code> method
* returns the IPP string representation of the attribute value.
* <P>
*
* @see Copies
* @see Finishings
* @see NumberUp
* @see PageRanges
* @see SheetCollate
* @see Sides
*
* @author David Mendenhall
* @author Alan Kaminsky
*/
public class MultipleDocumentHandling extends EnumSyntax
implements PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = 8098326460746413466L;
/**
* Single document -- see above for <A HREF="#sdfi">further
* information</A>.
*/
public static final MultipleDocumentHandling
SINGLE_DOCUMENT = new MultipleDocumentHandling (0);
/**
* Separate documents uncollated copies -- see above for
* <A HREF="#sducfi">further information</A>.
*/
public static final MultipleDocumentHandling
SEPARATE_DOCUMENTS_UNCOLLATED_COPIES = new MultipleDocumentHandling (1);
/**
* Separate documents collated copies -- see above for
* <A HREF="#sdccfi">further information</A>.
*/
public static final MultipleDocumentHandling
SEPARATE_DOCUMENTS_COLLATED_COPIES = new MultipleDocumentHandling (2);
/**
* Single document new sheet -- see above for
* <A HREF="#sdnsfi">further information</A>.
*/
public static final MultipleDocumentHandling
SINGLE_DOCUMENT_NEW_SHEET = new MultipleDocumentHandling (3);
/**
* Construct a new multiple document handling enumeration value with the
* given integer value.
*
* @param value Integer value.
*/
protected MultipleDocumentHandling(int value) {
super (value);
}
private static final String[] myStringTable = {
"single-document",
"separate-documents-uncollated-copies",
"separate-documents-collated-copies",
"single-document-new-sheet"
};
private static final MultipleDocumentHandling[] myEnumValueTable = {
SINGLE_DOCUMENT,
SEPARATE_DOCUMENTS_UNCOLLATED_COPIES,
SEPARATE_DOCUMENTS_COLLATED_COPIES,
SINGLE_DOCUMENT_NEW_SHEET
};
/**
* Returns the string table for class MultipleDocumentHandling.
*/
protected String[] getStringTable() {
return (String[])myStringTable.clone();
}
/**
* Returns the enumeration value table for class MultipleDocumentHandling.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class MultipleDocumentHandling and any vendor-defined subclasses,
* the category is class MultipleDocumentHandling itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return MultipleDocumentHandling.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class MultipleDocumentHandling and any vendor-defined subclasses,
* the category name is <CODE>"multiple-document-handling"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "multiple-document-handling";
}
}

View File

@@ -0,0 +1,114 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintJobAttribute;
/**
* Class NumberOfDocuments is an integer valued printing attribute that
* indicates the number of individual docs the printer has accepted for this
* job, regardless of whether the docs' print data has reached the printer or
* not.
* <P>
* <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
* category name returned by <CODE>getName()</CODE> gives the IPP attribute
* name.
* <P>
*
* @author Alan Kaminsky
*/
public final class NumberOfDocuments extends IntegerSyntax
implements PrintJobAttribute {
private static final long serialVersionUID = 7891881310684461097L;
/**
* Construct a new number of documents attribute with the given integer
* value.
*
* @param value Integer value.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
*/
public NumberOfDocuments(int value) {
super (value, 0, Integer.MAX_VALUE);
}
/**
* Returns whether this number of documents attribute is equivalent to the
* passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class NumberOfDocuments.
* <LI>
* This number of documents attribute's value and <CODE>object</CODE>'s
* value are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this number of
* documents attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals (object) &&
object instanceof NumberOfDocuments);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class NumberOfDocuments, the
* category is class NumberOfDocuments itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return NumberOfDocuments.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class NumberOfDocuments, the
* category name is <CODE>"number-of-documents"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "number-of-documents";
}
}

View File

@@ -0,0 +1,113 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintJobAttribute;
/**
* Class NumberOfInterveningJobs is an integer valued printing attribute that
* indicates the number of jobs that are ahead of this job in the relative
* chronological order of expected time to complete (i.e., the current
* scheduled order).
* <P>
* <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
* The category name returned by <CODE>getName()</CODE> gives the IPP
* attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class NumberOfInterveningJobs extends IntegerSyntax
implements PrintJobAttribute {
private static final long serialVersionUID = 2568141124844982746L;
/**
* Construct a new number of intervening jobs attribute with the given
* integer value.
*
* @param value Integer value.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
*/
public NumberOfInterveningJobs(int value) {
super(value, 0, Integer.MAX_VALUE);
}
/**
* Returns whether this number of intervening jobs attribute is equivalent
* to the passed in object. To be equivalent, all of the following
* conditions must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class NumberOfInterveningJobs.
* <LI>
* This number of intervening jobs attribute's value and
* <CODE>object</CODE>'s value are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this number of
* intervening jobs attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals (object) &&
object instanceof NumberOfInterveningJobs);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class NumberOfInterveningJobs, the
* category is class NumberOfInterveningJobs itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return NumberOfInterveningJobs.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class NumberOfInterveningJobs, the
* category name is <CODE>"number-of-intervening-jobs"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "number-of-intervening-jobs";
}
}

View File

@@ -0,0 +1,192 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class NumberUp is an integer valued printing attribute class that specifies
* the number of print-stream pages to impose upon a single side of an
* instance of a selected medium. That is, if the NumberUp value is <I>n,</I>
* the printer must place <I>n</I> print-stream pages on a single side of
* an instance of the
* selected medium. To accomplish this, the printer may add some sort of
* translation, scaling, or rotation. This attribute primarily controls the
* translation, scaling and rotation of print-stream pages.
* <P>
* The effect of a NumberUp attribute on a multidoc print job (a job with
* multiple documents) depends on whether all the docs have the same number up
* values specified or whether different docs have different number up values
* specified, and on the (perhaps defaulted) value of the {@link
* MultipleDocumentHandling MultipleDocumentHandling} attribute.
* <UL>
* <LI>
* If all the docs have the same number up value <I>n</I> specified, then any
* value of {@link MultipleDocumentHandling MultipleDocumentHandling} makes
* sense, and the printer's processing depends on the {@link
* MultipleDocumentHandling MultipleDocumentHandling} value:
* <UL>
* <LI>
* SINGLE_DOCUMENT -- All the input docs will be combined together into one
* output document. Each media impression will consist of <I>n</I>m
* print-stream pages from the output document.
* <P>
* <LI>
* SINGLE_DOCUMENT_NEW_SHEET -- All the input docs will be combined together
* into one output document. Each media impression will consist of <I>n</I>
* print-stream pages from the output document. However, the first impression of
* each input doc will always start on a new media sheet; this means the last
* impression of an input doc may have fewer than <I>n</I> print-stream pages
* on it.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The input docs will remain separate.
* Each media impression will consist of <I>n</I> print-stream pages from the
* input doc. Since the input docs are separate, the first impression of each
* input doc will always start on a new media sheet; this means the last
* impression of an input doc may have fewer than <I>n</I> print-stream pages on
* it.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_COLLATED_COPIES -- The input docs will remain separate.
* Each media impression will consist of <I>n</I> print-stream pages from the
* input doc. Since the input docs are separate, the first impression of each
* input doc will always start on a new media sheet; this means the last
* impression of an input doc may have fewer than <I>n</I> print-stream pages
* on it.
* </UL>
* <UL>
* <LI>
* SINGLE_DOCUMENT -- All the input docs will be combined together into one
* output document. Each media impression will consist of <I>n<SUB>i</SUB></I>
* print-stream pages from the output document, where <I>i</I> is the number of
* the input doc corresponding to that point in the output document. When the
* next input doc has a different number up value from the previous input doc,
* the first print-stream page of the next input doc goes at the start of the
* next media impression, possibly leaving fewer than the full number of
* print-stream pages on the previous media impression.
* <P>
* <LI>
* SINGLE_DOCUMENT_NEW_SHEET -- All the input docs will be combined together
* into one output document. Each media impression will consist of <I>n</I>
* print-stream pages from the output document. However, the first impression of
* each input doc will always start on a new media sheet; this means the last
* impression of an input doc may have fewer than <I>n</I> print-stream pages
* on it.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The input docs will remain separate.
* For input doc <I>i,</I> each media impression will consist of
* <I>n<SUB>i</SUB></I> print-stream pages from the input doc. Since the input
* docs are separate, the first impression of each input doc will always start
* on a new media sheet; this means the last impression of an input doc may have
* fewer than <I>n<SUB>i</SUB></I> print-stream pages on it.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_COLLATED_COPIES -- The input docs will remain separate.
* For input doc <I>i,</I> each media impression will consist of
* <I>n<SUB>i</SUB></I> print-stream pages from the input doc. Since the input
* docs are separate, the first impression of each input doc will always start
* on a new media sheet; this means the last impression of an input doc may
* have fewer than <I>n<SUB>i</SUB></I> print-stream pages on it.
* </UL>
* </UL>
* <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
* The category name returned by <CODE>getName()</CODE> gives the IPP
* attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class NumberUp extends IntegerSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = -3040436486786527811L;
/**
* Construct a new number up attribute with the given integer value.
*
* @param value Integer value.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 1.
*/
public NumberUp(int value) {
super (value, 1, Integer.MAX_VALUE);
}
/**
* Returns whether this number up attribute is equivalent to the passed in
* object. To be equivalent, all of the following conditions must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class NumberUp.
* <LI>
* This number up attribute's value and <CODE>object</CODE>'s value are
* equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this number up
* attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof NumberUp);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class NumberUp, the category is class NumberUp itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return NumberUp.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class NumberUp, the category name is <CODE>"number-up"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "number-up";
}
}

View File

@@ -0,0 +1,179 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.SetOfIntegerSyntax;
import javax.print.attribute.SupportedValuesAttribute;
/**
* Class NumberUpSupported is a printing attribute class, a set of integers,
* that gives the supported values for a {@link NumberUp NumberUp} attribute.
* <P>
* <B>IPP Compatibility:</B> The NumberUpSupported attribute's canonical array
* form gives the lower and upper bound for each range of number-up to be
* included in an IPP "number-up-supported" attribute. See class {@link
* javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
* explanation of canonical array form. The category name returned by
* <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class NumberUpSupported extends SetOfIntegerSyntax
implements SupportedValuesAttribute {
private static final long serialVersionUID = -1041573395759141805L;
/**
* Construct a new number up supported attribute with the given members.
* The supported values for NumberUp are specified in "array form;" see
* class
* {@link javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax}
* for an explanation of array form.
*
* @param members Set members in array form.
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>members</CODE> is null or
* any element of <CODE>members</CODE> is null.
* @exception IllegalArgumentException
* (unchecked exception) Thrown if any element of
* <CODE>members</CODE> is not a length-one or length-two array. Also
* thrown if <CODE>members</CODE> is a zero-length array or if any
* member of the set is less than 1.
*/
public NumberUpSupported(int[][] members) {
super (members);
if (members == null) {
throw new NullPointerException("members is null");
}
int[][] myMembers = getMembers();
int n = myMembers.length;
if (n == 0) {
throw new IllegalArgumentException("members is zero-length");
}
int i;
for (i = 0; i < n; ++ i) {
if (myMembers[i][0] < 1) {
throw new IllegalArgumentException
("Number up value must be > 0");
}
}
}
/**
* Construct a new number up supported attribute containing a single
* integer. That is, only the one value of NumberUp is supported.
*
* @param member Set member.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>member</CODE> is less than
* 1.
*/
public NumberUpSupported(int member) {
super (member);
if (member < 1) {
throw new IllegalArgumentException("Number up value must be > 0");
}
}
/**
* Construct a new number up supported attribute containing a single range
* of integers. That is, only those values of NumberUp in the one range are
* supported.
*
* @param lowerBound Lower bound of the range.
* @param upperBound Upper bound of the range.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if a null range is specified or if a
* non-null range is specified with <CODE>lowerBound</CODE> less than
* 1.
*/
public NumberUpSupported(int lowerBound, int upperBound) {
super (lowerBound, upperBound);
if (lowerBound > upperBound) {
throw new IllegalArgumentException("Null range specified");
} else if (lowerBound < 1) {
throw new IllegalArgumentException
("Number up value must be > 0");
}
}
/**
* Returns whether this number up supported attribute is equivalent to the
* passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class NumberUpSupported.
* <LI>
* This number up supported attribute's members and <CODE>object</CODE>'s
* members are the same.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this number up
* supported attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals (object) &&
object instanceof NumberUpSupported);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class NumberUpSupported, the
* category is class NumberUpSupported itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return NumberUpSupported.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class NumberUpSupported, the
* category name is <CODE>"number-up-supported"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "number-up-supported";
}
}

View File

@@ -0,0 +1,188 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class OrientationRequested is a printing attribute class, an enumeration,
* that indicates the desired orientation for printed print-stream pages; it
* does not describe the orientation of the client-supplied print-stream
* pages.
* <P>
* For some document formats (such as <CODE>"application/postscript"</CODE>),
* the desired orientation of the print-stream pages is specified within the
* document data. This information is generated by a device driver prior to
* the submission of the print job. Other document formats (such as
* <CODE>"text/plain"</CODE>) do not include the notion of desired orientation
* within the document data. In the latter case it is possible for the printer
* to bind the desired orientation to the document data after it has been
* submitted. It is expected that a printer would only support the
* OrientationRequested attribute for some document formats (e.g.,
* <CODE>"text/plain"</CODE> or <CODE>"text/html"</CODE>) but not others (e.g.
* <CODE>"application/postscript"</CODE>). This is no different from any other
* job template attribute, since a print job can always impose constraints
* among the values of different job template attributes.
* However, a special mention
* is made here since it is very likely that a printer will support the
* OrientationRequested attribute for only a subset of the supported document
* formats.
* <P>
* <B>IPP Compatibility:</B> The category name returned by
* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
* integer value is the IPP enum value. The <code>toString()</code> method
* returns the IPP string representation of the attribute value.
* <P>
*
* @author Alan Kaminsky
*/
public final class OrientationRequested extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = -4447437289862822276L;
/**
* The content will be imaged across the short edge of the medium.
*/
public static final OrientationRequested
PORTRAIT = new OrientationRequested(3);
/**
* The content will be imaged across the long edge of the medium.
* Landscape is defined to be a rotation of the print-stream page to be
* imaged by +90 degrees with respect to the medium
* (i.e. anti-clockwise) from the
* portrait orientation. <I>Note:</I> The +90 direction was chosen because
* simple finishing on the long edge is the same edge whether portrait or
* landscape.
*/
public static final OrientationRequested
LANDSCAPE = new OrientationRequested(4);
/**
* The content will be imaged across the long edge of the medium, but in
* the opposite manner from landscape. Reverse-landscape is defined to be
* a rotation of the print-stream page to be imaged by -90 degrees with
* respect to the medium (i.e. clockwise) from the portrait orientation.
* <I>Note:</I> The REVERSE_LANDSCAPE value was added because some
* applications rotate landscape -90 degrees from portrait, rather than
* +90 degrees.
*/
public static final OrientationRequested
REVERSE_LANDSCAPE = new OrientationRequested(5);
/**
* The content will be imaged across the short edge of the medium, but in
* the opposite manner from portrait. Reverse-portrait is defined to be a
* rotation of the print-stream page to be imaged by 180 degrees with
* respect to the medium from the portrait orientation. <I>Note:</I> The
* REVERSE_PORTRAIT value was added for use with the {@link
* Finishings Finishings} attribute in cases where the
* opposite edge is desired for finishing a portrait document on simple
* finishing devices that have only one finishing position. Thus a
* <CODE>"text/plain"</CODE> portrait document can be stapled "on the
* right" by a simple finishing device as is common use with some
* Middle Eastern languages such as Hebrew.
*/
public static final OrientationRequested
REVERSE_PORTRAIT = new OrientationRequested(6);
/**
* Construct a new orientation requested enumeration value with the given
* integer value.
*
* @param value Integer value.
*/
protected OrientationRequested(int value) {
super(value);
}
private static final String[] myStringTable = {
"portrait",
"landscape",
"reverse-landscape",
"reverse-portrait"
};
private static final OrientationRequested[] myEnumValueTable = {
PORTRAIT,
LANDSCAPE,
REVERSE_LANDSCAPE,
REVERSE_PORTRAIT
};
/**
* Returns the string table for class OrientationRequested.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
* Returns the enumeration value table for class OrientationRequested.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
}
/**
* Returns the lowest integer value used by class OrientationRequested.
*/
protected int getOffset() {
return 3;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class OrientationRequested, the
* category is class OrientationRequested itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return OrientationRequested.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class OrientationRequested, the
* category name is <CODE>"orientation-requested"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "orientation-requested";
}
}

View File

@@ -0,0 +1,128 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
import javax.print.attribute.TextSyntax;
import javax.print.attribute.PrintJobAttribute;
/**
* Class OutputDeviceAssigned is a printing attribute class, a text attribute,
* that identifies the output device to which the service has assigned this
* job. If an output device implements an embedded Print Service instance, the
* printer need not set this attribute. If a print server implements a
* Print Service instance, the value may be empty (zero- length string) or not
* returned until the service assigns an output device to the job. This
* attribute is particularly useful when a single service supports multiple
* devices (so called "fan-out").
* <P>
* <B>IPP Compatibility:</B> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class OutputDeviceAssigned extends TextSyntax
implements PrintJobAttribute {
private static final long serialVersionUID = 5486733778854271081L;
/**
* Constructs a new output device assigned attribute with the given device
* name and locale.
*
* @param deviceName Device name.
* @param locale Natural language of the text string. null
* is interpreted to mean the default locale as returned
* by <code>Locale.getDefault()</code>
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>deviceName</CODE> is null.
*/
public OutputDeviceAssigned(String deviceName, Locale locale) {
super (deviceName, locale);
}
// Exported operations inherited and overridden from class Object.
/**
* Returns whether this output device assigned attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class OutputDeviceAssigned.
* <LI>
* This output device assigned attribute's underlying string and
* <CODE>object</CODE>'s underlying string are equal.
* <LI>
* This output device assigned attribute's locale and
* <CODE>object</CODE>'s locale are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this output
* device assigned attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals (object) &&
object instanceof OutputDeviceAssigned);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class OutputDeviceAssigned, the
* category is class OutputDeviceAssigned itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return OutputDeviceAssigned.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class OutputDeviceAssigned, the
* category name is <CODE>"output-device-assigned"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "output-device-assigned";
}
}

View File

@@ -0,0 +1,128 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintServiceAttribute;
/**
* Class PDLOverrideSupported is a printing attribute class, an enumeration,
* that expresses the printer's ability to attempt to override processing
* instructions embedded in documents' print data with processing instructions
* specified as attributes outside the print data.
* <P>
* <B>IPP Compatibility:</B> The category name returned by
* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
* integer value is the IPP enum value. The <code>toString()</code> method
* returns the IPP string representation of the attribute value.
* <P>
*
* @author Alan Kaminsky
*/
public class PDLOverrideSupported extends EnumSyntax
implements PrintServiceAttribute {
private static final long serialVersionUID = -4393264467928463934L;
/**
* The printer makes no attempt to make the external job attribute values
* take precedence over embedded instructions in the documents' print
* data.
*/
public static final PDLOverrideSupported
NOT_ATTEMPTED = new PDLOverrideSupported(0);
/**
* The printer attempts to make the external job attribute values take
* precedence over embedded instructions in the documents' print data,
* however there is no guarantee.
*/
public static final PDLOverrideSupported
ATTEMPTED = new PDLOverrideSupported(1);
/**
* Construct a new PDL override supported enumeration value with the given
* integer value.
*
* @param value Integer value.
*/
protected PDLOverrideSupported(int value) {
super (value);
}
private static final String[] myStringTable = {
"not-attempted",
"attempted"
};
private static final PDLOverrideSupported[] myEnumValueTable = {
NOT_ATTEMPTED,
ATTEMPTED
};
/**
* Returns the string table for class PDLOverrideSupported.
*/
protected String[] getStringTable() {
return (String[])myStringTable.clone();
}
/**
* Returns the enumeration value table for class PDLOverrideSupported.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PDLOverrideSupported and any vendor-defined subclasses, the
* category is class PDLOverrideSupported itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PDLOverrideSupported.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PDLOverrideSupported and any vendor-defined subclasses, the
* category name is <CODE>"pdl-override-supported"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "pdl-override-supported";
}
}

View File

@@ -0,0 +1,265 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.SetOfIntegerSyntax;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class PageRanges is a printing attribute class, a set of integers, that
* identifies the range(s) of print-stream pages that the Printer object uses
* for each copy of each document which are to be printed. Nothing is printed
* for any pages identified that do not exist in the document(s). The attribute
* is associated with <I>print-stream</I> pages, not application-numbered pages
* (for example, the page numbers found in the headers and or footers for
* certain word processing applications).
* <P>
* In most cases, the exact pages to be printed will be generated by a device
* driver and this attribute would not be required. However, when printing an
* archived document which has already been formatted, the end user may elect to
* print just a subset of the pages contained in the document. In this case, if
* a page range of <CODE>"<I>n</I>-<I>m</I>"</CODE> is specified, the first page
* to be printed will be page <I>n.</I> All subsequent pages of the document
* will be printed through and including page <I>m.</I>
* <P>
* If a PageRanges attribute is not specified for a print job, all pages of
* the document will be printed. In other words, the default value for the
* PageRanges attribute is always <CODE>{{1, Integer.MAX_VALUE}}</CODE>.
* <P>
* The effect of a PageRanges attribute on a multidoc print job (a job with
* multiple documents) depends on whether all the docs have the same page ranges
* specified or whether different docs have different page ranges specified, and
* on the (perhaps defaulted) value of the {@link MultipleDocumentHandling
* MultipleDocumentHandling} attribute.
* <UL>
* <LI>
* If all the docs have the same page ranges specified, then any value of {@link
* MultipleDocumentHandling MultipleDocumentHandling} makes sense, and the
* printer's processing depends on the {@link MultipleDocumentHandling
* MultipleDocumentHandling} value:
* <UL>
* <LI>
* SINGLE_DOCUMENT -- All the input docs will be combined together into one
* output document. The specified page ranges of that output document will be
* printed.
* <P>
* <LI>
* SINGLE_DOCUMENT_NEW_SHEET -- All the input docs will be combined together
* into one output document, and the first impression of each input doc will
* always start on a new media sheet. The specified page ranges of that output
* document will be printed.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- For each separate input doc, the
* specified page ranges will be printed.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_COLLATED_COPIES -- For each separate input doc, the
* specified page ranges will be printed.
* </UL>
* <UL>
* <LI>
* SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- For each separate input doc, its own
* specified page ranges will be printed..
* <P>
* <LI>
* SEPARATE_DOCUMENTS_COLLATED_COPIES -- For each separate input doc, its own
* specified page ranges will be printed..
* </UL>
* </UL>
* <P>
* <B>IPP Compatibility:</B> The PageRanges attribute's canonical array form
* gives the lower and upper bound for each range of pages to be included in
* and IPP "page-ranges" attribute. See class {@link
* javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
* explanation of canonical array form. The category name returned by
* <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author David Mendenhall
* @author Alan Kaminsky
*/
public final class PageRanges extends SetOfIntegerSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = 8639895197656148392L;
/**
* Construct a new page ranges attribute with the given members. The
* members are specified in "array form;" see class {@link
* javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an
* explanation of array form.
*
* @param members Set members in array form.
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>members</CODE> is null or
* any element of <CODE>members</CODE> is null.
* @exception IllegalArgumentException
* (unchecked exception) Thrown if any element of
* <CODE>members</CODE> is not a length-one or length-two array. Also
* thrown if <CODE>members</CODE> is a zero-length array or if any
* member of the set is less than 1.
*/
public PageRanges(int[][] members) {
super (members);
if (members == null) {
throw new NullPointerException("members is null");
}
myPageRanges();
}
/**
* Construct a new page ranges attribute with the given members in
* string form.
* See class {@link javax.print.attribute.SetOfIntegerSyntax
* SetOfIntegerSyntax}
* for explanation of the syntax.
*
* @param members Set members in string form.
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>members</CODE> is null or
* any element of <CODE>members</CODE> is null.
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>members</CODE> does not
* obey the proper syntax. Also
* thrown if the constructed set-of-integer is a
* zero-length array or if any
* member of the set is less than 1.
*/
public PageRanges(String members) {
super(members);
if (members == null) {
throw new NullPointerException("members is null");
}
myPageRanges();
}
private void myPageRanges() {
int[][] myMembers = getMembers();
int n = myMembers.length;
if (n == 0) {
throw new IllegalArgumentException("members is zero-length");
}
int i;
for (i = 0; i < n; ++ i) {
if (myMembers[i][0] < 1) {
throw new IllegalArgumentException("Page value < 1 specified");
}
}
}
/**
* Construct a new page ranges attribute containing a single integer. That
* is, only the one page is to be printed.
*
* @param member Set member.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>member</CODE> is less than
* 1.
*/
public PageRanges(int member) {
super (member);
if (member < 1) {
throw new IllegalArgumentException("Page value < 1 specified");
}
}
/**
* Construct a new page ranges attribute containing a single range of
* integers. That is, only those pages in the one range are to be printed.
*
* @param lowerBound Lower bound of the range.
* @param upperBound Upper bound of the range.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if a null range is specified or if a
* non-null range is specified with <CODE>lowerBound</CODE> less than
* 1.
*/
public PageRanges(int lowerBound, int upperBound) {
super (lowerBound, upperBound);
if (lowerBound > upperBound) {
throw new IllegalArgumentException("Null range specified");
} else if (lowerBound < 1) {
throw new IllegalArgumentException("Page value < 1 specified");
}
}
/**
* Returns whether this page ranges attribute is equivalent to the passed
* in object. To be equivalent, all of the following conditions must be
* true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class PageRanges.
* <LI>
* This page ranges attribute's members and <CODE>object</CODE>'s members
* are the same.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this page ranges
* attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof PageRanges);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PageRanges, the category is class PageRanges itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PageRanges.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PageRanges, the category name is <CODE>"page-ranges"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "page-ranges";
}
}

View File

@@ -0,0 +1,114 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintServiceAttribute;
/**
* Class PagesPerMinute is an integer valued printing attribute that indicates
* the nominal number of pages per minute to the nearest whole number which may
* be generated by this printer (e.g., simplex, black-and-white). This attribute
* is informative, not a service guarantee. Generally, it is the value used in
* the marketing literature to describe the device. A value of 0 indicates a
* device that takes more than two minutes to process a page.
* <P>
* <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
* category name returned by <CODE>getName()</CODE> gives the IPP attribute
* name.
* <P>
*
* @author Alan Kaminsky
*/
public final class PagesPerMinute extends IntegerSyntax
implements PrintServiceAttribute {
private static final long serialVersionUID = -6366403993072862015L;
/**
* Construct a new pages per minute attribute with the given integer
* value.
*
* @param value Integer value.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
*/
public PagesPerMinute(int value) {
super(value, 0, Integer.MAX_VALUE);
}
/**
* Returns whether this pages per minute attribute is equivalent to the
* passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class PagesPerMinute.
* <LI>
* This pages per minute attribute's value and <CODE>object</CODE>'s
* value are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this pages per
* minute attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals (object) &&
object instanceof PagesPerMinute);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PagesPerMinute, the category is class PagesPerMinute itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PagesPerMinute.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PagesPerMinute, the
* category name is <CODE>"pages-per-minute"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "pages-per-minute";
}
}

View File

@@ -0,0 +1,126 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintServiceAttribute;
/**
* Class PagesPerMinuteColor is an integer valued printing attribute that
* indicates the nominal number of pages per minute to the nearest whole number
* which may be generated by this printer when printing color (e.g., simplex,
* color). For purposes of this attribute, "color" means the same as for the
* {@link ColorSupported ColorSupported} attribute, namely, the device is
* capable of any type of color printing at all, including highlight color as
* well as full process color. This attribute is informative, not a service
* guarantee. Generally, it is the value used in the marketing literature to
* describe the color capabilities of this device. A value of 0 indicates a
* device that takes more than two minutes to process a page. If a color device
* has several color modes, it may use the pages-per- minute value for this
* attribute that corresponds to the mode that produces the highest number.
* <P>
* A black and white only printer must not include the PagesPerMinuteColor
* attribute in its attribute set or service registration. If this attribute is
* present, then the {@link ColorSupported ColorSupported} printer description
* attribute must also be present and have a value of SUPPORTED.
* <P>
* <B>IPP Compatibility:</B> The integer value gives the IPP integer value. The
* category name returned by <CODE>getName()</CODE> gives the IPP attribute
* name.
* <P>
*
* @author Alan Kaminsky
*/
public final class PagesPerMinuteColor extends IntegerSyntax
implements PrintServiceAttribute {
static final long serialVersionUID = 1684993151687470944L;
/**
* Construct a new pages per minute color attribute with the given integer
* value.
*
* @param value Integer value.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
*/
public PagesPerMinuteColor(int value) {
super(value, 0, Integer.MAX_VALUE);
}
/**
* Returns whether this pages per minute color attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class PagesPerMinuteColor.
* <LI>
* This pages per minute attribute's value and <CODE>object</CODE>'s
* value are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this pages per
* minute color attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals(object) &&
object instanceof PagesPerMinuteColor);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PagesPerMinuteColor, the
* category is class PagesPerMinuteColor itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PagesPerMinuteColor.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PagesPerMinuteColor, the
* category name is <CODE>"pages-per-minute-color"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "pages-per-minute-color";
}
}

View File

@@ -0,0 +1,186 @@
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintJobAttribute;
import javax.print.attribute.PrintRequestAttribute;
/**
* Class PresentationDirection is a printing attribute class, an enumeration,
* that is used in conjunction with the {@link NumberUp NumberUp} attribute to
* indicate the layout of multiple print-stream pages to impose upon a
* single side of an instance of a selected medium.
* This is useful to mirror the text layout conventions of different scripts.
* For example, English is "toright-tobottom", Hebrew is "toleft-tobottom"
* and Japanese is usually "tobottom-toleft".
* <P>
* <B>IPP Compatibility:</B> This attribute is not an IPP 1.1
* attribute; it is an attribute in the Production Printing Extension
* (<a href="ftp://ftp.pwg.org/pub/pwg/standards/pwg5100.3.pdf">PDF</a>)
* of IPP 1.1. The category name returned by
* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
* integer value is the IPP enum value. The <code>toString()</code> method
* returns the IPP string representation of the attribute value.
* <P>
*
* @author Phil Race.
*/
public final class PresentationDirection extends EnumSyntax
implements PrintJobAttribute, PrintRequestAttribute {
private static final long serialVersionUID = 8294728067230931780L;
/**
* Pages are laid out in columns starting at the top left,
* proceeding towards the bottom {@literal &} right.
*/
public static final PresentationDirection TOBOTTOM_TORIGHT =
new PresentationDirection(0);
/**
* Pages are laid out in columns starting at the top right,
* proceeding towards the bottom {@literal &} left.
*/
public static final PresentationDirection TOBOTTOM_TOLEFT =
new PresentationDirection(1);
/**
* Pages are laid out in columns starting at the bottom left,
* proceeding towards the top {@literal &} right.
*/
public static final PresentationDirection TOTOP_TORIGHT =
new PresentationDirection(2);
/**
* Pages are laid out in columns starting at the bottom right,
* proceeding towards the top {@literal &} left.
*/
public static final PresentationDirection TOTOP_TOLEFT =
new PresentationDirection(3);
/**
* Pages are laid out in rows starting at the top left,
* proceeding towards the right {@literal &} bottom.
*/
public static final PresentationDirection TORIGHT_TOBOTTOM =
new PresentationDirection(4);
/**
* Pages are laid out in rows starting at the bottom left,
* proceeding towards the right {@literal &} top.
*/
public static final PresentationDirection TORIGHT_TOTOP =
new PresentationDirection(5);
/**
* Pages are laid out in rows starting at the top right,
* proceeding towards the left {@literal &} bottom.
*/
public static final PresentationDirection TOLEFT_TOBOTTOM =
new PresentationDirection(6);
/**
* Pages are laid out in rows starting at the bottom right,
* proceeding towards the left {@literal &} top.
*/
public static final PresentationDirection TOLEFT_TOTOP =
new PresentationDirection(7);
/**
* Construct a new presentation direction enumeration value with the given
* integer value.
*
* @param value Integer value.
*/
private PresentationDirection(int value) {
super (value);
}
private static final String[] myStringTable = {
"tobottom-toright",
"tobottom-toleft",
"totop-toright",
"totop-toleft",
"toright-tobottom",
"toright-totop",
"toleft-tobottom",
"toleft-totop",
};
private static final PresentationDirection[] myEnumValueTable = {
TOBOTTOM_TORIGHT,
TOBOTTOM_TOLEFT,
TOTOP_TORIGHT,
TOTOP_TOLEFT,
TORIGHT_TOBOTTOM,
TORIGHT_TOTOP,
TOLEFT_TOBOTTOM,
TOLEFT_TOTOP,
};
/**
* Returns the string table for class PresentationDirection.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
* Returns the enumeration value table for class PresentationDirection.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PresentationDirection
* the category is class PresentationDirection itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PresentationDirection.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PresentationDirection
* the category name is <CODE>"presentation-direction"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "presentation-direction";
}
}

View File

@@ -0,0 +1,135 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class PrintQuality is a printing attribute class, an enumeration,
* that specifies the print quality that the printer uses for the job.
* <P>
* <B>IPP Compatibility:</B> The category name returned by
* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
* integer value is the IPP enum value. The <code>toString()</code> method
* returns the IPP string representation of the attribute value.
* <P>
*
* @author David Mendenhall
* @author Alan Kaminsky
*/
public class PrintQuality extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = -3072341285225858365L;
/**
* Lowest quality available on the printer.
*/
public static final PrintQuality DRAFT = new PrintQuality(3);
/**
* Normal or intermediate quality on the printer.
*/
public static final PrintQuality NORMAL = new PrintQuality(4);
/**
* Highest quality available on the printer.
*/
public static final PrintQuality HIGH = new PrintQuality(5);
/**
* Construct a new print quality enumeration value with the given integer
* value.
*
* @param value Integer value.
*/
protected PrintQuality(int value) {
super (value);
}
private static final String[] myStringTable = {
"draft",
"normal",
"high"
};
private static final PrintQuality[] myEnumValueTable = {
DRAFT,
NORMAL,
HIGH
};
/**
* Returns the string table for class PrintQuality.
*/
protected String[] getStringTable() {
return (String[])myStringTable.clone();
}
/**
* Returns the enumeration value table for class PrintQuality.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
/**
* Returns the lowest integer value used by class PrintQuality.
*/
protected int getOffset() {
return 3;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PrintQuality and any vendor-defined subclasses, the category is
* class PrintQuality itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PrintQuality.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PrintQuality and any vendor-defined subclasses, the category
* name is <CODE>"print-quality"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "print-quality";
}
}

View File

@@ -0,0 +1,121 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
import javax.print.attribute.TextSyntax;
import javax.print.attribute.PrintServiceAttribute;
/**
* Class PrinterInfo is a printing attribute class, a text attribute, that
* provides descriptive information about a printer. This could include things
* like: <CODE>"This printer can be used for printing color transparencies for
* HR presentations"</CODE>, or <CODE>"Out of courtesy for others, please
* print only small (1-5 page) jobs at this printer"</CODE>, or even \
* <CODE>"This printer is going away on July 1, 1997, please find a new
* printer"</CODE>.
* <P>
* <B>IPP Compatibility:</B> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class PrinterInfo extends TextSyntax
implements PrintServiceAttribute {
private static final long serialVersionUID = 7765280618777599727L;
/**
* Constructs a new printer info attribute with the given information
* string and locale.
*
* @param info Printer information string.
* @param locale Natural language of the text string. null
* is interpreted to mean the default locale as returned
* by <code>Locale.getDefault()</code>
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>info</CODE> is null.
*/
public PrinterInfo(String info, Locale locale) {
super (info, locale);
}
/**
* Returns whether this printer info attribute is equivalent to the passed
* in object. To be equivalent, all of the following conditions must be
* true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class PrinterInfo.
* <LI>
* This printer info attribute's underlying string and
* <CODE>object</CODE>'s underlying string are equal.
* <LI>
* This printer info attribute's locale and <CODE>object</CODE>'s
* locale are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this printer
* info attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof PrinterInfo);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PrinterInfo, the category is class PrinterInfo itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PrinterInfo.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PrinterInfo, the category name is <CODE>"printer-info"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "printer-info";
}
}

View File

@@ -0,0 +1,128 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintServiceAttribute;
/**
* Class PrinterIsAcceptingJobs is a printing attribute class, an enumeration,
* that indicates whether the printer is currently able to accept jobs. This
* value is independent of the {@link PrinterState PrinterState} and {@link
* PrinterStateReasons PrinterStateReasons} attributes because its value does
* not affect the current job; rather it affects future jobs. If the value is
* NOT_ACCEPTING_JOBS, the printer will reject jobs even when the {@link
* PrinterState PrinterState} is IDLE. If value is ACCEPTING_JOBS, the Printer
* will accept jobs even when the {@link PrinterState PrinterState} is STOPPED.
* <P>
* <B>IPP Compatibility:</B> The IPP boolean value is "true" for ACCEPTING_JOBS
* and "false" for NOT_ACCEPTING_JOBS. The category name returned by
* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
* integer value is the IPP enum value. The <code>toString()</code> method
* returns the IPP string representation of the attribute value.
* <P>
*
* @author Alan Kaminsky
*/
public final class PrinterIsAcceptingJobs extends EnumSyntax
implements PrintServiceAttribute {
private static final long serialVersionUID = -5052010680537678061L;
/**
* The printer is currently rejecting any jobs sent to it.
*/
public static final PrinterIsAcceptingJobs
NOT_ACCEPTING_JOBS = new PrinterIsAcceptingJobs(0);
/**
* The printer is currently accepting jobs.
*/
public static final PrinterIsAcceptingJobs
ACCEPTING_JOBS = new PrinterIsAcceptingJobs(1);
/**
* Construct a new printer is accepting jobs enumeration value with the
* given integer value.
*
* @param value Integer value.
*/
protected PrinterIsAcceptingJobs(int value) {
super (value);
}
private static final String[] myStringTable = {
"not-accepting-jobs",
"accepting-jobs"
};
private static final PrinterIsAcceptingJobs[] myEnumValueTable = {
NOT_ACCEPTING_JOBS,
ACCEPTING_JOBS
};
/**
* Returns the string table for class PrinterIsAcceptingJobs.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
* Returns the enumeration value table for class PrinterIsAcceptingJobs.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PrinterIsAcceptingJobs, the
* category is class PrinterIsAcceptingJobs itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PrinterIsAcceptingJobs.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PrinterIsAcceptingJobs, the
* category name is <CODE>"printer-is-accepting-jobs"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "printer-is-accepting-jobs";
}
}

View File

@@ -0,0 +1,119 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
import javax.print.attribute.TextSyntax;
import javax.print.attribute.PrintServiceAttribute;
/**
* Class PrinterLocation is a printing attribute class, a text attribute, that
* identifies the location of the device. This could include things like:
* <CODE>"in Room 123A, second floor of building XYZ"</CODE>.
* <P>
* <B>IPP Compatibility:</B> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class PrinterLocation extends TextSyntax
implements PrintServiceAttribute {
private static final long serialVersionUID = -1598610039865566337L;
/**
* Constructs a new printer location attribute with the given location and
* locale.
*
* @param location Printer location.
* @param locale Natural language of the text string. null
* is interpreted to mean the default locale as returned
* by <code>Locale.getDefault()</code>
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>location</CODE> is null.
*/
public PrinterLocation(String location, Locale locale) {
super (location, locale);
}
/**
* Returns whether this printer location attribute is equivalent to the
* passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class PrinterLocation.
* <LI>
* This printer location attribute's underlying string and
* <CODE>object</CODE>'s underlying string are equal.
* <LI>
* This printer location attribute's locale and <CODE>object</CODE>'s
* locale are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this printer
* location attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof PrinterLocation);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PrinterLocation, the
* category is class PrinterLocation itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PrinterLocation.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PrinterLocation, the
* category name is <CODE>"printer-location"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "printer-location";
}
}

View File

@@ -0,0 +1,118 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
import javax.print.attribute.TextSyntax;
import javax.print.attribute.PrintServiceAttribute;
/**
* Class PrinterMakeAndModel is a printing attribute class, a text attribute,
* that the make and model of the printer.
* <P>
* <B>IPP Compatibility:</B> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class PrinterMakeAndModel extends TextSyntax
implements PrintServiceAttribute {
private static final long serialVersionUID = 4580461489499351411L;
/**
* Constructs a new printer make and model attribute with the given make
* and model string and locale.
*
* @param makeAndModel Printer make and model string.
* @param locale Natural language of the text string. null
* is interpreted to mean the default locale as returned
* by <code>Locale.getDefault()</code>
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>makeAndModel</CODE> is null.
*/
public PrinterMakeAndModel(String makeAndModel, Locale locale) {
super (makeAndModel, locale);
}
/**
* Returns whether this printer make and model attribute is equivalent to
* the passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class PrinterMakeAndModel.
* <LI>
* This printer make and model attribute's underlying string and
* <CODE>object</CODE>'s underlying string are equal.
* <LI>
* This printer make and model attribute's locale and
* <CODE>object</CODE>'s locale are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this printer
* make and model attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals(object) &&
object instanceof PrinterMakeAndModel);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PrinterMakeAndModel, the
* category is class PrinterMakeAndModel itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PrinterMakeAndModel.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PrinterMakeAndModel, the
* category name is <CODE>"printer-make-and-model"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "printer-make-and-model";
}
}

View File

@@ -0,0 +1,134 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
import javax.print.attribute.TextSyntax;
import javax.print.attribute.PrintServiceAttribute;
/**
* Class PrinterMessageFromOperator is a printing attribute class, a text
* attribute, that provides a message from an operator, system administrator,
* or "intelligent" process to indicate to the end user information about or
* status of the printer, such as why it is unavailable or when it is
* expected to be available.
* <P>
* A Print Service's attribute set includes zero instances or one instance of
* a
* PrinterMessageFromOperator attribute, not more than one instance. A new
* PrinterMessageFromOperator attribute replaces an existing
* PrinterMessageFromOperator attribute, if any. In other words,
* PrinterMessageFromOperator is not intended to be a history log.
* If it wishes, the client can detect changes to a Print Service's
* PrinterMessageFromOperator
* attribute and maintain the client's own history log of the
* PrinterMessageFromOperator attribute values.
* <P>
* <B>IPP Compatibility:</B> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class PrinterMessageFromOperator extends TextSyntax
implements PrintServiceAttribute {
static final long serialVersionUID = -4486871203218629318L;
/**
* Constructs a new printer message from operator attribute with the
* given message and locale.
*
* @param message Message.
* @param locale Natural language of the text string. null
* is interpreted to mean the default locale as returned
* by <code>Locale.getDefault()</code>
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>message</CODE> is null.
*/
public PrinterMessageFromOperator(String message, Locale locale) {
super (message, locale);
}
/**
* Returns whether this printer message from operator attribute is
* equivalent to the passed in object. To be equivalent, all of the
* following conditions must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class
* PrinterMessageFromOperator.
* <LI>
* This printer message from operator attribute's underlying string and
* <CODE>object</CODE>'s underlying string are equal.
* <LI>
* This printer message from operator attribute's locale and
* <CODE>object</CODE>'s locale are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this printer
* message from operator attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals(object) &&
object instanceof PrinterMessageFromOperator);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PrinterMessageFromOperator,
* the category is class PrinterMessageFromOperator itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PrinterMessageFromOperator.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PrinterMessageFromOperator,
* the category name is <CODE>"printer-message-from-operator"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "printer-message-from-operator";
}
}

View File

@@ -0,0 +1,123 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.net.URI;
import javax.print.attribute.Attribute;
import javax.print.attribute.URISyntax;
import javax.print.attribute.PrintServiceAttribute;
/**
* Class PrinterMoreInfo is a printing attribute class, a URI, that is used to
* obtain more information about this specific printer. For example, this
* could be an HTTP type URI referencing an HTML page accessible to a web
* browser. The information obtained from this URI is intended for end user
* consumption. Features outside the scope of the Print Service API can be
* accessed from this URI.
* The information is intended to be specific to this printer instance and
* site specific services (e.g. job pricing, services offered, end user
* assistance).
* <P>
* In contrast, the {@link PrinterMoreInfoManufacturer
* PrinterMoreInfoManufacturer} attribute is used to find out more information
* about this general kind of printer rather than this specific printer.
* <P>
* <B>IPP Compatibility:</B> The string form returned by
* <CODE>toString()</CODE> gives the IPP uri value.
* The category name returned by <CODE>getName()</CODE>
* gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class PrinterMoreInfo extends URISyntax
implements PrintServiceAttribute {
private static final long serialVersionUID = 4555850007675338574L;
/**
* Constructs a new printer more info attribute with the specified URI.
*
* @param uri URI.
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>uri</CODE> is null.
*/
public PrinterMoreInfo(URI uri) {
super (uri);
}
/**
* Returns whether this printer more info attribute is equivalent to the
* passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class PrinterMoreInfo.
* <LI>
* This printer more info attribute's URI and <CODE>object</CODE>'s URI
* are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this printer
* more info attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals(object) &&
object instanceof PrinterMoreInfo);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PrinterMoreInfo, the category is class PrinterMoreInfo itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PrinterMoreInfo.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PrinterMoreInfo, the
* category name is <CODE>"printer-more-info"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "printer-more-info";
}
}

View File

@@ -0,0 +1,127 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.net.URI;
import javax.print.attribute.Attribute;
import javax.print.attribute.URISyntax;
import javax.print.attribute.PrintServiceAttribute;
/**
* Class PrinterMoreInfoManufacturer is a printing attribute class, a URI,
* that is used to obtain more information about this type of device.
* The information obtained from this URI is intended for end user
* consumption. Features outside the scope of the Print Service API
* can be accessed from this URI (e.g.,
* latest firmware, upgrades, service proxies, optional features available,
* details on color support). The information is intended to be germane to
* this kind of printer without regard to site specific modifications or
* services.
* <P>
* In contrast, the {@link PrinterMoreInfo PrinterMoreInfo} attribute is used
* to find out more information about this specific printer rather than this
* general kind of printer.
* <P>
* <P>
* <B>IPP Compatibility:</B> The string form returned by
* <CODE>toString()</CODE> gives the IPP uri value.
* The category name returned by <CODE>getName()</CODE>
* gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class PrinterMoreInfoManufacturer extends URISyntax
implements PrintServiceAttribute {
private static final long serialVersionUID = 3323271346485076608L;
/**
* Constructs a new printer more info manufacturer attribute with the
* specified URI.
*
* @param uri URI.
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>uri</CODE> is null.
*/
public PrinterMoreInfoManufacturer(URI uri) {
super (uri);
}
/**
* Returns whether this printer more info manufacturer attribute is
* equivalent to the passed in object. To be equivalent, all of the
* following conditions must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class
* PrinterMoreInfoManufacturer.
* <LI>
* This printer more info manufacturer attribute's URI and
* <CODE>object</CODE>'s URI are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this printer
* more info manufacturer attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals(object) &&
object instanceof PrinterMoreInfoManufacturer);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PrinterMoreInfoManufacturer, the category is
* class PrinterMoreInfoManufacturer itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PrinterMoreInfoManufacturer.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PrinterMoreInfoManufacturer, the category name is
* <CODE>"printer-more-info-manufacturer"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "printer-more-info-manufacturer";
}
}

View File

@@ -0,0 +1,121 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
import javax.print.attribute.TextSyntax;
import javax.print.attribute.PrintServiceAttribute;
/**
* Class PrinterName is a printing attribute class, a text attribute, that
* specifies the name of a printer. It is a name that is more end-user friendly
* than a URI. An administrator determines a printer's name and sets this
* attribute to that name. This name may be the last part of the printer's URI
* or it may be unrelated. In non-US-English locales, a name may contain
* characters that are not allowed in a URI.
* <P>
* <B>IPP Compatibility:</B> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class PrinterName extends TextSyntax
implements PrintServiceAttribute {
private static final long serialVersionUID = 299740639137803127L;
/**
* Constructs a new printer name attribute with the given name and locale.
*
* @param printerName Printer name.
* @param locale Natural language of the text string. null
* is interpreted to mean the default locale as returned
* by <code>Locale.getDefault()</code>
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>printerName</CODE> is null.
*/
public PrinterName(String printerName, Locale locale) {
super (printerName, locale);
}
/**
* Returns whether this printer name attribute is equivalent to the passed
* in object. To be equivalent, all of the following conditions must be
* true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class PrinterName.
* <LI>
* This printer name attribute's underlying string and
* <CODE>object</CODE>'s underlying string are equal.
* <LI>
* This printer name attribute's locale and <CODE>object</CODE>'s locale
* are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this printer
* name attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof PrinterName);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PrinterName, the category is
* class PrinterName itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PrinterName.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PrinterName, the category
* name is <CODE>"printer-name"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "printer-name";
}
}

View File

@@ -0,0 +1,151 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.ResolutionSyntax;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class PrinterResolution is a printing attribute class that specifies an
* exact resolution supported by a printer or to be used for a print job.
* This attribute assumes that printers have a small set of device resolutions
* at which they can operate rather than a continuum.
* <p>
* PrinterResolution is used in multiple ways:
* <OL TYPE=1>
* <LI>
* When a client searches looking for a printer that supports the client's
* desired resolution exactly (no more, no less), the client specifies
* an instance of class PrinterResolution indicating the exact resolution the
* client wants. Only printers supporting that exact resolution will match the
* search.
* <P>
* <LI>
* When a client needs to print a job using the client's desired resolution
* exactly (no more, no less), the client specifies an instance of class
* PrinterResolution as an attribute of the Print Job. This will fail if the
* Print Job doesn't support that exact resolution, and Fidelity is set to
* true.
* </OL>
* If a client wants to locate a printer supporting a resolution
* greater than some required minimum, then it may be necessary to exclude
* this attribute from a lookup request and to directly query the set of
* supported resolutions, and specify the one that most closely meets
* the client's requirements.
* In some cases this may be more simply achieved by specifying a
* PrintQuality attribute which often controls resolution.
* <P>
* <P>
* <B>IPP Compatibility:</B> The information needed to construct an IPP
* <CODE>"printer-resolution"</CODE> attribute can be obtained by calling
* methods on the PrinterResolution object. The category name returned by
* <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author David Mendenhall
* @author Alan Kaminsky
*/
public final class PrinterResolution extends ResolutionSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = 13090306561090558L;
/**
* Construct a new printer resolution attribute from the given items.
*
* @param crossFeedResolution
* Cross feed direction resolution.
* @param feedResolution
* Feed direction resolution.
* @param units
* Unit conversion factor, e.g. <code>ResolutionSyntax.DPI</CODE>
* or <code>ResolutionSyntax.DPCM</CODE>.
*
* @exception IllegalArgumentException
* (unchecked exception) Thrown if {@code crossFeedResolution < 1} or
* {@code feedResolution < 1} or {@code units < 1}.
*/
public PrinterResolution(int crossFeedResolution, int feedResolution,
int units) {
super (crossFeedResolution, feedResolution, units);
}
/**
* Returns whether this printer resolution attribute is equivalent to the
* passed in object. To be equivalent, all of the following conditions
* must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class PrinterResolution.
* <LI>
* This attribute's cross feed direction resolution is equal to
* <CODE>object</CODE>'s cross feed direction resolution.
* <LI>
* This attribute's feed direction resolution is equal to
* <CODE>object</CODE>'s feed direction resolution.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this printer
* resolution attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals (object) &&
object instanceof PrinterResolution);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PrinterResolution, the category is class PrinterResolution itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PrinterResolution.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PrinterResolution, the
* category name is <CODE>"printer-resolution"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "printer-resolution";
}
}

View File

@@ -0,0 +1,142 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.PrintServiceAttribute;
/**
* Class PrinterState is a printing attribute class, an enumeration, that
* identifies the current state of a printer. Class PrinterState defines
* standard printer state values. A Print Service implementation only needs
* to report those printer states which are appropriate for the particular
* implementation; it does not have to report every defined printer state. The
* {@link PrinterStateReasons PrinterStateReasons} attribute augments the
* PrinterState attribute to give more detailed information about the printer
* in given printer state.
* <P>
* <B>IPP Compatibility:</B> The category name returned by
* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
* integer value is the IPP enum value. The <code>toString()</code> method
* returns the IPP string representation of the attribute value.
* <P>
*
* @author Alan Kaminsky
*/
public final class PrinterState extends EnumSyntax
implements PrintServiceAttribute {
private static final long serialVersionUID = -649578618346507718L;
/**
* The printer state is unknown.
*/
public static final PrinterState UNKNOWN = new PrinterState(0);
/**
* Indicates that new jobs can start processing without waiting.
*/
public static final PrinterState IDLE = new PrinterState(3);
/**
* Indicates that jobs are processing;
* new jobs will wait before processing.
*/
public static final PrinterState PROCESSING = new PrinterState(4);
/**
* Indicates that no jobs can be processed and intervention is required.
*/
public static final PrinterState STOPPED = new PrinterState(5);
/**
* Construct a new printer state enumeration value with the given integer
* value.
*
* @param value Integer value.
*/
protected PrinterState(int value) {
super (value);
}
private static final String[] myStringTable = {
"unknown",
null,
null,
"idle",
"processing",
"stopped"
};
private static final PrinterState[] myEnumValueTable = {
UNKNOWN,
null,
null,
IDLE,
PROCESSING,
STOPPED
};
/**
* Returns the string table for class PrinterState.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
* Returns the enumeration value table for class PrinterState.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PrinterState, the category is class PrinterState itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PrinterState.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PrinterState, the category name is <CODE>"printer-state"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "printer-state";
}
}

View File

@@ -0,0 +1,444 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.Attribute;
/**
* Class PrinterStateReason is a printing attribute class, an enumeration,
* that provides additional information about the printer's current state,
* i.e., information that augments the value of the printer's
* {@link PrinterState PrinterState} attribute.
* Class PrinterStateReason defines standard printer
* state reason values. A Print Service implementation only needs to report
* those printer state reasons which are appropriate for the particular
* implementation; it does not have to report every defined printer state
* reason.
* <P>
* Instances of PrinterStateReason do not appear in a Print Service's
* attribute set directly.
* Rather, a {@link PrinterStateReasons PrinterStateReasons}
* attribute appears in the Print Service's attribute set. The {@link
* PrinterStateReasons PrinterStateReasons} attribute contains zero, one, or
* more than one PrinterStateReason objects which pertain to the
* Print Service's status, and each PrinterStateReason object is
* associated with a {@link Severity Severity} level of REPORT (least severe),
* WARNING, or ERROR (most severe). The printer adds a PrinterStateReason
* object to the Print Service's
* {@link PrinterStateReasons PrinterStateReasons} attribute when the
* corresponding condition becomes true of the printer, and the printer
* removes the PrinterStateReason object again when the corresponding
* condition becomes false, regardless of whether the Print Service's overall
* {@link PrinterState PrinterState} also changed.
* <P>
* <B>IPP Compatibility:</B>
* The string values returned by each individual {@link PrinterStateReason} and
* associated {@link Severity} object's <CODE>toString()</CODE>
* methods, concatenated together with a hyphen (<CODE>"-"</CODE>) in
* between, gives the IPP keyword value for a {@link PrinterStateReasons}.
* The category name returned by <CODE>getName()</CODE> gives the IPP
* attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public class PrinterStateReason extends EnumSyntax implements Attribute {
private static final long serialVersionUID = -1623720656201472593L;
/**
* The printer has detected an error other than ones listed below.
*/
public static final PrinterStateReason OTHER = new PrinterStateReason(0);
/**
* A tray has run out of media.
*/
public static final PrinterStateReason
MEDIA_NEEDED = new PrinterStateReason(1);
/**
* The device has a media jam.
*/
public static final PrinterStateReason
MEDIA_JAM = new PrinterStateReason(2);
/**
* Someone has paused the printer, but the device(s) are taking an
* appreciable time to stop. Later, when all output has stopped,
* the {@link PrinterState PrinterState} becomes STOPPED,
* and the PAUSED value replaces
* the MOVING_TO_PAUSED value in the {@link PrinterStateReasons
* PrinterStateReasons} attribute. This value must be supported if the
* printer can be paused and the implementation takes significant time to
* pause a device in certain circumstances.
*/
public static final PrinterStateReason
MOVING_TO_PAUSED = new PrinterStateReason(3);
/**
* Someone has paused the printer and the printer's {@link PrinterState
* PrinterState} is STOPPED. In this state, a printer must not produce
* printed output, but it must perform other operations requested by a
* client. If a printer had been printing a job when the printer was
* paused,
* the Printer must resume printing that job when the printer is no longer
* paused and leave no evidence in the printed output of such a pause.
* This value must be supported if the printer can be paused.
*/
public static final PrinterStateReason
PAUSED = new PrinterStateReason(4);
/**
* Someone has removed a printer from service, and the device may be
* powered down or physically removed.
* In this state, a printer must not produce
* printed output, and unless the printer is realized by a print server
* that is still active, the printer must perform no other operations
* requested by a client.
* If a printer had been printing a job when it was shut down,
* the printer need not resume printing that job when the printer is no
* longer shut down. If the printer resumes printing such a job, it may
* leave evidence in the printed output of such a shutdown, e.g. the part
* printed before the shutdown may be printed a second time after the
* shutdown.
*/
public static final PrinterStateReason
SHUTDOWN = new PrinterStateReason(5);
/**
* The printer has scheduled a job on the output device and is in the
* process of connecting to a shared network output device (and might not
* be able to actually start printing the job for an arbitrarily long time
* depending on the usage of the output device by other servers on the
* network).
*/
public static final PrinterStateReason
CONNECTING_TO_DEVICE = new PrinterStateReason(6);
/**
* The server was able to connect to the output device (or is always
* connected), but was unable to get a response from the output device.
*/
public static final PrinterStateReason
TIMED_OUT = new PrinterStateReason(7);
/**
* The printer is in the process of stopping the device and will be
* stopped in a while.
* When the device is stopped, the printer will change the
* {@link PrinterState PrinterState} to STOPPED. The STOPPING reason is
* never an error, even for a printer with a single output device. When an
* output device ceases accepting jobs, the printer's {@link
* PrinterStateReasons PrinterStateReasons} will have this reason while
* the output device completes printing.
*/
public static final PrinterStateReason
STOPPING = new PrinterStateReason(8);
/**
* When a printer controls more than one output device, this reason
* indicates that one or more output devices are stopped. If the reason's
* severity is a report, fewer than half of the output devices are
* stopped.
* If the reason's severity is a warning, half or more but fewer than
* all of the output devices are stopped.
*/
public static final PrinterStateReason
STOPPED_PARTLY = new PrinterStateReason(9);
/**
* The device is low on toner.
*/
public static final PrinterStateReason
TONER_LOW = new PrinterStateReason(10);
/**
* The device is out of toner.
*/
public static final PrinterStateReason
TONER_EMPTY = new PrinterStateReason(11);
/**
* The limit of persistent storage allocated for spooling has been
* reached.
* The printer is temporarily unable to accept more jobs. The printer will
* remove this reason when it is able to accept more jobs.
* This value should be used by a non-spooling printer that only
* accepts one or a small number
* jobs at a time or a spooling printer that has filled the spool space.
*/
public static final PrinterStateReason
SPOOL_AREA_FULL = new PrinterStateReason(12);
/**
* One or more covers on the device are open.
*/
public static final PrinterStateReason
COVER_OPEN = new PrinterStateReason(13);
/**
* One or more interlock devices on the printer are unlocked.
*/
public static final PrinterStateReason
INTERLOCK_OPEN = new PrinterStateReason(14);
/**
* One or more doors on the device are open.
*/
public static final PrinterStateReason
DOOR_OPEN = new PrinterStateReason(15);
/**
* One or more input trays are not in the device.
*/
public static final PrinterStateReason
INPUT_TRAY_MISSING = new PrinterStateReason(16);
/**
* At least one input tray is low on media.
*/
public static final PrinterStateReason
MEDIA_LOW = new PrinterStateReason(17);
/**
* At least one input tray is empty.
*/
public static final PrinterStateReason
MEDIA_EMPTY = new PrinterStateReason(18);
/**
* One or more output trays are not in the device.
*/
public static final PrinterStateReason
OUTPUT_TRAY_MISSING = new PrinterStateReason(19);
/**
* One or more output areas are almost full
* (e.g. tray, stacker, collator).
*/
public static final PrinterStateReason
OUTPUT_AREA_ALMOST_FULL = new PrinterStateReason(20);
/**
* One or more output areas are full (e.g. tray, stacker, collator).
*/
public static final PrinterStateReason
OUTPUT_AREA_FULL = new PrinterStateReason(21);
/**
* The device is low on at least one marker supply (e.g. toner, ink,
* ribbon).
*/
public static final PrinterStateReason
MARKER_SUPPLY_LOW = new PrinterStateReason(22);
/**
* The device is out of at least one marker supply (e.g. toner, ink,
* ribbon).
*/
public static final PrinterStateReason
MARKER_SUPPLY_EMPTY = new PrinterStateReason(23);
/**
* The device marker supply waste receptacle is almost full.
*/
public static final PrinterStateReason
MARKER_WASTE_ALMOST_FULL = new PrinterStateReason(24);
/**
* The device marker supply waste receptacle is full.
*/
public static final PrinterStateReason
MARKER_WASTE_FULL = new PrinterStateReason(25);
/**
* The fuser temperature is above normal.
*/
public static final PrinterStateReason
FUSER_OVER_TEMP = new PrinterStateReason(26);
/**
* The fuser temperature is below normal.
*/
public static final PrinterStateReason
FUSER_UNDER_TEMP = new PrinterStateReason(27);
/**
* The optical photo conductor is near end of life.
*/
public static final PrinterStateReason
OPC_NEAR_EOL = new PrinterStateReason(28);
/**
* The optical photo conductor is no longer functioning.
*/
public static final PrinterStateReason
OPC_LIFE_OVER = new PrinterStateReason(29);
/**
* The device is low on developer.
*/
public static final PrinterStateReason
DEVELOPER_LOW = new PrinterStateReason(30);
/**
* The device is out of developer.
*/
public static final PrinterStateReason
DEVELOPER_EMPTY = new PrinterStateReason(31);
/**
* An interpreter resource is unavailable (e.g., font, form).
*/
public static final PrinterStateReason
INTERPRETER_RESOURCE_UNAVAILABLE = new PrinterStateReason(32);
/**
* Construct a new printer state reason enumeration value with
* the given integer value.
*
* @param value Integer value.
*/
protected PrinterStateReason(int value) {
super (value);
}
private static final String[] myStringTable = {
"other",
"media-needed",
"media-jam",
"moving-to-paused",
"paused",
"shutdown",
"connecting-to-device",
"timed-out",
"stopping",
"stopped-partly",
"toner-low",
"toner-empty",
"spool-area-full",
"cover-open",
"interlock-open",
"door-open",
"input-tray-missing",
"media-low",
"media-empty",
"output-tray-missing",
"output-area-almost-full",
"output-area-full",
"marker-supply-low",
"marker-supply-empty",
"marker-waste-almost-full",
"marker-waste-full",
"fuser-over-temp",
"fuser-under-temp",
"opc-near-eol",
"opc-life-over",
"developer-low",
"developer-empty",
"interpreter-resource-unavailable"
};
private static final PrinterStateReason[] myEnumValueTable = {
OTHER,
MEDIA_NEEDED,
MEDIA_JAM,
MOVING_TO_PAUSED,
PAUSED,
SHUTDOWN,
CONNECTING_TO_DEVICE,
TIMED_OUT,
STOPPING,
STOPPED_PARTLY,
TONER_LOW,
TONER_EMPTY,
SPOOL_AREA_FULL,
COVER_OPEN,
INTERLOCK_OPEN,
DOOR_OPEN,
INPUT_TRAY_MISSING,
MEDIA_LOW,
MEDIA_EMPTY,
OUTPUT_TRAY_MISSING,
OUTPUT_AREA_ALMOST_FULL,
OUTPUT_AREA_FULL,
MARKER_SUPPLY_LOW,
MARKER_SUPPLY_EMPTY,
MARKER_WASTE_ALMOST_FULL,
MARKER_WASTE_FULL,
FUSER_OVER_TEMP,
FUSER_UNDER_TEMP,
OPC_NEAR_EOL,
OPC_LIFE_OVER,
DEVELOPER_LOW,
DEVELOPER_EMPTY,
INTERPRETER_RESOURCE_UNAVAILABLE
};
/**
* Returns the string table for class PrinterStateReason.
*/
protected String[] getStringTable() {
return (String[])myStringTable.clone();
}
/**
* Returns the enumeration value table for class PrinterStateReason.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PrinterStateReason and any vendor-defined subclasses, the
* category is class PrinterStateReason itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PrinterStateReason.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PrinterStateReason and any vendor-defined subclasses, the
* category name is <CODE>"printer-state-reason"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "printer-state-reason";
}
}

View File

@@ -0,0 +1,308 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.AbstractSet;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.HashMap;
import java.util.Set;
import javax.print.attribute.Attribute;
import javax.print.attribute.PrintServiceAttribute;
/**
* Class PrinterStateReasons is a printing attribute class, a set of
* enumeration values, that provides additional information about the
* printer's current state, i.e., information that augments the value of the
* printer's {@link PrinterState PrinterState} attribute.
* <P>
* Instances of {@link PrinterStateReason PrinterStateReason} do not appear in
* a Print Service's attribute set directly. Rather, a PrinterStateReasons
* attribute appears in the Print Service's attribute set. The
* PrinterStateReasons attribute contains zero, one, or more than one {@link
* PrinterStateReason PrinterStateReason} objects which pertain to the Print
* Service's status, and each {@link PrinterStateReason PrinterStateReason}
* object is associated with a {@link Severity Severity} level of REPORT
* (least severe), WARNING, or ERROR (most severe). The printer adds a {@link
* PrinterStateReason PrinterStateReason} object to the Print Service's
* PrinterStateReasons attribute when the corresponding condition becomes true
* of the printer, and the printer removes the {@link PrinterStateReason
* PrinterStateReason} object again when the corresponding condition becomes
* false, regardless of whether the Print Service's overall
* {@link PrinterState PrinterState} also changed.
* <P>
* Class PrinterStateReasons inherits its implementation from class {@link
* java.util.HashMap java.util.HashMap}. Each entry in the map consists of a
* {@link PrinterStateReason PrinterStateReason} object (key) mapping to a
* {@link Severity Severity} object (value):
* <P>
* Unlike most printing attributes which are immutable once constructed, class
* PrinterStateReasons is designed to be mutable; you can add {@link
* PrinterStateReason PrinterStateReason} objects to an existing
* PrinterStateReasons object and remove them again. However, like class
* {@link java.util.HashMap java.util.HashMap}, class PrinterStateReasons is
* not multiple thread safe. If a PrinterStateReasons object will be used by
* multiple threads, be sure to synchronize its operations (e.g., using a
* synchronized map view obtained from class {@link java.util.Collections
* java.util.Collections}).
* <P>
* <B>IPP Compatibility:</B> The string values returned by each individual
* {@link PrinterStateReason PrinterStateReason} object's and the associated
* {@link Severity Severity} object's <CODE>toString()</CODE> methods,
* concatenated
* together with a hyphen (<CODE>"-"</CODE>) in between, gives the IPP keyword
* value. The category name returned by <CODE>getName()</CODE> gives the IPP
* attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class PrinterStateReasons
extends HashMap<PrinterStateReason,Severity>
implements PrintServiceAttribute
{
private static final long serialVersionUID = -3731791085163619457L;
/**
* Construct a new, empty printer state reasons attribute; the underlying
* hash map has the default initial capacity and load factor.
*/
public PrinterStateReasons() {
super();
}
/**
* super a new, empty printer state reasons attribute; the underlying
* hash map has the given initial capacity and the default load factor.
*
* @param initialCapacity Initial capacity.
*
* @throws IllegalArgumentException if the initial capacity is less
* than zero.
*/
public PrinterStateReasons(int initialCapacity) {
super (initialCapacity);
}
/**
* Construct a new, empty printer state reasons attribute; the underlying
* hash map has the given initial capacity and load factor.
*
* @param initialCapacity Initial capacity.
* @param loadFactor Load factor.
*
* @throws IllegalArgumentException if the initial capacity is less
* than zero.
*/
public PrinterStateReasons(int initialCapacity, float loadFactor) {
super (initialCapacity, loadFactor);
}
/**
* Construct a new printer state reasons attribute that contains the same
* {@link PrinterStateReason PrinterStateReason}-to-{@link Severity
* Severity} mappings as the given map. The underlying hash map's initial
* capacity and load factor are as specified in the superclass constructor
* {@link java.util.HashMap#HashMap(java.util.Map)
* HashMap(Map)}.
*
* @param map Map to copy.
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>map</CODE> is null or if any
* key or value in <CODE>map</CODE> is null.
* @throws ClassCastException
* (unchecked exception) Thrown if any key in <CODE>map</CODE> is not
* an instance of class {@link PrinterStateReason PrinterStateReason} or
* if any value in <CODE>map</CODE> is not an instance of class
* {@link Severity Severity}.
*/
public PrinterStateReasons(Map<PrinterStateReason,Severity> map) {
this();
for (Map.Entry<PrinterStateReason,Severity> e : map.entrySet())
put(e.getKey(), e.getValue());
}
/**
* Adds the given printer state reason to this printer state reasons
* attribute, associating it with the given severity level. If this
* printer state reasons attribute previously contained a mapping for the
* given printer state reason, the old value is replaced.
*
* @param reason Printer state reason. This must be an instance of
* class {@link PrinterStateReason PrinterStateReason}.
* @param severity Severity of the printer state reason. This must be
* an instance of class {@link Severity Severity}.
*
* @return Previous severity associated with the given printer state
* reason, or <tt>null</tt> if the given printer state reason was
* not present.
*
* @throws NullPointerException
* (unchecked exception) Thrown if <CODE>reason</CODE> is null or
* <CODE>severity</CODE> is null.
* @throws ClassCastException
* (unchecked exception) Thrown if <CODE>reason</CODE> is not an
* instance of class {@link PrinterStateReason PrinterStateReason} or if
* <CODE>severity</CODE> is not an instance of class {@link Severity
* Severity}.
* @since 1.5
*/
public Severity put(PrinterStateReason reason, Severity severity) {
if (reason == null) {
throw new NullPointerException("reason is null");
}
if (severity == null) {
throw new NullPointerException("severity is null");
}
return super.put(reason, severity);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PrinterStateReasons, the
* category is class PrinterStateReasons itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PrinterStateReasons.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PrinterStateReasons, the
* category name is <CODE>"printer-state-reasons"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "printer-state-reasons";
}
/**
* Obtain an unmodifiable set view of the individual printer state reason
* attributes at the given severity level in this PrinterStateReasons
* attribute. Each element in the set view is a {@link PrinterStateReason
* PrinterStateReason} object. The only elements in the set view are the
* {@link PrinterStateReason PrinterStateReason} objects that map to the
* given severity value. The set view is backed by this
* PrinterStateReasons attribute, so changes to this PrinterStateReasons
* attribute are reflected in the set view.
* The set view does not support element insertion or
* removal. The set view's iterator does not support element removal.
*
* @param severity Severity level.
*
* @return Set view of the individual {@link PrinterStateReason
* PrinterStateReason} attributes at the given {@link Severity
* Severity} level.
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>severity</CODE> is null.
*/
public Set<PrinterStateReason> printerStateReasonSet(Severity severity) {
if (severity == null) {
throw new NullPointerException("severity is null");
}
return new PrinterStateReasonSet (severity, entrySet());
}
private class PrinterStateReasonSet
extends AbstractSet<PrinterStateReason>
{
private Severity mySeverity;
private Set myEntrySet;
public PrinterStateReasonSet(Severity severity, Set entrySet) {
mySeverity = severity;
myEntrySet = entrySet;
}
public int size() {
int result = 0;
Iterator iter = iterator();
while (iter.hasNext()) {
iter.next();
++ result;
}
return result;
}
public Iterator iterator() {
return new PrinterStateReasonSetIterator(mySeverity,
myEntrySet.iterator());
}
}
private class PrinterStateReasonSetIterator implements Iterator {
private Severity mySeverity;
private Iterator myIterator;
private Map.Entry myEntry;
public PrinterStateReasonSetIterator(Severity severity,
Iterator iterator) {
mySeverity = severity;
myIterator = iterator;
goToNext();
}
private void goToNext() {
myEntry = null;
while (myEntry == null && myIterator.hasNext()) {
myEntry = (Map.Entry) myIterator.next();
if ((Severity) myEntry.getValue() != mySeverity) {
myEntry = null;
}
}
}
public boolean hasNext() {
return myEntry != null;
}
public Object next() {
if (myEntry == null) {
throw new NoSuchElementException();
}
Object result = myEntry.getKey();
goToNext();
return result;
}
public void remove() {
throw new UnsupportedOperationException();
}
}
}

View File

@@ -0,0 +1,116 @@
/*
* Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.net.URI;
import java.util.Locale;
import javax.print.attribute.Attribute;
import javax.print.attribute.URISyntax;
import javax.print.attribute.PrintServiceAttribute;
/**
* Class PrinterURI is a printing attribute class, a URI, that specifies the
* globally unique name of a printer. If it has such a name, an administrator
* determines a printer's URI and sets this attribute to that name.
* <P>
* <B>IPP Compatibility:</B> This implements the
* IPP printer-uri attribute. The string form returned by
* <CODE>toString()</CODE> gives the IPP printer-uri value.
* The category name returned by <CODE>getName()</CODE>
* gives the IPP attribute name.
* <P>
*
* @author Robert Herriot
*/
public final class PrinterURI extends URISyntax
implements PrintServiceAttribute {
private static final long serialVersionUID = 7923912792485606497L;
/**
* Constructs a new PrinterURI attribute with the specified URI.
*
* @param uri URI of the printer
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>uri</CODE> is null.
*/
public PrinterURI(URI uri) {
super (uri);
}
/**
* Returns whether this printer name attribute is equivalent to the passed
* in object. To be equivalent, all of the following conditions must be
* true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class PrinterURI.
* <LI>
* This PrinterURI attribute's underlying URI and
* <CODE>object</CODE>'s underlying URI are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this PrinterURI
* attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals(object) && object instanceof PrinterURI);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class PrinterURI and any vendor-defined subclasses, the category is
* class PrinterURI itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return PrinterURI.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class PrinterURI and any vendor-defined subclasses, the category
* name is <CODE>"printer-uri"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "printer-uri";
}
}

View File

@@ -0,0 +1,111 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.IntegerSyntax;
import javax.print.attribute.PrintServiceAttribute;
/**
* Class QueuedJobCount is an integer valued printing attribute that indicates
* the number of jobs in the printer whose {@link JobState JobState} is either
* PENDING, PENDING_HELD, PROCESSING, or PROCESSING_STOPPED.
* <P>
* <B>IPP Compatibility:</B> The integer value gives the IPP integer value.
* The category name returned by <CODE>getName()</CODE> gives the IPP
* attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class QueuedJobCount extends IntegerSyntax
implements PrintServiceAttribute {
private static final long serialVersionUID = 7499723077864047742L;
/**
* Construct a new queued job count attribute with the given integer
* value.
*
* @param value Integer value.
*
* @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>value</CODE> is less than 0.
*/
public QueuedJobCount(int value) {
super (value, 0, Integer.MAX_VALUE);
}
/**
* Returns whether this queued job count attribute is equivalent to the
* passed in object. To be equivalent, all of the following conditions
* mus be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class QueuedJobCount.
* <LI>
* This queued job count attribute's value and <CODE>object</CODE>'s
* value are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this queued job
* count attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals (object) &&
object instanceof QueuedJobCount);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class QueuedJobCount, the category is class QueuedJobCount itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return QueuedJobCount.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class QueuedJobCount, the
* category name is <CODE>"queued-job-count"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "queued-job-count";
}
}

View File

@@ -0,0 +1,183 @@
/*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.Attribute;
/**
* Class ReferenceUriSchemesSupported is a printing attribute class
* an enumeration, that indicates a "URI scheme," such as "http:" or "ftp:",
* that a printer can use to retrieve print data stored at a URI location.
* If a printer supports doc flavors with a print data representation class of
* <CODE>"java.net.URL"</CODE>, the printer uses instances of class
* ReferenceUriSchemesSupported to advertise the URI schemes it can accept.
* The acceptable URI schemes are included as service attributes in the
* lookup service; this lets clients search the
* for printers that can get print data using a certain URI scheme. The
* acceptable URI schemes can also be queried using the capability methods in
* interface <code>PrintService</code>. However,
* ReferenceUriSchemesSupported attributes are used solely for determining
* acceptable URI schemes, they are never included in a doc's,
* print request's, print job's, or print service's attribute set.
* <P>
* The Internet Assigned Numbers Authority maintains the
* <A HREF="http://www.iana.org/assignments/uri-schemes.html">official
* list of URI schemes</A>.
* <p>
* Class ReferenceUriSchemesSupported defines enumeration values for widely
* used URI schemes. A printer that supports additional URI schemes
* can define them in a subclass of class ReferenceUriSchemesSupported.
* <P>
* <B>IPP Compatibility:</B> The category name returned by
* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
* integer value is the IPP enum value. The <code>toString()</code> method
* returns the IPP string representation of the attribute value.
* <P>
*
* @author Alan Kaminsky
*/
public class ReferenceUriSchemesSupported
extends EnumSyntax implements Attribute {
private static final long serialVersionUID = -8989076942813442805L;
/**
* File Transfer Protocol (FTP).
*/
public static final ReferenceUriSchemesSupported FTP =
new ReferenceUriSchemesSupported(0);
/**
* HyperText Transfer Protocol (HTTP).
*/
public static final ReferenceUriSchemesSupported HTTP = new ReferenceUriSchemesSupported(1);
/**
* Secure HyperText Transfer Protocol (HTTPS).
*/
public static final ReferenceUriSchemesSupported HTTPS = new ReferenceUriSchemesSupported(2);
/**
* Gopher Protocol.
*/
public static final ReferenceUriSchemesSupported GOPHER = new ReferenceUriSchemesSupported(3);
/**
* USENET news.
*/
public static final ReferenceUriSchemesSupported NEWS = new ReferenceUriSchemesSupported(4);
/**
* USENET news using Network News Transfer Protocol (NNTP).
*/
public static final ReferenceUriSchemesSupported NNTP = new ReferenceUriSchemesSupported(5);
/**
* Wide Area Information Server (WAIS) protocol.
*/
public static final ReferenceUriSchemesSupported WAIS = new ReferenceUriSchemesSupported(6);
/**
* Host-specific file names.
*/
public static final ReferenceUriSchemesSupported FILE = new ReferenceUriSchemesSupported(7);
/**
* Construct a new reference URI scheme enumeration value with the given
* integer value.
*
* @param value Integer value.
*/
protected ReferenceUriSchemesSupported(int value) {
super (value);
}
private static final String[] myStringTable = {
"ftp",
"http",
"https",
"gopher",
"news",
"nntp",
"wais",
"file",
};
private static final ReferenceUriSchemesSupported[] myEnumValueTable = {
FTP,
HTTP,
HTTPS,
GOPHER,
NEWS,
NNTP,
WAIS,
FILE,
};
/**
* Returns the string table for class ReferenceUriSchemesSupported.
*/
protected String[] getStringTable() {
return myStringTable.clone();
}
/**
* Returns the enumeration value table for class
* ReferenceUriSchemesSupported.
*/
protected EnumSyntax[] getEnumValueTable() {
return (EnumSyntax[])myEnumValueTable.clone();
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class ReferenceUriSchemesSupported and any vendor-defined
* subclasses, the category is class ReferenceUriSchemesSupported itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return ReferenceUriSchemesSupported.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class ReferenceUriSchemesSupported and any vendor-defined
* subclasses, the category name is
* <CODE>"reference-uri-schemes-supported"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "reference-uri-schemes-supported";
}
}

View File

@@ -0,0 +1,130 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import java.util.Locale;
import javax.print.attribute.Attribute;
import javax.print.attribute.TextSyntax;
import javax.print.attribute.PrintRequestAttribute;
/**
* Class RequestingUserName is a printing attribute class, a text attribute,
* that specifies the name of the end user that submitted the print job. A
* requesting user name is an arbitrary string defined by the client. The
* printer does not put the client-specified RequestingUserName attribute into
* the Print Job's attribute set; rather, the printer puts in a {@link
* JobOriginatingUserName JobOriginatingUserName} attribute.
* This means that services which support specifying a username with this
* attribute should also report a JobOriginatingUserName in the job's
* attribute set. Note that many print services may have a way to independently
* authenticate the user name, and so may state support for a
* requesting user name, but in practice will then report the user name
* authenticated by the service rather than that specified via this
* attribute.
* <P>
* <B>IPP Compatibility:</B> The string value gives the IPP name value. The
* locale gives the IPP natural language. The category name returned by
* <CODE>getName()</CODE> gives the IPP attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class RequestingUserName extends TextSyntax
implements PrintRequestAttribute {
private static final long serialVersionUID = -2683049894310331454L;
/**
* Constructs a new requesting user name attribute with the given user
* name and locale.
*
* @param userName User name.
* @param locale Natural language of the text string. null
* is interpreted to mean the default locale as returned
* by <code>Locale.getDefault()</code>
*
* @exception NullPointerException
* (unchecked exception) Thrown if <CODE>userName</CODE> is null.
*/
public RequestingUserName(String userName, Locale locale) {
super (userName, locale);
}
/**
* Returns whether this requesting user name attribute is equivalent to
* the passed in object. To be equivalent, all of the following
* conditions must be true:
* <OL TYPE=1>
* <LI>
* <CODE>object</CODE> is not null.
* <LI>
* <CODE>object</CODE> is an instance of class RequestingUserName.
* <LI>
* This requesting user name attribute's underlying string and
* <CODE>object</CODE>'s underlying string are equal.
* <LI>
* This requesting user name attribute's locale and
* <CODE>object</CODE>'s locale are equal.
* </OL>
*
* @param object Object to compare to.
*
* @return True if <CODE>object</CODE> is equivalent to this requesting
* user name attribute, false otherwise.
*/
public boolean equals(Object object) {
return (super.equals(object) &&
object instanceof RequestingUserName);
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class RequestingUserName, the
* category is class RequestingUserName itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return RequestingUserName.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class RequestingUserName, the
* category name is <CODE>"requesting-user-name"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "requesting-user-name";
}
}

View File

@@ -0,0 +1,158 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.Attribute;
/**
* Class Severity is a printing attribute class, an enumeration, that denotes
* the severity of a {@link PrinterStateReason PrinterStateReason} attribute.
* <P>
* Instances of Severity do not appear in a Print Service's attribute set
* directly. Rather, a {@link PrinterStateReasons PrinterStateReasons}
* attribute appears in the Print Service's attribute set.
* The {@link PrinterStateReasons
* PrinterStateReasons} attribute contains zero, one, or more than one {@link
* PrinterStateReason PrinterStateReason} objects which pertain to the Print
* Service's status, and each {@link PrinterStateReason PrinterStateReason}
* object is associated with a Severity level of REPORT (least severe),
* WARNING, or ERROR (most severe).
* The printer adds a {@link PrinterStateReason
* PrinterStateReason} object to the Print Service's
* {@link PrinterStateReasons PrinterStateReasons} attribute when the
* corresponding condition becomes true
* of the printer, and the printer removes the {@link PrinterStateReason
* PrinterStateReason} object again when the corresponding condition becomes
* false, regardless of whether the Print Service's overall
* {@link PrinterState PrinterState} also changed.
* <P>
* <B>IPP Compatibility:</B>
* <code>Severity.toString()</code> returns either "error", "warning", or
* "report". The string values returned by
* each individual {@link PrinterStateReason} and
* associated {@link Severity} object's <CODE>toString()</CODE>
* methods, concatenated together with a hyphen (<CODE>"-"</CODE>) in
* between, gives the IPP keyword value for a {@link PrinterStateReasons}.
* The category name returned by <CODE>getName()</CODE> gives the IPP
* attribute name.
* <P>
*
* @author Alan Kaminsky
*/
public final class Severity extends EnumSyntax implements Attribute {
private static final long serialVersionUID = 8781881462717925380L;
/**
* Indicates that the {@link PrinterStateReason PrinterStateReason} is a
* "report" (least severe). An implementation may choose to omit some or
* all reports.
* Some reports specify finer granularity about the printer state;
* others serve as a precursor to a warning. A report must contain nothing
* that could affect the printed output.
*/
public static final Severity REPORT = new Severity (0);
/**
* Indicates that the {@link PrinterStateReason PrinterStateReason} is a
* "warning." An implementation may choose to omit some or all warnings.
* Warnings serve as a precursor to an error. A warning must contain
* nothing that prevents a job from completing, though in some cases the
* output may be of lower quality.
*/
public static final Severity WARNING = new Severity (1);
/**
* Indicates that the {@link PrinterStateReason PrinterStateReason} is an
* "error" (most severe). An implementation must include all errors.
* If this attribute contains one or more errors, the printer's
* {@link PrinterState PrinterState} must be STOPPED.
*/
public static final Severity ERROR = new Severity (2);
/**
* Construct a new severity enumeration value with the given integer
* value.
*
* @param value Integer value.
*/
protected Severity(int value) {
super (value);
}
private static final String[] myStringTable = {
"report",
"warning",
"error"
};
private static final Severity[] myEnumValueTable = {
REPORT,
WARNING,
ERROR
};
/**
* Returns the string table for class Severity.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
* Returns the enumeration value table for class Severity.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class Severity, the category is class Severity itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return Severity.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class Severit, the category name is <CODE>"severity"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "severity";
}
}

View File

@@ -0,0 +1,234 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class SheetCollate is a printing attribute class, an enumeration, that
* specifies whether or not the media sheets of each copy of each printed
* document in a job are to be in sequence, when multiple copies of the document
* are specified by the {@link Copies Copies} attribute. When SheetCollate is
* COLLATED, each copy of each document is printed with the print-stream sheets
* in sequence. When SheetCollate is UNCOLLATED, each print-stream sheet is
* printed a number of times equal to the value of the {@link Copies Copies}
* attribute in succession. For example, suppose a document produces two media
* sheets as output, {@link Copies Copies} is 6, and SheetCollate is UNCOLLATED;
* in this case six copies of the first media sheet are printed followed by
* six copies of the second media sheet.
* <P>
* Whether the effect of sheet collation is achieved by placing copies of a
* document in multiple output bins or in the same output bin with
* implementation defined document separation is implementation dependent.
* Also whether it is achieved by making multiple passes over the job or by
* using an output sorter is implementation dependent.
* <P>
* If a printer does not support the SheetCollate attribute (meaning the client
* cannot specify any particular sheet collation), the printer must behave as
* though SheetCollate were always set to COLLATED.
* <P>
* The SheetCollate attribute interacts with the {@link MultipleDocumentHandling
* MultipleDocumentHandling} attribute. The {@link MultipleDocumentHandling
* MultipleDocumentHandling} attribute describes the collation of entire
* documents, and the SheetCollate attribute describes the semantics of
* collating individual pages within a document.
* <P>
* The effect of a SheetCollate attribute on a multidoc print job (a job with
* multiple documents) depends on whether all the docs have the same sheet
* collation specified or whether different docs have different sheet
* collations specified, and on the (perhaps defaulted) value of the {@link
* MultipleDocumentHandling MultipleDocumentHandling} attribute.
* <UL>
* <LI>
* If all the docs have the same sheet collation specified, then the following
* combinations of SheetCollate and {@link MultipleDocumentHandling
* MultipleDocumentHandling} are permitted, and the printer reports an error
* when the job is submitted if any other combination is specified:
* <UL>
* <LI>
* SheetCollate = COLLATED, {@link MultipleDocumentHandling
* MultipleDocumentHandling} = SINGLE_DOCUMENT -- All the input docs will be
* combined into one output document. Multiple copies of the output document
* will be produced with pages in collated order, i.e. pages 1, 2, 3, . . .,
* 1, 2, 3, . . .
* <P>
* <LI>
* SheetCollate = COLLATED, {@link MultipleDocumentHandling
* MultipleDocumentHandling} = SINGLE_DOCUMENT_NEW_SHEET -- All the input docs
* will be combined into one output document, and the first impression of each
* input doc will always start on a new media sheet. Multiple copies of the
* output document will be produced with pages in collated order, i.e. pages
* 1, 2, 3, . . ., 1, 2, 3, . . .
* <P>
* <LI>
* SheetCollate = COLLATED, {@link MultipleDocumentHandling
* MultipleDocumentHandling} = SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each
* input doc will remain a separate output document. Multiple copies of each
* output document (call them A, B, . . .) will be produced with each document's
* pages in collated order, but the documents themselves in uncollated order,
* i.e. pages A1, A2, A3, . . ., A1, A2, A3, . . ., B1, B2, B3, . . ., B1, B2,
* B3, . . .
* <P>
* <LI>
* SheetCollate = COLLATED, {@link MultipleDocumentHandling
* MultipleDocumentHandling} = SEPARATE_DOCUMENTS_COLLATED_COPIES -- Each input
* doc will remain a separate output document. Multiple copies of each output
* document (call them A, B, . . .) will be produced with each document's pages
* in collated order, with the documents themselves also in collated order, i.e.
* pages A1, A2, A3, . . ., B1, B2, B3, . . ., A1, A2, A3, . . ., B1, B2, B3,
* . . .
* <P>
* <LI>
* SheetCollate = UNCOLLATED, {@link MultipleDocumentHandling
* MultipleDocumentHandling} = SINGLE_DOCUMENT -- All the input docs will be
* combined into one output document. Multiple copies of the output document
* will be produced with pages in uncollated order, i.e. pages 1, 1, . . .,
* 2, 2, . . ., 3, 3, . . .
* <P>
* <LI>
* SheetCollate = UNCOLLATED, {@link MultipleDocumentHandling
* MultipleDocumentHandling} = SINGLE_DOCUMENT_NEW_SHEET -- All the input docs
* will be combined into one output document, and the first impression of each
* input doc will always start on a new media sheet. Multiple copies of the
* output document will be produced with pages in uncollated order, i.e. pages
* 1, 1, . . ., 2, 2, . . ., 3, 3, . . .
* <P>
* <LI>
* SheetCollate = UNCOLLATED, {@link MultipleDocumentHandling
* MultipleDocumentHandling} = SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each
* input doc will remain a separate output document. Multiple copies of each
* output document (call them A, B, . . .) will be produced with each document's
* pages in uncollated order, with the documents themselves also in uncollated
* order, i.e. pages A1, A1, . . ., A2, A2, . . ., A3, A3, . . ., B1, B1, . . .,
* B2, B2, . . ., B3, B3, . . .
* </UL>
* <P>
* <LI>
* If different docs have different sheet collations specified, then only one
* value of {@link MultipleDocumentHandling MultipleDocumentHandling} is
* permitted, and the printer reports an error when the job is submitted if any
* other value is specified:
* <UL>
* <LI>
* {@link MultipleDocumentHandling MultipleDocumentHandling} =
* SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each input doc will remain a separate
* output document. Multiple copies of each output document (call them A, B,
* . . .) will be produced with each document's pages in collated or uncollated
* order as the corresponding input doc's SheetCollate attribute specifies, and
* with the documents themselves in uncollated order. If document A had
* SheetCollate = UNCOLLATED and document B had SheetCollate = COLLATED, the
* following pages would be produced: A1, A1, . . ., A2, A2, . . ., A3, A3,
* . . ., B1, B2, B3, . . ., B1, B2, B3, . . .
* </UL>
* </UL>
* <P>
* <B>IPP Compatibility:</B> SheetCollate is not an IPP attribute at present.
* <P>
*
* @see MultipleDocumentHandling
*
* @author Alan Kaminsky
*/
public final class SheetCollate extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = 7080587914259873003L;
/**
* Sheets within a document appear in uncollated order when multiple
* copies are printed.
*/
public static final SheetCollate UNCOLLATED = new SheetCollate(0);
/**
* Sheets within a document appear in collated order when multiple copies
* are printed.
*/
public static final SheetCollate COLLATED = new SheetCollate(1);
/**
* Construct a new sheet collate enumeration value with the given integer
* value.
*
* @param value Integer value.
*/
protected SheetCollate(int value) {
super (value);
}
private static final String[] myStringTable = {
"uncollated",
"collated"
};
private static final SheetCollate[] myEnumValueTable = {
UNCOLLATED,
COLLATED
};
/**
* Returns the string table for class SheetCollate.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
* Returns the enumeration value table for class SheetCollate.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class SheetCollate, the category is class SheetCollate itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return SheetCollate.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class SheetCollate, the category name is <CODE>"sheet-collate"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "sheet-collate";
}
}

View File

@@ -0,0 +1,222 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
import javax.print.attribute.DocAttribute;
import javax.print.attribute.PrintRequestAttribute;
import javax.print.attribute.PrintJobAttribute;
/**
* Class Sides is a printing attribute class, an enumeration, that specifies
* how print-stream pages are to be imposed upon the sides of an instance of a
* selected medium, i.e., an impression.
* <P>
* The effect of a Sides attribute on a multidoc print job (a job with multiple
* documents) depends on whether all the docs have the same sides values
* specified or whether different docs have different sides values specified,
* and on the (perhaps defaulted) value of the {@link MultipleDocumentHandling
* MultipleDocumentHandling} attribute.
* <UL>
* <LI>
* If all the docs have the same sides value <I>n</I> specified, then any value
* of {@link MultipleDocumentHandling MultipleDocumentHandling} makes sense,
* and the printer's processing depends on the {@link MultipleDocumentHandling
* MultipleDocumentHandling} value:
* <UL>
* <LI>
* SINGLE_DOCUMENT -- All the input docs will be combined together into one
* output document. Each media sheet will consist of <I>n</I> impressions from
* the output document.
* <P>
* <LI>
* SINGLE_DOCUMENT_NEW_SHEET -- All the input docs will be combined together
* into one output document. Each media sheet will consist of <I>n</I>
* impressions from the output document. However, the first impression of each
* input doc will always start on a new media sheet; this means the last media
* sheet of an input doc may have only one impression on it.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The input docs will remain separate.
* Each media sheet will consist of <I>n</I> impressions from the input doc.
* Since the input docs are separate, the first impression of each input doc
* will always start on a new media sheet; this means the last media sheet of
* an input doc may have only one impression on it.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_COLLATED_COPIES -- The input docs will remain separate.
* Each media sheet will consist of <I>n</I> impressions from the input doc.
* Since the input docs are separate, the first impression of each input doc
* will always start on a new media sheet; this means the last media sheet of
* an input doc may have only one impression on it.
* </UL>
* <P>
* <UL>
* <LI>
* SINGLE_DOCUMENT -- All the input docs will be combined together into one
* output document. Each media sheet will consist of <I>n<SUB>i</SUB></I>
* impressions from the output document, where <I>i</I> is the number of the
* input doc corresponding to that point in the output document. When the next
* input doc has a different sides value from the previous input doc, the first
* print-stream page of the next input doc goes at the start of the next media
* sheet, possibly leaving only one impression on the previous media sheet.
* <P>
* <LI>
* SINGLE_DOCUMENT_NEW_SHEET -- All the input docs will be combined together
* into one output document. Each media sheet will consist of <I>n</I>
* impressions from the output document. However, the first impression of each
* input doc will always start on a new media sheet; this means the last
* impression of an input doc may have only one impression on it.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- The input docs will remain separate.
* For input doc <I>i,</I> each media sheet will consist of <I>n<SUB>i</SUB></I>
* impressions from the input doc. Since the input docs are separate, the first
* impression of each input doc will always start on a new media sheet; this
* means the last media sheet of an input doc may have only one impression on
* it.
* <P>
* <LI>
* SEPARATE_DOCUMENTS_COLLATED_COPIES -- The input docs will remain separate.
* For input doc <I>i,</I> each media sheet will consist of <I>n<SUB>i</SUB></I>
* impressions from the input doc. Since the input docs are separate, the first
* impression of each input doc will always start on a new media sheet; this
* means the last media sheet of an input doc may have only one impression on
* it.
* </UL>
* </UL>
* <P>
* <B>IPP Compatibility:</B> The category name returned by
* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
* integer value is the IPP enum value. The <code>toString()</code> method
* returns the IPP string representation of the attribute value.
* <P>
*
* @author Alan Kaminsky
*/
public final class Sides extends EnumSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
private static final long serialVersionUID = -6890309414893262822L;
/**
* Imposes each consecutive print-stream page upon the same side of
* consecutive media sheets.
*/
public static final Sides ONE_SIDED = new Sides(0);
/**
* Imposes each consecutive pair of print-stream pages upon front and back
* sides of consecutive media sheets, such that the orientation of each
* pair of print-stream pages on the medium would be correct for the
* reader as if for binding on the long edge. This imposition is also
* known as "duplex" (see {@link #DUPLEX DUPLEX}).
*/
public static final Sides TWO_SIDED_LONG_EDGE = new Sides(1);
/**
* Imposes each consecutive pair of print-stream pages upon front and back
* sides of consecutive media sheets, such that the orientation of each
* pair of print-stream pages on the medium would be correct for the
* reader as if for binding on the short edge. This imposition is also
* known as "tumble" (see {@link #TUMBLE TUMBLE}).
*/
public static final Sides TWO_SIDED_SHORT_EDGE = new Sides(2);
/**
* An alias for "two sided long edge" (see {@link #TWO_SIDED_LONG_EDGE
* TWO_SIDED_LONG_EDGE}).
*/
public static final Sides DUPLEX = TWO_SIDED_LONG_EDGE;
/**
* An alias for "two sided short edge" (see {@link #TWO_SIDED_SHORT_EDGE
* TWO_SIDED_SHORT_EDGE}).
*/
public static final Sides TUMBLE = TWO_SIDED_SHORT_EDGE;
/**
* Construct a new sides enumeration value with the given integer value.
*
* @param value Integer value.
*/
protected Sides(int value) {
super (value);
}
private static final String[] myStringTable = {
"one-sided",
"two-sided-long-edge",
"two-sided-short-edge"
};
private static final Sides[] myEnumValueTable = {
ONE_SIDED,
TWO_SIDED_LONG_EDGE,
TWO_SIDED_SHORT_EDGE
};
/**
* Returns the string table for class Sides.
*/
protected String[] getStringTable() {
return myStringTable;
}
/**
* Returns the enumeration value table for class Sides.
*/
protected EnumSyntax[] getEnumValueTable() {
return myEnumValueTable;
}
/**
* Get the printing attribute class which is to be used as the "category"
* for this printing attribute value.
* <P>
* For class Sides, the category is class Sides itself.
*
* @return Printing attribute class (category), an instance of class
* {@link java.lang.Class java.lang.Class}.
*/
public final Class<? extends Attribute> getCategory() {
return Sides.class;
}
/**
* Get the name of the category of which this attribute value is an
* instance.
* <P>
* For class Sides, the category name is <CODE>"sides"</CODE>.
*
* @return Attribute category name.
*/
public final String getName() {
return "sides";
}
}