classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: Patch for EnumSyntax attributes in the print api


From: Wolfgang Baer
Subject: [cp-patches] FYI: Patch for EnumSyntax attributes in the print api
Date: Thu, 15 Dec 2005 22:17:27 +0100
User-agent: Debian Thunderbird 1.0.7 (X11/20051017)

Hi all,

I am commiting the patch of the first half of classes extending javax.print.attribute.EnumSyntax which are needing some methods to be overriden. There are also several fixes found during work on the internals.

The other patch completing the EnumSyntax derived attribute types follows
this weekend.

Regards,
Wolfgang

2005-12-15  Wolfgang Baer  <address@hidden>

        * javax/print/attribute/standard/PDLOverrideSupported.java:
        Added and updated javadocs to class and methods.
        (getStringTable): New overridden method.
        (getEnumValueTable): New overridden method.
        (stringTable): New field.
        (enumValueTable): New field.
        (ATTEMPTED): Fixed value of enum.
        * javax/print/attribute/standard/PrinterIsAcceptingJobs.java,
        * javax/print/attribute/standard/Severity.java,
        * javax/print/attribute/standard/MultipleDocumentHandling.java:
        Added and updated javadocs to class and methods.
        (getStringTable): New overridden method.
        (getEnumValueTable): New overridden method.
        (stringTable): New field.
        (enumValueTable): New field.            
        * javax/print/attribute/standard/Fidelity.java:
        Added and updated javadocs to class and methods.
        (getStringTable): New overridden method.
        (getEnumValueTable): New overridden method.
        (stringTable): New field.
        (enumValueTable): New field.    
        (getName): Use correct ipp attribute name.      
        * javax/print/attribute/standard/OrientationRequested.java:
        Added and updated javadocs to class and methods.
        (getStringTable): New overridden method.
        (getEnumValueTable): New overridden method.
        (getOffset): New overridden method.
        (stringTable): New field.
        (enumValueTable): New field.
        * javax/print/attribute/standard/PrintQuality.java:
        Added and updated javadocs to class and methods.
        (getStringTable): New overridden method.
        (getEnumValueTable): New overridden method.
        (getOffset): New overridden method.
        (stringTable): New field.
        (enumValueTable): New field.
        (DRAFT): Fixed value of enum.
        (NORMAL): Likewise.
        (HIGH): Likewise.
        * javax/print/attribute/standard/Finishings.java:
        Added and updated javadocs to class and methods.
        (getStringTable): New overridden method.
        (getEnumValueTable): New overridden method.
        (getOffset): New overridden method.
        (stringTable): New field.
        (enumValueTable): New field.
        (NONE): Fixed value of enum.    
        (STAPLE): Likewise.
        (COVER): Likewise.
        (BIND): Likewise.
        (SADDLE_STITCH): Likewise.
        (EDGE_STITCH): Likewise.
        (STAPLE_TOP_LEFT): Likewise.
        (STAPLE_BOTTOM_LEFT): Likewise.
        (STAPLE_TOP_RIGHT): Likewise.
        (STAPLE_BOTTOM_RIGHT): Likewise.
        (EDGE_STITCH_LEFT): Likewise.
        (EDGE_STITCH_TOP): Likewise.
        (EDGE_STITCH_RIGHT): Likewise.
        (EDGE_STITCH_BOTTOM): Likewise.
        (STAPLE_DUAL_LEFT): Likewise.
        (STAPLE_DUAL_TOP): Likewise.
        (STAPLE_DUAL_RIGHT): Likewise.
        (STAPLE_DUAL_BOTTOM): Likewise.
        * javax/print/attribute/standard/Sides.java:
        Added and updated javadocs to class and methods.
        (getStringTable): New overridden method.
        (getEnumValueTable): New overridden method.
        (stringTable): New field.
        (enumValueTable): New field.
        (DUPLEX): Fixed value of enum.
        (TUMBLE): Likewise.     

Index: javax/print/attribute/standard/PDLOverrideSupported.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/print/attribute/standard/PDLOverrideSupported.java,v
retrieving revision 1.4
diff -u -r1.4 PDLOverrideSupported.java
--- javax/print/attribute/standard/PDLOverrideSupported.java    2 Jul 2005 
20:32:46 -0000       1.4
+++ javax/print/attribute/standard/PDLOverrideSupported.java    15 Dec 2005 
21:02:17 -0000
@@ -1,5 +1,5 @@
 /* PDLOverrideSupported.java --
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -42,20 +42,44 @@
 
 
 /**
+ * The <code>PDLOverrideSupported</code> printing attribute specifies
+ * if a print services is capable of attempting to override document data
+ * instructions with IPP attributesc.
+ * <p>
+ * <b>IPP Compatibility:</b> PDLOverrideSupported is an IPP 1.1 attribute.
+ * </p>
+ * 
  * @author Michael Koch (address@hidden)
+ * @author Wolfgang Baer (address@hidden)
  */
 public class PDLOverrideSupported extends EnumSyntax
   implements PrintServiceAttribute
 {
   private static final long serialVersionUID = -4393264467928463934L;
 
+  /**
+   * Indicates that the print service is not capable of
+   * attempting to override document data instructions.
+   */
   public static final PDLOverrideSupported NOT_ATTEMPTED =
     new PDLOverrideSupported(0);
+  
+  /**
+   * Indicates that the print service is capable of
+   * attempting to override document data instructions.
+   */
   public static final PDLOverrideSupported ATTEMPTED =
-    new PDLOverrideSupported(0);
+    new PDLOverrideSupported(1);
+  
+  private static final String[] stringTable = { "not-attempted", "attempted" };
+  
+  private static final PDLOverrideSupported[] enumValueTable = { NOT_ATTEMPTED,
+                                                                 ATTEMPTED};
 
   /**
    * Constructs a <code>PDLOverrideSupported</code> object.
+   * 
+   * @param value the enum value
    */
   protected PDLOverrideSupported(int value)
   {
@@ -65,7 +89,7 @@
   /**
    * Returns category of this class.
    *
-   * @return the class <code>PDLOverrideSupported</code> itself
+   * @return The class  <code>PDLOverrideSupported</code> itself.
    */
   public Class getCategory()
   {
@@ -75,10 +99,31 @@
   /**
    * Returns the name of this attribute.
    *
-   * @return the name
+   * @return The name "pdl-override-supported".
    */
   public String getName()
   {
     return "pdl-override-supported";
   }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
 }
Index: javax/print/attribute/standard/PrinterIsAcceptingJobs.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/print/attribute/standard/PrinterIsAcceptingJobs.java,v
retrieving revision 1.4
diff -u -r1.4 PrinterIsAcceptingJobs.java
--- javax/print/attribute/standard/PrinterIsAcceptingJobs.java  2 Jul 2005 
20:32:46 -0000       1.4
+++ javax/print/attribute/standard/PrinterIsAcceptingJobs.java  15 Dec 2005 
21:02:17 -0000
@@ -1,5 +1,5 @@
 /* PrinterIsAcceptingJobs.java --
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -42,20 +42,46 @@
 
 
 /**
+ * The <code>PrinterIsAcceptingJobs</code> printing attribute signals 
+ * if a print services is currently accepting jobs.
+ * <p>
+ * <b>IPP Compatibility:</b> PrinterIsAcceptingJobs is an IPP 1.1 attribute.
+ * The IPP specification treats PrinterIsAcceptingJobs as boolean type which 
+ * is not available in the Java Print Service API. The IPP boolean value 
"true" 
+ * corresponds to <code>ACCEPTING_JOBS</code> and "false" 
+ * to <code>NOT_ACCEPTING_JOBS</code>.
+ * </p>
+ * 
  * @author Michael Koch (address@hidden)
+ * @author Wolfgang Baer (address@hidden)
  */
 public class PrinterIsAcceptingJobs extends EnumSyntax
   implements PrintServiceAttribute
 {
   private static final long serialVersionUID = -5052010680537678061L;
 
+  /**
+   * The printer is not accepting jobs currently.
+   */
   public static final PrinterIsAcceptingJobs NOT_ACCEPTING_JOBS =
     new PrinterIsAcceptingJobs(0);
+  
+  /**
+   * The printer is accepting jobs.
+   */
   public static final PrinterIsAcceptingJobs ACCEPTING_JOBS =
     new PrinterIsAcceptingJobs(1);
 
+  private static final String[] stringTable = { "not-accepting-jobs", 
+                                                "accepting-jobs" };
+  
+  private static final PrinterIsAcceptingJobs[] enumValueTable = 
+    { NOT_ACCEPTING_JOBS, ACCEPTING_JOBS };
+  
   /**
    * Constructs a <code>PrinterIsAcceptingJobs</code> object.
+   * 
+   * @param value the enum value.
    */
   protected PrinterIsAcceptingJobs(int value)
   {
@@ -65,7 +91,7 @@
   /**
    * Returns category of this class.
    *
-   * @return the class <code>PrinterIsAcceptingJobs</code> itself
+   * @return The class <code>PrinterIsAcceptingJobs</code> itself.
    */
   public Class getCategory()
   {
@@ -75,10 +101,31 @@
   /**
    * Returns the name of this attribute.
    *
-   * @return the name
+   * @return The name "printer-is-accepting-jobs".
    */
   public String getName()
   {
     return "printer-is-accepting-jobs";
   }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
 }
Index: javax/print/attribute/standard/Severity.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/print/attribute/standard/Severity.java,v
retrieving revision 1.3
diff -u -r1.3 Severity.java
--- javax/print/attribute/standard/Severity.java        2 Jul 2005 20:32:46 
-0000       1.3
+++ javax/print/attribute/standard/Severity.java        15 Dec 2005 21:02:17 
-0000
@@ -1,5 +1,5 @@
 /* Severity.java --
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -42,19 +42,50 @@
 
 
 /**
+ * The <code>Severity</code> printing attribute specifies the severity
+ * for a <code>PrinterStateReason</code> attribute.
+ * <p>
+ * This attribute does not appear in the attribute set of a print service 
+ * itself. Its used inside the <code>PrinterStateReasons</code> 
+ * attribute which contains <code>PrinterStateReason</code> objects which 
+ * informs about the print service's status.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> Severity is not an IPP attribute on its own
+ * but used in the PrinterStateReason attribute to indicate the severity.
+ * </p>
+ * 
  * @author Michael Koch (address@hidden)
+ * @author Wolfgang Baer (address@hidden)
  */
 public final class Severity extends EnumSyntax
   implements Attribute
 {
   private static final long serialVersionUID = 8781881462717925380L;
 
+  /**
+   * Indicates that the reason is a report.
+   */
   public static final Severity REPORT = new Severity(0);
+  
+  /**
+   * Indicates that the reason is a warning.
+   */
   public static final Severity WARNING = new Severity(1);
+  
+  /**
+   * Indicates that the reason is an error.
+   */
   public static final Severity ERROR = new Severity(2);
 
+  private static final String[] stringTable = { "report", "warning", "error" };
+  
+  private static final Severity[] enumValueTable = { REPORT, WARNING, ERROR };
+  
   /**
    * Constructs a <code>Severity</code> object.
+   *
+   * @param value the enum value.
    */
   protected Severity(int value)
   {
@@ -64,7 +95,7 @@
   /**
    * Returns category of this class.
    *
-   * @return the class <code>Severity</code> itself
+   * @return The class <code>Severity</code> itself.
    */
   public Class getCategory()
   {
@@ -72,12 +103,33 @@
   }
 
   /**
-   * Returns name of this class.
+   * Returns the name of this attribute.
    *
-   * @return the string "severity"
+   * @return The name "severity".
    */
   public String getName()
   {
     return "severity";
   }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
 }
Index: javax/print/attribute/standard/MultipleDocumentHandling.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/print/attribute/standard/MultipleDocumentHandling.java,v
retrieving revision 1.5
diff -u -r1.5 MultipleDocumentHandling.java
--- javax/print/attribute/standard/MultipleDocumentHandling.java        2 Jul 
2005 20:32:46 -0000       1.5
+++ javax/print/attribute/standard/MultipleDocumentHandling.java        15 Dec 
2005 21:02:17 -0000
@@ -43,24 +43,60 @@
 
 
 /**
+ * The <code>MultipleDocumentHandling</code> printing attribute controls
+ * how certain printing attributes affect printing in case of multiple 
+ * documents in a print job. This attribute is only relevant if a job 
+ * has multiple documents.
+ * <p>
+ * <b>IPP Compatibility:</b> MultipleDocumentHandling is an IPP 1.1 attribute.
+ * </p>
+ * 
  * @author Michael Koch (address@hidden)
+ * @author Wolfgang Baer (address@hidden)
  */
 public class MultipleDocumentHandling extends EnumSyntax
   implements PrintJobAttribute, PrintRequestAttribute
 {
   private static final long serialVersionUID = 8098326460746413466L;
 
+  /** 
+   * Multiple documents are treated as a single document.
+   */
   public static final MultipleDocumentHandling SINGLE_DOCUMENT =
     new MultipleDocumentHandling(0);
+  
+  /** 
+   * Multiple documents are treated as uncollated copies.
+   */
   public static final MultipleDocumentHandling 
SEPARATE_DOCUMENTS_UNCOLLATED_COPIES =
     new MultipleDocumentHandling(1);
+  
+  /** 
+   * Multiple documents are treated as collated copies. 
+   */
   public static final MultipleDocumentHandling 
SEPARATE_DOCUMENTS_COLLATED_COPIES =
     new MultipleDocumentHandling(2);
+  
+  /** 
+   * Multiple documents are treated so that every single document starts
+   * with a new sheet. 
+   */
   public static final MultipleDocumentHandling SINGLE_DOCUMENT_NEW_SHEET =
     new MultipleDocumentHandling(3);
+  
+  private static final String[] stringTable = { "single-document", 
+                                                
"separate-documents-uncollated-copies",
+                                                
"separate-documents-collated-copies",
+                                                "single-document-new-sheet" };
+  
+  private static final MultipleDocumentHandling[] enumValueTable = 
+    { SINGLE_DOCUMENT, SEPARATE_DOCUMENTS_UNCOLLATED_COPIES,
+      SEPARATE_DOCUMENTS_COLLATED_COPIES, SINGLE_DOCUMENT_NEW_SHEET};
 
   /**
    * Constructs a <code>MultipleDocumentHandling</code> object.
+   * 
+   * @param value the enum value
    */
   protected MultipleDocumentHandling(int value)
   {
@@ -70,7 +106,7 @@
   /**
    * Returns category of this class.
    *
-   * @return the class <code>MultipleDocumentHandling</code> itself
+   * @return The class <code>MultipleDocumentHandling</code> itself.
    */
   public Class getCategory()
   {
@@ -80,10 +116,31 @@
   /**
    * Returns the name of this attribute.
    *
-   * @return the name
+   * @return The name "multiple-document-handling".
    */
   public String getName()
   {
     return "multiple-document-handling";
   }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
 }
Index: javax/print/attribute/standard/Fidelity.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/print/attribute/standard/Fidelity.java,v
retrieving revision 1.4
diff -u -r1.4 Fidelity.java
--- javax/print/attribute/standard/Fidelity.java        2 Jul 2005 20:32:46 
-0000       1.4
+++ javax/print/attribute/standard/Fidelity.java        15 Dec 2005 21:02:17 
-0000
@@ -1,5 +1,5 @@
 /* Fidelity.java --
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -33,7 +33,8 @@
 or based on this library.  If you modify this library, you may extend
 this exception to your version of the library, but you are not
 obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
+exception statement from your version.  */
+
 
 package javax.print.attribute.standard;
 
@@ -43,15 +44,53 @@
 
 
 /**
+ * The <code>Fidelity</code> attribute specifies how a print job is handled
+ * if the supplied attributes are not fully supported.
+ * <p>
+ * There may be conflicts between the client requested attributes and the
+ * attributes supported by the printer object. Such situations are controlled
+ * through the client by providing this attribute to indicate the wanted
+ * conflict handling mechanism:
+ * <ul>
+ * <li>address@hidden #FIDELITY_TRUE}: Reject the job since the job can not be 
+ * processed exactly as specified by the attributes of the client.</li>
+ * <li>address@hidden #FIDELITY_FALSE}: The Printer may make any changes 
necessary 
+ * to proceed with processing the Job as good as possible.</li>
+ * </ul>
+ * </p> 
+ * <p>
+ * <b>IPP Compatibility:</b> Fidelity is an IPP 1.1 attribute. The IPP name
+ * is "ipp-attribute-fidelity". The IPP specification treats Fidelity as a 
+ * boolean type which is not available in the Java Print Service API. The IPP
+ * boolean value "true" corresponds to <code>FIDELITY_TRUE</code> and "false" 
+ * to <code>FIDELITY_FALSE</code>.
+ * </p>
+ * 
  * @author Michael Koch (address@hidden)
+ * @author Wolfgang Baer (address@hidden)
  */
 public final class Fidelity extends EnumSyntax
   implements PrintJobAttribute, PrintRequestAttribute
 {
   private static final long serialVersionUID = 6320827847329172308L;
 
+  /** 
+   * Requests that the job is printed exactly as specified, 
+   * or rejected otherwise.
+   */
   public static final Fidelity FIDELITY_TRUE = new Fidelity(0);
+  
+  /** 
+   * Requests that the job is printed as exactly as reasonable. This means
+   * that the print service may choose to substitute the default value 
+   * associated with that attribute, or use some other supported value that 
+   * is similar to the unsupported requested value. 
+   */
   public static final Fidelity FIDELITY_FALSE = new Fidelity(1);
+  
+  private static final String[] stringTable = { "true", "false" };
+  private static final Fidelity[] enumValueTable = { FIDELITY_TRUE,
+                                                     FIDELITY_FALSE };
 
   /**
    * Constructs a <code>Fidelity</code> object.
@@ -66,7 +105,7 @@
   /**
    * Returns category of this class.
    *
-   * @return the class <code>Fidelity</code> itself
+   * @return The class <code>Fidelity</code> itself.
    */
   public Class getCategory()
   {
@@ -76,10 +115,31 @@
   /**
    * Returns the name of this attribute.
    *
-   * @return the name
+   * @return The name "ipp-attribute-fidelity".
    */
   public String getName()
   {
-    return "fidelity";
+    return "ipp-attribute-fidelity";
+  }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
   }
 }
Index: javax/print/attribute/standard/OrientationRequested.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/print/attribute/standard/OrientationRequested.java,v
retrieving revision 1.4
diff -u -r1.4 OrientationRequested.java
--- javax/print/attribute/standard/OrientationRequested.java    2 Jul 2005 
20:32:46 -0000       1.4
+++ javax/print/attribute/standard/OrientationRequested.java    15 Dec 2005 
21:02:18 -0000
@@ -1,5 +1,5 @@
 /* OrientationRequested.java --
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -44,25 +44,64 @@
 
 
 /**
+ * The <code>OrientationRequested</code> printing attribute specifies
+ * the desired orientation of the print data on the media sheet.
+ * <p>
+ * The effect of this attribute may depend on the document format as
+ * some document formats (e.g. postscript) contains the orientation
+ * inside the print data. However for other formats like e.g. plain
+ * text this attribute will have an effect on the orientation.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> OrientationRequested is an IPP 1.1 attribute.
+ * </p>
+ * 
  * @author Michael Koch (address@hidden)
+ * @author Wolfgang Baer (address@hidden)
  */
 public final class OrientationRequested extends EnumSyntax
   implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
 {
   private static final long serialVersionUID = -4447437289862822276L;
 
+  /** 
+   * Orientation as portrait. 
+   */
   public static final OrientationRequested PORTRAIT =
-    new OrientationRequested(0);
+    new OrientationRequested(3);
+  
+  /** 
+   * Orientation as landscape. 
+   */
   public static final OrientationRequested LANDSCAPE =
-    new OrientationRequested(1);
+    new OrientationRequested(4);
+  
+  /** 
+   * Orientation as reversed landscape. 
+   */
   public static final OrientationRequested REVERSE_LANDSCAPE =
-    new OrientationRequested(2);
+    new OrientationRequested(5);
+  
+  /** 
+   * Orientation as reversed portrait. 
+   */
   public static final OrientationRequested REVERSE_PORTRAIT =
-    new OrientationRequested(3);
+    new OrientationRequested(6);
+  
 
-    /**
-     * Constructs a <code>OrientationRequested</code> object.
-     */
+  private static final String[] stringTable = { "portrait", "landscape",
+                                                "reverse-landscape",
+                                                "reverse-portrait" };
+  
+  private static final OrientationRequested[] 
+      enumValueTable = { PORTRAIT, LANDSCAPE, 
+                         REVERSE_LANDSCAPE, REVERSE_PORTRAIT };
+
+  /**
+   * Constructs a <code>OrientationRequested</code> object.
+   * 
+   * @param value the value
+   */
   protected OrientationRequested(int value)
   {
     super(value);
@@ -71,7 +110,7 @@
   /**
    * Returns category of this class.
    *
-   * @return the class <code>OrientationRequested</code> itself
+   * @return The class <code>OrientationRequested</code> itself.
    */
   public Class getCategory()
   {
@@ -81,10 +120,41 @@
   /**
    * Returns the name of this attribute.
    *
-   * @return the name
+   * @return The name "orientation-requested".
    */
   public String getName()
   {
     return "orientation-requested";
   }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+  
+  /**
+   * Returns the lowest used value by the enumerations of this class.
+   * .
+   * @return The lowest value used.
+   */
+  protected int getOffset()
+  {
+    return 3;
+  }  
 }
Index: javax/print/attribute/standard/PrintQuality.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/print/attribute/standard/PrintQuality.java,v
retrieving revision 1.4
diff -u -r1.4 PrintQuality.java
--- javax/print/attribute/standard/PrintQuality.java    2 Jul 2005 20:32:46 
-0000       1.4
+++ javax/print/attribute/standard/PrintQuality.java    15 Dec 2005 21:02:18 
-0000
@@ -1,5 +1,5 @@
 /* PrintQuality.java --
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -44,19 +44,43 @@
 
 
 /**
+ * The <code>PrintQuality</code> printing attribute specifies the
+ * print quality that should be used by the print services for a job.
+ * <p>
+ * <b>IPP Compatibility:</b> PrintQuality is an IPP 1.1 attribute.
+ * </p>
+ * 
  * @author Michael Koch (address@hidden)
+ * @author Wolfgang Baer (address@hidden)
  */
 public class PrintQuality extends EnumSyntax
   implements DocAttribute, PrintJobAttribute, PrintRequestAttribute
 {
   private static final long serialVersionUID = -3072341285225858365L;
 
-  public static final PrintQuality DRAFT = new PrintQuality(0);
-  public static final PrintQuality NORMAL = new PrintQuality(1);
-  public static final PrintQuality HIGH = new PrintQuality(2);
+  /** 
+   * Draft quality of the printer. 
+   */
+  public static final PrintQuality DRAFT = new PrintQuality(3);
+  
+  /** 
+   * Normal quality of the printer. 
+   */
+  public static final PrintQuality NORMAL = new PrintQuality(4);
+  
+  /** 
+   * High quality of the printer. 
+   */
+  public static final PrintQuality HIGH = new PrintQuality(5);
 
+  private static final String[] stringTable = { "draft", "normal", "high" };
+  
+  private static final PrintQuality[] enumValueTable = { DRAFT, NORMAL, HIGH };
+  
   /**
    * Constructs a <code>PrintQuality</code> object.
+   * 
+   * @param value the value of the enum
    */
   protected PrintQuality(int value)
   {
@@ -66,7 +90,7 @@
   /**
    * Returns category of this class.
    *
-   * @return the class <code>PrintQuality</code> itself
+   * @return The class <code>PrintQuality</code> itself.
    */
   public Class getCategory()
   {
@@ -74,12 +98,43 @@
   }
 
   /**
-   * Returns name of this class.
+   * Returns the name of this attribute.
    *
-   * @return the string "print-quality"
+   * @return The name "print-quality".
    */
   public String getName()
   {
     return "print-quality";
   }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }  
+
+  /**
+   * Returns the lowest used value by the enumerations of this class.
+   * .
+   * @return The lowest value used.
+   */
+  protected int getOffset()
+  {
+    return 3;
+  }
 }
Index: javax/print/attribute/standard/Finishings.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/print/attribute/standard/Finishings.java,v
retrieving revision 1.4
diff -u -r1.4 Finishings.java
--- javax/print/attribute/standard/Finishings.java      2 Jul 2005 20:32:46 
-0000       1.4
+++ javax/print/attribute/standard/Finishings.java      15 Dec 2005 21:02:18 
-0000
@@ -1,5 +1,5 @@
 /* Finishings.java --
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -33,7 +33,8 @@
 or based on this library.  If you modify this library, you may extend
 this exception to your version of the library, but you are not
 obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version. */
+exception statement from your version.  */
+
 
 package javax.print.attribute.standard;
 
@@ -44,32 +45,184 @@
 
 
 /**
+ * The <code>Finishings</code> attribute specifies the finishing operations
+ * that the Printer applies to every copy of each printed document in the Job.
+ * <p>
+ * Standard enum values are: <code>NONE</code>, <code>STAPLE</code>, 
+ * <code>COVER</code>, <code>BIND</code>, <code>SADDLE_STITCH</code>,
+ * <code>EDGE_STITCH</code>.
+ * <br><br>
+ * The following values are more specific: 
+ * <code>STAPLE_TOP_LEFT</code>, <code>STAPLE_BOTTOM_LEFT</code>, 
+ * <code>STAPLE_TOP_RIGHT</code>, <code>STAPLE_BOTTOM_RIGHT</code>, 
+ * <code>EDGE_STITCH_LEFT</code>, <code>EDGE_STITCH_TOP</code>, 
+ * <code>EDGE_STITCH_RIGHT</code>, <code>EDGE_STITCH_BOTTOM</code>, 
+ * <code>STAPLE_DUAL_LEFT</code>, <code>STAPLE_DUAL_TOP</code>, 
+ * <code>STAPLE_DUAL_RIGHT</code>, <code>STAPLE_DUAL_BOTTOM</code>.
+ * </p> 
+ * <p>
+ * <b>Note:</b> The effect of this attribute on jobs with multiple documents 
+ * is controlled by the job attribute 
+ * address@hidden javax.print.attribute.standard.MultipleDocumentHandling}.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> Finishings is an IPP 1.1 attribute. Differences 
+ * to the IPP specification are that in the Java Print Service API only one 
+ * enum value is supported (in IPP a set of enums). Further the enum 
+ * <code>punch</code> is not supported.
+ * </p>
+ * 
  * @author Michael Koch (address@hidden)
+ * @author Wolfgang Baer (address@hidden)
  */
 public class Finishings extends EnumSyntax
   implements DocAttribute, PrintJobAttribute, PrintRequestAttribute
 {
   private static final long serialVersionUID = -627840419548391754L;
 
-  public static final Finishings NONE = new Finishings(0);
-  public static final Finishings STAPLE = new Finishings(1);
-  public static final Finishings COVER = new Finishings(2);
-  public static final Finishings BIND = new Finishings(3);
-  public static final Finishings SADDLE_STITCH = new Finishings(4);
-  public static final Finishings EDGE_STITCH = new Finishings(5);
-  public static final Finishings STAPLE_TOP_LEFT = new Finishings(6);
-  public static final Finishings STAPLE_BOTTOM_LEFT = new Finishings(7);
-  public static final Finishings STAPLE_TOP_RIGHT = new Finishings(8);
-  public static final Finishings STAPLE_BOTTOM_RIGHT = new Finishings(9);
-  public static final Finishings EDGE_STITCH_LEFT = new Finishings(10);
-  public static final Finishings EDGE_STITCH_TOP = new Finishings(11);
-  public static final Finishings EDGE_STITCH_RIGHT = new Finishings(12);
-  public static final Finishings EDGE_STITCH_BOTTOM = new Finishings(13);
-  public static final Finishings STAPLE_DUAL_LEFT = new Finishings(14);
-  public static final Finishings STAPLE_DUAL_TOP = new Finishings(15);
-  public static final Finishings STAPLE_DUAL_RIGHT = new Finishings(16);
-  public static final Finishings STAPLE_DUAL_BOTTOM = new Finishings(17);
+  /** 
+   * Perform no finishings of the documents.
+   */
+  public static final Finishings NONE = new Finishings(3);
+  
+  /** 
+   * Selects binding of the documents with one or more staples.  
+   */
+  public static final Finishings STAPLE = new Finishings(4);
+  
+  /**
+   * Selects the use of a non-printed (or pre-printed) cover for 
+   * the document.
+   */
+  public static final Finishings COVER = new Finishings(6);
+  
+  /**
+   * Selects 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);
+  
+  /**
+   * Selects binding of the documents with one or more staples
+   * along the middle fold.  
+   */
+  public static final Finishings SADDLE_STITCH = new Finishings(8);
+  
+  /**
+   * Selects binding of the documents with one or more staples 
+   * along one edge. 
+   */
+  public static final Finishings EDGE_STITCH = new Finishings(9);
+  
+  /** 
+   * Selects binding of the documents with one or more staples 
+   * in the top left corner. 
+   */
+  public static final Finishings STAPLE_TOP_LEFT = new Finishings(20);
+  
+  /** 
+   * Selects binding of the documents with one or more staples in the bottom 
+   * left corner. 
+   */
+  public static final Finishings STAPLE_BOTTOM_LEFT = new Finishings(21);
+  
+  /**
+   * Selects binding of the documents with one or more staples in 
+   * the top right corner.
+   */
+  public static final Finishings STAPLE_TOP_RIGHT = new Finishings(22);
+  
+  /**
+   * Selects binding of the documents with one or more staples in 
+   * the bottom right corner.
+   */
+  public static final Finishings STAPLE_BOTTOM_RIGHT = new Finishings(23);
+  
+  /**
+   * Selects binding of the documents with one or more staples
+   * along the left edge.
+   */
+  public static final Finishings EDGE_STITCH_LEFT = new Finishings(24);
+  
+  /**
+   * Selects binding of the documents with one or more staples along 
+   * the top edge.
+   */
+  public static final Finishings EDGE_STITCH_TOP = new Finishings(25);
+  
+  /**
+   * Selects binding of the documents with one or more staples along 
+   * the right edge.
+   */
+  public static final Finishings EDGE_STITCH_RIGHT = new Finishings(26);
+  
+  /**
+   * Selects binding of the documents with one or more staples along
+   * the bottom edge. 
+   */
+  public static final Finishings EDGE_STITCH_BOTTOM = new Finishings(27);
+  
+  /**
+   * Selects binding of the documents with two staples along the 
+   * left edge assuming a portrait document.
+   */
+  public static final Finishings STAPLE_DUAL_LEFT = new Finishings(28);
+  
+  /**
+   * Selects binding of the documents with two staples along the 
+   * top edge assuming a portrait document.
+   */
+  public static final Finishings STAPLE_DUAL_TOP = new Finishings(29);
+  
+  /**
+   * Selects binding of the documents with two staples along the 
+   * right edge assuming a portrait document.
+   */
+  public static final Finishings STAPLE_DUAL_RIGHT = new Finishings(30);
+  
+  /**
+   * Selects binding of the documents with two staples along the 
+   * bottom edge assuming a portrait document.
+   */
+  public static final Finishings STAPLE_DUAL_BOTTOM = new Finishings(31);
 
+  private static final String[] stringTable = { "none", "staple", null, 
+                                                "cover", "bind", 
"saddle-stitch",
+                                                "edge-stitch", null, 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[] enumValueTable = { NONE, STAPLE, null, 
+                                                       COVER, BIND, 
+                                                       SADDLE_STITCH,
+                                                       EDGE_STITCH, null, 
+                                                       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 };
+  
   /**
    * Constructs a <code>Finishings</code> object.
    * 
@@ -93,10 +246,41 @@
   /**
    * Returns the name of this attribute.
    *
-   * @return the name
+   * @return The name "finishings".
    */
   public String getName()
   {
     return "finishings";
   }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
+
+  /**
+   * Returns the lowest used value by the enumerations of this class.
+   * .
+   * @return The lowest value used.
+   */
+  protected int getOffset()
+  {
+    return 3;
+  }  
 }
Index: javax/print/attribute/standard/Sides.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/print/attribute/standard/Sides.java,v
retrieving revision 1.3
diff -u -r1.3 Sides.java
--- javax/print/attribute/standard/Sides.java   2 Jul 2005 20:32:46 -0000       
1.3
+++ javax/print/attribute/standard/Sides.java   15 Dec 2005 21:02:18 -0000
@@ -1,5 +1,5 @@
 /* Sides.java --
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -44,19 +44,55 @@
 
 
 /**
+ * The <code>Sides</code> printing attribute specifies how consecutive
+ * printing pages are arranged on the media sheet. 
+ * <p>
+ * <b>IPP Compatibility:</b> Sides is an IPP 1.1 attribute.
+ * </p>
+ * 
  * @author Michael Koch (address@hidden)
+ * @author Wolfgang Baer (address@hidden)
  */
 public final class Sides extends EnumSyntax
   implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
 {
   private static final long serialVersionUID = -6890309414893262822L;
 
+  /** 
+   * Specifies that each page should be printed on one sheet. 
+   */
   public static final Sides ONE_SIDED = new Sides(0);
+  
+  /** 
+   * Specifies that two following pages should be printed on the 
+   * front and back of one sheet for binding on the long edge.
+   */
   public static final Sides TWO_SIDED_LONG_EDGE = new Sides(1);
+  
+  /** 
+   * Specifies that two following pages should be printed on the 
+   * front and back of one sheet for binding on the short edge.
+   */
   public static final Sides TWO_SIDED_SHORT_EDGE = new Sides(2);
-  public static final Sides DUPLEX = new Sides(3);
-  public static final Sides TUMBLE = new Sides(4);
+  
+  /** 
+   * An alias constant for "two sided long edge". 
+   */
+  public static final Sides DUPLEX = new Sides(1);
+  
+  /** 
+   * An alias constant for "two sided short edge". 
+   */
+  public static final Sides TUMBLE = new Sides(2);
 
+  private static final String[] stringTable = { "one-sided", 
+                                                "two-sided-long-edge",
+                                                "two-sided-short-edge" };
+  
+  private static final Sides[] enumValueTable = { ONE_SIDED, 
+                                                  TWO_SIDED_LONG_EDGE, 
+                                                  TWO_SIDED_SHORT_EDGE };  
+  
   /**
    * Creates a <code>Sides</code> object.
    *
@@ -70,7 +106,7 @@
   /**
    * Returns category of this class.
    *
-   * @return the class <code>Sides</code> itself
+   * @return The class <code>Sides</code> itself.
    */
   public Class getCategory()
   {
@@ -80,10 +116,31 @@
   /**
    * Returns the name of this attribute.
    *
-   * @return the name
+   * @return The name "sides".
    */
   public String getName()
   {
     return "sides";
   }
+  
+  /**
+   * Returns a table with the enumeration values represented as strings
+   * for this object.
+   *
+   * @return The enumeration values as strings.
+   */
+  protected String[] getStringTable()
+  {
+    return stringTable;
+  }
+
+  /**
+   * Returns a table with the enumeration values for this object.
+   *
+   * @return The enumeration values.
+   */
+  protected EnumSyntax[] getEnumValueTable()
+  {
+    return enumValueTable;
+  }
 }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]