src/share/classes/javax/print/attribute/standard/Media.java

Print this page


   1 /*
   2  * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  35  * medium on which to print.
  36  * <p>
  37  * Media may be specified in different ways.
  38  * <ul>
  39  * <li> it may be specified by paper source - eg paper tray
  40  * <li> it may be specified by a standard size - eg "A4"
  41  * <li> it may be specified by a name - eg "letterhead"
  42  * </ul>
  43  * Each of these corresponds to the IPP "media" attribute.
  44  * The current API does not support describing media by characteristics
  45  * (eg colour, opacity).
  46  * This may be supported in a later revision of the specification.
  47  * <p>
  48  * A Media object is constructed with a value which represents
  49  * one of the ways in which the Media attribute can be specified.
  50  * <p>
  51  * <B>IPP Compatibility:</B>  The category name returned by
  52  * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's
  53  * integer value is the IPP enum value.  The <code>toString()</code> method
  54  * returns the IPP string representation of the attribute value.
  55  * <P>
  56  *
  57  * @author Phil Race
  58  */
  59 public abstract class Media extends EnumSyntax
  60     implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
  61 
  62     private static final long serialVersionUID = -2823970704630722439L;
  63 
  64     /**
  65      * Constructs a new media attribute specified by name.
  66      *
  67      * @param value         a value
  68      */
  69     protected Media(int value) {
  70            super (value);
  71     }
  72 
  73     /**
  74      * Returns whether this media attribute is equivalent to the passed in
  75      * object. To be equivalent, all of the following conditions must be true:


   1 /*
   2  * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  35  * medium on which to print.
  36  * <p>
  37  * Media may be specified in different ways.
  38  * <ul>
  39  * <li> it may be specified by paper source - eg paper tray
  40  * <li> it may be specified by a standard size - eg "A4"
  41  * <li> it may be specified by a name - eg "letterhead"
  42  * </ul>
  43  * Each of these corresponds to the IPP "media" attribute.
  44  * The current API does not support describing media by characteristics
  45  * (eg colour, opacity).
  46  * This may be supported in a later revision of the specification.
  47  * <p>
  48  * A Media object is constructed with a value which represents
  49  * one of the ways in which the Media attribute can be specified.
  50  * <p>
  51  * <B>IPP Compatibility:</B>  The category name returned by
  52  * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's
  53  * integer value is the IPP enum value.  The <code>toString()</code> method
  54  * returns the IPP string representation of the attribute value.

  55  *
  56  * @author Phil Race
  57  */
  58 public abstract class Media extends EnumSyntax
  59     implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
  60 
  61     private static final long serialVersionUID = -2823970704630722439L;
  62 
  63     /**
  64      * Constructs a new media attribute specified by name.
  65      *
  66      * @param value         a value
  67      */
  68     protected Media(int value) {
  69            super (value);
  70     }
  71 
  72     /**
  73      * Returns whether this media attribute is equivalent to the passed in
  74      * object. To be equivalent, all of the following conditions must be true: