J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2001 Sun Microsystems, Inc. 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. |
| 8 | * |
| 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 12 | * version 2 for more details (a copy is included in the LICENSE file that |
| 13 | * accompanied this code). |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License version |
| 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
| 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 18 | * |
| 19 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 20 | * CA 95054 USA or visit www.sun.com if you need additional information or |
| 21 | * have any questions. |
| 22 | */ |
| 23 | |
| 24 | import javax.print.*; |
| 25 | import javax.print.attribute.*; |
| 26 | import javax.print.event.*; |
| 27 | |
| 28 | public class Applet3PrintService implements PrintService { |
| 29 | |
| 30 | |
| 31 | public Applet3PrintService() { |
| 32 | } |
| 33 | |
| 34 | public String getName() { |
| 35 | return "Applet 3 Printer"; |
| 36 | } |
| 37 | |
| 38 | public DocPrintJob createPrintJob() { |
| 39 | return null; |
| 40 | } |
| 41 | |
| 42 | public PrintServiceAttributeSet getUpdatedAttributes() { |
| 43 | return null; |
| 44 | } |
| 45 | |
| 46 | public void addPrintServiceAttributeListener( |
| 47 | PrintServiceAttributeListener listener) { |
| 48 | return; |
| 49 | } |
| 50 | |
| 51 | public void removePrintServiceAttributeListener( |
| 52 | PrintServiceAttributeListener listener) { |
| 53 | return; |
| 54 | } |
| 55 | |
| 56 | public PrintServiceAttribute getAttribute(Class category) { |
| 57 | return null; |
| 58 | } |
| 59 | |
| 60 | public PrintServiceAttributeSet getAttributes() { |
| 61 | return null; |
| 62 | } |
| 63 | |
| 64 | public DocFlavor[] getSupportedDocFlavors() { |
| 65 | return null; |
| 66 | } |
| 67 | |
| 68 | public boolean isDocFlavorSupported(DocFlavor flavor) { |
| 69 | return false; |
| 70 | } |
| 71 | |
| 72 | public Class[] getSupportedAttributeCategories() { |
| 73 | return null; |
| 74 | } |
| 75 | |
| 76 | public boolean isAttributeCategorySupported(Class category) { |
| 77 | return false; |
| 78 | } |
| 79 | |
| 80 | public Object getDefaultAttributeValue(Class category) { |
| 81 | return null; |
| 82 | } |
| 83 | |
| 84 | public Object getSupportedAttributeValues(Class category, |
| 85 | DocFlavor flavor, |
| 86 | AttributeSet attributes) { |
| 87 | return null; |
| 88 | } |
| 89 | |
| 90 | public boolean isAttributeValueSupported(Attribute attr, |
| 91 | DocFlavor flavor, |
| 92 | AttributeSet attributes) { |
| 93 | return false; |
| 94 | } |
| 95 | |
| 96 | public AttributeSet getUnsupportedAttributes(DocFlavor flavor, |
| 97 | AttributeSet attributes) { |
| 98 | |
| 99 | return null; |
| 100 | } |
| 101 | public ServiceUIFactory getServiceUIFactory() { |
| 102 | return null; |
| 103 | } |
| 104 | |
| 105 | public String toString() { |
| 106 | return "Printer : " + getName(); |
| 107 | } |
| 108 | |
| 109 | public boolean equals(Object obj) { |
| 110 | return (obj == this || |
| 111 | (obj instanceof Applet3PrintService && |
| 112 | ((Applet3PrintService)obj).getName().equals(getName()))); |
| 113 | } |
| 114 | |
| 115 | public int hashCode() { |
| 116 | return this.getClass().hashCode()+getName().hashCode(); |
| 117 | } |
| 118 | |
| 119 | } |