classpath-patches
[Top][All Lists]
Advanced

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

[cp-patches] FYI: Completing some classes in javax.print.attribute.stand


From: Wolfgang Baer
Subject: [cp-patches] FYI: Completing some classes in javax.print.attribute.standard
Date: Wed, 30 Nov 2005 19:33:12 +0100
User-agent: Debian Thunderbird 1.0.7 (X11/20051017)

Hi,

this patch completes the first classes in the big
javax.print.attribute.standard package which provides
printing attributes.

As these classes are subclasses of EnumSyntax some methods
have to be overridden to return static arrays used in
deserialization and the toString() method. See the
javadoc in EnumSyntax for futher clarifications.

2005-11-30  Wolfgang Baer  <address@hidden>

        * javax/print/attribute/standard/Compression.java:
        Added java docs to class and methods.
        (getStringTable): New overridden method.
        (getEnumValueTable): New overridden method.
        (stringTable): New field.
        (enumValueTable): New field.
        * javax/print/attribute/standard/ColorSupported.java:
        Added java docs to class and methods.
        (getStringTable): New overridden method.
        (getEnumValueTable): New overridden method.
        (stringTable): New field.
        (enumValueTable): New field.
        * javax/print/attribute/standard/Chromaticity.java:
        Added java docs to class and methods.
        (getStringTable): New overridden method.
        (getEnumValueTable): New overridden method.
        (stringTable): New field.
        (enumValueTable): New field.

Regards,
Wolfgang


Index: javax/print/attribute/standard/Chromaticity.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/print/attribute/standard/Chromaticity.java,v
retrieving revision 1.3
diff -u -r1.3 Chromaticity.java
--- javax/print/attribute/standard/Chromaticity.java    2 Jul 2005 20:32:46 
-0000       1.3
+++ javax/print/attribute/standard/Chromaticity.java    30 Nov 2005 18:22:30 
-0000
@@ -44,15 +44,40 @@
 import javax.print.attribute.PrintRequestAttribute;
 
 /**
+ * The <code>Chromaticity</code> printing attribute specifies if print data
+ * should be printed in monochrome or color.
+ * <p>
+ * The attribute interacts with the document to be printed. If the document
+ * to be printed is a monochrome document it will be printed monochrome 
+ * regardless of the value of this attribute category. However if it is a
+ * color document supplying the attribute value <code>MONOCHROME</code>
+ * will prepare the document to be printed in monochrome instead of color.
+ * </p>
+ * <p>
+ * This printing attribute has nothing to do with the capabilities of the
+ * printer device. To check if a specific printer service supports printing
+ * in color you have to use the attribute
+ * address@hidden javax.print.attribute.standard.ColorSupported}
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> Chromaticity is not an IPP 1.1 attribute.
+ * </p>
+ *  
  * @author Michael Koch (address@hidden)
  */
 public final class Chromaticity extends EnumSyntax
   implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
 {
   private static final long serialVersionUID = 4660543931355214012L;
-
+  
+  /** Specifies monochrome printing. */
   public static final Chromaticity MONOCHROME = new Chromaticity(0);
+  
+  /** Specifies color printing. */
   public static final Chromaticity COLOR = new Chromaticity(1);
+  
+  private static final String[] stringTable = { "monochrome", "color" };
+  private static final Chromaticity[] enumValueTable = { MONOCHROME, COLOR };
 
   /**
    * Creates a <code>Chromaticity</code> object.
@@ -67,7 +92,7 @@
   /**
    * Returns category of this class.
    *
-   * @return the class <code>Sides</code> itself
+   * @return The class <code>Chromaticity</code> itself.
    */
   public Class getCategory()
   {
@@ -77,10 +102,32 @@
   /**
    * Returns the name of this attribute.
    *
-   * @return the name
+   * @return The name "chromaticity".
    */
   public String getName()
   {
     return "chromaticity";
   }
+  
+  /**
+   * 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/ColorSupported.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/print/attribute/standard/ColorSupported.java,v
retrieving revision 1.4
diff -u -r1.4 ColorSupported.java
--- javax/print/attribute/standard/ColorSupported.java  2 Jul 2005 20:32:46 
-0000       1.4
+++ javax/print/attribute/standard/ColorSupported.java  30 Nov 2005 18:22:30 
-0000
@@ -1,5 +1,5 @@
 /* ColorSupported.java --
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -42,6 +42,20 @@
 
 
 /**
+ * The <code>ColorSupported</code> printing attribute specifies if a 
+ * printing device is capable of color printing.
+ * <p>
+ * This attributes just tells if a printer device supports color printing
+ * but does not specify how a specific print job is printed. Therefore the
+ * attribute address@hidden javax.print.attribute.standard.Chromaticity} 
exists.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> ColorSupported is an IPP 1.1 attribute. The IPP
+ * specification treats ColorSupported as a boolean type which is not available
+ * in the Java Print Service API. The IPP boolean value true corresponds
+ * to <code>SUPPORTED</code> and "false" to <code>NOT_SUPPORTED</code>.
+ * </p>
+ * 
  * @author Michael Koch (address@hidden)
  */
 public final class ColorSupported extends EnumSyntax
@@ -49,13 +63,20 @@
 {
   private static final long serialVersionUID = -2700555589688535545L;
 
+  /** The printer does not support printing in color. */
   public static final ColorSupported NOT_SUPPORTED = new ColorSupported(0);
+  
+  /** The printer supports printing in color. */
   public static final ColorSupported SUPPORTED = new ColorSupported(1);
 
+  private static final String[] stringTable = { "not-supported", "supported" };
+  private static final ColorSupported[] enumValueTable = { NOT_SUPPORTED,
+                                                          SUPPORTED };
+  
   /**
    * Constructs a <code>ColorSupported</code> object.
    * 
-   * @param value the value
+   * @param value the enum value
    */
   protected ColorSupported(int value)
   {
@@ -65,7 +86,7 @@
   /**
    * Returns category of this class.
    *
-   * @return the class <code>ColorSupported</code> itself
+   * @return The class <code>ColorSupported</code> itself.
    */
   public Class getCategory()
   {
@@ -75,10 +96,31 @@
   /**
    * Returns the name of this attribute.
    *
-   * @return the name
+   * @return The name "color-supported".
    */
   public String getName()
   {
     return "color-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/Compression.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/print/attribute/standard/Compression.java,v
retrieving revision 1.4
diff -u -r1.4 Compression.java
--- javax/print/attribute/standard/Compression.java     2 Jul 2005 20:32:46 
-0000       1.4
+++ javax/print/attribute/standard/Compression.java     30 Nov 2005 18:22:30 
-0000
@@ -1,5 +1,5 @@
 /* Compression.java --
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -42,6 +42,16 @@
 
 
 /**
+ * The <code>Compression</code> printing attribute specifies if and how the
+ * supplied print data is compressed.
+ * <p>
+ * If this attribute is ommitted from the attributes set of the print
+ * data it is assumed that no compression is done.
+ * </p>
+ * <p>
+ * <b>IPP Compatibility:</b> Compression is an IPP 1.1 attribute.
+ * </p>
+ * 
  * @author Michael Koch (address@hidden)
  */
 public class Compression extends EnumSyntax
@@ -49,15 +59,27 @@
 {
   private static final long serialVersionUID = -5716748913324997674L;
 
+  /** The print data is not compressed. */
   public static final Compression NONE = new Compression(0);
+  
+  /** The print data is ZIP compressed. */
   public static final Compression DEFLATE = new Compression(1);
+  
+  /** The print data is GNU Zip compressed. */
   public static final Compression GZIP = new Compression(2);
+  
+  /** The print data is UNIX compressed. */
   public static final Compression COMPRESS = new Compression(3);
+  
+  private static final String[] stringTable = { "none", "deflate", 
+                                                "gzip", "compress" };
+  private static final Compression[] enumValueTable = { NONE, DEFLATE, 
+                                                        GZIP, COMPRESS };
 
   /**
    * Constructs a <code>Compression</code> object.
    * 
-   * @param value that value
+   * @param value the enum value
    */
   protected Compression(int value)
   {
@@ -67,7 +89,7 @@
   /**
    * Returns category of this class.
    *
-   * @return the class <code>Compression</code> itself
+   * @return The class <code>Compression</code> itself.
    */
   public Class getCategory()
   {
@@ -77,10 +99,31 @@
   /**
    * Returns the name of this attribute.
    *
-   * @return the name
+   * @return The name "compression".
    */
   public String getName()
   {
     return "compression";
+  }
+  
+  /**
+   * 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]