diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2010-04-27 21:34:02 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2010-04-27 21:34:02 +0000 |
commit | 69b6ad399ffc49ad436def3b67d74ccdc0198ef8 (patch) | |
tree | 95c0047735ca3a6a8dcc74f33340f292b8b05828 /gnu | |
parent | 2414dc7d8f6bfb6e8cb9797f0de258f0eb2a4c26 (diff) | |
download | classpath-69b6ad399ffc49ad436def3b67d74ccdc0198ef8.tar.gz |
Normalise whitespace usage.
2010-04-27 Andrew John Hughes <ahughes@redhat.com>
* gnu/javax/print/CupsIppOperation.java,
* gnu/javax/print/CupsMediaMapping.java,
* gnu/javax/print/CupsPrintService.java,
* gnu/javax/print/CupsPrintServiceLookup.java,
* gnu/javax/print/CupsServer.java,
* gnu/javax/print/PrintAttributeException.java,
* gnu/javax/print/PrintFlavorException.java,
* gnu/javax/print/PrintUriException.java,
* gnu/javax/print/PrinterDialog.java,
* gnu/javax/print/ipp/DocPrintJobImpl.java,
* gnu/javax/print/ipp/IppDelimiterTag.java,
* gnu/javax/print/ipp/IppException.java,
* gnu/javax/print/ipp/IppMultiDocPrintService.java,
* gnu/javax/print/ipp/IppRequest.java,
* gnu/javax/print/ipp/IppResponse.java,
* gnu/javax/print/ipp/IppStatusCode.java,
* gnu/javax/print/ipp/IppUtilities.java,
* gnu/javax/print/ipp/IppValueTag.java,
* gnu/javax/print/ipp/MultiDocPrintJobImpl.java,
* gnu/javax/print/ipp/attribute/CharsetSyntax.java,
* gnu/javax/print/ipp/attribute/DefaultValueAttribute.java,
* gnu/javax/print/ipp/attribute/DetailedStatusMessage.java,
* gnu/javax/print/ipp/attribute/DocumentAccessError.java,
* gnu/javax/print/ipp/attribute/NaturalLanguageSyntax.java,
* gnu/javax/print/ipp/attribute/RequestedAttributes.java,
* gnu/javax/print/ipp/attribute/StatusMessage.java,
* gnu/javax/print/ipp/attribute/UnknownAttribute.java,
* gnu/javax/print/ipp/attribute/defaults/CopiesDefault.java,
* gnu/javax/print/ipp/attribute/defaults/DocumentFormatDefault.java,
* gnu/javax/print/ipp/attribute/defaults/FinishingsDefault.java,
* gnu/javax/print/ipp/attribute/defaults/JobHoldUntilDefault.java,
* gnu/javax/print/ipp/attribute/defaults/JobPriorityDefault.java,
* gnu/javax/print/ipp/attribute/defaults/JobSheetsDefault.java,
* gnu/javax/print/ipp/attribute/defaults/MediaDefault.java,
* gnu/javax/print/ipp/attribute/defaults/MultipleDocumentHandlingDefault.java,
* gnu/javax/print/ipp/attribute/defaults/NumberUpDefault.java,
* gnu/javax/print/ipp/attribute/defaults/OrientationRequestedDefault.java,
* gnu/javax/print/ipp/attribute/defaults/PrintQualityDefault.java,
* gnu/javax/print/ipp/attribute/defaults/PrinterResolutionDefault.java,
* gnu/javax/print/ipp/attribute/defaults/SidesDefault.java,
* gnu/javax/print/ipp/attribute/job/AttributesCharset.java,
* gnu/javax/print/ipp/attribute/job/AttributesNaturalLanguage.java,
* gnu/javax/print/ipp/attribute/job/JobDetailedStatusMessages.java,
* gnu/javax/print/ipp/attribute/job/JobDocumentAccessErrors.java,
* gnu/javax/print/ipp/attribute/job/JobId.java,
* gnu/javax/print/ipp/attribute/job/JobMoreInfo.java,
* gnu/javax/print/ipp/attribute/job/JobPrinterUri.java,
* gnu/javax/print/ipp/attribute/job/JobStateMessage.java,
* gnu/javax/print/ipp/attribute/job/JobUri.java,
* gnu/javax/print/ipp/attribute/printer/CharsetConfigured.java,
* gnu/javax/print/ipp/attribute/printer/DocumentFormat.java,
* gnu/javax/print/ipp/attribute/printer/MultipleOperationTimeOut.java,
* gnu/javax/print/ipp/attribute/printer/NaturalLanguageConfigured.java,
* gnu/javax/print/ipp/attribute/printer/PrinterCurrentTime.java,
* gnu/javax/print/ipp/attribute/printer/PrinterDriverInstaller.java,
* gnu/javax/print/ipp/attribute/printer/PrinterStateMessage.java,
* gnu/javax/print/ipp/attribute/printer/PrinterUpTime.java:
Normalise whitespace; replace tabs with spaces and removing
trailing whitespace.
Diffstat (limited to 'gnu')
57 files changed, 1317 insertions, 1317 deletions
diff --git a/gnu/javax/print/CupsIppOperation.java b/gnu/javax/print/CupsIppOperation.java index e91516911..96744c1f3 100644 --- a/gnu/javax/print/CupsIppOperation.java +++ b/gnu/javax/print/CupsIppOperation.java @@ -1,4 +1,4 @@ -/* CupsIppOperation.java -- +/* CupsIppOperation.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -45,55 +45,55 @@ package gnu.javax.print; * See: CUPS Implementation of IPP, chapter 3.2<br> * http://www.cups.org/doc-1.1/ipp.html * </p> - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class CupsIppOperation { /** Get the default destination - since CUPS 1.0 */ - public static final int CUPS_GET_DEFAULT = 0x4001; - + public static final int CUPS_GET_DEFAULT = 0x4001; + /** Get all of the available printers - since CUPS 1.0 */ public static final int CUPS_GET_PRINTERS = 0x4002; - + /** Add or modify a printer - since CUPS 1.0 */ public static final int CUPS_ADD_MODIFY_PRINTER = 0x4003; - + /** Delete a printer - since CUPS 1.0 */ public static final int CUPS_DELETE_PRINTER = 0x4004; - + /** Get all of the available printer classes - since CUPS 1.0 */ public static final int CUPS_GET_CLASSES = 0x4005; - + /** Add or modify a printer class - since CUPS 1.0 */ public static final int CUPS_ADD_MODIFY_CLASS = 0x4006; - + /** Delete a printer class - since CUPS 1.0 */ public static final int CUPS_DELETE_CLASS = 0x4007; - + /** Accept jobs on a printer or printer class - since CUPS 1.0 */ public static final int CUPS_ACCEPT_JOBS = 0x4008; - + /** Reject jobs on a printer or printer class - since CUPS 1.0 */ public static final int CUPS_REJECT_JOBS = 0x4009; - + /** Set the default destination - since CUPS 1.0 */ public static final int CUPS_SET_DEFAULT = 0x400A; - + /** Get all of the available PPDs - since CUPS 1.1 */ public static final int CUPS_GET_DEVICES = 0x400B; - + /** Get all of the available PPDs - since CUPS 1.1 */ public static final int CUPS_GET_PPDS = 0x400C; - + /** Move a job to a different printer - since CUPS 1.1 */ public static final int CUPS_MOVE_JOB = 0x400D; - - + + private CupsIppOperation() - { + { // not to be instantiated } - + } diff --git a/gnu/javax/print/CupsMediaMapping.java b/gnu/javax/print/CupsMediaMapping.java index eaf2d5e54..49bd94d6f 100644 --- a/gnu/javax/print/CupsMediaMapping.java +++ b/gnu/javax/print/CupsMediaMapping.java @@ -1,4 +1,4 @@ -/* CupsMediaMapping.java -- +/* CupsMediaMapping.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -52,12 +52,12 @@ import javax.print.attribute.standard.MediaSizeName; * for use of media attribute translation between Java JPS API and * CUPS. * </p> - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public class CupsMediaMapping { - // the mapping map + // the mapping map private static final HashMap ippByCups = new HashMap(); /** @@ -67,11 +67,11 @@ public class CupsMediaMapping { ippByCups.put("Postcard", MediaSizeName.JAPANESE_POSTCARD); ippByCups.put("Statement", MediaSizeName.INVOICE); - + ippByCups.put("Letter", MediaSizeName.NA_LETTER); ippByCups.put("Executive", MediaSizeName.EXECUTIVE); ippByCups.put("Legal", MediaSizeName.NA_LEGAL); - + ippByCups.put("A0", MediaSizeName.ISO_A0); ippByCups.put("A1", MediaSizeName.ISO_A1); ippByCups.put("A2", MediaSizeName.ISO_A2); @@ -83,7 +83,7 @@ public class CupsMediaMapping ippByCups.put("A8", MediaSizeName.ISO_A8); ippByCups.put("A9", MediaSizeName.ISO_A9); ippByCups.put("A10", MediaSizeName.ISO_A10); - + ippByCups.put("B0", MediaSizeName.JIS_B0); ippByCups.put("B1", MediaSizeName.JIS_B1); ippByCups.put("B2", MediaSizeName.JIS_B2); @@ -95,7 +95,7 @@ public class CupsMediaMapping ippByCups.put("B8", MediaSizeName.JIS_B8); ippByCups.put("B9", MediaSizeName.JIS_B9); ippByCups.put("B10", MediaSizeName.JIS_B10); - + ippByCups.put("ISOB0", MediaSizeName.ISO_B0); ippByCups.put("ISOB1", MediaSizeName.ISO_B1); ippByCups.put("ISOB2", MediaSizeName.ISO_B2); @@ -118,7 +118,7 @@ public class CupsMediaMapping ippByCups.put("EnvISOB8", MediaSizeName.ISO_B8); ippByCups.put("EnvISOB9", MediaSizeName.ISO_B9); ippByCups.put("EnvISOB10", MediaSizeName.ISO_B10); - + ippByCups.put("C0", MediaSizeName.ISO_C0); ippByCups.put("C1", MediaSizeName.ISO_C1); ippByCups.put("C2", MediaSizeName.ISO_C2); @@ -136,7 +136,7 @@ public class CupsMediaMapping ippByCups.put("Env12", MediaSizeName.NA_NUMBER_12_ENVELOPE); ippByCups.put("Env14", MediaSizeName.NA_NUMBER_14_ENVELOPE); ippByCups.put("c8x10", MediaSizeName.NA_8X10); - + ippByCups.put("EnvDL", MediaSizeName.ISO_DESIGNATED_LONG); ippByCups.put("DL", MediaSizeName.ISO_DESIGNATED_LONG); ippByCups.put("EnvC0", MediaSizeName.ISO_C0); @@ -145,12 +145,12 @@ public class CupsMediaMapping ippByCups.put("EnvC3", MediaSizeName.ISO_C3); ippByCups.put("EnvC4", MediaSizeName.ISO_C4); ippByCups.put("EnvC5", MediaSizeName.ISO_C5); - ippByCups.put("EnvC6", MediaSizeName.ISO_C6); + ippByCups.put("EnvC6", MediaSizeName.ISO_C6); } - + /** * Returns the IPP media name of the given cups name. - * + * * @param cupsName the name in cups * @return The IPP name if a mapping is known, <code>null</code> otherwise. */ @@ -158,10 +158,10 @@ public class CupsMediaMapping { return (String) ippByCups.get(cupsName); } - + /** * Returns the mapping map for iteration. - * + * * @return The mapping map as unmodifiable map. */ public static final Map getMappingMap() @@ -169,7 +169,7 @@ public class CupsMediaMapping return Collections.unmodifiableMap(ippByCups); } - private CupsMediaMapping() + private CupsMediaMapping() { // not to be instantiated } diff --git a/gnu/javax/print/CupsPrintService.java b/gnu/javax/print/CupsPrintService.java index 4f77523c5..f3bec996c 100644 --- a/gnu/javax/print/CupsPrintService.java +++ b/gnu/javax/print/CupsPrintService.java @@ -48,9 +48,9 @@ import javax.print.DocFlavor; import javax.print.attribute.AttributeSet; /** - * Implementation of the PrintService/MultiDocPrintService + * Implementation of the PrintService/MultiDocPrintService * interface for Cups printers (supports Cups 1.1 and up) - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class CupsPrintService extends IppMultiDocPrintService @@ -58,26 +58,26 @@ public final class CupsPrintService extends IppMultiDocPrintService /** * Creates a <code>CupsPrintService</code> object. - * + * * @param uri the URI of the IPP printer. * @param username the user of this print service. * @param password the password of the user. - * + * * @throws IppException if an error during connection occurs. */ public CupsPrintService(URI uri, String username, String password) throws IppException { super(uri, username, password); - } - + } + /** * Overridden for CUPS specific handling of the media attribute. */ - protected Object handleSupportedAttributeValuesResponse(IppResponse response, + protected Object handleSupportedAttributeValuesResponse(IppResponse response, Class category) { - // TODO Implement different behaviour of cups here - actually the Media + // TODO Implement different behaviour of cups here - actually the Media // printing attribute stuff. For now just use IPP reference implementation. return super.handleSupportedAttributeValuesResponse(response, category); } @@ -89,7 +89,7 @@ public final class CupsPrintService extends IppMultiDocPrintService { // TODO Implement media attribute behaviour for cups here //if (category.equals(Media.class) - + return super.getDefaultAttributeValue(category); } diff --git a/gnu/javax/print/CupsPrintServiceLookup.java b/gnu/javax/print/CupsPrintServiceLookup.java index 1aa83218a..d537c398f 100644 --- a/gnu/javax/print/CupsPrintServiceLookup.java +++ b/gnu/javax/print/CupsPrintServiceLookup.java @@ -51,12 +51,12 @@ import javax.print.attribute.AttributeSet; /** * The platform default implementation based on CUPS. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public class CupsPrintServiceLookup extends PrintServiceLookup -{ - private CupsServer server; +{ + private CupsServer server; /** * Default constructor checking security access. @@ -67,14 +67,14 @@ public class CupsPrintServiceLookup extends PrintServiceLookup SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPrintJobAccess(); - + // use the localhost cups server server = new CupsServer(null, null); } /** * This is the printer marked as default in CUPS. - * + * * @return The default lookup service or * <code>null</code> if there is no default. */ @@ -83,21 +83,21 @@ public class CupsPrintServiceLookup extends PrintServiceLookup try { return server.getDefaultPrinter(); - } + } catch (IppException e) { // if discovery fails treat as if there is none return null; - } + } } - + /** * All printers and printer classes of the CUPS server are checked. * If flavors or attributes are null the constraint is not used. - * + * * @param flavors the document flavors which have to be supported. * @param attributes the attributes which have to be supported. - * + * * @return The multidoc print services of the implementing lookup service * for the given parameters, or an array of length 0 if none is available. */ @@ -105,49 +105,49 @@ public class CupsPrintServiceLookup extends PrintServiceLookup AttributeSet attributes) { ArrayList result = new ArrayList(); - PrintService[] services = getPrintServices(); - + PrintService[] services = getPrintServices(); + for (int i=0; i < services.length; i++) { if (checkMultiDocPrintService(flavors, attributes, services[i])) - result.add(services[i]); + result.add(services[i]); } - + return (MultiDocPrintService[]) result.toArray( new MultiDocPrintService[result.size()]); } /** * These are all printers and printer classes of the CUPS server. - * - * @return All known print services regardless of supported features, + * + * @return All known print services regardless of supported features, * or an array of length 0 if none is available. */ public PrintService[] getPrintServices() { ArrayList result = new ArrayList(); - + try { result.addAll(server.getAllPrinters()); result.addAll(server.getAllClasses()); } catch (IppException e) - { + { // ignore as this method cannot throw exceptions // if print service discovery fails - bad luck } return (PrintService[]) result.toArray(new PrintService[result.size()]); } - - + + /** * All printers and printer classes of the CUPS server are checked. * If flavor or attributes are null the constraint is not used. - * + * * @param flavor the document flavor which has to be supported. * @param attributes the attributes which have to be supported. - * + * * @return The print services of the implementing lookup service * for the given parameters, or an array of length 0 if none is available. */ @@ -156,25 +156,25 @@ public class CupsPrintServiceLookup extends PrintServiceLookup { ArrayList result = new ArrayList(); PrintService[] services = getPrintServices(); - + for (int i=0; i < services.length; i++) { if (checkPrintService(flavor, attributes, services[i])) result.add(services[i]); } - + return (PrintService[]) result.toArray(new PrintService[result.size()]); } - + /** * Checks the given print service - own method so it can be used also * to check application registered print services from PrintServiceLookup. - * + * * @param flavor the document flavor which has to be supported. * @param attributes the attributes which have to be supported. * @param service the service to check - * - * @return <code>true</code> if all constraints match, <code>false</code> + * + * @return <code>true</code> if all constraints match, <code>false</code> * otherwise. */ public boolean checkPrintService(DocFlavor flavor, AttributeSet attributes, @@ -185,7 +185,7 @@ public class CupsPrintServiceLookup extends PrintServiceLookup { if (attributes == null || attributes.size() == 0) return allAttributesSupported; - + Attribute[] atts = attributes.toArray(); for (int i = 0; i < atts.length; i++) { @@ -197,29 +197,29 @@ public class CupsPrintServiceLookup extends PrintServiceLookup } return allAttributesSupported; } - + return false; } - + /** * Checks the given print service - own method so it can be used also * to check application registered print services from PrintServiceLookup. - * + * * @param flavors the document flavors which have to be supported. * @param attributes the attributes which have to be supported. * @param service the service to check - * - * @return <code>true</code> if all constraints match, <code>false</code> + * + * @return <code>true</code> if all constraints match, <code>false</code> * otherwise. */ - public boolean checkMultiDocPrintService(DocFlavor[] flavors, + public boolean checkMultiDocPrintService(DocFlavor[] flavors, AttributeSet attributes, PrintService service) - { + { if (service instanceof MultiDocPrintService) - { + { boolean allFlavorsSupported = true; boolean allAttributesSupported = true; - + if (flavors == null || flavors.length != 0) allFlavorsSupported = true; else @@ -233,7 +233,7 @@ public class CupsPrintServiceLookup extends PrintServiceLookup } } } - + if (attributes == null || attributes.size() == 0) allAttributesSupported = true; else @@ -249,11 +249,11 @@ public class CupsPrintServiceLookup extends PrintServiceLookup } } } - + if (allAttributesSupported && allFlavorsSupported) return true; - } - + } + return false; } diff --git a/gnu/javax/print/CupsServer.java b/gnu/javax/print/CupsServer.java index 0486e69de..6dbcfc732 100644 --- a/gnu/javax/print/CupsServer.java +++ b/gnu/javax/print/CupsServer.java @@ -1,4 +1,4 @@ -/* CupsServer.java -- +/* CupsServer.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -58,25 +58,25 @@ import java.util.Set; * compatible server. It mainly consists of its URI and optional * user and password combination if access is restricted. * <p> - * It provides methods for retrival of valid CUPS printer uris + * It provides methods for retrival of valid CUPS printer uris * that are used to construct IppPrintService objects. * </p> - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public class CupsServer { - /** + /** * The URI of the CUPS server. * This is something like: http://localhost:631 */ private transient URI uri; - + /** * The optional username. */ private transient String username; - + /** * The optional password for the user. */ @@ -84,11 +84,11 @@ public class CupsServer /** * Creates a <code>CupsServer</code> object which - * tries to connect to a cups server. + * tries to connect to a cups server. * * If <code>gnu.javax.print.server</code> is explicitly set, then * that hostname will be used. Otherwise it will default to localhost. - * + * * @param username the username * @param password the password for the username. */ @@ -100,13 +100,13 @@ public class CupsServer this.uri = null; try { - String serv = System.getProperty("gnu.javax.print.server"); - if( serv != null ) - this.uri = new URI("http://"+serv+":631"); + String serv = System.getProperty("gnu.javax.print.server"); + if( serv != null ) + this.uri = new URI("http://"+serv+":631"); } catch(URISyntaxException use) { - throw new RuntimeException("gnu.javax.print.CupsServer value is not a valid hostname."); + throw new RuntimeException("gnu.javax.print.CupsServer value is not a valid hostname."); } catch(SecurityException se) { @@ -114,20 +114,20 @@ public class CupsServer try { - if( this.uri == null ) - this.uri = new URI("http://localhost:631"); + if( this.uri == null ) + this.uri = new URI("http://localhost:631"); } catch (URISyntaxException e) { // does not happen } } - + /** * Creates a <code>CupsServer</code> object which * tries to connect to a running cups server on the * given URI. - * + * * @param uri the URI of the server. * @param username the username * @param password the password for the username. @@ -138,75 +138,75 @@ public class CupsServer this.username = username; this.password = password; } - + /** * Requests the default printer from this CUPS server. * This is always returned as IppPrintService. - * + * * @return The default printer. * @throws IppException if problems during request/response processing occur. */ public IppPrintService getDefaultPrinter() throws IppException - { + { IppResponse response = null; - + try { - IppRequest request = new IppRequest(uri, username, password); - request.setOperationID((short)CupsIppOperation.CUPS_GET_DEFAULT); - request.setOperationAttributeDefaults(); - - RequestedAttributes requestedAttrs + IppRequest request = new IppRequest(uri, username, password); + request.setOperationID((short)CupsIppOperation.CUPS_GET_DEFAULT); + request.setOperationAttributeDefaults(); + + RequestedAttributes requestedAttrs = new RequestedAttributes("printer-uri-supported"); request.addOperationAttribute(requestedAttrs); - + response = request.send(); - } + } catch (IOException e) { throw new IppException("IOException in IPP request/response.", e); - } - + } + Map printerAttributes = (Map) response.getPrinterAttributes().get(0); Set uris = (Set) printerAttributes.get(PrinterUriSupported.class); PrinterUriSupported uri = (PrinterUriSupported) uris.toArray()[0]; - - IppPrintService service + + IppPrintService service = new CupsPrintService(uri.getURI(), username, password); - + return service; } - + /** * Requests all printers from this CUPS server. - * + * * @return The list of available printers. * @throws IppException if problems during request/response processing occur. */ public List getAllPrinters() throws IppException - { + { IppResponse response = null; - + try { - IppRequest request = new IppRequest(uri, username, password); - request.setOperationID((short)CupsIppOperation.CUPS_GET_PRINTERS); + IppRequest request = new IppRequest(uri, username, password); + request.setOperationID((short)CupsIppOperation.CUPS_GET_PRINTERS); request.setOperationAttributeDefaults(); - - RequestedAttributes requestedAttrs + + RequestedAttributes requestedAttrs = new RequestedAttributes("printer-uri-supported"); request.addOperationAttribute(requestedAttrs); - + response = request.send(); - } + } catch (IOException e) { throw new IppException("IOException in IPP request/response.", e); - } + } List prAttr = response.getPrinterAttributes(); List services = new ArrayList(); - + for (int i=0; i < prAttr.size(); i++) { Map printerAttributes = (Map) prAttr.get(i); @@ -224,50 +224,50 @@ public class CupsServer // do nothing, we only catch the IppException which could be // thrown during instantiation as single printers may be discovered // correctly but not usable due to other security restrictions - } - } - + } + } + return services; } - + /** * Requests all classes from this CUPS server. Classes in cups are - * collections of printers. This means jobs directed to a class + * collections of printers. This means jobs directed to a class * are forwarded to the first available printer of the collection. - * + * * @return The list of available classes. * @throws IppException if problems during request/response processing occur. */ public List getAllClasses() throws IppException - { + { IppResponse response = null; - + try { - IppRequest request = new IppRequest(uri, username, password); - request.setOperationID((short)CupsIppOperation.CUPS_GET_CLASSES); + IppRequest request = new IppRequest(uri, username, password); + request.setOperationID((short)CupsIppOperation.CUPS_GET_CLASSES); request.setOperationAttributeDefaults(); - - RequestedAttributes requestedAttrs + + RequestedAttributes requestedAttrs = new RequestedAttributes("printer-uri-supported"); request.addOperationAttribute(requestedAttrs); - + response = request.send(); - } + } catch (IOException e) { throw new IppException("IOException in IPP request/response.", e); - } - + } + List prAttr = response.getPrinterAttributes(); - List services = new ArrayList(); - + List services = new ArrayList(); + for (int i=0; i < prAttr.size(); i++) { Map printerAttributes = (Map) prAttr.get(i); Set uris = (Set) printerAttributes.get(PrinterUriSupported.class); PrinterUriSupported uri = (PrinterUriSupported) uris.toArray()[0]; - + try { CupsPrintService cups = new CupsPrintService(uri.getURI(), @@ -279,9 +279,9 @@ public class CupsServer // do nothing, we only catch the IppException which could be // thrown during instantiation as single printers may be discovered // correctly but not usable due to other security restrictions - } - } - + } + } + return services; } diff --git a/gnu/javax/print/PrintAttributeException.java b/gnu/javax/print/PrintAttributeException.java index 345193d93..5bcc59fc9 100644 --- a/gnu/javax/print/PrintAttributeException.java +++ b/gnu/javax/print/PrintAttributeException.java @@ -1,4 +1,4 @@ -/* PrintAttributeException.java -- +/* PrintAttributeException.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -46,25 +46,25 @@ import javax.print.attribute.Attribute; * A <code>PrintException</code> further refining the exception * cause by providing an implementation of the print exception * interface <code>AttributeException</code>. - * + * * @see javax.print.PrintException * @see javax.print.AttributeException - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class PrintAttributeException extends PrintException +public final class PrintAttributeException extends PrintException implements AttributeException { private Class[] categories; private Attribute[] values; - + /** * Constructs a <code>PrintAttributeException</code> * with the given unsupported attributes and/or values. - * - * @param unsupportedAttributes the unsupported categories, + * + * @param unsupportedAttributes the unsupported categories, * may be <code>null</code>. - * @param unsupportedValues the unsupported attribute values, + * @param unsupportedValues the unsupported attribute values, * may be <code>null</code>. */ public PrintAttributeException(Class[] unsupportedAttributes, @@ -78,11 +78,11 @@ public final class PrintAttributeException extends PrintException /** * Constructs a <code>PrintAttributeException</code> * with the given unsupported attributes and/or values. - * + * * @param e chained exception - * @param unsupportedAttributes the unsupported categories, + * @param unsupportedAttributes the unsupported categories, * may be <code>null</code>. - * @param unsupportedValues the unsupported attribute values, + * @param unsupportedValues the unsupported attribute values, * may be <code>null</code>. */ public PrintAttributeException(Exception e, @@ -96,11 +96,11 @@ public final class PrintAttributeException extends PrintException /** * Constructs a <code>PrintAttributeException</code> * with the given unsupported attributes and/or values. - * + * * @param s detailed message - * @param unsupportedAttributes the unsupported categories, + * @param unsupportedAttributes the unsupported categories, * may be <code>null</code>. - * @param unsupportedValues the unsupported attribute values, + * @param unsupportedValues the unsupported attribute values, * may be <code>null</code>. */ public PrintAttributeException(String s, @@ -114,12 +114,12 @@ public final class PrintAttributeException extends PrintException /** * Constructs a <code>PrintAttributeException</code> * with the given unsupported attributes and/or values. - * + * * @param s detailed message * @param e chained exception - * @param unsupportedAttributes the unsupported categories, + * @param unsupportedAttributes the unsupported categories, * may be <code>null</code>. - * @param unsupportedValues the unsupported attribute values, + * @param unsupportedValues the unsupported attribute values, * may be <code>null</code>. */ public PrintAttributeException(String s, Exception e, diff --git a/gnu/javax/print/PrintFlavorException.java b/gnu/javax/print/PrintFlavorException.java index 1885e9851..a9342db96 100644 --- a/gnu/javax/print/PrintFlavorException.java +++ b/gnu/javax/print/PrintFlavorException.java @@ -1,4 +1,4 @@ -/* PrintFlavorException.java -- +/* PrintFlavorException.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -46,21 +46,21 @@ import javax.print.PrintException; * A <code>PrintException</code> further refining the exception * cause by providing an implementation of the print exception * interface <code>FlavorException</code>. - * + * * @see javax.print.PrintException * @see javax.print.FlavorException - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public class PrintFlavorException extends PrintException +public class PrintFlavorException extends PrintException implements FlavorException { private DocFlavor[] flavors; - + /** * Constructs a <code>PrintFlavorException</code> * with the given unsupported doc flavor array - * + * * @param unsupportedFlavors the unsupported document flavors. */ public PrintFlavorException(DocFlavor[] unsupportedFlavors) @@ -72,7 +72,7 @@ public class PrintFlavorException extends PrintException /** * Constructs a <code>PrintFlavorException</code> * with the given unsupported doc flavor array - * + * * @param e chained exception * @param unsupportedFlavors the unsupported document flavors. */ @@ -85,7 +85,7 @@ public class PrintFlavorException extends PrintException /** * Constructs a <code>PrintFlavorException</code> * with the given unsupported doc flavor array - * + * * @param s detailed message * @param unsupportedFlavors the unsupported document flavors. */ @@ -98,12 +98,12 @@ public class PrintFlavorException extends PrintException /** * Constructs a <code>PrintFlavorException</code> * with the given unsupported doc flavor array - * + * * @param s detailed message * @param e chained exception * @param unsupportedFlavors the unsupported document flavors. */ - public PrintFlavorException(String s, Exception e, + public PrintFlavorException(String s, Exception e, DocFlavor[] unsupportedFlavors) { super(s, e); diff --git a/gnu/javax/print/PrintUriException.java b/gnu/javax/print/PrintUriException.java index d031000ca..9c13c132a 100644 --- a/gnu/javax/print/PrintUriException.java +++ b/gnu/javax/print/PrintUriException.java @@ -1,4 +1,4 @@ -/* PrintUriException.java -- +/* PrintUriException.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -47,13 +47,13 @@ import javax.print.URIException; * A <code>PrintException</code> further refining the exception * cause by providing an implementation of the print exception * interface <code>URIException</code>. - * + * * @see javax.print.PrintException * @see javax.print.URIException - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class PrintUriException extends PrintException +public final class PrintUriException extends PrintException implements URIException { private int reason; @@ -65,20 +65,20 @@ public final class PrintUriException extends PrintException * * @param reason the reason for the exception. * @param unsupportedUri the URI which is unsupported. - * + * * @see URIException */ public PrintUriException(int reason, URI unsupportedUri) { super(); this.reason = reason; - uri = unsupportedUri; + uri = unsupportedUri; } /** * Constructs a <code>PrintUriException</code> with the given reason * and unsupported URI instance. - * + * * @param e chained exception * @param reason the reason for the exception. * @param unsupportedUri the URI which is unsupported. @@ -87,13 +87,13 @@ public final class PrintUriException extends PrintException { super(e); this.reason = reason; - uri = unsupportedUri; + uri = unsupportedUri; } /** * Constructs a <code>PrintUriException</code> with the given reason * and unsupported URI instance. - * + * * @param s detailed message * @param reason the reason for the exception. * @param unsupportedUri the URI which is unsupported. @@ -102,24 +102,24 @@ public final class PrintUriException extends PrintException { super(s); this.reason = reason; - uri = unsupportedUri; + uri = unsupportedUri; } /** * Constructs a <code>PrintUriException</code> with the given reason * and unsupported URI instance. - * + * * @param s detailed message * @param e chained exception * @param reason the reason for the exception. * @param unsupportedUri the URI which is unsupported. */ - public PrintUriException(String s, Exception e, + public PrintUriException(String s, Exception e, int reason, URI unsupportedUri) { super(s, e); this.reason = reason; - uri = unsupportedUri; + uri = unsupportedUri; } /** diff --git a/gnu/javax/print/PrinterDialog.java b/gnu/javax/print/PrinterDialog.java index 54d6b87b4..6557baf4f 100644 --- a/gnu/javax/print/PrinterDialog.java +++ b/gnu/javax/print/PrinterDialog.java @@ -98,12 +98,12 @@ import javax.swing.event.ChangeListener; * Implementation of the PrinterDialog used by * {@link javax.print.ServiceUI} for visual selection * of print services and its attributes. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class PrinterDialog extends JDialog implements ActionListener { - + /** * The General Panel used in the printing dialog. * @author Wolfgang Baer (WBaer@gmx.de) @@ -114,57 +114,57 @@ public final class PrinterDialog extends JDialog implements ActionListener * Handles the copies attribute. * @author Wolfgang Baer (WBaer@gmx.de) */ - final class CopiesAndSorted extends JPanel + final class CopiesAndSorted extends JPanel implements ChangeListener, ActionListener - { - private JCheckBox sort; + { + private JCheckBox sort; private JSpinner copies; private JLabel copies_lb; private SpinnerNumberModel copiesModel; - + CopiesAndSorted() { - copies_lb = new JLabel(getLocalizedString("lb.copies")); + copies_lb = new JLabel(getLocalizedString("lb.copies")); sort = new JCheckBox(getLocalizedString("cb.sort")); sort.addActionListener(this); - + copiesModel = new SpinnerNumberModel(1, 1, 9999, 1); copies = new JSpinner(copiesModel); copies.addChangeListener(this); - + GridBagLayout layout = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.insets = new Insets(5, 5, 5, 5); - + setLayout(layout); setBorder(new TitledBorder(getLocalizedString("title.copies"))); - + c.anchor = GridBagConstraints.WEST; - + c.gridx = 0; c.gridy = 0; add(copies_lb, c); - + c.gridx = 1; c.gridy = 0; add(copies, c); - + c.gridx = 0; c.gridy = 1; add(sort, c); } - + // copies jspinner state public void stateChanged(ChangeEvent event) { int value = ((Integer) copies.getValue()).intValue(); atts.add(new Copies(value)); - + if (value > 1 && categorySupported(SheetCollate.class)) sort.setEnabled(true); else - sort.setEnabled(false); + sort.setEnabled(false); } // sorted checkbox state @@ -180,30 +180,30 @@ public final class PrinterDialog extends JDialog implements ActionListener * selected attributes are supported. */ void updateForSelectedService() - { + { if (categorySupported(Copies.class)) { copies.setEnabled(true); copies_lb.setEnabled(true); - + Copies copies = (Copies) attribute(Copies.class); if (copies != null) copiesModel.setValue(new Integer(copies.getValue())); - - if (((Integer)copiesModel.getValue()).intValue() > 1 + + if (((Integer)copiesModel.getValue()).intValue() > 1 && categorySupported(SheetCollate.class)) { sort.setEnabled(true); Attribute collate = attribute(SheetCollate.class); if (collate != null && collate.equals(SheetCollate.COLLATED)) - sort.setSelected(true); + sort.setSelected(true); } else sort.setEnabled(false); } else { - copies.setEnabled(false); + copies.setEnabled(false); copies_lb.setEnabled(false); } } @@ -213,18 +213,18 @@ public final class PrinterDialog extends JDialog implements ActionListener * Handles the print ranges attribute. * @author Wolfgang Baer (WBaer@gmx.de) */ - final class PrintRange extends JPanel + final class PrintRange extends JPanel implements ActionListener, FocusListener - { - private JLabel to; - private JRadioButton all_rb, pages_rb; + { + private JLabel to; + private JRadioButton all_rb, pages_rb; private JTextField from_tf, to_tf; - + PrintRange() - { + { to = new JLabel(getLocalizedString("lb.to")); to.setEnabled(false); - + all_rb = new JRadioButton(getLocalizedString("rbt.all")); all_rb.setSelected(true); all_rb.setActionCommand("ALL"); @@ -233,86 +233,86 @@ public final class PrinterDialog extends JDialog implements ActionListener pages_rb.setActionCommand("PAGES"); pages_rb.setEnabled(false); pages_rb.addActionListener(this); - + ButtonGroup group = new ButtonGroup(); group.add(all_rb); group.add(pages_rb); - + from_tf = new JTextField("1", 4); from_tf.setEnabled(false); from_tf.addFocusListener(this); to_tf = new JTextField("1", 4); to_tf.setEnabled(false); to_tf.addFocusListener(this); - + GridBagLayout layout = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; - + setLayout(layout); setBorder(new TitledBorder(getLocalizedString("title.printrange"))); - + c.insets = new Insets(15, 5, 5, 5); c.gridx = 0; c.gridy = 0; add(all_rb, c); - + c.insets = new Insets(5, 5, 15, 5); c.gridx = 0; c.gridy = 1; add(pages_rb, c); - + c.gridx = 1; c.gridy = 1; add(from_tf, c); - + c.gridx = 2; c.gridy = 1; add(to, c); - + c.insets = new Insets(5, 5, 15, 15); c.gridx = 3; c.gridy = 1; add(to_tf, c); } - + // focus pagerange public void focusGained(FocusEvent event) { updatePageRanges(); } - + public void focusLost(FocusEvent event) { updatePageRanges(); } - + // updates the range after user changed it private void updatePageRanges() { int lower = Integer.parseInt(from_tf.getText()); int upper = Integer.parseInt(to_tf.getText()); - + if (lower > upper) { upper = lower; - to_tf.setText("" + lower); + to_tf.setText("" + lower); } - + PageRanges range = new PageRanges(lower, upper); atts.add(range); } // page range change public void actionPerformed(ActionEvent e) - { + { // if ALL is selected we must use a full-range object if (e.getActionCommand().equals("ALL")) { from_tf.setEnabled(false); to.setEnabled(false); to_tf.setEnabled(false); - + atts.add(new PageRanges(1, Integer.MAX_VALUE)); } else @@ -321,9 +321,9 @@ public final class PrinterDialog extends JDialog implements ActionListener to.setEnabled(true); to_tf.setEnabled(true); all_rb.setSelected(false); - } + } } - + /** * Called to update for new selected * print service. Tests if currently @@ -339,12 +339,12 @@ public final class PrinterDialog extends JDialog implements ActionListener { from_tf.setEnabled(true); to.setEnabled(true); - to_tf.setEnabled(true); + to_tf.setEnabled(true); all_rb.setSelected(false); pages_rb.setSelected(true); - + int[][] members = range.getMembers(); - // Although passed in attributes may contain more than one + // Although passed in attributes may contain more than one // range we only take the first one from_tf.setText("" + members[0][0]); to_tf.setText("" + members[0][1]); @@ -365,15 +365,15 @@ public final class PrinterDialog extends JDialog implements ActionListener * and its location and description attributes. * @author Wolfgang Baer (WBaer@gmx.de) */ - final class PrintServices extends JPanel + final class PrintServices extends JPanel implements ActionListener - { + { private JLabel name, status, typ, info; - private JLabel statusValue, typValue, infoValue; - private JButton attributes; - private JComboBox services_cob; + private JLabel statusValue, typValue, infoValue; + private JButton attributes; + private JComboBox services_cob; private JCheckBox fileRedirection_cb; - + PrintServices() { name = new JLabel(getLocalizedString("lb.name")); @@ -383,79 +383,79 @@ public final class PrinterDialog extends JDialog implements ActionListener typValue = new JLabel(); infoValue = new JLabel(); statusValue = new JLabel(); - + attributes = new JButton(getLocalizedString("bt.attributes")); attributes.setEnabled(false); attributes.setActionCommand("ATTRIBUTES"); attributes.addActionListener(this); - + services_cob = new JComboBox(getPrintServices()); services_cob.setActionCommand("SERVICE"); services_cob.addActionListener(this); - + fileRedirection_cb = new JCheckBox(getLocalizedString("cb.output")); fileRedirection_cb.setEnabled(false); - + GridBagLayout layout = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); - + setLayout(layout); setBorder(new TitledBorder(getLocalizedString("title.printservice"))); - + c.insets = new Insets(5, 5, 5, 5); c.anchor = GridBagConstraints.LINE_END; c.gridx = 0; c.gridy = 0; add(name, c); - + c.gridx = 0; c.gridy = 1; add(status, c); - + c.gridx = 0; c.gridy = 2; add(typ, c); - + c.gridx = 0; c.gridy = 3; add(info, c); - + c.gridx = 2; c.gridy = 3; c.weightx = 1; add(fileRedirection_cb, c); - + c.anchor = GridBagConstraints.LINE_START; c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 1; c.gridy = 0; c.weightx = 1.5; add(services_cob, c); - + c.gridx = 1; c.gridy = 1; c.gridwidth = 2; c.weightx = 1; add(statusValue, c); - + c.gridx = 1; c.gridy = 2; c.gridwidth = 2; c.weightx = 1; add(typValue, c); - + c.gridx = 1; c.gridy = 3; c.gridwidth = 2; c.weightx = 1; add(infoValue, c); - + c.gridx = 2; c.gridy = 0; c.weightx = 1.5; add(attributes, c); } - + public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("SERVICE")) @@ -465,13 +465,13 @@ public final class PrinterDialog extends JDialog implements ActionListener } else if (e.getActionCommand().equals("ATTRIBUTES")) { - // TODO LowPriority-Enhancement: As tests have shown this button + // TODO LowPriority-Enhancement: As tests have shown this button // is even gray and not enabled under Windows - Its a good place - // to provide a classpath specific browsing dialog for all - // attributes not in the default printing dialog. + // to provide a classpath specific browsing dialog for all + // attributes not in the default printing dialog. } - } - + } + /** * Called to update for new selected * print service. Tests if currently @@ -482,30 +482,30 @@ public final class PrinterDialog extends JDialog implements ActionListener PrinterMakeAndModel att1 = getSelectedPrintService().getAttribute(PrinterMakeAndModel.class); typValue.setText(att1 == null ? "" : att1.getValue()); - - PrinterInfo att2 = + + PrinterInfo att2 = getSelectedPrintService().getAttribute(PrinterInfo.class); infoValue.setText(att2 == null ? "" : att2.getValue()); - + PrinterIsAcceptingJobs att3 = getSelectedPrintService().getAttribute(PrinterIsAcceptingJobs.class); PrinterState att4 = getSelectedPrintService().getAttribute(PrinterState.class); - - String status = att4.toString(); + + String status = att4.toString(); if (att3 == PrinterIsAcceptingJobs.ACCEPTING_JOBS) status += " - " + getLocalizedString("lb.acceptingjobs"); else if (att3 == PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS) status += " - " + getLocalizedString("lb.notacceptingjobs"); - + statusValue.setText(status); - + if (categorySupported(Destination.class)) { fileRedirection_cb.setEnabled(false); } } - + } private PrintServices printserv_panel; @@ -516,7 +516,7 @@ public final class PrinterDialog extends JDialog implements ActionListener * Constructs the General Panel. */ public GeneralPanel() - { + { setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); printserv_panel = new PrintServices(); @@ -534,7 +534,7 @@ public final class PrinterDialog extends JDialog implements ActionListener add(Box.createRigidArea(new Dimension(0, 12))); add(layout_panel); } - + /** * Calls update on all internal panels to adjust * for a new selected print service. @@ -560,7 +560,7 @@ public final class PrinterDialog extends JDialog implements ActionListener final class Orientation extends JPanel implements ActionListener { private JRadioButton portrait, landscape, rev_portrait, rev_landscape; - + Orientation() { portrait = new JRadioButton(getLocalizedString("rbt.portrait")); @@ -571,38 +571,38 @@ public final class PrinterDialog extends JDialog implements ActionListener rev_portrait.addActionListener(this); rev_landscape = new JRadioButton(getLocalizedString("rbt.revlandscape")); rev_landscape.addActionListener(this); - + ButtonGroup group = new ButtonGroup(); group.add(portrait); group.add(landscape); group.add(rev_portrait); group.add(rev_landscape); - + GridBagLayout layout = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; - + setLayout(layout); setBorder(new TitledBorder(getLocalizedString("title.orientation"))); - + c.insets = new Insets(5, 5, 5, 5); c.gridx = 0; c.gridy = 0; add(portrait, c); - + c.gridx = 0; c.gridy = 1; add(landscape, c); - + c.gridx = 0; c.gridy = 2; add(rev_portrait, c); - + c.gridx = 0; c.gridy = 3; add(rev_landscape, c); } - + // event handling orientation public void actionPerformed(ActionEvent e) { @@ -613,9 +613,9 @@ public final class PrinterDialog extends JDialog implements ActionListener else if (e.getSource() == rev_portrait) atts.add(OrientationRequested.REVERSE_PORTRAIT); else - atts.add(OrientationRequested.REVERSE_LANDSCAPE); + atts.add(OrientationRequested.REVERSE_LANDSCAPE); } - + /** * Called to update for new selected * print service. Tests if currently @@ -629,7 +629,7 @@ public final class PrinterDialog extends JDialog implements ActionListener landscape.setEnabled(true); rev_landscape.setEnabled(true); rev_portrait.setEnabled(true); - + Attribute orientation = attribute(OrientationRequested.class); if (orientation != null) { @@ -639,7 +639,7 @@ public final class PrinterDialog extends JDialog implements ActionListener portrait.setSelected(true); else if (orientation.equals(OrientationRequested.REVERSE_PORTRAIT)) rev_portrait.setSelected(true); - else + else rev_landscape.setSelected(true); } else @@ -651,7 +651,7 @@ public final class PrinterDialog extends JDialog implements ActionListener portrait.setSelected(true); else if (defaultValue.equals(OrientationRequested.REVERSE_PORTRAIT)) rev_portrait.setSelected(true); - else + else rev_landscape.setSelected(true); } } @@ -661,7 +661,7 @@ public final class PrinterDialog extends JDialog implements ActionListener landscape.setEnabled(false); rev_landscape.setEnabled(false); rev_portrait.setEnabled(false); - } + } } } @@ -673,84 +673,84 @@ public final class PrinterDialog extends JDialog implements ActionListener { private JLabel size_lb, source_lb; private JComboBox size, source; - + MediaTypes() { size_lb = new JLabel(getLocalizedString("lb.size")); source_lb = new JLabel(getLocalizedString("lb.source")); - + size = new JComboBox(); size.setEditable(false); size.addActionListener(this); source = new JComboBox(); source.setEditable(false); size.addActionListener(this); - + GridBagLayout layout = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); - + setLayout(layout); setBorder(new TitledBorder(getLocalizedString("title.medias"))); - + c.insets = new Insets(5, 5, 5, 5); c.anchor = GridBagConstraints.LINE_END; c.gridx = 0; c.gridy = 0; add(size_lb, c); - + c.gridx = 0; c.gridy = 1; add(source_lb, c); - + c.anchor = GridBagConstraints.LINE_START; c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 1; c.gridy = 0; c.weightx = 1.5; add(size, c); - + c.gridx = 1; c.gridy = 1; c.weightx = 1.5; add(source, c); } - + public void actionPerformed(ActionEvent event) - { + { if (event.getSource() == size) { Object obj = size.getSelectedItem(); if (obj instanceof Media) - atts.add((Media) obj); + atts.add((Media) obj); } - + // we ignore source events currently - // as only the automatic selection is used. + // as only the automatic selection is used. } - + /** * Called to update for new selected * print service. Tests if currently * selected attributes are supported. */ void updateForSelectedService() - { + { if (categorySupported(Media.class)) { Media[] medias = (Media[]) getSelectedPrintService() .getSupportedAttributeValues(Media.class, flavor, null); - + size.removeAllItems(); if (medias.length == 0) - size.addItem(getLocalizedString("lb.automatically")); + size.addItem(getLocalizedString("lb.automatically")); else for (int i=0; i < medias.length; i++) size.addItem(medias[i]); - + Media media = (Media) attribute(Media.class); if (media != null) size.setSelectedItem(media); - + // this is currently ignored source.removeAllItems(); source.addItem(getLocalizedString("lb.automatically")); @@ -759,7 +759,7 @@ public final class PrinterDialog extends JDialog implements ActionListener { size.removeAllItems(); source.removeAllItems(); - + size.addItem(getLocalizedString("lb.automatically")); source.addItem(getLocalizedString("lb.automatically")); } @@ -774,14 +774,14 @@ public final class PrinterDialog extends JDialog implements ActionListener { private JLabel left, right, top, bottom; private JTextField left_tf, right_tf, top_tf, bottom_tf; - + Margins() { left = new JLabel(getLocalizedString("lb.left")); right = new JLabel(getLocalizedString("lb.right")); top = new JLabel(getLocalizedString("lb.top")); bottom = new JLabel(getLocalizedString("lb.bottom")); - + left_tf = new JTextField(7); left_tf.addFocusListener(this); right_tf = new JTextField(7); @@ -790,67 +790,67 @@ public final class PrinterDialog extends JDialog implements ActionListener top_tf.addFocusListener(this); bottom_tf = new JTextField(7); bottom_tf.addFocusListener(this); - + GridBagLayout layout = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); - + setLayout(layout); setBorder(new TitledBorder(getLocalizedString("title.margins"))); - + c.insets = new Insets(5, 5, 5, 5); c.gridx = 0; c.gridy = 0; add(left, c); - + c.gridx = 1; c.gridy = 0; add(right, c); - + c.insets = new Insets(5, 5, 5, 5); c.gridx = 0; c.gridy = 1; add(left_tf, c); - + c.gridx = 1; c.gridy = 1; add(right_tf, c); - + c.insets = new Insets(10, 5, 5, 5); c.gridx = 0; c.gridy = 2; add(top, c); - + c.gridx = 1; c.gridy = 2; add(bottom, c); - + c.insets = new Insets(0, 5, 5, 5); c.gridx = 0; c.gridy = 3; add(top_tf, c); - + c.gridx = 1; c.gridy = 3; add(bottom_tf, c); } - + public void focusGained(FocusEvent event) { updateMargins(); } - + public void focusLost(FocusEvent event) { updateMargins(); } - + // updates the margins after user changed it private void updateMargins() { // We currently do not support this attribute // as it is not in the IPP spec and therefore not in CUPS } - + /** * Called to update for new selected * print service. Tests if currently @@ -867,7 +867,7 @@ public final class PrinterDialog extends JDialog implements ActionListener left_tf.setEnabled(true); right_tf.setEnabled(true); top_tf.setEnabled(true); - bottom_tf.setEnabled(true); + bottom_tf.setEnabled(true); } else { @@ -878,8 +878,8 @@ public final class PrinterDialog extends JDialog implements ActionListener left_tf.setEnabled(false); right_tf.setEnabled(false); top_tf.setEnabled(false); - bottom_tf.setEnabled(false); - } + bottom_tf.setEnabled(false); + } } } @@ -887,8 +887,8 @@ public final class PrinterDialog extends JDialog implements ActionListener private Orientation orientation_panel; private Margins margins_panel; - /** - * Constructs the page setup user interface. + /** + * Constructs the page setup user interface. */ public PageSetupPanel() { @@ -909,7 +909,7 @@ public final class PrinterDialog extends JDialog implements ActionListener add(Box.createRigidArea(new Dimension(0, 12))); add(layout_panel); } - + /** * Calls update on all internal panels to adjust * for a new selected print service. @@ -936,7 +936,7 @@ public final class PrinterDialog extends JDialog implements ActionListener { private JRadioButton low, normal, high; private ButtonGroup group; - + Quality() { low = new JRadioButton(getLocalizedString("rbt.low")); @@ -945,33 +945,33 @@ public final class PrinterDialog extends JDialog implements ActionListener normal.addActionListener(this); high = new JRadioButton(getLocalizedString("rbt.high")); high.addActionListener(this); - + group = new ButtonGroup(); group.add(low); group.add(normal); group.add(high); - + GridBagLayout layout = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); - + setLayout(layout); setBorder(new TitledBorder(getLocalizedString("title.quality"))); - + c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(5, 5, 5, 5); c.gridx = 0; c.gridy = 0; add(low, c); - + c.gridx = 0; c.gridy = 1; add(normal, c); - + c.gridx = 0; c.gridy = 2; add(high, c); } - + public void actionPerformed(ActionEvent e) { if (e.getSource() == low) @@ -979,9 +979,9 @@ public final class PrinterDialog extends JDialog implements ActionListener else if (e.getSource() == normal) atts.add(PrintQuality.NORMAL); else - atts.add(PrintQuality.HIGH); + atts.add(PrintQuality.HIGH); } - + /** * Called to update for new selected * print service. Tests if currently @@ -994,17 +994,17 @@ public final class PrinterDialog extends JDialog implements ActionListener low.setEnabled(true); normal.setEnabled(true); high.setEnabled(true); - - Object defaultValue = defaultValue(PrintQuality.class); + + Object defaultValue = defaultValue(PrintQuality.class); Attribute quality = attribute(PrintQuality.class); - + if (quality != null) { if (quality.equals(PrintQuality.DRAFT)) low.setSelected(true); else if (quality.equals(PrintQuality.NORMAL)) normal.setSelected(true); - else + else high.setSelected(true); } else @@ -1013,81 +1013,81 @@ public final class PrinterDialog extends JDialog implements ActionListener low.setSelected(true); else if (defaultValue.equals(PrintQuality.NORMAL)) normal.setSelected(true); - else + else high.setSelected(true); - } + } } else { low.setEnabled(false); normal.setEnabled(false); high.setEnabled(false); - } + } } } - + /** * Handles the job attributes as requesting username, jobname etc. * @author Wolfgang Baer (WBaer@gmx.de) */ final class JobAttributes extends JPanel implements ActionListener, ChangeListener, FocusListener - { - private JLabel jobname, username, priority_lb; - private JTextField jobname_tf, username_tf; - private JCheckBox cover; + { + private JLabel jobname, username, priority_lb; + private JTextField jobname_tf, username_tf; + private JCheckBox cover; private JSpinner priority; private SpinnerNumberModel model; - + JobAttributes() { jobname = new JLabel(getLocalizedString("lb.jobname")); username = new JLabel(getLocalizedString("lb.username")); priority_lb = new JLabel(getLocalizedString("lb.priority")); - + cover = new JCheckBox(getLocalizedString("cb.cover")); cover.addActionListener(this); - + model = new SpinnerNumberModel(1, 1, 100, 1); priority = new JSpinner(model); priority.addChangeListener(this); - + jobname_tf = new JTextField(); jobname_tf.addFocusListener(this); username_tf = new JTextField(); username_tf.addFocusListener(this); - + GridBagLayout layout = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); - + setLayout(layout); setBorder(new TitledBorder(getLocalizedString("title.jobattributes"))); - + c.insets = new Insets(10, 5, 10, 5); c.gridx = 0; c.gridy = 0; add(cover, c); - + c.anchor = GridBagConstraints.LINE_END; c.gridx = 1; c.gridy = 0; c.weightx = 2; add(priority_lb, c); - + c.gridx = 2; c.gridy = 0; c.weightx = 0.5; add(priority, c); - + c.anchor = GridBagConstraints.LINE_END; c.gridx = 0; c.gridy = 1; add(jobname, c); - + c.gridx = 0; c.gridy = 2; add(username, c); - + c.anchor = GridBagConstraints.CENTER; c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 1; @@ -1095,13 +1095,13 @@ public final class PrinterDialog extends JDialog implements ActionListener c.gridwidth = 2; c.weightx = 1.5; add(jobname_tf, c); - + c.insets = new Insets(10, 5, 15, 5); c.gridx = 1; c.gridy = 2; add(username_tf, c); } - + public void actionPerformed(ActionEvent event) { if (cover.isSelected()) @@ -1109,23 +1109,23 @@ public final class PrinterDialog extends JDialog implements ActionListener else atts.add(JobSheets.NONE); } - + public void stateChanged(ChangeEvent event) { int value = ((Integer) priority.getValue()).intValue(); - atts.add(new JobPriority(value)); + atts.add(new JobPriority(value)); } - + public void focusGained(FocusEvent event) - { + { updateTextfields(event); } - + public void focusLost(FocusEvent event) { updateTextfields(event); } - + private void updateTextfields(FocusEvent event) { if (event.getSource() == jobname_tf) @@ -1141,59 +1141,59 @@ public final class PrinterDialog extends JDialog implements ActionListener */ void updateForSelectedService() { - // JobPriority + // JobPriority if (categorySupported(JobPriority.class)) { JobPriority prio = (JobPriority) attribute(JobPriority.class); - JobPriority value = (JobPriority) defaultValue(JobPriority.class); + JobPriority value = (JobPriority) defaultValue(JobPriority.class); priority.setEnabled(true); if (prio != null) model.setValue(new Integer(prio.getValue())); else model.setValue(new Integer(value.getValue())); - } + } else - priority.setEnabled(false); - + priority.setEnabled(false); + // Requesting username if (categorySupported(RequestingUserName.class)) { Attribute user = attribute(RequestingUserName.class); Object value = defaultValue(RequestingUserName.class); - username.setEnabled(true); + username.setEnabled(true); if (user != null) username_tf.setText(user.toString()); else username_tf.setText(value.toString()); } else - username.setEnabled(false); - + username.setEnabled(false); + // Job Name if (categorySupported(JobName.class)) { Attribute job = attribute(JobName.class); Object value = defaultValue(JobName.class); - jobname.setEnabled(true); + jobname.setEnabled(true); if (job != null) jobname_tf.setText(job.toString()); else jobname_tf.setText(value.toString()); } else - jobname.setEnabled(false); - + jobname.setEnabled(false); + // Job sheets if (categorySupported(JobSheets.class)) { Attribute sheet = attribute(JobSheets.class); Object value = defaultValue(JobSheets.class); - cover.setEnabled(true); + cover.setEnabled(true); if (sheet != null) { if (sheet.equals(JobSheets.NONE)) cover.setSelected(false); - else + else cover.setSelected(true); } else @@ -1205,53 +1205,53 @@ public final class PrinterDialog extends JDialog implements ActionListener } } else - cover.setEnabled(false); + cover.setEnabled(false); } } - + /** * Handles the sides attributes. * @author Wolfgang Baer (WBaer@gmx.de) */ final class SidesPanel extends JPanel implements ActionListener - { + { private JRadioButton oneside, calendar, duplex; - + SidesPanel() - { + { oneside = new JRadioButton(getLocalizedString("rbt.onesided")); oneside.addActionListener(this); calendar = new JRadioButton(getLocalizedString("rbt.calendar")); calendar.addActionListener(this); duplex = new JRadioButton(getLocalizedString("rbt.duplex")); duplex.addActionListener(this); - + ButtonGroup group = new ButtonGroup(); group.add(oneside); group.add(calendar); group.add(duplex); - + GridBagLayout layout = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; - + setLayout(layout); setBorder(new TitledBorder(getLocalizedString("title.sides"))); - + c.insets = new Insets(5, 5, 5, 5); c.gridx = 0; c.gridy = 0; add(oneside, c); - + c.gridx = 0; c.gridy = 1; add(calendar, c); - + c.gridx = 0; c.gridy = 2; add(duplex, c); } - + public void actionPerformed(ActionEvent e) { if (e.getSource() == calendar) @@ -1261,7 +1261,7 @@ public final class PrinterDialog extends JDialog implements ActionListener else atts.add(Sides.TWO_SIDED_LONG_EDGE); } - + /** * Called to update for new selected * print service. Tests if currently @@ -1274,8 +1274,8 @@ public final class PrinterDialog extends JDialog implements ActionListener oneside.setEnabled(true); calendar.setEnabled(true); duplex.setEnabled(true); - - Object defaultValue = defaultValue(Sides.class); + + Object defaultValue = defaultValue(Sides.class); Attribute sides = attribute(Sides.class); if (sides != null) { @@ -1297,14 +1297,14 @@ public final class PrinterDialog extends JDialog implements ActionListener } } else - { + { oneside.setEnabled(false); calendar.setEnabled(false); duplex.setEnabled(false); - } + } } } - + /** * Handles the chromaticity attributes. * @author Wolfgang Baer (WBaer@gmx.de) @@ -1312,43 +1312,43 @@ public final class PrinterDialog extends JDialog implements ActionListener final class Color extends JPanel implements ActionListener { private JRadioButton bw, color; - + Color() { bw = new JRadioButton(getLocalizedString("rbt.blackwhite")); bw.addActionListener(this); color = new JRadioButton(getLocalizedString("rbt.color")); color.addActionListener(this); - + ButtonGroup group = new ButtonGroup(); group.add(bw); group.add(color); - + GridBagLayout layout = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); - + setLayout(layout); setBorder(new TitledBorder(getLocalizedString("title.color"))); - + c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(5, 5, 5, 5); c.gridx = 0; c.gridy = 0; add(bw, c); - + c.gridx = 0; c.gridy = 1; add(color, c); } - + public void actionPerformed(ActionEvent e) { if (e.getSource() == bw) - atts.add(Chromaticity.MONOCHROME); + atts.add(Chromaticity.MONOCHROME); else atts.add(Chromaticity.COLOR); } - + /** * Called to update for new selected * print service. Tests if currently @@ -1359,68 +1359,68 @@ public final class PrinterDialog extends JDialog implements ActionListener if (categorySupported(Chromaticity.class)) { bw.setEnabled(true); - color.setEnabled(true); - - Object defaultValue = defaultValue(Chromaticity.class); + color.setEnabled(true); + + Object defaultValue = defaultValue(Chromaticity.class); Attribute chromaticity = attribute(Chromaticity.class); if (chromaticity != null) { if (chromaticity.equals(Chromaticity.MONOCHROME)) bw.setSelected(true); - else + else color.setSelected(true); } else { if (defaultValue.equals(Chromaticity.MONOCHROME)) bw.setSelected(true); - else + else color.setSelected(true); } } else - { + { bw.setEnabled(false); color.setEnabled(false); } } } - + private Quality quality_panel; private JobAttributes jobAttr_panel; private SidesPanel sides_panel; private Color chromaticy_panel; - + /** * Creates the panel for appearance attributes. */ public AppearancePanel() { setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); - + quality_panel = new Quality(); jobAttr_panel = new JobAttributes(); sides_panel = new SidesPanel(); chromaticy_panel = new Color(); - + JPanel layout_panel = new JPanel(); layout_panel.setLayout(new BoxLayout(layout_panel, BoxLayout.LINE_AXIS)); layout_panel.add(chromaticy_panel); layout_panel.add(Box.createRigidArea(new Dimension(10, 0))); layout_panel.add(quality_panel); - + JPanel layout2_panel = new JPanel(); layout2_panel.setLayout(new BoxLayout(layout2_panel, BoxLayout.LINE_AXIS)); layout2_panel.add(sides_panel); layout2_panel.add(Box.createRigidArea(new Dimension(10, 0))); layout2_panel.add(jobAttr_panel); - + setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS)); add(layout_panel); add(Box.createRigidArea(new Dimension(0, 12))); add(layout2_panel); } - + /** * Calls update on all internal panels to adjust * for a new selected print service. @@ -1442,47 +1442,47 @@ public final class PrinterDialog extends JDialog implements ActionListener private GeneralPanel general_panel; private PageSetupPanel pagesetup_panel; private AppearancePanel appearance_panel; - + private PrintService[] services; private PrintService defaultService; private PrintService selectedService; private DocFlavor flavor; private PrintRequestAttributeSet attributes; - - private boolean onlyPageDialog; - private PrintRequestAttributeSet atts; - + + private boolean onlyPageDialog; + private PrintRequestAttributeSet atts; + private final static ResourceBundle messages; static - { + { messages = ResourceBundle.getBundle("gnu/javax/print/PrinterDialog"); } - + // TODO LowPriority: Include checks so that if a specific value formerly // selected is no more supported by the new service changes to the default. - + /** * Class private constructs a printer dialog. - * + * * @param gc the screen to use. <code>null</code> is default screen. * @param services the print services to browse (not null). * @param defaultService the default service. If <code>null</code> * the first of the print services in the services array will be used. * @param flavor the flavours to be printed. - * @param attributes the attributes requested. Will be updated + * @param attributes the attributes requested. Will be updated * by selections done by the user in the dialog. * @param onlyPageDialog if true a page settings only dialog is constructed. - * + * * @throws HeadlessException if GraphicsEnvironment is headless */ - private PrinterDialog(GraphicsConfiguration gc, PrintService[] services, - PrintService defaultService, DocFlavor flavor, + private PrinterDialog(GraphicsConfiguration gc, PrintService[] services, + PrintService defaultService, DocFlavor flavor, PrintRequestAttributeSet attributes, boolean onlyPageDialog, String title) throws HeadlessException { super((Frame)null, title, true, gc); - + setResizable(false); setDefaultCloseOperation(DISPOSE_ON_CLOSE); @@ -1493,97 +1493,97 @@ public final class PrinterDialog extends JDialog implements ActionListener for(int i=0; i < services.length; i++) if (services[i].isDocFlavorSupported(flavor)) list.add(services[i]); - + if (defaultService != null && (! list.contains(defaultService))) defaultService = (PrintService) list.get(0); - + PrintService[] newServices = new PrintService[list.size()]; this.services = (PrintService[]) list.toArray(newServices); } else this.services = services; - + if (defaultService == null) this.defaultService = services[0]; else this.defaultService = defaultService; - + this.selectedService = this.defaultService; this.flavor = flavor; - + // the attributes given by the user this.attributes = attributes; // the one to work with during browsing this.atts = new HashPrintRequestAttributeSet(attributes); - + this.onlyPageDialog = onlyPageDialog; - - initUI(onlyPageDialog); + + initUI(onlyPageDialog); pack(); updateAll(); } - + /** * Constructs a page settings only dialog. - * + * * @param gc the screen to use. <code>null</code> is default screen. * @param service the print service for the page dialog. * the first of the print services in the services array will be used. * @param flavor the flavours to be printed. - * @param attributes the attributes requested. Will be updated - * by selections done by the user in the dialog. - * + * @param attributes the attributes requested. Will be updated + * by selections done by the user in the dialog. + * * @throws HeadlessException if GraphicsEnvironment is headless */ - public PrinterDialog(GraphicsConfiguration gc, PrintService service, + public PrinterDialog(GraphicsConfiguration gc, PrintService service, DocFlavor flavor, PrintRequestAttributeSet attributes) throws HeadlessException { - this(gc, new PrintService[] {service}, service, flavor, attributes, - true, getLocalizedString("title.pagedialog")); + this(gc, new PrintService[] {service}, service, flavor, attributes, + true, getLocalizedString("title.pagedialog")); } - + /** * Constructs a printer dialog. - * + * * @param gc the screen to use. <code>null</code> is default screen. * @param services the print services to browse (not null). * @param defaultService the default service. If <code>null</code> * the first of the print services in the services array will be used. * @param flavor the flavours to be printed. - * @param attributes the attributes requested. Will be updated - * by selections done by the user in the dialog. - * + * @param attributes the attributes requested. Will be updated + * by selections done by the user in the dialog. + * * @throws HeadlessException if GraphicsEnvironment is headless */ - public PrinterDialog(GraphicsConfiguration gc, PrintService[] services, - PrintService defaultService, DocFlavor flavor, + public PrinterDialog(GraphicsConfiguration gc, PrintService[] services, + PrintService defaultService, DocFlavor flavor, PrintRequestAttributeSet attributes) throws HeadlessException { - this(gc, services, defaultService, flavor, attributes, + this(gc, services, defaultService, flavor, attributes, false, getLocalizedString("title.printdialog")); } // initializes the gui parts private void initUI(boolean onlyPageDialog) - { + { JPanel buttonPane = new JPanel(); - + if (onlyPageDialog) { JPanel pane = new JPanel(); pane.setLayout(new BorderLayout()); pagesetup_panel = new PageSetupPanel(); pane.add(pagesetup_panel, BorderLayout.CENTER); - + ok_bt = new JButton(getLocalizedString("bt.OK")); ok_bt.addActionListener(this); cancel_bt = new JButton(getLocalizedString("bt.cancel")); - cancel_bt.addActionListener(this); - - getContentPane().add(pane, BorderLayout.CENTER); + cancel_bt.addActionListener(this); + + getContentPane().add(pane, BorderLayout.CENTER); } else { @@ -1607,14 +1607,14 @@ public final class PrinterDialog extends JDialog implements ActionListener // Put everything together getContentPane().add(pane, BorderLayout.CENTER); } - + buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS)); buttonPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); buttonPane.add(Box.createHorizontalGlue()); buttonPane.add(ok_bt); buttonPane.add(Box.createRigidArea(new Dimension(5, 0))); buttonPane.add(cancel_bt); - + getContentPane().add(buttonPane, BorderLayout.PAGE_END); } @@ -1635,17 +1635,17 @@ public final class PrinterDialog extends JDialog implements ActionListener { return selectedService; } - + /** * Sets the currently selected print service. - * + * * @param service the service selected. */ protected void setSelectedPrintService(PrintService service) { selectedService = service; } - + /** * Returns the print service array. * @return The print services. @@ -1654,7 +1654,7 @@ public final class PrinterDialog extends JDialog implements ActionListener { return services; } - + /** * Calls update on all panels to adjust * for a new selected print service. @@ -1662,57 +1662,57 @@ public final class PrinterDialog extends JDialog implements ActionListener void updateAll() { pagesetup_panel.update(); - + if (! onlyPageDialog) { general_panel.update(); appearance_panel.update(); - } + } } - + boolean categorySupported(Class category) { return getSelectedPrintService(). isAttributeCategorySupported(category); } - + Object defaultValue(Class category) { return getSelectedPrintService(). getDefaultAttributeValue(category); } - + Attribute attribute(Class category) { return atts.get(category); } - - /** + + /** * Action handler for Print/Cancel buttons. * If cancel is pressed we reset the attributes * and the selected service. - * + * * @param e the ActionEvent */ public void actionPerformed(ActionEvent e) { if (e.getSource() == ok_bt) { - setVisible(false); + setVisible(false); attributes.addAll(atts); dispose(); } else { - setVisible(false); + setVisible(false); selectedService = null; dispose(); } } - + /** * Retrieves localized messages from the resource bundle. - * + * * @param key the key * @return The localized value for the key. */ diff --git a/gnu/javax/print/ipp/DocPrintJobImpl.java b/gnu/javax/print/ipp/DocPrintJobImpl.java index d391afc7e..8cfd6880d 100644 --- a/gnu/javax/print/ipp/DocPrintJobImpl.java +++ b/gnu/javax/print/ipp/DocPrintJobImpl.java @@ -76,52 +76,52 @@ import javax.print.event.PrintJobEvent; import javax.print.event.PrintJobListener; /** - * Implementation of the DocPrintJob interface. Implementation is + * Implementation of the DocPrintJob interface. Implementation is * specific to the <code>IppPrintService</code> implementation. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public class DocPrintJobImpl implements CancelablePrintJob { /** The print service this job is bound to. */ private IppPrintService service; - + /** The set of print job listeners. */ private HashSet printJobListener = new HashSet(); - + /** The print job attributes listeners. */ private ArrayList attributesListener = new ArrayList(); /** The print job attributes listeners associated attribute set. */ private ArrayList attributesListenerAttributes = new ArrayList(); - + /** The username. */ private String username; /** The password of the user. */ private String password; - + /** Returned job uri. */ private JobUri jobUri = null; /** Returned job id. */ private JobId jobId = null; - + /** The requesting-username for later canceling */ private RequestingUserName requestingUser; - + /** The print job sets. */ private PrintJobAttributeSet oldSet = new HashPrintJobAttributeSet(); private PrintJobAttributeSet currentSet = new HashPrintJobAttributeSet(); - - /** + + /** * State variable if we already started printing. */ private boolean printing = false; - + // TODO Implement complete PrintJobListener notification // TODO Implement PrintJobAttributeListener notification /** * Constructs a DocPrintJobImpl instance bound to the given print service. - * + * * @param service the print service instance. * @param user the user of this print service. * @param passwd the password of the user. @@ -141,7 +141,7 @@ public class DocPrintJobImpl implements CancelablePrintJob { if (listener == null) return; - + attributesListener.add(listener); attributesListenerAttributes.add(attributes); } @@ -153,7 +153,7 @@ public class DocPrintJobImpl implements CancelablePrintJob { if (listener == null) return; - + printJobListener.add(listener); } @@ -181,30 +181,30 @@ public class DocPrintJobImpl implements CancelablePrintJob { if (printing) throw new PrintException("already printing"); - + printing = true; - + DocAttributeSet docAtts = doc.getAttributes(); DocFlavor flavor = doc.getDocFlavor(); - + if (flavor == null || (!service.isDocFlavorSupported(flavor))) { notifyPrintJobListeners(new PrintJobEvent(this, PrintJobEvent.JOB_FAILED)); throw new PrintFlavorException("Invalid flavor", new DocFlavor[] {flavor}); } - - // merge attributes as doc attributes take precendence + + // merge attributes as doc attributes take precendence // over the print request attributes HashAttributeSet mergedAtts = new HashAttributeSet(); - + if (attributes != null) mergedAtts.addAll(attributes); if (docAtts != null) mergedAtts.addAll(docAtts); - + // check for requesting-user-name -add the // executing username if no other is specified - // save user name so we can make a cancel operation under same user + // save user name so we can make a cancel operation under same user if (! mergedAtts.containsKey(RequestingUserName.class)) { mergedAtts.add(IppPrintService.REQUESTING_USER_NAME); @@ -212,53 +212,53 @@ public class DocPrintJobImpl implements CancelablePrintJob } else { - requestingUser = (RequestingUserName) + requestingUser = (RequestingUserName) mergedAtts.get(RequestingUserName.class); } - + // same for job-name if (! mergedAtts.containsKey(JobName.class)) mergedAtts.add(IppPrintService.JOB_NAME); - + IppResponse response = null; - + try { PrinterURI printerUri = service.getPrinterURI(); String printerUriStr = "http" + printerUri.toString().substring(3); - + URI uri = null; try { uri = new URI(printerUriStr); } - catch (URISyntaxException e) + catch (URISyntaxException e) { - // does not happen + // does not happen } - - IppRequest request = - new IppRequest(uri, username, password); - + + IppRequest request = + new IppRequest(uri, username, password); + request.setOperationID( (short) OperationsSupported.PRINT_JOB.getValue()); request.setOperationAttributeDefaults(); request.addOperationAttribute(printerUri); - + if (mergedAtts != null) { request.addAndFilterJobOperationAttributes(mergedAtts); request.addAndFilterJobTemplateAttributes(mergedAtts); - } - + } + // DocFlavor getMimeType returns charset quoted DocumentFormat format = DocumentFormat.createDocumentFormat(flavor); request.addOperationAttribute(format); - - // Get and set the printdata based on the + + // Get and set the printdata based on the // representation classname - String className = flavor.getRepresentationClassName(); - - if (className.equals("[B")) + String className = flavor.getRepresentationClassName(); + + if (className.equals("[B")) { request.setData((byte[]) doc.getPrintData()); response = request.send(); @@ -275,7 +275,7 @@ public class DocPrintJobImpl implements CancelablePrintJob try { // CUPS only supports UTF-8 currently so we convert - // We also assume that char[] is always utf-16 - correct ? + // We also assume that char[] is always utf-16 - correct ? String str = new String((char[]) doc.getPrintData()); request.setData(str.getBytes("utf-16")); response = request.send(); @@ -285,7 +285,7 @@ public class DocPrintJobImpl implements CancelablePrintJob notifyPrintJobListeners(new PrintJobEvent(this, PrintJobEvent.JOB_FAILED)); throw new PrintFlavorException("Invalid charset of flavor", e, new DocFlavor[] {flavor}); } - } + } else if (className.equals("java.io.Reader")) { try @@ -300,13 +300,13 @@ public class DocPrintJobImpl implements CancelablePrintJob notifyPrintJobListeners(new PrintJobEvent(this, PrintJobEvent.JOB_FAILED)); throw new PrintFlavorException("Invalid charset of flavor", e, new DocFlavor[] {flavor}); } - } + } else if (className.equals("java.lang.String")) { try { // CUPS only supports UTF-8 currently so we convert - // We also assume that String is always utf-16 - correct ? + // We also assume that String is always utf-16 - correct ? String str = (String) doc.getPrintData(); request.setData(str.getBytes("utf-16")); response = request.send(); @@ -316,7 +316,7 @@ public class DocPrintJobImpl implements CancelablePrintJob notifyPrintJobListeners(new PrintJobEvent(this, PrintJobEvent.JOB_FAILED)); throw new PrintFlavorException("Invalid charset of flavor", e, new DocFlavor[] {flavor}); } - } + } else if (className.equals("java.net.URL")) { URL url = (URL) doc.getPrintData(); @@ -332,22 +332,22 @@ public class DocPrintJobImpl implements CancelablePrintJob // For the future :-) throw new PrintException("Not yet supported."); } - else + else { // should not happen - however notifyPrintJobListeners(new PrintJobEvent(this, PrintJobEvent.JOB_FAILED)); throw new PrintFlavorException("Invalid flavor", new DocFlavor[] {flavor}); - } - + } + // at this point the data is transfered notifyPrintJobListeners(new PrintJobEvent( this, PrintJobEvent.DATA_TRANSFER_COMPLETE)); - } + } catch (IOException e) { throw new PrintException("IOException occured.", e); - } - + } + int status = response.getStatusCode(); if (! (status == IppStatusCode.SUCCESSFUL_OK || status == IppStatusCode.SUCCESSFUL_OK_IGNORED_OR_SUBSTITUED_ATTRIBUTES @@ -356,7 +356,7 @@ public class DocPrintJobImpl implements CancelablePrintJob notifyPrintJobListeners(new PrintJobEvent( this, PrintJobEvent.JOB_FAILED)); throw new PrintException("Printing failed - received statuscode " + Integer.toHexString(status)); - + // TODO maybe specific status codes may require to throw a specific // detailed attribute exception } @@ -364,18 +364,18 @@ public class DocPrintJobImpl implements CancelablePrintJob { // start print job progress monitoring thread // FIXME Implement - + // for now we just notify as finished notifyPrintJobListeners( new PrintJobEvent(this, PrintJobEvent.JOB_COMPLETE)); } - + List jobAtts = response.getJobAttributes(); - + // extract the uri and id of job for canceling and further monitoring Map jobAttributes = (Map) jobAtts.get(0); jobUri = (JobUri) ((HashSet)jobAttributes.get(JobUri.class)).toArray()[0]; - jobId = (JobId) ((HashSet)jobAttributes.get(JobId.class)).toArray()[0]; + jobId = (JobId) ((HashSet)jobAttributes.get(JobId.class)).toArray()[0]; } /** @@ -385,7 +385,7 @@ public class DocPrintJobImpl implements CancelablePrintJob { if (listener == null) return; - + int index = attributesListener.indexOf(listener); if (index != -1) { @@ -401,10 +401,10 @@ public class DocPrintJobImpl implements CancelablePrintJob { if (listener == null) return; - + printJobListener.remove(listener); } - + /** * @see CancelablePrintJob#cancel() */ @@ -414,23 +414,23 @@ public class DocPrintJobImpl implements CancelablePrintJob { throw new PrintException("print job is not yet send"); } - + IppResponse response = null; - + try { - IppRequest request = new IppRequest(jobUri.getURI(), username, password); + IppRequest request = new IppRequest(jobUri.getURI(), username, password); request.setOperationID( (short) OperationsSupported.CANCEL_JOB.getValue()); request.setOperationAttributeDefaults(); request.addOperationAttribute(jobUri); request.addOperationAttribute(requestingUser); - response = request.send(); - } + response = request.send(); + } catch (IOException e) - { + { throw new IppException("IOException occured during cancel request.", e); - } - + } + int status = response.getStatusCode(); if (! (status == IppStatusCode.SUCCESSFUL_OK || status == IppStatusCode.SUCCESSFUL_OK_IGNORED_OR_SUBSTITUED_ATTRIBUTES @@ -438,15 +438,15 @@ public class DocPrintJobImpl implements CancelablePrintJob { notifyPrintJobListeners(new PrintJobEvent( this, PrintJobEvent.JOB_FAILED)); - throw new PrintException("Canceling failed - received statuscode " + Integer.toHexString(status)); + throw new PrintException("Canceling failed - received statuscode " + Integer.toHexString(status)); } - else + else { notifyPrintJobListeners(new PrintJobEvent( this, PrintJobEvent.JOB_CANCELED)); } } - + private void notifyPrintJobListeners(PrintJobEvent e) { Iterator it = printJobListener.iterator(); @@ -463,9 +463,9 @@ public class DocPrintJobImpl implements CancelablePrintJob l.printJobFailed(e); else if (e.getPrintEventType() == PrintJobEvent.NO_MORE_EVENTS) l.printJobNoMoreEvents(e); - else + else l.printJobRequiresAttention(e); - } + } } - + } diff --git a/gnu/javax/print/ipp/IppDelimiterTag.java b/gnu/javax/print/ipp/IppDelimiterTag.java index ce6bb4f7e..1c074a8dd 100644 --- a/gnu/javax/print/ipp/IppDelimiterTag.java +++ b/gnu/javax/print/ipp/IppDelimiterTag.java @@ -1,4 +1,4 @@ -/* IppDelimiterTag.java -- +/* IppDelimiterTag.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -42,57 +42,57 @@ package gnu.javax.print.ipp; /** * IPP Delimiter Tags as described in RFC 2910 section 3.5.1. * <p> - * Every delimiter tag value can occur in the protocol field + * Every delimiter tag value can occur in the protocol field * begin-attribute-group-tag and indicates that the following * attributes will be part of the named group.<br> * The end-of-attributes-tag signals the end of the attributes * section in the IPP request/response and therefore the beginning - * of the data section (if any). + * of the data section (if any). * </p> - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class IppDelimiterTag { /** Start of the operation attributes group section. */ public static final byte OPERATION_ATTRIBUTES_TAG = 0x01; - + /** Start of the job attributes group section. */ public static final byte JOB_ATTRIBUTES_TAG = 0x02; - + /** End of the attributes section and begin of data section. */ public static final byte END_OF_ATTRIBUTES_TAG = 0x03; - + /** Start of the printer attributes group section. */ public static final byte PRINTER_ATTRIBUTES_TAG = 0x04; - + /** Start of the unsupported attributes group section. */ public static final byte UNSUPPORTED_ATTRIBUTES_TAG = 0x05; - - + + // 0x00 reserved for definition in a future IETF // standards track document - + // 0x06-0x0f reserved for future delimiters in IETF // standards track documents - + private IppDelimiterTag() { // not to be instantiated } - + /** - * Tests if given value corresponds to a + * Tests if given value corresponds to a * delimiter tag value. - * + * * @param value the value to test for * @return <code>true</code> if, <code>false</code> otherwise. */ - public static boolean isDelimiterTag(byte value) + public static boolean isDelimiterTag(byte value) { if (value >= 0x01 && value <= 0x05) return true; - + return false; } diff --git a/gnu/javax/print/ipp/IppException.java b/gnu/javax/print/ipp/IppException.java index 27b156fd8..c34a8f227 100644 --- a/gnu/javax/print/ipp/IppException.java +++ b/gnu/javax/print/ipp/IppException.java @@ -1,4 +1,4 @@ -/* IppException.java -- +/* IppException.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -44,7 +44,7 @@ import javax.print.PrintException; * <code>IppException</code> signals exception thrown by * the IPP implementation for various things like a failed * ipp request or a wrapped io exception. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public class IppException extends PrintException @@ -65,7 +65,7 @@ public class IppException extends PrintException { super(s); } - + /** * Creates an <code>IppException</code>. * @param e the exception cause this one. diff --git a/gnu/javax/print/ipp/IppMultiDocPrintService.java b/gnu/javax/print/ipp/IppMultiDocPrintService.java index df2a4793c..59c3408d5 100644 --- a/gnu/javax/print/ipp/IppMultiDocPrintService.java +++ b/gnu/javax/print/ipp/IppMultiDocPrintService.java @@ -1,4 +1,4 @@ -/* IppMultiDocPrintService.java -- +/* IppMultiDocPrintService.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -47,25 +47,25 @@ import javax.print.MultiDocPrintService; /** * Implementation of the MultiDocPrintService interface * for IPP based printers. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public class IppMultiDocPrintService extends IppPrintService +public class IppMultiDocPrintService extends IppPrintService implements MultiDocPrintService { /** The username. */ private transient String user; - + /** The password of the user. */ private transient String passwd; /** * Creates a <code>IppMultiDocPrintService</code> object. - * + * * @param uri the URI of the IPP printer. * @param username the user of this print service. * @param password the password of the user. - * + * * @throws IppException if an error during connection occurs. */ public IppMultiDocPrintService(URI uri, String username, String password) @@ -74,12 +74,12 @@ public class IppMultiDocPrintService extends IppPrintService super(uri, username, password); user = username; passwd = password; - } + } /** * @see MultiDocPrintService#createMultiDocPrintJob() */ - public MultiDocPrintJob createMultiDocPrintJob() + public MultiDocPrintJob createMultiDocPrintJob() { return new MultiDocPrintJobImpl(this, user, passwd); } diff --git a/gnu/javax/print/ipp/IppRequest.java b/gnu/javax/print/ipp/IppRequest.java index 869f8224b..661f144aa 100644 --- a/gnu/javax/print/ipp/IppRequest.java +++ b/gnu/javax/print/ipp/IppRequest.java @@ -1,4 +1,4 @@ -/* IppRequest.java -- +/* IppRequest.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -112,37 +112,37 @@ import javax.print.attribute.standard.Sides; * <li>data - q bytes - optional</li> * </ul> * </p> - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public class IppRequest { /** - * The printer-poll timeout. + * The printer-poll timeout. */ private static final int timeout = 1000; /** * Helper class used to write the attributes of a request * into the supplied data output stream in the correct way. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ class RequestWriter - { + { private DataOutputStream out; - + /** * Creates a RequestWriter. - * + * * @param stream the stream to write to. */ RequestWriter(DataOutputStream stream) { out = stream; } - + /** * Writes an attribute in IntegerSyntax into the stream. * @param attribute the attribute @@ -218,7 +218,7 @@ public class IppRequest out.write(name.getBytes()); } else - out.writeShort(0x0000); // only name-length + out.writeShort(0x0000); // only name-length out.writeShort(8); // range is 8 bytes out.writeInt(ranges[i][0]); @@ -283,7 +283,7 @@ public class IppRequest } out.writeByte(directionFromUTC); - out.writeByte(offsetInMillis / 3600000); // hours + out.writeByte(offsetInMillis / 3600000); // hours out.writeByte((offsetInMillis % 3600000) / 60000); // minutes } @@ -295,7 +295,7 @@ public class IppRequest * of NAME value-tag in IPP this method checks for these attributes and * writes them as NAME_WITHOUT_LANGUAGE value-tag into the stream. * </p> - * + * * @param attribute the attribute * @param out the stream to write to * @throws IOException if thrown by the stream @@ -314,11 +314,11 @@ public class IppRequest out.writeByte(IppValueTag.MIME_MEDIA_TYPE); else out.writeByte(IppValueTag.TEXT_WITHOUT_LANGUAGE); - + out.writeShort(name.length()); out.write(name.getBytes()); out.writeShort(attribute.getValue().length()); - out.write(attribute.getValue().getBytes()); + out.write(attribute.getValue().getBytes()); } /** @@ -347,8 +347,8 @@ public class IppRequest * @throws IOException if thrown by the stream */ private void write(CharsetSyntax attribute) throws IOException - { - String name = ((Attribute) attribute).getName(); + { + String name = ((Attribute) attribute).getName(); out.writeByte(IppValueTag.CHARSET); out.writeShort(name.length()); out.write(name.getBytes()); @@ -371,7 +371,7 @@ public class IppRequest out.writeShort(attribute.getValue().length()); out.write(attribute.getValue().getBytes()); } - + /** * Writes an attribute in RequestedAttributes into the stream. * @param attribute the attribute @@ -381,31 +381,31 @@ public class IppRequest private void write(RequestedAttributes attribute) throws IOException { List values = attribute.getValues(); - + String name = ((Attribute) attribute).getName(); out.writeByte(IppValueTag.KEYWORD); out.writeShort(name.length()); - out.write(name.getBytes()); + out.write(name.getBytes()); out.writeShort(((String) values.get(0)).length()); out.write(((String) values.get(0)).getBytes()); - + for (int i=1; i < values.size(); i++) { out.writeByte(IppValueTag.KEYWORD); out.writeShort(0x0000); // length for additional value out.writeShort(((String) values.get(i)).length()); - out.write(((String) values.get(i)).getBytes()); + out.write(((String) values.get(i)).getBytes()); } - } + } + - /** * Writes the given operation attribute group of the given map instance * (key=group, values=set of attributes) into the supplied data * output stream. - * + * * @param attributes the set with the attributes. - * + * * @throws IOException if thrown by the used DataOutputStream. * @throws IppException if unknown attributes occur. */ @@ -413,29 +413,29 @@ public class IppRequest throws IOException, IppException { out.write(IppDelimiterTag.OPERATION_ATTRIBUTES_TAG); - + // its essential to write these two in this order and as first ones Attribute att = attributes.get(AttributesCharset.class); write((CharsetSyntax) att); - - logger.log(Component.IPP, "Attribute: Name: <" - + att.getCategory().getName() + "> Value: <" + att.toString() + ">"); - + + logger.log(Component.IPP, "Attribute: Name: <" + + att.getCategory().getName() + "> Value: <" + att.toString() + ">"); + attributes.remove(AttributesCharset.class); - + att = attributes.get(AttributesNaturalLanguage.class); write((NaturalLanguageSyntax) att); attributes.remove(AttributesNaturalLanguage.class); - - logger.log(Component.IPP, "Attribute: Name: <" + + logger.log(Component.IPP, "Attribute: Name: <" + att.getCategory().getName() + "> Value: <" + att.toString() + ">"); - + // furthermore its essential to now write out the target attribute PrinterURI printerUri = (PrinterURI) attributes.get(PrinterURI.class); JobUri jobUri = (JobUri) attributes.get(JobUri.class); JobId jobId = (JobId) attributes.get(JobId.class); - RequestedAttributes reqAttrs - = (RequestedAttributes)attributes.get(RequestedAttributes.class); + RequestedAttributes reqAttrs + = (RequestedAttributes)attributes.get(RequestedAttributes.class); if (printerUri != null && jobId == null && jobUri == null) { write(printerUri); @@ -470,26 +470,26 @@ public class IppRequest .getName() + "> Value: <" + jobUri.toString() + ">"); } else if (reqAttrs != null) - { - write(reqAttrs); - attributes.remove(RequestedAttributes.class); - logger.log(Component.IPP, "RequestedAttributes: <" + reqAttrs + ">"); - } + { + write(reqAttrs); + attributes.remove(RequestedAttributes.class); + logger.log(Component.IPP, "RequestedAttributes: <" + reqAttrs + ">"); + } else { throw new IppException("Unknown target operation attribute combination."); - } - + } + writeAttributes(attributes); } - + /** * Writes the given attribute groups of the given map instance * (key=group, values=set of attributes) into the supplied data * output stream. - * + * * @param attributes the set with the attributes. - * + * * @throws IOException if thrown by the used DataOutputStream. * @throws IppException if unknown attributes occur. */ @@ -500,9 +500,9 @@ public class IppRequest for (int i = 0; i < attributeArray.length; i++) { logger.log(Component.IPP, "Attribute: Name: <" + attributeArray[i] - .getCategory().getName() + "> Value: <" - + attributeArray[i].toString() + ">"); - + .getCategory().getName() + "> Value: <" + + attributeArray[i].toString() + ">"); + if (attributeArray[i] instanceof IntegerSyntax) write((IntegerSyntax) attributeArray[i]); else if (attributeArray[i] instanceof TextSyntax) @@ -551,8 +551,8 @@ public class IppRequest /** The operation type of this request. */ private short operation_id; - /** - * The request id of this request. This is + /** + * The request id of this request. This is * assigned automatically by the constructor. */ private final int request_id; @@ -564,48 +564,48 @@ public class IppRequest private AttributeSet jobAttributes; private Object data; - + private URI requestUri; /** The underlying connection - IPP is http based */ private HttpURLConnection connection; - + /** * Creates an IPPRequest instance. - * + * * @param uri the URI of the request * @param user the user if any * @param password the password of the supplied user */ public IppRequest(URI uri, String user, String password) - { + { request_id = incrementRequestIdCounter(); requestUri = uri; - + try { - URL url = new URL("http", - user == null - ? uri.getHost() : user + ":" - + password + "@" + uri.getHost(), + URL url = new URL("http", + user == null + ? uri.getHost() : user + ":" + + password + "@" + uri.getHost(), uri.getPort(), uri.getPath()); - + connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setDoOutput(true); - + connection.setRequestProperty("Content-type", "application/ipp"); - connection.setRequestProperty("Accept", "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"); - } + connection.setRequestProperty("Accept", "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"); + } catch (IOException e) { // MalformedURLException - uri is already checked // ProtocolException - POST is correct method type - // IOException -HTTPURLConnection constructor actually + // IOException -HTTPURLConnection constructor actually // does never throw this exception. logger.log(Component.IPP, "Unexpected IOException", e); } - + logger.log(Component.IPP, "[IppConnection] Host: " + uri.getHost() + " Port: " + uri.getPort() + " Path: " + uri.getPath()); @@ -614,7 +614,7 @@ public class IppRequest /** * Synchronized method to be called by the constructor * to assign a unique request id to this request. - * + * * @return The unique request id. */ private synchronized int incrementRequestIdCounter() @@ -624,7 +624,7 @@ public class IppRequest /** * Returns the id of this request. - * + * * @return The request ID. */ public int getRequestID() @@ -632,11 +632,11 @@ public class IppRequest return request_id; } - /** - * Sets the data of the request. The data used in this + /** + * Sets the data of the request. The data used in this * request will be the one of the supplied inputstream * instead of the alternative byte array possibility. - * + * * @param stream the input stream to use for the data. */ public void setData(InputStream stream) @@ -644,11 +644,11 @@ public class IppRequest data = stream; } - /** - * Sets the data of the request. The data used in this + /** + * Sets the data of the request. The data used in this * request will be the one of the supplied byte[] * instead of the alternative input stream possibility. - * + * * @param bytes the byte[] to use for the data. */ public void setData(byte[] bytes) @@ -658,7 +658,7 @@ public class IppRequest /** * Sets the operation id for this request. - * + * * @param id the operation id. */ public void setOperationID(short id) @@ -668,7 +668,7 @@ public class IppRequest /** * Adds the default values for the operation - * attributes "attributes-charset" and + * attributes "attributes-charset" and * "attributes-natural-language" */ public void setOperationAttributeDefaults() @@ -679,64 +679,64 @@ public class IppRequest operationAttributes.add(AttributesCharset.UTF8); operationAttributes.add(AttributesNaturalLanguage.EN); } - + /** * Add the job attribute of this request to the given * attribute set. - * + * * @param attribute the job attribute. */ public void addJobAttribute(Attribute attribute) { if (jobAttributes == null) jobAttributes = new HashAttributeSet(); - + jobAttributes.add(attribute); } - + /** * Sets the printer attribute of this request to the given * attribute set. - * + * * @param attribute the printer attribute. */ public void addPrinterAttributes(Attribute attribute) { if (printerAttributes == null) printerAttributes = new HashAttributeSet(); - + printerAttributes.add(attribute); } /** * Adds the given attribute to the operation attributes set. - * + * * @param attribute the operation attribute to add. */ public void addOperationAttribute(Attribute attribute) { if (operationAttributes == null) operationAttributes = new HashAttributeSet(); - + operationAttributes.add(attribute); } - + /** * Filters from the given attribute set the job operation out * and adds them to the operation attributes set. - * + * * @param set the attributes to filter, may not be <code>null</code>. */ public void addAndFilterJobOperationAttributes(AttributeSet set) { if (operationAttributes == null) operationAttributes = new HashAttributeSet(); - + // document-natural-language - not defined in JPS attributes // document-format - specified outside, special treatment Attribute[] tmp = set.toArray(); - for (int i = 0; i < tmp.length; i++) - { + for (int i = 0; i < tmp.length; i++) + { if (tmp[i].getCategory().equals(JobName.class) || tmp[i].getCategory().equals(Fidelity.class) || tmp[i].getCategory().equals(JobImpressions.class) @@ -745,27 +745,27 @@ public class IppRequest || tmp[i].getCategory().equals(Compression.class) || tmp[i].getCategory().equals(DocumentName.class) || tmp[i].getCategory().equals(RequestingUserName.class)) - - operationAttributes.add(tmp[i]); - } + + operationAttributes.add(tmp[i]); + } } - + /** * Filters from the given attribute set the job template attributes * out and adds them to the job attributes set. - * + * * @param set the attributes to filter, may not be <code>null</code>. */ public void addAndFilterJobTemplateAttributes(AttributeSet set) { if (jobAttributes == null) jobAttributes = new HashAttributeSet(); - + // document-natural-language - not defined in JPS attributes // document-format - specified outside, special treatment Attribute[] tmp = set.toArray(); - for (int i = 0; i < tmp.length; i++) - { + for (int i = 0; i < tmp.length; i++) + { if (tmp[i].getCategory().equals(JobPriority.class) || tmp[i].getCategory().equals(JobHoldUntil.class) || tmp[i].getCategory().equals(JobSheets.class) @@ -780,67 +780,67 @@ public class IppRequest || tmp[i].getCategory().equals(PrintQuality.class) || tmp[i].getCategory().equals(SheetCollate.class) || tmp[i].getCategory().equals(Sides.class)) - - jobAttributes.add(tmp[i]); - } + + jobAttributes.add(tmp[i]); + } } /** * Does some validation of the supplied parameters and then * sends the request to the ipp server or service. - * + * * @return The response if any. - * + * * @throws IllegalStateException if request is already sent * @throws IppException if connection or request failed. - * @throws IOException if writing of the header, attributes or footer fails. + * @throws IOException if writing of the header, attributes or footer fails. */ public IppResponse send() throws IppException, IOException { if (alreadySent) throw new IllegalStateException("Request is already sent"); - + alreadySent = true; - - OutputStream stream = connection.getOutputStream(); + + OutputStream stream = connection.getOutputStream(); DataOutputStream out = new DataOutputStream(stream); - + // the header 8 bytes long out.writeShort(VERSION); out.writeShort(operation_id); out.writeInt(request_id); - - logger.log(Component.IPP, "OperationID: " + Integer.toHexString(operation_id) - + " RequestID: " + request_id); - + + logger.log(Component.IPP, "OperationID: " + Integer.toHexString(operation_id) + + " RequestID: " + request_id); + // Pass stuff the the attribute writer which knows how to // write the attributes in correct order logger.log(Component.IPP, "Operation Attributes"); - + RequestWriter writer = new RequestWriter(out); - writer.writeOperationAttributes(operationAttributes); - + writer.writeOperationAttributes(operationAttributes); + if (jobAttributes != null) { logger.log(Component.IPP, "Job Attributes"); out.write(IppDelimiterTag.JOB_ATTRIBUTES_TAG); writer.writeAttributes(jobAttributes); - } + } if (printerAttributes != null) { logger.log(Component.IPP, "Printer Attributes"); out.write(IppDelimiterTag.PRINTER_ATTRIBUTES_TAG); writer.writeAttributes(printerAttributes); - } + } // write the delimiter to the data - out.write(IppDelimiterTag.END_OF_ATTRIBUTES_TAG); + out.write(IppDelimiterTag.END_OF_ATTRIBUTES_TAG); // check if data is byte[] or inputstream if (data instanceof InputStream) { byte[] readbuf = new byte[2048]; - int len = 0; + int len = 0; while( (len = ((InputStream) data).read(readbuf)) > 0) out.write(readbuf, 0, len); } @@ -848,27 +848,27 @@ public class IppRequest { out.write((byte[]) data); } - + out.flush(); - stream.flush(); - + stream.flush(); + // Set the connection timeout, for if the printer is offline. // FIXME: The print services polling should probably be done in its // own thread. connection.setConnectTimeout( timeout ); int responseCode = connection.getResponseCode(); - + if (responseCode == HttpURLConnection.HTTP_OK) - { - IppResponse response = new IppResponse(requestUri, operation_id); - response.setResponseData(connection.getInputStream()); + { + IppResponse response = new IppResponse(requestUri, operation_id); + response.setResponseData(connection.getInputStream()); return response; } logger.log(Component.IPP, "HTTP-Statuscode: " + responseCode); - throw new IppException("Request failed got HTTP status code " + throw new IppException("Request failed got HTTP status code " + responseCode); } diff --git a/gnu/javax/print/ipp/IppResponse.java b/gnu/javax/print/ipp/IppResponse.java index 81a1eb47b..00de2444b 100644 --- a/gnu/javax/print/ipp/IppResponse.java +++ b/gnu/javax/print/ipp/IppResponse.java @@ -1,4 +1,4 @@ -/* IppResponse.java -- +/* IppResponse.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -99,9 +99,9 @@ import javax.print.attribute.standard.PrinterStateReasons; import javax.print.attribute.standard.Severity; /** - * <code>IppResponse</code> models a response received from an IPP + * <code>IppResponse</code> models a response received from an IPP * compatible server as described in RFC 2910 IPP 1.1 Encoding and Transport. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public class IppResponse @@ -112,7 +112,7 @@ public class IppResponse * response stream. It provides access to the attribute groups after parsing * via getter methods. * <p> - * The enconding of a response is structured as follows (for an official + * The enconding of a response is structured as follows (for an official * description please have a look at the RFC document mentioned above): * <ul> * <li>version-number - 2 bytes - required</li> @@ -122,19 +122,19 @@ public class IppResponse * <li>end-of-attributes-tag - 1 byte - required</li> * <li>data - q bytes - optional</li> * </ul> - * </p><p> + * </p><p> * Where each attribute-group (if any) is encoded as follows: * <ul> * <li>begin-attribute-group-tag - 1 byte</li> * <li>attribute - p bytes - 0 or more</li> * </ul> - * </p><p> + * </p><p> * Encoding of attributes: * <ul> * <li>attribute-with-one-value - q bytes</li> * <li>additional-value - r bytes - 0 or more</li> * </ul> - * </p><p> + * </p><p> * Encoding of attribute-with-one-value: * <ul> * <li>value-tag - 1 byte</li> @@ -143,7 +143,7 @@ public class IppResponse * <li>value-length (value is v) - 2 bytes</li> * <li>value - v bytes</li> * </ul> - * </p><p> + * </p><p> * Encoding of additional value: * <ul> * <li>value-tag - 1 byte</li> @@ -152,21 +152,21 @@ public class IppResponse * <li>value - w bytes</li> * </ul> * </p> - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ class ResponseReader { /** The IPP version defaults to 1.1 */ private static final short VERSION = 0x0101; - + /** * Parses the inputstream containing the response of the IPP request. * @param input the inputstream * @throws IppException if unexpected exceptions occur. * @throws IOException if IO problems with the underlying inputstream occur. */ - public void parseResponse(InputStream input) + public void parseResponse(InputStream input) throws IppException, IOException { DataInputStream stream = new DataInputStream(input); @@ -179,7 +179,7 @@ public class IppResponse throw new IppException("Version mismatch - " + "implementation does not support other versions than IPP 1.1"); - logger.log(Component.IPP, "Statuscode: " + logger.log(Component.IPP, "Statuscode: " + Integer.toHexString(status_code) + " Request-ID: " + request_id); byte tag = 0; @@ -294,7 +294,7 @@ public class IppResponse // (4) The value itself value = new byte[valueLength]; - stream.read(value); + stream.read(value); // the value itself switch (tag) @@ -304,12 +304,12 @@ public class IppResponse case IppValueTag.UNKNOWN: // TODO implement out-of-band handling // We currently throw an exception to see when it occurs - not yet :-) - throw new IppException( + throw new IppException( "Unexpected name value for out-of-band value tag " + tag); case IppValueTag.NO_VALUE: - attribute = null; + attribute = null; - break; + break; case IppValueTag.INTEGER: int intValue = IppUtilities.convertToInt(value); attribute = IppUtilities.getIntegerAttribute(name, intValue); @@ -319,11 +319,11 @@ public class IppResponse // JPS API models boolean syntax type as enums // 0x01 = true, 0x00 = false - all are enums attribute = IppUtilities.getEnumAttribute(name, new Integer(value[0])); - + break; case IppValueTag.ENUM: - int intVal = IppUtilities.convertToInt(value); - attribute = IppUtilities.getEnumAttribute(name, new Integer(intVal)); + int intVal = IppUtilities.convertToInt(value); + attribute = IppUtilities.getEnumAttribute(name, new Integer(intVal)); break; case IppValueTag.OCTECTSTRING_UNSPECIFIED: @@ -347,7 +347,7 @@ public class IppResponse int crossFeed = IppUtilities.convertToInt(value[0], value[1], value[2], value[3]); int feed = IppUtilities.convertToInt(value[4], value[5], value[6], value[7]); int units = value[8]; - + if (name.equals("printer-resolution-default")) attribute = new PrinterResolutionDefault(crossFeed, feed, units); else if (name.equals("printer-resolution-supported")) // may be here also @@ -362,7 +362,7 @@ public class IppResponse attribute = new CopiesSupported(lower, upper); else if (name.equals("number-up-supported")) attribute = new NumberUpSupported(lower, upper); - else if (name.equals("job-k-octets-supported")) + else if (name.equals("job-k-octets-supported")) attribute = new JobKOctetsSupported(lower, upper); else if (name.equals("job-impressions-supported")) attribute = new JobImpressionsSupported(lower, upper); @@ -375,19 +375,19 @@ public class IppResponse case IppValueTag.NAME_WITH_LANGUAGE: case IppValueTag.NAME_WITHOUT_LANGUAGE: attribute = IppUtilities.getTextAttribute(name, tag, value); - + break; case IppValueTag.KEYWORD: str = new String(value); if (name.equals("job-hold-until-supported")) // may also be name type attribute = new JobHoldUntilSupported(str, null); else if (name.equals("job-hold-until-default")) - attribute = new JobHoldUntilDefault(str, null); + attribute = new JobHoldUntilDefault(str, null); else if (name.equals("media-supported")) attribute = new MediaSupported(str, null); else if (name.equals("media-default")) attribute = new MediaDefault(str, null); - else if (name.equals("job-sheets-default")) + else if (name.equals("job-sheets-default")) attribute = new JobSheetsDefault(str, null); else if (name.equals("job-sheets-supported")) attribute = new JobSheetsSupported(str, null); @@ -397,13 +397,13 @@ public class IppResponse attribute = parsePrinterStateReasons(value, lastAttribute); else attribute = IppUtilities.getEnumAttribute(name, str); - - // all other stuff is either an enum or needs to be mapped to an - // UnknownAttribute instance. Enums catched here are: + + // all other stuff is either an enum or needs to be mapped to an + // UnknownAttribute instance. Enums catched here are: // ipp-versions-supported, pdl-override-supported, compression-supported // uri-authentication-supported, uri-security-supported, sides-supported // sides-default, multiple-document-handling-supported, multiple-document-handling-default - + break; case IppValueTag.URI: try @@ -429,13 +429,13 @@ public class IppResponse attribute = new PrinterDriverInstaller(uri); else if (name.equals("printer-more-info-manufacturer")) attribute = new PrinterMoreInfoManufacturer(uri); - + break; case IppValueTag.URI_SCHEME: // only one uri-scheme exists - and its an enum if (name.equals("reference-uri-schemes-supported")) attribute = IppUtilities.getEnumAttribute(name, new String(value)); - + break; case IppValueTag.CHARSET: str = new String(value); @@ -445,7 +445,7 @@ public class IppResponse attribute = new CharsetConfigured(str); else if (name.equals("charset-supported")) // setOf attribute = new CharsetSupported(str); - + break; case IppValueTag.NATURAL_LANGUAGE: str = new String(value); @@ -455,7 +455,7 @@ public class IppResponse attribute = new NaturalLanguageConfigured(str); else if (name.equals("generated-natural-language-supported")) // setOf attribute = new GeneratedNaturalLanguageSupported(str); - + break; case IppValueTag.MIME_MEDIA_TYPE: str = new String(value); @@ -465,7 +465,7 @@ public class IppResponse attribute = new DocumentFormatSupported(str, null); else if (name.equals("document-format")) // setOf attribute = new DocumentFormat(str, null); - + break; default: throw new IppException("Unknown tag with value " @@ -474,10 +474,10 @@ public class IppResponse if (attribute == null) attribute = new UnknownAttribute(tag, name, value); - + addAttribute(attributes, attribute); lastAttribute = attribute; - + logger.log(Component.IPP, "Attribute: " + name + " Value: " + attribute.toString()); } @@ -505,7 +505,7 @@ public class IppResponse attributeValues.add(attribute); } - + /** * Parses a name with or without language attribute value from the byte[] * and returns the result as an object[]. @@ -516,39 +516,39 @@ public class IppResponse private PrinterStateReasons parsePrinterStateReasons(byte[] value, Attribute lastAttr) { String str = new String(value); - PrinterStateReasons attribute; - + PrinterStateReasons attribute; + if (lastAttr instanceof PrinterStateReasons) attribute = (PrinterStateReasons) lastAttr; else attribute = new PrinterStateReasons(); - + // special case indicating no reasons - if (str.equals("none")) + if (str.equals("none")) return attribute; - + Severity severity = null; PrinterStateReason reason = null; - + if (str.endsWith(Severity.WARNING.toString())) severity = Severity.WARNING; else if (str.endsWith(Severity.REPORT.toString())) severity = Severity.REPORT; else if (str.endsWith(Severity.ERROR.toString())) severity = Severity.ERROR; - + if (severity != null) - str = str.substring(0, str.lastIndexOf('-')); - else // we must associate a severity + str = str.substring(0, str.lastIndexOf('-')); + else // we must associate a severity severity = Severity.REPORT; - - reason = (PrinterStateReason) + + reason = (PrinterStateReason) IppUtilities.getEnumAttribute("printer-state-reason", str); - + attribute.put(reason , severity); return attribute; } - + /** * Parses a name with or without language attribute value from the byte[] * and returns the result as an object[]. @@ -559,24 +559,24 @@ public class IppResponse private JobStateReasons parseJobStateReasons(byte[] value, Attribute lastAttr) { String str = new String(value); - JobStateReasons attribute; - + JobStateReasons attribute; + if (lastAttr instanceof JobStateReasons) attribute = (JobStateReasons) lastAttr; else attribute = new JobStateReasons(); - + // special case indicating no reasons - if (str.equals("none")) + if (str.equals("none")) return attribute; - - JobStateReason reason = (JobStateReason) + + JobStateReason reason = (JobStateReason) IppUtilities.getEnumAttribute("job-state-reason", str); - + attribute.add(reason); return attribute; } - + /** * Parses a DateTime syntax attribute and returns the constructed Date * object. @@ -597,7 +597,7 @@ public class IppResponse * <li>10 | 11 | minutes from UTC | 0..59</li> * </ul> * </p> - * + * * @param value the byte[] * @return The date object. */ @@ -625,13 +625,13 @@ public class IppResponse return cal.getTime(); } } - + /** * Logger for tracing - enable by passing * -Dgnu.classpath.debug.components=ipp to the vm. */ static final Logger logger = SystemLogger.SYSTEM; - + URI uri; short operation_id; short status_code; @@ -646,7 +646,7 @@ public class IppResponse /** * Creates an <code>IppResponse</code> instance. - * + * * @param uri the uri the request was directy to. * @param operation_id the operation id of the request. */ @@ -662,7 +662,7 @@ public class IppResponse /** * Sets the data received from the request sent. - * + * * @param input the input stream received. * @throws IppException if parsing fails. */ @@ -703,7 +703,7 @@ public class IppResponse * Returns the set of job attributes group maps. * There may occur more than one group of type job attribute in a response * because of e.g. multiple job or print service informations requested. - * + * * @return The list of job attribute grou maps. */ public List getJobAttributes() @@ -715,7 +715,7 @@ public class IppResponse * Returns the set of operation attributes group maps. * There may occur more than one group of type job attribute in a response * because of e.g. multiple job or print service informations requested. - * + * * @return The list of operation attribute grou maps. */ public List getOperationAttributes() @@ -727,7 +727,7 @@ public class IppResponse * Returns the set of printer attributes group maps. * There may occur more than one group of type job attribute in a response * because of e.g. multiple job or print service informations requested. - * + * * @return The list of printer attribute grou maps. */ public List getPrinterAttributes() @@ -737,7 +737,7 @@ public class IppResponse /** * Returns the ID of the initial request. - * + * * @return The request ID. */ public int getRequestID() @@ -748,7 +748,7 @@ public class IppResponse /** * Returns the status code of the response. * Defined in {@link IppStatusCode}. - * + * * @return The status code. */ public short getStatusCode() @@ -760,7 +760,7 @@ public class IppResponse * Returns the set of unsupported attributes group maps. * There may occur more than one group of type job attribute in a response * because of e.g. multiple job or print service informations requested. - * + * * @return The list of unsupported attribute grou maps. */ public List getUnsupportedAttributes() @@ -770,7 +770,7 @@ public class IppResponse /** * Returns the data of the response. - * + * * @return The data as byte[]. */ public byte[] getData() diff --git a/gnu/javax/print/ipp/IppStatusCode.java b/gnu/javax/print/ipp/IppStatusCode.java index d2cb8391f..a3b245c43 100644 --- a/gnu/javax/print/ipp/IppStatusCode.java +++ b/gnu/javax/print/ipp/IppStatusCode.java @@ -1,4 +1,4 @@ -/* IppStatusCode.java -- +/* IppStatusCode.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -39,20 +39,20 @@ package gnu.javax.print.ipp; /** - * IPP Status codes as described in RFC 2911 APPENDIX B + * IPP Status codes as described in RFC 2911 APPENDIX B * (Status Codes and Suggested Status Code Messages) * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class IppStatusCode -{ - /** - * Indicates a successful request with no attributes being - * ignored or substituted. +{ + /** + * Indicates a successful request with no attributes being + * ignored or substituted. */ public static final int SUCCESSFUL_OK = 0x0000; - /** + /** * Indicates a successful request, however some of the supplied * attributes are ignored or substituted. */ @@ -67,7 +67,7 @@ public final class IppStatusCode // Client Error Status Codes // Indicates that the client has done something wrong in its // requests send to the IPP server object - + /** Indicates a bad request e.g. malformed syntax. */ public static final int CLIENT_ERROR_BAD_REQUEST = 0x0400; @@ -80,9 +80,9 @@ public final class IppStatusCode /** Indicates that the client is not authorized. */ public static final int CLIENT_ERROR_NOT_AUTHORIZED = 0x0403; - /** + /** * Indicates a request which is not possible to process. - * For example if the request is directed at a job already finished. + * For example if the request is directed at a job already finished. */ public static final int CLIENT_ERROR_NOT_POSSIBLE = 0x0404; @@ -106,16 +106,16 @@ public final class IppStatusCode /** * Indicates that the supplied attributes or values of attributes are not - * supported by the printer object. Returning this code depends on the + * supported by the printer object. Returning this code depends on the * given "ipp-attribute-fidelity" operation attribute value. */ - public static final int CLIENT_ERROR_ATTRIBUTES_OR_VALUES_NOT_SUPPORTED + public static final int CLIENT_ERROR_ATTRIBUTES_OR_VALUES_NOT_SUPPORTED = 0x040B; - /** + /** * Indicates the the URI scheme in a supplied print-uri or send-uri attribute * is not supported. - */ + */ public static final int CLIENT_ERROR_URI_SCHEME_NOT_SUPPORTED = 0x040C; /** Indicates that a supplied attributes-charset is not supported. */ @@ -127,8 +127,8 @@ public final class IppStatusCode /** Indicates that the specified algorithm is not supported. */ public static final int CLIENT_ERROR_COMPRESSION_NOT_SUPPORTED = 0x040F; - /** - * Indicates that the document cannot be decompressed with the client + /** + * Indicates that the document cannot be decompressed with the client * compression algorithm specified by the client. */ public static final int CLIENT_ERROR_COMPRESSION_ERROR = 0x0410; @@ -136,13 +136,13 @@ public final class IppStatusCode /** Indicates an error in the document format of the document. */ public static final int CLIENT_ERROR_DOCUMENT_FORMAT_ERROR = 0x0411; - /** - * Indicates that the document supplied via print-uri or send-uri cannot be + /** + * Indicates that the document supplied via print-uri or send-uri cannot be * accessed by the printer object. */ public static final int CLIENT_ERROR_DOCUMENT_ACCESS_ERROR = 0x0412; - + /** Indicates an internal server error. */ public static final int SERVER_ERROR_INTERNAL_ERROR = 0x0500; @@ -164,7 +164,7 @@ public final class IppStatusCode /** Indicates that the server is currently not accepting jobs. */ public static final int SERVER_ERROR_NOT_ACCEPTING_JOBS = 0x0506; - /** + /** * Indicates that the server is currently busy with processing. * Requests may be tried later again. */ @@ -174,11 +174,11 @@ public final class IppStatusCode public static final int SERVER_ERROR_JOB_CANCELED = 0x0508; /** Indicates that the server does not support multidocument jobs. */ - public static final int SERVER_ERROR_MULTIPLE_DOCUMENT_JOBS_NOT_SUPPORTED + public static final int SERVER_ERROR_MULTIPLE_DOCUMENT_JOBS_NOT_SUPPORTED = 0x0509; private IppStatusCode() - { + { // not to be instantiated } diff --git a/gnu/javax/print/ipp/IppUtilities.java b/gnu/javax/print/ipp/IppUtilities.java index 303899887..3de29e4ea 100644 --- a/gnu/javax/print/ipp/IppUtilities.java +++ b/gnu/javax/print/ipp/IppUtilities.java @@ -1,4 +1,4 @@ -/* IppUtilities.java -- +/* IppUtilities.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -140,7 +140,7 @@ import javax.print.attribute.standard.Sides; * Also provides mapping from the attribute name values to * the actual class object. Used to construct objects via reflection. * </p> - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class IppUtilities @@ -150,7 +150,7 @@ public final class IppUtilities private static Class[] INTEGER_CLASS_ARRAY = new Class[] {int.class}; private static Object[] TEXT_ATT_VALUE = new Object[2]; private static Class[] TEXT_CLASS_ARRAY = new Class[] {String.class, Locale.class}; - + // The map -> Attribute name to Attribute class private static HashMap classesByName = new HashMap(); // The map -> StandardAttribute class to SupportedAttribute category name @@ -161,7 +161,7 @@ public final class IppUtilities */ static { - // enums + // enums classesByName.put(JobState.ABORTED.getName(), JobState.class); classesByName.put(Sides.DUPLEX.getName(), Sides.class); classesByName.put(SheetCollate.COLLATED.getName(), SheetCollate.class); @@ -174,113 +174,113 @@ public final class IppUtilities classesByName.put(PrintQuality.DRAFT.getName(), PrintQuality.class); classesByName.put(PrinterState.IDLE.getName(), PrinterState.class); classesByName.put(SidesDefault.ONE_SIDED.getName(), SidesDefault.class); - classesByName.put(ReferenceUriSchemesSupported.FILE.getName(), - ReferenceUriSchemesSupported.class); + classesByName.put(ReferenceUriSchemesSupported.FILE.getName(), + ReferenceUriSchemesSupported.class); classesByName.put(PrinterStateReason.DOOR_OPEN.getName(), - PrinterStateReason.class); - classesByName.put(PresentationDirection.TOLEFT_TOTOP.getName(), + PrinterStateReason.class); + classesByName.put(PresentationDirection.TOLEFT_TOTOP.getName(), PresentationDirection.class); - classesByName.put(PDLOverrideSupported.ATTEMPTED.getName(), + classesByName.put(PDLOverrideSupported.ATTEMPTED.getName(), PDLOverrideSupported.class); - classesByName.put(OrientationRequested.PORTRAIT.getName(), + classesByName.put(OrientationRequested.PORTRAIT.getName(), OrientationRequested.class); - classesByName.put(MultipleDocumentHandling.SINGLE_DOCUMENT.getName(), + classesByName.put(MultipleDocumentHandling.SINGLE_DOCUMENT.getName(), MultipleDocumentHandling.class); - classesByName.put(JobStateReason.JOB_QUEUED.getName(), + classesByName.put(JobStateReason.JOB_QUEUED.getName(), JobStateReason.class); - classesByName.put(UriAuthenticationSupported.NONE.getName(), - UriAuthenticationSupported.class); - classesByName.put(OperationsSupported.GET_JOBS.getName(), - OperationsSupported.class); - classesByName.put(UriSecuritySupported.NONE.getName(), - UriSecuritySupported.class); - classesByName.put(FinishingsSupported.NONE.getName(), - FinishingsSupported.class); - classesByName.put(FinishingsDefault.NONE.getName(), - FinishingsDefault.class); - classesByName.put(IppVersionsSupported.V_1_0.getName(), - IppVersionsSupported.class); - classesByName.put(MultipleDocumentHandlingSupported.SINGLE_DOCUMENT.getName(), - MultipleDocumentHandlingSupported.class); - classesByName.put(MultipleDocumentHandlingDefault.SINGLE_DOCUMENT.getName(), - MultipleDocumentHandlingDefault.class); - classesByName.put(CompressionSupported.NONE.getName(), - CompressionSupported.class); - classesByName.put(OrientationRequestedSupported.PORTRAIT.getName(), - OrientationRequestedSupported.class); - classesByName.put(OrientationRequestedDefault.PORTRAIT.getName(), - OrientationRequestedDefault.class); - classesByName.put(SidesSupported.ONE_SIDED.getName(), - SidesSupported.class); - classesByName.put(PrintQualityDefault.DRAFT.getName(), - PrintQualityDefault.class); - classesByName.put(PrintQualitySupported.DRAFT.getName(), - PrintQualitySupported.class); - classesByName.put(ReferenceUriSchemesSupported.FTP.getName(), + classesByName.put(UriAuthenticationSupported.NONE.getName(), + UriAuthenticationSupported.class); + classesByName.put(OperationsSupported.GET_JOBS.getName(), + OperationsSupported.class); + classesByName.put(UriSecuritySupported.NONE.getName(), + UriSecuritySupported.class); + classesByName.put(FinishingsSupported.NONE.getName(), + FinishingsSupported.class); + classesByName.put(FinishingsDefault.NONE.getName(), + FinishingsDefault.class); + classesByName.put(IppVersionsSupported.V_1_0.getName(), + IppVersionsSupported.class); + classesByName.put(MultipleDocumentHandlingSupported.SINGLE_DOCUMENT.getName(), + MultipleDocumentHandlingSupported.class); + classesByName.put(MultipleDocumentHandlingDefault.SINGLE_DOCUMENT.getName(), + MultipleDocumentHandlingDefault.class); + classesByName.put(CompressionSupported.NONE.getName(), + CompressionSupported.class); + classesByName.put(OrientationRequestedSupported.PORTRAIT.getName(), + OrientationRequestedSupported.class); + classesByName.put(OrientationRequestedDefault.PORTRAIT.getName(), + OrientationRequestedDefault.class); + classesByName.put(SidesSupported.ONE_SIDED.getName(), + SidesSupported.class); + classesByName.put(PrintQualityDefault.DRAFT.getName(), + PrintQualityDefault.class); + classesByName.put(PrintQualitySupported.DRAFT.getName(), + PrintQualitySupported.class); + classesByName.put(ReferenceUriSchemesSupported.FTP.getName(), ReferenceUriSchemesSupported.class); - - // the boolean types - classesByName.put(ColorSupported.SUPPORTED.getName(), ColorSupported.class); - classesByName.put(PrinterIsAcceptingJobs.ACCEPTING_JOBS.getName(), + + // the boolean types + classesByName.put(ColorSupported.SUPPORTED.getName(), ColorSupported.class); + classesByName.put(PrinterIsAcceptingJobs.ACCEPTING_JOBS.getName(), PrinterIsAcceptingJobs.class); - classesByName.put(MultipleDocumentJobsSupported.SUPPORTED.getName(), + classesByName.put(MultipleDocumentJobsSupported.SUPPORTED.getName(), MultipleDocumentJobsSupported.class); - classesByName.put(PageRangesSupported.SUPPORTED.getName(), + classesByName.put(PageRangesSupported.SUPPORTED.getName(), PageRangesSupported.class); - + // TextSyntax derived attributes - classesByName.put("media-default", MediaDefault.class); + classesByName.put("media-default", MediaDefault.class); classesByName.put("media-supported", MediaSupported.class); - classesByName.put("media", MediaSizeName.class); - classesByName.put("printer-location", PrinterLocation.class); - classesByName.put("printer-info", PrinterInfo.class); - classesByName.put("printer-make-and-model", PrinterMakeAndModel.class); + classesByName.put("media", MediaSizeName.class); + classesByName.put("printer-location", PrinterLocation.class); + classesByName.put("printer-info", PrinterInfo.class); + classesByName.put("printer-make-and-model", PrinterMakeAndModel.class); classesByName.put("printer-state-message", PrinterStateMessage.class); - classesByName.put("job-state-message", JobStateMessage.class); - classesByName.put("job-sheets-default", JobSheetsDefault.class); - classesByName.put("job-sheets-supported", JobSheetsSupported.class); - classesByName.put("job-name", JobName.class); - classesByName.put("printer-name", PrinterName.class); - classesByName.put("status-message", StatusMessage.class); - classesByName.put("detailed-status-message", DetailedStatusMessage.class); - classesByName.put("document-access-error", DocumentAccessError.class); - classesByName.put("output-device-assigned", OutputDeviceAssigned.class); - classesByName.put("job-hold-until-default", JobHoldUntilDefault.class); - classesByName.put("job-originating-user-name", - JobOriginatingUserName.class); - classesByName.put("job-hold-until-supported", + classesByName.put("job-state-message", JobStateMessage.class); + classesByName.put("job-sheets-default", JobSheetsDefault.class); + classesByName.put("job-sheets-supported", JobSheetsSupported.class); + classesByName.put("job-name", JobName.class); + classesByName.put("printer-name", PrinterName.class); + classesByName.put("status-message", StatusMessage.class); + classesByName.put("detailed-status-message", DetailedStatusMessage.class); + classesByName.put("document-access-error", DocumentAccessError.class); + classesByName.put("output-device-assigned", OutputDeviceAssigned.class); + classesByName.put("job-hold-until-default", JobHoldUntilDefault.class); + classesByName.put("job-originating-user-name", + JobOriginatingUserName.class); + classesByName.put("job-hold-until-supported", JobHoldUntilSupported.class); - classesByName.put("job-message-from-operator", - JobMessageFromOperator.class); - classesByName.put("printer-message-from-operator", - PrinterMessageFromOperator.class); - classesByName.put("job-detailed-status-messages", + classesByName.put("job-message-from-operator", + JobMessageFromOperator.class); + classesByName.put("printer-message-from-operator", + PrinterMessageFromOperator.class); + classesByName.put("job-detailed-status-messages", JobDetailedStatusMessages.class); - classesByName.put("job-document-access-errors", - JobDocumentAccessErrors.class); - + classesByName.put("job-document-access-errors", + JobDocumentAccessErrors.class); + // IntegerSyntax derived Attributes - classesByName.put("copies-default", CopiesDefault.class); - classesByName.put("job-id", JobId.class); + classesByName.put("copies-default", CopiesDefault.class); + classesByName.put("job-id", JobId.class); classesByName.put("job-priority-supported", JobPrioritySupported.class); classesByName.put("job-priority-default", JobPriorityDefault.class); classesByName.put("number-up-supported", NumberUpSupported.class); classesByName.put("number-up-default", NumberUpDefault.class); classesByName.put("queued-job-count", QueuedJobCount.class); - classesByName.put("printer-up-time", PrinterUpTime.class); + classesByName.put("printer-up-time", PrinterUpTime.class); classesByName.put("pages-per-minute", PagesPerMinute.class); - classesByName.put("pages-per-minute-color", PagesPerMinuteColor.class); + classesByName.put("pages-per-minute-color", PagesPerMinuteColor.class); classesByName.put("job-k-octets-processed", JobKOctetsProcessed.class); - classesByName.put("number-of-intervening-jobs", + classesByName.put("number-of-intervening-jobs", NumberOfInterveningJobs.class); - classesByName.put("job-impressions-completed", - JobImpressionsCompleted.class); - classesByName.put("job-media-sheets-completed", + classesByName.put("job-impressions-completed", + JobImpressionsCompleted.class); + classesByName.put("job-media-sheets-completed", JobMediaSheetsCompleted.class); - classesByName.put("multiple-operation-time-out", + classesByName.put("multiple-operation-time-out", MultipleOperationTimeOut.class); - - + + // 4.2 job template attributes instanceByClass.put(JobPriority.class, new JobPrioritySupported(1)); instanceByClass.put(JobHoldUntil.class, new JobHoldUntilSupported("", null)); @@ -299,7 +299,7 @@ public final class IppUtilities // 4.4 printer attributes instanceByClass.put(Compression.class, CompressionSupported.COMPRESS); } - + private IppUtilities() { // not to be instantiated @@ -308,7 +308,7 @@ public final class IppUtilities /** * Returns the implementing class object for given * attribute name objects. - * + * * @param name the attribute name * @return The <code>Class</code> object. */ @@ -316,11 +316,11 @@ public final class IppUtilities { return (Class) classesByName.get(name); } - + /** - * Returns the name of the supported attribute + * Returns the name of the supported attribute * based on the given standard attribute category. - * + * * @param clazz the standard attribute category * @return The name of the supported attribute category. */ @@ -328,18 +328,18 @@ public final class IppUtilities { return ((SupportedValuesAttribute) instanceByClass.get(clazz)).getName(); } - + /** - * Returns the category of the supported attribute + * Returns the category of the supported attribute * based on the given standard attribute category. - * + * * @param clazz the standard attribute category * @return The supported attribute category. */ public static Class getSupportedCategory(Class clazz) { return ((SupportedValuesAttribute) instanceByClass.get(clazz)).getCategory(); - } + } /** * Helper method to convert to an int. @@ -351,7 +351,7 @@ public final class IppUtilities return (((b[0] & 0xff) << 24) | ((b[1] & 0xff) << 16) | ((b[2] & 0xff) << 8) | (b[3] & 0xff)); } - + /** * Helper method to convert to an int. * @param b1 the 1th byte @@ -376,11 +376,11 @@ public final class IppUtilities { return (short) ((b1 << 8) | (b2 & 0xff)); } - + /** * Instantiates an <code>EnumSyntax</code> based attribute with the given IPP * name and the given value (Enums maybe int or String based). - * + * * @param name the attribute name of the subclass. * @param value the integer value of the specific enum. * @return The Attribute (a subclass of EnumSyntax) @@ -388,10 +388,10 @@ public final class IppUtilities public static Attribute getEnumAttribute(String name, Object value) { Class attrClass = getClass(name); - + // There might be unknown enums we have no mapped class for if (attrClass == null) - return null; + return null; try { @@ -423,24 +423,24 @@ public final class IppUtilities { // should not happen, all fields are public } - + return null; } - - - + + + /** - * Instantiates an <code>IntegerSyntax</code> based attribute with the + * Instantiates an <code>IntegerSyntax</code> based attribute with the * given IPP name for the given int value. - * + * * @param name the attribute name of the subclass. * @param value the integer value * @return The Attribute (a subclass of IntegerSyntax) */ public static Attribute getIntegerAttribute(String name, int value) - { + { Class attrClass = getClass(name); - + // There might be unknown attributes we have no mapped class for if (attrClass == null) return null; @@ -448,8 +448,8 @@ public final class IppUtilities try { INTEGER_ATT_VALUE[0] = new Integer(value); - Constructor c = attrClass.getDeclaredConstructor(INTEGER_CLASS_ARRAY); - return (Attribute) c.newInstance(INTEGER_ATT_VALUE); + Constructor c = attrClass.getDeclaredConstructor(INTEGER_CLASS_ARRAY); + return (Attribute) c.newInstance(INTEGER_ATT_VALUE); } catch (SecurityException e) { @@ -471,21 +471,21 @@ public final class IppUtilities { // should not happen, all fields are public } - + return null; - } - + } + /** * Instantiates an <code>TextSyntax</code> based attribute with the given * IPP name for the given text value (will be decoded). - * + * * @param name the attribute name of the subclass. * @param tag the tag defined in {@link IppValueTag} * @param value the byte[] value to be decoded based on the tag value. * @return The Attribute (a subclass of TextSyntax) */ public static Attribute getTextAttribute(String name, byte tag, byte[] value) - { + { // without language tag is rather easy - default locale if (tag == IppValueTag.NAME_WITHOUT_LANGUAGE || tag == IppValueTag.TEXT_WITHOUT_LANGUAGE) @@ -504,7 +504,7 @@ public final class IppUtilities String language = new String(tmp); String text = new String(tmp2); Locale locale = null; - + if (language.length() > 2) locale = new Locale(language.substring(0, 2), language.substring(3)); else @@ -512,18 +512,18 @@ public final class IppUtilities TEXT_ATT_VALUE[0] = text; TEXT_ATT_VALUE[1] = locale; - } - + } + Class attrClass = getClass(name); - + // There might be unknown attributes we have no mapped class for if (attrClass == null) return null; try { - Constructor c = attrClass.getDeclaredConstructor(TEXT_CLASS_ARRAY); - return (Attribute) c.newInstance(TEXT_ATT_VALUE); + Constructor c = attrClass.getDeclaredConstructor(TEXT_CLASS_ARRAY); + return (Attribute) c.newInstance(TEXT_ATT_VALUE); } catch (SecurityException e) { @@ -545,7 +545,7 @@ public final class IppUtilities { // should not happen, all fields are public } - + return null; } } diff --git a/gnu/javax/print/ipp/IppValueTag.java b/gnu/javax/print/ipp/IppValueTag.java index 0c81befca..def9545a3 100644 --- a/gnu/javax/print/ipp/IppValueTag.java +++ b/gnu/javax/print/ipp/IppValueTag.java @@ -1,4 +1,4 @@ -/* IppValueTag.java -- +/* IppValueTag.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -44,96 +44,96 @@ package gnu.javax.print.ipp; * Attributes are always of a special type syntax (e.g. boolean or * interger attribute). These value types are specified by the tag * constants provided in this class. Beside the syntax types some - * out of band values for reporting requested attributes as + * out of band values for reporting requested attributes as * unsupported, unknown etc. back to the client. * </p> - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class IppValueTag -{ - +{ + /** Out of band value for unsupported attributes. */ public static final byte UNSUPPORTED = 0x10; - + // 0x11 reserved for 'default' for definition in a future - // IETF standards track document - + // IETF standards track document + /** Out of band value for unknown attributes. */ public static final byte UNKNOWN = 0x12; - + /** Out of band value for attribute without a value. */ public static final byte NO_VALUE = 0x13; - + // 0x14-0x1F reserved for "out-of-band" values in future IETF // standards track documents. - + // 0x20 reserved for definition in a future IETF // standards track document - + /** Indicates a value of syntax type integer. */ public static final byte INTEGER = 0x21; - + /** Indicates a value of syntax type boolean. */ public static final byte BOOLEAN = 0x22; - + /** Indicates a value of syntax type enum (enumeration). */ public static final byte ENUM = 0x23; - + // 0x24-0x2F reserved for integer types for definition in // future IETF standards track documents /** Indicates a value of syntax type octect string. */ public static final byte OCTECTSTRING_UNSPECIFIED = 0x30; - + /** Indicates a value of syntax type datetime. */ public static final byte DATETIME = 0x31; - + /** Indicates a value of syntax type resolution. */ public static final byte RESOLUTION = 0x32; - + /** Indicates a value of syntax type range of integers. */ public static final byte RANGEOFINTEGER = 0x33; - + // 0x34 reserved for definition in a future IETF // standards track document - + /** Indicates a value of syntax type text with language. */ public static final byte TEXT_WITH_LANGUAGE = 0x35; - + /** Indicates a value of syntax type name with language. */ public static final byte NAME_WITH_LANGUAGE = 0x36; - + // 0x37-0x3F reserved for octetString type definitions in // future IETF standards track documents // 0x40 reserved for definition in a future IETF // standards track document - + /** Indicates a value of syntax type text without language. */ public static final byte TEXT_WITHOUT_LANGUAGE = 0x41; - + /** Indicates a value of syntax type name without language. */ public static final byte NAME_WITHOUT_LANGUAGE = 0x42; - + // 0x43 reserved for definition in a future IETF // standards track document - + /** Indicates a value of syntax type keyword. */ - public static final byte KEYWORD = 0x44; - + public static final byte KEYWORD = 0x44; + /** Indicates a value of syntax type URI. */ - public static final byte URI = 0x45; - + public static final byte URI = 0x45; + /** Indicates a value of syntax type URI scheme. */ public static final byte URI_SCHEME = 0x46; - + /** Indicates a value of syntax type charset. */ - public static final byte CHARSET = 0x47; - + public static final byte CHARSET = 0x47; + /** Indicates a value of syntax type language. */ - public static final byte NATURAL_LANGUAGE =0x48; - + public static final byte NATURAL_LANGUAGE =0x48; + /** Indicates a value of syntax type mime media. */ public static final byte MIME_MEDIA_TYPE = 0x49; @@ -145,15 +145,15 @@ public final class IppValueTag { // not to be instantiated; } - + /** - * Tests if given value corresponds to a + * Tests if given value corresponds to a * value tag value. - * + * * @param value the value to test for * @return <code>true</code> if, <code>false</code> otherwise. */ - public static boolean isValueTag(byte value) + public static boolean isValueTag(byte value) { if(value == 0x10 || value == 0x12 || value == 0x13 || value == 0x21 || value == 0x22 || value == 0x23 @@ -163,8 +163,8 @@ public final class IppValueTag || value == 0x45 || value == 0x46 || value == 0x47 || value == 0x48 || value == 0x49 ) return true; - + return false; } - + } diff --git a/gnu/javax/print/ipp/MultiDocPrintJobImpl.java b/gnu/javax/print/ipp/MultiDocPrintJobImpl.java index 1167f52c3..89163dc99 100644 --- a/gnu/javax/print/ipp/MultiDocPrintJobImpl.java +++ b/gnu/javax/print/ipp/MultiDocPrintJobImpl.java @@ -45,18 +45,18 @@ import javax.print.PrintException; import javax.print.attribute.PrintRequestAttributeSet; /** - * Implementation of the MultiDocPrintJob interface. Implementation + * Implementation of the MultiDocPrintJob interface. Implementation * is specific to the <code>IppPrintService</code> implementation. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public class MultiDocPrintJobImpl extends DocPrintJobImpl +public class MultiDocPrintJobImpl extends DocPrintJobImpl implements MultiDocPrintJob { /** * Constructor forwarding arguments to the super constructor. - * + * * @param service the print service instance. * @param user the user of this print service. * @param passwd the password of the user. diff --git a/gnu/javax/print/ipp/attribute/CharsetSyntax.java b/gnu/javax/print/ipp/attribute/CharsetSyntax.java index 0db846cba..cd112f459 100644 --- a/gnu/javax/print/ipp/attribute/CharsetSyntax.java +++ b/gnu/javax/print/ipp/attribute/CharsetSyntax.java @@ -1,4 +1,4 @@ -/* CharsetSyntax.java -- +/* CharsetSyntax.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,7 +41,7 @@ package gnu.javax.print.ipp.attribute; import java.io.Serializable; /** - * <code>CharsetSyntax</code> is the abstract base class of all attribute + * <code>CharsetSyntax</code> is the abstract base class of all attribute * classes which provide a charset (US-ASCII) string as value. * * @author Wolfgang Baer (WBaer@gmx.de) @@ -62,7 +62,7 @@ public abstract class CharsetSyntax implements Cloneable, Serializable { if (value == null) throw new NullPointerException("value may not be null"); - + this.value = value; } @@ -98,14 +98,14 @@ public abstract class CharsetSyntax implements Cloneable, Serializable if (! (obj instanceof CharsetSyntax)) return false; - CharsetSyntax tmp = (CharsetSyntax) obj; + CharsetSyntax tmp = (CharsetSyntax) obj; return value.equals(tmp.getValue()); } /** * Returns a string representing the object. The returned * string is the underlying text value of this object. - * + * * @return The string representation. */ public String toString() diff --git a/gnu/javax/print/ipp/attribute/DefaultValueAttribute.java b/gnu/javax/print/ipp/attribute/DefaultValueAttribute.java index 0f1084f49..cc40db22e 100644 --- a/gnu/javax/print/ipp/attribute/DefaultValueAttribute.java +++ b/gnu/javax/print/ipp/attribute/DefaultValueAttribute.java @@ -1,4 +1,4 @@ -/* DefaultValueAttribute.java -- +/* DefaultValueAttribute.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,18 +41,18 @@ package gnu.javax.print.ipp.attribute; import javax.print.attribute.Attribute; /** - * Marker interface for all attribute classes describing attributes + * Marker interface for all attribute classes describing attributes * providing default values. Often there exist a sequence of an * attribute name like: Name - > Name-default -> Name-supported. * * @author Wolfgang Baer (WBaer@gmx.de) */ public interface DefaultValueAttribute extends Attribute -{ +{ /** * Returns the equally enum of the standard attribute class * of this SupportedValuesAttribute enum. - * + * * @return The enum of the standard attribute class. */ public Attribute getAssociatedAttribute(); diff --git a/gnu/javax/print/ipp/attribute/DetailedStatusMessage.java b/gnu/javax/print/ipp/attribute/DetailedStatusMessage.java index 433b6f35a..6d0c2fe39 100644 --- a/gnu/javax/print/ipp/attribute/DetailedStatusMessage.java +++ b/gnu/javax/print/ipp/attribute/DetailedStatusMessage.java @@ -1,4 +1,4 @@ -/* DetailedStatusMessage.java -- +/* DetailedStatusMessage.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -45,12 +45,12 @@ import javax.print.attribute.TextSyntax; /** * DetailedStatusMessage attribute as described in RFC 2911 section - * 3.1.6 Operation Response Status Codes and Status Message + * 3.1.6 Operation Response Status Codes and Status Message * provides a short description of the status of the operation. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class DetailedStatusMessage extends TextSyntax +public final class DetailedStatusMessage extends TextSyntax implements Attribute { diff --git a/gnu/javax/print/ipp/attribute/DocumentAccessError.java b/gnu/javax/print/ipp/attribute/DocumentAccessError.java index 3433e3ed7..ad2eedf89 100644 --- a/gnu/javax/print/ipp/attribute/DocumentAccessError.java +++ b/gnu/javax/print/ipp/attribute/DocumentAccessError.java @@ -1,4 +1,4 @@ -/* DocumentAccessError.java -- +/* DocumentAccessError.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -45,12 +45,12 @@ import javax.print.attribute.TextSyntax; /** * DocumentAccessError attribute as described in RFC 2911 section - * 3.1.6 Operation Response Status Codes and Status Message + * 3.1.6 Operation Response Status Codes and Status Message * provides additional information for document access errors. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class DocumentAccessError extends TextSyntax +public final class DocumentAccessError extends TextSyntax implements Attribute { diff --git a/gnu/javax/print/ipp/attribute/NaturalLanguageSyntax.java b/gnu/javax/print/ipp/attribute/NaturalLanguageSyntax.java index c90af3eb8..a648c8cec 100644 --- a/gnu/javax/print/ipp/attribute/NaturalLanguageSyntax.java +++ b/gnu/javax/print/ipp/attribute/NaturalLanguageSyntax.java @@ -1,4 +1,4 @@ -/* NaturalLanguageSyntax.java -- +/* NaturalLanguageSyntax.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,13 +41,13 @@ package gnu.javax.print.ipp.attribute; import java.io.Serializable; /** - * <code>NaturalLanguageSyntax</code> is the abstract base class of all - * attribute classes which provide a natural language (US-ASCII) + * <code>NaturalLanguageSyntax</code> is the abstract base class of all + * attribute classes which provide a natural language (US-ASCII) * string as value. * * @author Wolfgang Baer (WBaer@gmx.de) */ -public abstract class NaturalLanguageSyntax +public abstract class NaturalLanguageSyntax implements Cloneable, Serializable { private final String value; @@ -64,7 +64,7 @@ public abstract class NaturalLanguageSyntax { if (value == null) throw new NullPointerException("value may not be null"); - + this.value = value; } @@ -100,14 +100,14 @@ public abstract class NaturalLanguageSyntax if (! (obj instanceof NaturalLanguageSyntax)) return false; - NaturalLanguageSyntax tmp = (NaturalLanguageSyntax) obj; + NaturalLanguageSyntax tmp = (NaturalLanguageSyntax) obj; return value.equals(tmp.getValue()); } /** * Returns a string representing the object. The returned * string is the underlying text value of this object. - * + * * @return The string representation. */ public String toString() diff --git a/gnu/javax/print/ipp/attribute/RequestedAttributes.java b/gnu/javax/print/ipp/attribute/RequestedAttributes.java index 814fe2d0a..cc2d0cfb0 100644 --- a/gnu/javax/print/ipp/attribute/RequestedAttributes.java +++ b/gnu/javax/print/ipp/attribute/RequestedAttributes.java @@ -1,4 +1,4 @@ -/* RequestedAttributes.java -- +/* RequestedAttributes.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -48,7 +48,7 @@ import javax.print.attribute.Attribute; /** * <code>RequestedAttributes</code> specifies the requested * attributes in an IPP request operation. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class RequestedAttributes implements Attribute @@ -56,7 +56,7 @@ public final class RequestedAttributes implements Attribute private ArrayList attributes; /** - * Creates a <code>RequestedAttributes</code> object with + * Creates a <code>RequestedAttributes</code> object with * the initial value. * * @param value the string for the ipp name @@ -67,29 +67,29 @@ public final class RequestedAttributes implements Attribute { if (value == null) throw new NullPointerException(); - - attributes = new ArrayList(); + + attributes = new ArrayList(); attributes.add(value); } - + /** * Adds the IPP name value to the set. - * + * * @param value the string for the ipp name */ public void addValue(String value) { attributes.add(value); } - + /** * Returns the values. - * + * * @return The values as list. */ - public List getValues() + public List getValues() { - return attributes; + return attributes; } /** @@ -120,13 +120,13 @@ public final class RequestedAttributes implements Attribute public String toString() { CPStringBuilder b = new CPStringBuilder(); - + if (attributes.size() > 0) b.append(attributes.get(0)); - + for (int i=1; i < attributes.size(); i++) b.append(", " + attributes.get(i)); - + return b.toString(); - } + } } diff --git a/gnu/javax/print/ipp/attribute/StatusMessage.java b/gnu/javax/print/ipp/attribute/StatusMessage.java index 692b26ed5..78a3136c5 100644 --- a/gnu/javax/print/ipp/attribute/StatusMessage.java +++ b/gnu/javax/print/ipp/attribute/StatusMessage.java @@ -1,4 +1,4 @@ -/* StatusMessage.java -- +/* StatusMessage.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -45,9 +45,9 @@ import javax.print.attribute.TextSyntax; /** * StatusMessage attribute as described in RFC 2911 section - * 3.1.6 Operation Response Status Codes and Status Message + * 3.1.6 Operation Response Status Codes and Status Message * provides a short description of the status of the operation. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class StatusMessage extends TextSyntax implements Attribute diff --git a/gnu/javax/print/ipp/attribute/UnknownAttribute.java b/gnu/javax/print/ipp/attribute/UnknownAttribute.java index 233431ad3..71bd1a49b 100644 --- a/gnu/javax/print/ipp/attribute/UnknownAttribute.java +++ b/gnu/javax/print/ipp/attribute/UnknownAttribute.java @@ -1,4 +1,4 @@ -/* UnknownAttribute.java -- +/* UnknownAttribute.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -49,7 +49,7 @@ import javax.print.attribute.Attribute; /** * UnknownAttribute holds all the parsed Attribute information. * It provides methods to get the value-tag, name and value. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class UnknownAttribute implements Attribute @@ -61,7 +61,7 @@ public final class UnknownAttribute implements Attribute /** * Creates a <code>UnknownAttribute</code> object with the given values. * - * @param tag the value tag + * @param tag the value tag * @param name the attribute name * @param value the byte[] with the value */ @@ -91,18 +91,18 @@ public final class UnknownAttribute implements Attribute { return name; } - + /** * Returns the value tag * @return The tag. - * + * * @see gnu.javax.print.ipp.IppValueTag */ public byte getValueTag() { return tag; } - + /** * Returns the name of the attribute. * @return The name. @@ -111,7 +111,7 @@ public final class UnknownAttribute implements Attribute { return name; } - + /** * Returns the attribute value origin byte array. * @return The value. @@ -120,7 +120,7 @@ public final class UnknownAttribute implements Attribute { return value; } - + /** * Returns the attribute value decoded as String. * @return The value as String. @@ -129,7 +129,7 @@ public final class UnknownAttribute implements Attribute { return new String(value); } - + /** * Returns the attribute value decoded as int. * @return The value as int. @@ -138,7 +138,7 @@ public final class UnknownAttribute implements Attribute { return IppUtilities.convertToInt(value); } - + /** * Returns the attribute value decoded as an URI. * @return The value as URI. @@ -159,7 +159,7 @@ public final class UnknownAttribute implements Attribute * Provides a string representation for some default * tag types (e.g. int, rangeofinteger, string, uri). * For other more complex types "No conversion found." - * is returned. + * is returned. */ public String toString() { @@ -168,9 +168,9 @@ public final class UnknownAttribute implements Attribute case IppValueTag.INTEGER: return "" + getAttributeValueAsInt(); case IppValueTag.RANGEOFINTEGER: - int lower = IppUtilities.convertToInt(value[0], value[1], + int lower = IppUtilities.convertToInt(value[0], value[1], value[2], value[3]); - int upper = IppUtilities.convertToInt(value[4], value[5], + int upper = IppUtilities.convertToInt(value[4], value[5], value[6], value[7]); return lower + "-" + upper; case IppValueTag.URI: @@ -186,5 +186,5 @@ public final class UnknownAttribute implements Attribute default: return "No conversion found."; } - } + } } diff --git a/gnu/javax/print/ipp/attribute/defaults/CopiesDefault.java b/gnu/javax/print/ipp/attribute/defaults/CopiesDefault.java index 225a0895a..545429281 100644 --- a/gnu/javax/print/ipp/attribute/defaults/CopiesDefault.java +++ b/gnu/javax/print/ipp/attribute/defaults/CopiesDefault.java @@ -1,4 +1,4 @@ -/* CopiesDefault.java -- +/* CopiesDefault.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -46,13 +46,13 @@ import javax.print.attribute.standard.Copies; /** * <code>CopiesDefault</code> provides the default value * for the copies attribute. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class CopiesDefault extends IntegerSyntax implements DefaultValueAttribute { - + /** * Creates a <code>CopiesDefault</code> object. * @@ -67,13 +67,13 @@ public final class CopiesDefault extends IntegerSyntax if (value < 1) throw new IllegalArgumentException("value may not be less than 1"); } - + /** * Tests if the given object is equal to this object. * * @param obj the object to test * - * @return <code>true</code> if both objects are equal, + * @return <code>true</code> if both objects are equal, * <code>false</code> otherwise. */ public boolean equals(Object obj) @@ -103,15 +103,15 @@ public final class CopiesDefault extends IntegerSyntax { return "copies-default"; } - + /** * Returns the equally enum of the standard attribute class * of this DefaultValuesAttribute enum. * <p>May return null if no value exists in JPS API.</p> - * + * * @return The enum of the standard attribute class. */ - public Attribute getAssociatedAttribute() + public Attribute getAssociatedAttribute() { return new Copies(getValue()); } diff --git a/gnu/javax/print/ipp/attribute/defaults/DocumentFormatDefault.java b/gnu/javax/print/ipp/attribute/defaults/DocumentFormatDefault.java index fe40aee72..dd797c53a 100644 --- a/gnu/javax/print/ipp/attribute/defaults/DocumentFormatDefault.java +++ b/gnu/javax/print/ipp/attribute/defaults/DocumentFormatDefault.java @@ -1,4 +1,4 @@ -/* DocumentFormatDefault.java -- +/* DocumentFormatDefault.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -49,16 +49,16 @@ import javax.print.attribute.TextSyntax; /** * <code>DocumentFormatDefault</code> specifies the default document * format of a printer. - * + * * @author Wolfgang Baer (WBaer@gmx.de) * */ -public final class DocumentFormatDefault extends TextSyntax +public final class DocumentFormatDefault extends TextSyntax implements DefaultValueAttribute { /** - * Creates a <code>DocumentFormatDefault</code> object with the + * Creates a <code>DocumentFormatDefault</code> object with the * given value and locale. * * @param value the value for this syntax @@ -95,12 +95,12 @@ public final class DocumentFormatDefault extends TextSyntax /** * Returns the equally enum of the standard attribute class * of this DefaultValuesAttribute enum. - * + * * @return The enum of the standard attribute class. */ - public Attribute getAssociatedAttribute() + public Attribute getAssociatedAttribute() { return new DocumentFormat(getValue(), getLocale()); } - + } diff --git a/gnu/javax/print/ipp/attribute/defaults/FinishingsDefault.java b/gnu/javax/print/ipp/attribute/defaults/FinishingsDefault.java index d3dd99c06..f8a9ab1a7 100644 --- a/gnu/javax/print/ipp/attribute/defaults/FinishingsDefault.java +++ b/gnu/javax/print/ipp/attribute/defaults/FinishingsDefault.java @@ -48,7 +48,7 @@ import javax.print.attribute.EnumSyntax; /** * The <code>FinishingsDefault</code> attribute provides the supported * values for finishings of a job. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class FinishingsDefault extends EnumSyntax @@ -57,108 +57,108 @@ public final class FinishingsDefault extends EnumSyntax /** No finishing. */ public static final FinishingsDefault NONE = new FinishingsDefault(3); - + /** Staple the document(s) */ public static final FinishingsDefault STAPLE = new FinishingsDefault(4); - + /** Cover a document */ public static final FinishingsDefault COVER = new FinishingsDefault(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 FinishingsDefault BIND = new FinishingsDefault(7); - + /** - * Bind the document(s) with one or more staples (wire stitches) - * along the middle fold. + * Bind the document(s) with one or more staples (wire stitches) + * along the middle fold. */ public static final FinishingsDefault SADDLE_STITCH = new FinishingsDefault(8); - + /** - * Bind the document(s) with one or more staples (wire stitches) - * along one edge. + * Bind the document(s) with one or more staples (wire stitches) + * along one edge. */ public static final FinishingsDefault EDGE_STITCH = new FinishingsDefault(9); - - /** - * Bind the document(s) with one or more staples in the top left - * corner. + + /** + * Bind the document(s) with one or more staples in the top left + * corner. */ public static final FinishingsDefault STAPLE_TOP_LEFT = new FinishingsDefault(20); - - /** - * Bind the document(s) with one or more staples in the bottom - * left corner. + + /** + * Bind the document(s) with one or more staples in the bottom + * left corner. */ public static final FinishingsDefault STAPLE_BOTTOM_LEFT = new FinishingsDefault(21); - + /** * Bind the document(s) with one or more staples in the top right corner. */ public static final FinishingsDefault STAPLE_TOP_RIGHT = new FinishingsDefault(22); - + /** * Bind the document(s) with one or more staples in the bottom right corner. */ public static final FinishingsDefault STAPLE_BOTTOM_RIGHT = new FinishingsDefault(23); - + /** - * Bind the document(s) with one or more staples (wire stitches) + * Bind the document(s) with one or more staples (wire stitches) * along the left edge. */ public static final FinishingsDefault EDGE_STITCH_LEFT = new FinishingsDefault(24); - + /** - * Bind the document(s) with one or more staples (wire stitches) along + * Bind the document(s) with one or more staples (wire stitches) along * the top edge. */ public static final FinishingsDefault EDGE_STITCH_TOP = new FinishingsDefault(25); - + /** - * Bind the document(s) with one or more staples (wire stitches) along + * Bind the document(s) with one or more staples (wire stitches) along * the right edge. */ public static final FinishingsDefault EDGE_STITCH_RIGHT = new FinishingsDefault(26); - + /** * Bind the document(s) with one or more staples (wire stitches) along - * the bottom edge. + * the bottom edge. */ public static final FinishingsDefault EDGE_STITCH_BOTTOM = new FinishingsDefault(27); - + /** - * Bind the document(s) with two staples (wire stitches) along the + * Bind the document(s) with two staples (wire stitches) along the * left edge assuming a portrait document. */ public static final FinishingsDefault STAPLE_DUAL_LEFT = new FinishingsDefault(28); - + /** - * Bind the document(s) with two staples (wire stitches) along the + * Bind the document(s) with two staples (wire stitches) along the * top edge assuming a portrait document. */ public static final FinishingsDefault STAPLE_DUAL_TOP = new FinishingsDefault(29); - + /** - * Bind the document(s) with two staples (wire stitches) along the + * Bind the document(s) with two staples (wire stitches) along the * right edge assuming a portrait document. */ public static final FinishingsDefault STAPLE_DUAL_RIGHT = new FinishingsDefault(30); - + /** - * Bind the document(s) with two staples (wire stitches) along the + * Bind the document(s) with two staples (wire stitches) along the * bottom edge assuming a portrait document. */ public static final FinishingsDefault STAPLE_DUAL_BOTTOM = new FinishingsDefault(31); - private static final String[] stringTable = { "none", "staple", null, + 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-left", + "staple-top-right", "staple-bottom-right", "edge-stitch-left", "edge-stitch-top", @@ -168,14 +168,14 @@ public final class FinishingsDefault extends EnumSyntax "staple-dual-top", "staple-dual-right", "staple-dual-bottom" }; - - private static final FinishingsDefault[] enumValueTable = { NONE, STAPLE, null, - COVER, BIND, + + private static final FinishingsDefault[] enumValueTable = { NONE, STAPLE, null, + COVER, BIND, SADDLE_STITCH, - EDGE_STITCH, null, - null, null, null, - null, null, null, - null, null, null, + EDGE_STITCH, null, + null, null, null, + null, null, null, + null, null, null, STAPLE_TOP_LEFT, STAPLE_BOTTOM_LEFT, STAPLE_TOP_RIGHT, @@ -188,10 +188,10 @@ public final class FinishingsDefault extends EnumSyntax STAPLE_DUAL_TOP, STAPLE_DUAL_RIGHT, STAPLE_DUAL_BOTTOM }; - + /** * Constructs a <code>FinishingsDefault</code> object. - * + * * @param value the value */ protected FinishingsDefault(int value) @@ -218,7 +218,7 @@ public final class FinishingsDefault extends EnumSyntax { return "finishings-default"; } - + /** * Returns a table with the enumeration values represented as strings * for this object. @@ -249,14 +249,14 @@ public final class FinishingsDefault extends EnumSyntax { return 3; } - + /** * Returns the equally enum of the standard attribute class * of this DefaultValuesAttribute enum. - * + * * @return The enum of the standard attribute class. */ - public Attribute getAssociatedAttribute() + public Attribute getAssociatedAttribute() { return IppUtilities.getEnumAttribute("finishings", new Integer(getValue())); } diff --git a/gnu/javax/print/ipp/attribute/defaults/JobHoldUntilDefault.java b/gnu/javax/print/ipp/attribute/defaults/JobHoldUntilDefault.java index a0baac727..817d8e6b9 100644 --- a/gnu/javax/print/ipp/attribute/defaults/JobHoldUntilDefault.java +++ b/gnu/javax/print/ipp/attribute/defaults/JobHoldUntilDefault.java @@ -1,4 +1,4 @@ -/* JobHoldUntilDefault.java -- +/* JobHoldUntilDefault.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -50,57 +50,57 @@ import javax.print.attribute.standard.JobHoldUntil; /** * JobHoldUntilDefault attribute provides the default value * for the attribute type job-hold-until. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class JobHoldUntilDefault extends TextSyntax +public final class JobHoldUntilDefault extends TextSyntax implements DefaultValueAttribute { - - // a keyword/name based attribute in IPP + + // a keyword/name based attribute in IPP // can be extended by administrators // standard values are predefined - + /** Job should be printed immediately. */ - public static final JobHoldUntilDefault NO_HOLD = + public static final JobHoldUntilDefault NO_HOLD = new JobHoldUntilDefault("no-hold", null); - + /** Job should be hold indefinitely. */ - public static final JobHoldUntilDefault INDEFINITE = + public static final JobHoldUntilDefault INDEFINITE = new JobHoldUntilDefault("indefinite", null); - + /** Job should be processed during the day. */ - public static final JobHoldUntilDefault DAY_TIME = + public static final JobHoldUntilDefault DAY_TIME = new JobHoldUntilDefault("day-time", null); - + /** Job should be processed in the evening. */ - public static final JobHoldUntilDefault EVENING = + public static final JobHoldUntilDefault EVENING = new JobHoldUntilDefault("evening", null); - + /** Job should be processed during night. */ - public static final JobHoldUntilDefault NIGHT = + public static final JobHoldUntilDefault NIGHT = new JobHoldUntilDefault("night", null); - + /** Job should be processed during the weekend. */ - public static final JobHoldUntilDefault WEEKEND = + public static final JobHoldUntilDefault WEEKEND = new JobHoldUntilDefault("weekend", null); - - /** - * Job should be processed as second-shift - * (after close of business). + + /** + * Job should be processed as second-shift + * (after close of business). */ - public static final JobHoldUntilDefault SECOND_SHIFT = + public static final JobHoldUntilDefault SECOND_SHIFT = new JobHoldUntilDefault("second-shift", null); - - /** - * Job should be processed as third-shift - * (after midnight). + + /** + * Job should be processed as third-shift + * (after midnight). */ - public static final JobHoldUntilDefault THIRD_SHIFT = - new JobHoldUntilDefault("third-shift", null); + public static final JobHoldUntilDefault THIRD_SHIFT = + new JobHoldUntilDefault("third-shift", null); /** - * Creates a <code>JobHoldUntilDefault</code> object with the + * Creates a <code>JobHoldUntilDefault</code> object with the * given value and locale. * * @param value the value for this syntax @@ -133,14 +133,14 @@ public final class JobHoldUntilDefault extends TextSyntax { return "job-hold-until-default"; } - + /** * Returns the equally enum of the standard attribute class * of this DefaultValuesAttribute enum. - * + * * @return The enum of the standard attribute class. */ - public Attribute getAssociatedAttribute() + public Attribute getAssociatedAttribute() { // FIXME Same Mapping problem as in IppPrintService return new JobHoldUntil(new Date()); diff --git a/gnu/javax/print/ipp/attribute/defaults/JobPriorityDefault.java b/gnu/javax/print/ipp/attribute/defaults/JobPriorityDefault.java index de6ad5a8a..93b8061f0 100644 --- a/gnu/javax/print/ipp/attribute/defaults/JobPriorityDefault.java +++ b/gnu/javax/print/ipp/attribute/defaults/JobPriorityDefault.java @@ -1,4 +1,4 @@ -/* JobPriorityDefault.java -- +/* JobPriorityDefault.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -47,13 +47,13 @@ import javax.print.attribute.standard.JobPriority; /** * JobPriorityDefault attribute provides the default value of * the printer object for the job-priority attribute. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class JobPriorityDefault extends IntegerSyntax implements DefaultValueAttribute { - + /** * Creates a <code>JobPriorityDefault</code> object. * @@ -74,7 +74,7 @@ public final class JobPriorityDefault extends IntegerSyntax * * @param obj the object to test * - * @return <code>true</code> if both objects are equal, + * @return <code>true</code> if both objects are equal, * <code>false</code> otherwise. */ public boolean equals(Object obj) @@ -104,14 +104,14 @@ public final class JobPriorityDefault extends IntegerSyntax { return "job-priority-default"; } - + /** * Returns the equally enum of the standard attribute class * of this DefaultValuesAttribute enum. - * + * * @return The enum of the standard attribute class. */ - public Attribute getAssociatedAttribute() + public Attribute getAssociatedAttribute() { return new JobPriority(getValue()); } diff --git a/gnu/javax/print/ipp/attribute/defaults/JobSheetsDefault.java b/gnu/javax/print/ipp/attribute/defaults/JobSheetsDefault.java index 8f9289123..233f90140 100644 --- a/gnu/javax/print/ipp/attribute/defaults/JobSheetsDefault.java +++ b/gnu/javax/print/ipp/attribute/defaults/JobSheetsDefault.java @@ -1,4 +1,4 @@ -/* JobSheetsDefault.java -- +/* JobSheetsDefault.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -49,26 +49,26 @@ import javax.print.attribute.standard.JobSheets; /** * JobSheetsDefault attribute provides the default value of * the printer object for the job-sheets attribute. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class JobSheetsDefault extends TextSyntax +public final class JobSheetsDefault extends TextSyntax implements DefaultValueAttribute { - //a keyword/name based attribute in IPP + //a keyword/name based attribute in IPP // can be extended by administrators // standard values are predefined - + /** No job sheet is the default */ - public static final JobSheetsDefault NONE = + public static final JobSheetsDefault NONE = new JobSheetsDefault("none", Locale.getDefault()); - + /** A job sheet is the default */ - public static final JobSheetsDefault STANDARD = + public static final JobSheetsDefault STANDARD = new JobSheetsDefault("standard", Locale.getDefault()); - + /** - * Creates a <code>JobSheetsDefault</code> object with the + * Creates a <code>JobSheetsDefault</code> object with the * given value and locale. * * @param value the value for this syntax @@ -81,7 +81,7 @@ public final class JobSheetsDefault extends TextSyntax { super(value, locale); } - + /** * Returns category of this class. * @@ -101,21 +101,21 @@ public final class JobSheetsDefault extends TextSyntax { return "job-sheets-default"; } - + /** * Returns the equally enum of the standard attribute class * of this DefaultValuesAttribute enum. * <p>May return null if no value exists in JPS API.</p> - * + * * @return The enum of the standard attribute class. */ - public Attribute getAssociatedAttribute() + public Attribute getAssociatedAttribute() { if (this.equals(JobSheetsDefault.NONE)) return JobSheets.NONE; if (this.equals(JobSheetsDefault.STANDARD)) return JobSheets.STANDARD; - + return null; } diff --git a/gnu/javax/print/ipp/attribute/defaults/MediaDefault.java b/gnu/javax/print/ipp/attribute/defaults/MediaDefault.java index b4e626da6..a348fa19a 100644 --- a/gnu/javax/print/ipp/attribute/defaults/MediaDefault.java +++ b/gnu/javax/print/ipp/attribute/defaults/MediaDefault.java @@ -1,4 +1,4 @@ -/* MediaDefault.java -- +/* MediaDefault.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -49,15 +49,15 @@ import javax.print.attribute.TextSyntax; /** * MediaDefault attribute provides the default value of * the printer object for the media attribute. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class MediaDefault extends TextSyntax +public final class MediaDefault extends TextSyntax implements DefaultValueAttribute { - + /** - * Creates a <code>MediaDefault</code> object with the + * Creates a <code>MediaDefault</code> object with the * given value and locale. * * @param value the value for this syntax @@ -70,7 +70,7 @@ public final class MediaDefault extends TextSyntax { super(value, locale); } - + /** * Returns category of this class. * @@ -90,14 +90,14 @@ public final class MediaDefault extends TextSyntax { return "media-default"; } - + /** * Returns the equally enum of the standard attribute class * of this DefaultValuesAttribute enum. - * + * * @return The enum of the standard attribute class. */ - public Attribute getAssociatedAttribute() + public Attribute getAssociatedAttribute() { return IppUtilities.getEnumAttribute("media" , getValue()); } diff --git a/gnu/javax/print/ipp/attribute/defaults/MultipleDocumentHandlingDefault.java b/gnu/javax/print/ipp/attribute/defaults/MultipleDocumentHandlingDefault.java index 0cc324352..17bb9196e 100644 --- a/gnu/javax/print/ipp/attribute/defaults/MultipleDocumentHandlingDefault.java +++ b/gnu/javax/print/ipp/attribute/defaults/MultipleDocumentHandlingDefault.java @@ -47,49 +47,49 @@ import javax.print.attribute.EnumSyntax; /** * <code>MultipleDocumentHandlingDefault</code> provides the * default value for the MultipleDocumentHandling attribute. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class MultipleDocumentHandlingDefault extends EnumSyntax implements DefaultValueAttribute { - + //a keyword based attribute in IPP - int values just starting at 0 - - /** - * Supports only multiple documents treated as a single document. This + + /** + * Supports only multiple documents treated as a single document. This * applies to attributes which specify treatment of multiple document jobs. */ public static final MultipleDocumentHandlingDefault SINGLE_DOCUMENT = new MultipleDocumentHandlingDefault(0); - + /** Supports multiple documents as uncollated copies */ public static final MultipleDocumentHandlingDefault SEPARATE_DOCUMENTS_UNCOLLATED_COPIES = new MultipleDocumentHandlingDefault(1); - + /** Supports multiple documents as collated copies */ public static final MultipleDocumentHandlingDefault SEPARATE_DOCUMENTS_COLLATED_COPIES = new MultipleDocumentHandlingDefault(2); - - /** + + /** * Supports multiple documents where every single document starts - * with a new sheet. + * with a new sheet. */ public static final MultipleDocumentHandlingDefault SINGLE_DOCUMENT_NEW_SHEET = new MultipleDocumentHandlingDefault(3); - private static final String[] stringTable = { "single-document", + private static final String[] stringTable = { "single-document", "separate-documents-uncollated-copies", "separate-documents-collated-copies", "single-document-new-sheet" }; - - private static final MultipleDocumentHandlingDefault[] enumValueTable = + + private static final MultipleDocumentHandlingDefault[] enumValueTable = { SINGLE_DOCUMENT, SEPARATE_DOCUMENTS_UNCOLLATED_COPIES, SEPARATE_DOCUMENTS_COLLATED_COPIES, SINGLE_DOCUMENT_NEW_SHEET}; - + /** * Constructs a <code>MultipleDocumentHandlingDefault</code> object. - * + * * @param value the enum value */ protected MultipleDocumentHandlingDefault(int value) @@ -116,7 +116,7 @@ public final class MultipleDocumentHandlingDefault extends EnumSyntax { return "multiple-document-handling-default"; } - + /** * Returns a table with the enumeration values represented as strings * for this object. @@ -137,16 +137,16 @@ public final class MultipleDocumentHandlingDefault extends EnumSyntax { return enumValueTable; } - + /** * Returns the equally enum of the standard attribute class * of this DefaultValuesAttribute enum. - * + * * @return The enum of the standard attribute class. */ - public Attribute getAssociatedAttribute() + public Attribute getAssociatedAttribute() { - return IppUtilities.getEnumAttribute("multiple-document-handling", + return IppUtilities.getEnumAttribute("multiple-document-handling", new Integer(getValue())); } } diff --git a/gnu/javax/print/ipp/attribute/defaults/NumberUpDefault.java b/gnu/javax/print/ipp/attribute/defaults/NumberUpDefault.java index 6689f2d1c..40bca19cd 100644 --- a/gnu/javax/print/ipp/attribute/defaults/NumberUpDefault.java +++ b/gnu/javax/print/ipp/attribute/defaults/NumberUpDefault.java @@ -1,4 +1,4 @@ -/* NumberUpDefault.java -- +/* NumberUpDefault.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -46,13 +46,13 @@ import javax.print.attribute.standard.NumberUp; /** * NumberUpDefault attribute provides the default value of * the numper up attribute. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class NumberUpDefault extends IntegerSyntax implements DefaultValueAttribute { - + /** * Creates a <code>NumberUpDefault</code> object. * @@ -63,13 +63,13 @@ public final class NumberUpDefault extends IntegerSyntax { super(value); } - + /** * Tests if the given object is equal to this object. * * @param obj the object to test * - * @return <code>true</code> if both objects are equal, + * @return <code>true</code> if both objects are equal, * <code>false</code> otherwise. */ public boolean equals(Object obj) @@ -99,15 +99,15 @@ public final class NumberUpDefault extends IntegerSyntax { return "number-up-default"; } - + /** * Returns the equally enum of the standard attribute class * of this DefaultValuesAttribute enum. * <p>May return null if no value exists in JPS API.</p> - * + * * @return The enum of the standard attribute class. */ - public Attribute getAssociatedAttribute() + public Attribute getAssociatedAttribute() { return new NumberUp(getValue()); } diff --git a/gnu/javax/print/ipp/attribute/defaults/OrientationRequestedDefault.java b/gnu/javax/print/ipp/attribute/defaults/OrientationRequestedDefault.java index 14d265559..12d9ebe6d 100644 --- a/gnu/javax/print/ipp/attribute/defaults/OrientationRequestedDefault.java +++ b/gnu/javax/print/ipp/attribute/defaults/OrientationRequestedDefault.java @@ -45,27 +45,27 @@ import javax.print.attribute.EnumSyntax; /** - * The <code>OrientationRequestedDefault</code> attribute provides + * The <code>OrientationRequestedDefault</code> attribute provides * the default value for the job attribute orientation-requested. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class OrientationRequestedDefault extends EnumSyntax implements DefaultValueAttribute { - + /** Orientation as portrait. */ public static final OrientationRequestedDefault PORTRAIT = new OrientationRequestedDefault(3); - + /** Orientation as landscape. */ public static final OrientationRequestedDefault LANDSCAPE = new OrientationRequestedDefault(4); - + /** Orientation as reversed landscape. */ public static final OrientationRequestedDefault REVERSE_LANDSCAPE = new OrientationRequestedDefault(5); - + /** Orientation as reversed portrait. */ public static final OrientationRequestedDefault REVERSE_PORTRAIT = new OrientationRequestedDefault(6); @@ -74,14 +74,14 @@ public final class OrientationRequestedDefault extends EnumSyntax private static final String[] stringTable = { "portrait", "landscape", "reverse-landscape", "reverse-portrait" }; - - private static final OrientationRequestedDefault[] - enumValueTable = { PORTRAIT, LANDSCAPE, + + private static final OrientationRequestedDefault[] + enumValueTable = { PORTRAIT, LANDSCAPE, REVERSE_LANDSCAPE, REVERSE_PORTRAIT }; - + /** * Constructs a <code>OrientationRequestedDefault</code> object. - * + * * @param value the value */ protected OrientationRequestedDefault(int value) @@ -108,7 +108,7 @@ public final class OrientationRequestedDefault extends EnumSyntax { return "orientation-requested-default"; } - + /** * Returns a table with the enumeration values represented as strings * for this object. @@ -129,7 +129,7 @@ public final class OrientationRequestedDefault extends EnumSyntax { return enumValueTable; } - + /** * Returns the lowest used value by the enumerations of this class. * . @@ -139,16 +139,16 @@ public final class OrientationRequestedDefault extends EnumSyntax { return 3; } - + /** * Returns the equally enum of the standard attribute class * of this DefaultValuesAttribute enum. - * + * * @return The enum of the standard attribute class. */ - public Attribute getAssociatedAttribute() + public Attribute getAssociatedAttribute() { - return IppUtilities.getEnumAttribute("orientation-requested", + return IppUtilities.getEnumAttribute("orientation-requested", new Integer(getValue())); } } diff --git a/gnu/javax/print/ipp/attribute/defaults/PrintQualityDefault.java b/gnu/javax/print/ipp/attribute/defaults/PrintQualityDefault.java index 707d11de0..62495b31f 100644 --- a/gnu/javax/print/ipp/attribute/defaults/PrintQualityDefault.java +++ b/gnu/javax/print/ipp/attribute/defaults/PrintQualityDefault.java @@ -47,7 +47,7 @@ import javax.print.attribute.EnumSyntax; /** * <code>PrintQualityDefault</code> provides the * default value for the print-quality attribute. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class PrintQualityDefault extends EnumSyntax @@ -55,20 +55,20 @@ public final class PrintQualityDefault extends EnumSyntax { /** Draft quality of the printer. */ public static final PrintQualityDefault DRAFT = new PrintQualityDefault(3); - + /** Normal quality of the printer. */ public static final PrintQualityDefault NORMAL = new PrintQualityDefault(4); - + /** High quality of the printer. */ public static final PrintQualityDefault HIGH = new PrintQualityDefault(5); private static final String[] stringTable = { "draft", "normal", "high" }; - + private static final PrintQualityDefault[] enumValueTable = { DRAFT, NORMAL, HIGH }; - + /** * Constructs a <code>PrintQualityDefault</code> object. - * + * * @param value the value of the enum */ protected PrintQualityDefault(int value) @@ -95,7 +95,7 @@ public final class PrintQualityDefault extends EnumSyntax { return "print-quality-default"; } - + /** * Returns a table with the enumeration values represented as strings * for this object. @@ -116,7 +116,7 @@ public final class PrintQualityDefault extends EnumSyntax { return enumValueTable; } - + /** * Returns the lowest used value by the enumerations of this class. * . @@ -126,14 +126,14 @@ public final class PrintQualityDefault extends EnumSyntax { return 3; } - + /** * Returns the equally enum of the standard attribute class * of this DefaultValuesAttribute enum. - * + * * @return The enum of the standard attribute class. */ - public Attribute getAssociatedAttribute() + public Attribute getAssociatedAttribute() { return IppUtilities.getEnumAttribute( "print-quality", new Integer(getValue())); diff --git a/gnu/javax/print/ipp/attribute/defaults/PrinterResolutionDefault.java b/gnu/javax/print/ipp/attribute/defaults/PrinterResolutionDefault.java index baa00c6e9..811a4648d 100644 --- a/gnu/javax/print/ipp/attribute/defaults/PrinterResolutionDefault.java +++ b/gnu/javax/print/ipp/attribute/defaults/PrinterResolutionDefault.java @@ -45,15 +45,15 @@ import javax.print.attribute.standard.PrinterResolution; /** - * The <code>PrinterResolutionDefault</code> attribute provides + * The <code>PrinterResolutionDefault</code> attribute provides * the default value for the job attribute printer-resolution. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class PrinterResolutionDefault extends ResolutionSyntax implements DefaultValueAttribute { - + /** * Creates a <code>ResolutionSyntax</code> object with the given arguments. * @@ -68,20 +68,20 @@ public final class PrinterResolutionDefault extends ResolutionSyntax { super(crossFeedResolution, feedResolution, units); } - + /** * Tests if the given object is equal to this object. * * @param obj the object to test * - * @return <code>true</code> if both objects are equal, + * @return <code>true</code> if both objects are equal, * <code>false</code> otherwise. */ public boolean equals(Object obj) { if(! (obj instanceof PrinterResolutionDefault)) return false; - + return super.equals(obj); } @@ -104,16 +104,16 @@ public final class PrinterResolutionDefault extends ResolutionSyntax { return "printer-resolution-default"; } - + /** * Returns the equally enum of the standard attribute class * of this DefaultValuesAttribute enum. - * + * * @return The enum of the standard attribute class. */ - public Attribute getAssociatedAttribute() + public Attribute getAssociatedAttribute() { - return new PrinterResolution(getCrossFeedResolutionDphi(), + return new PrinterResolution(getCrossFeedResolutionDphi(), getFeedResolutionDphi(), 1); } } diff --git a/gnu/javax/print/ipp/attribute/defaults/SidesDefault.java b/gnu/javax/print/ipp/attribute/defaults/SidesDefault.java index 3c5b0cb86..0645773cf 100644 --- a/gnu/javax/print/ipp/attribute/defaults/SidesDefault.java +++ b/gnu/javax/print/ipp/attribute/defaults/SidesDefault.java @@ -47,45 +47,45 @@ import javax.print.attribute.EnumSyntax; /** * <code>SidesDefault</code> provides the * default for the sides attribute. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class SidesDefault extends EnumSyntax implements DefaultValueAttribute { - + /** Specifies that each page should be printed on one sheet. */ public static final SidesDefault ONE_SIDED = new SidesDefault(0); - - /** - * Specifies that two following pages should be printed on the + + /** + * 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 SidesDefault TWO_SIDED_LONG_EDGE = + public static final SidesDefault TWO_SIDED_LONG_EDGE = new SidesDefault(1); - - /** - * Specifies that two following pages should be printed on the + + /** + * 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 SidesDefault TWO_SIDED_SHORT_EDGE = + public static final SidesDefault TWO_SIDED_SHORT_EDGE = new SidesDefault(2); - + /** An alias constant for "two sided long edge". */ public static final SidesDefault DUPLEX = new SidesDefault(1); - + /** An alias constant for "two sided short edge". */ public static final SidesDefault TUMBLE = new SidesDefault(2); - private static final String[] stringTable = { "one-sided", + private static final String[] stringTable = { "one-sided", "two-sided-long-edge", "two-sided-short-edge" }; - - private static final SidesDefault[] enumValueTable = { ONE_SIDED, - TWO_SIDED_LONG_EDGE, + + private static final SidesDefault[] enumValueTable = { ONE_SIDED, + TWO_SIDED_LONG_EDGE, TWO_SIDED_SHORT_EDGE }; - - + + /** * Creates a <code>SidesDefault</code> object. * @@ -115,7 +115,7 @@ public final class SidesDefault extends EnumSyntax { return "sides-default"; } - + /** * Returns a table with the enumeration values represented as strings * for this object. @@ -136,14 +136,14 @@ public final class SidesDefault extends EnumSyntax { return enumValueTable; } - + /** * Returns the equally enum of the standard attribute class * of this DefaultValuesAttribute enum. - * + * * @return The enum of the standard attribute class. */ - public Attribute getAssociatedAttribute() + public Attribute getAssociatedAttribute() { return IppUtilities.getEnumAttribute("sides", new Integer(getValue())); } diff --git a/gnu/javax/print/ipp/attribute/job/AttributesCharset.java b/gnu/javax/print/ipp/attribute/job/AttributesCharset.java index 057db9bf6..76847a94a 100644 --- a/gnu/javax/print/ipp/attribute/job/AttributesCharset.java +++ b/gnu/javax/print/ipp/attribute/job/AttributesCharset.java @@ -46,24 +46,24 @@ import javax.print.attribute.Attribute; * AttributesCharset attribute as described in RFC 2911 chapter * 3.1.4 Character Set and Natural Language Operation Attributes. * <p> - * This operation attribute identifies the charset used by any text + * This operation attribute identifies the charset used by any text * and name attribute supplied by the client in the request. This * charset must be used by the printer object in the response.<br> * All clients and IPP objects must support the 'utf-8' charset. * </p> - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class AttributesCharset extends CharsetSyntax +public final class AttributesCharset extends CharsetSyntax implements Attribute { - + /** Defines a default UTF-8 charset instance */ public static final AttributesCharset UTF8 = new AttributesCharset("utf-8"); /** * Creates a <code>AttributesCharset</code> object. - * + * * @param value the charset string value. */ public AttributesCharset(String value) diff --git a/gnu/javax/print/ipp/attribute/job/AttributesNaturalLanguage.java b/gnu/javax/print/ipp/attribute/job/AttributesNaturalLanguage.java index 8a41711ac..e30859b9a 100644 --- a/gnu/javax/print/ipp/attribute/job/AttributesNaturalLanguage.java +++ b/gnu/javax/print/ipp/attribute/job/AttributesNaturalLanguage.java @@ -1,4 +1,4 @@ -/* AttributesNaturalLanguage.java -- +/* AttributesNaturalLanguage.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -49,23 +49,23 @@ import javax.print.attribute.Attribute; * <p> * This operation attribute identifies the natural language used * by any text and name attribute supplied by the client in the request. - * The printer object should use this natural language for the response + * The printer object should use this natural language for the response * to this request. * </p> - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class AttributesNaturalLanguage extends NaturalLanguageSyntax +public final class AttributesNaturalLanguage extends NaturalLanguageSyntax implements Attribute { - + /** Defines the default language EN */ - public static final AttributesNaturalLanguage EN = + public static final AttributesNaturalLanguage EN = new AttributesNaturalLanguage("en"); /** * Creates a <code>AttributesNaturalLanguage</code> object. - * + * * @param value the language string value. */ public AttributesNaturalLanguage(String value) diff --git a/gnu/javax/print/ipp/attribute/job/JobDetailedStatusMessages.java b/gnu/javax/print/ipp/attribute/job/JobDetailedStatusMessages.java index 29f47b7fa..0b8e262dd 100644 --- a/gnu/javax/print/ipp/attribute/job/JobDetailedStatusMessages.java +++ b/gnu/javax/print/ipp/attribute/job/JobDetailedStatusMessages.java @@ -1,4 +1,4 @@ -/* JobDetailedStatusMessages.java -- +/* JobDetailedStatusMessages.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -46,10 +46,10 @@ import javax.print.attribute.TextSyntax; /** * JobDetailedStatusMessages provides additional detailed and * technical job informations. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class JobDetailedStatusMessages +public final class JobDetailedStatusMessages extends TextSyntax implements Attribute { diff --git a/gnu/javax/print/ipp/attribute/job/JobDocumentAccessErrors.java b/gnu/javax/print/ipp/attribute/job/JobDocumentAccessErrors.java index 46083bed7..2ab4f8734 100644 --- a/gnu/javax/print/ipp/attribute/job/JobDocumentAccessErrors.java +++ b/gnu/javax/print/ipp/attribute/job/JobDocumentAccessErrors.java @@ -1,4 +1,4 @@ -/* JobDocumentAccessErrors.java -- +/* JobDocumentAccessErrors.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -47,10 +47,10 @@ import javax.print.attribute.TextSyntax; * JobDocumentAccessErrors provides additional information * for each access error for print-uri or document-uri jobs. * technical job informations. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class JobDocumentAccessErrors +public final class JobDocumentAccessErrors extends TextSyntax implements Attribute { diff --git a/gnu/javax/print/ipp/attribute/job/JobId.java b/gnu/javax/print/ipp/attribute/job/JobId.java index f1d85fa50..bec478f78 100644 --- a/gnu/javax/print/ipp/attribute/job/JobId.java +++ b/gnu/javax/print/ipp/attribute/job/JobId.java @@ -1,4 +1,4 @@ -/* JobId.java -- +/* JobId.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -44,7 +44,7 @@ import javax.print.attribute.IntegerSyntax; /** * The <code>JobId</code> attribute contains the ID of a * print job created or currently being processed. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class JobId extends IntegerSyntax implements Attribute @@ -59,7 +59,7 @@ public final class JobId extends IntegerSyntax implements Attribute public JobId(int value) { super(value); - + if (value < 1) throw new IllegalArgumentException("job-id may not be less than 1"); } diff --git a/gnu/javax/print/ipp/attribute/job/JobMoreInfo.java b/gnu/javax/print/ipp/attribute/job/JobMoreInfo.java index a2fe322a8..394c0e19b 100644 --- a/gnu/javax/print/ipp/attribute/job/JobMoreInfo.java +++ b/gnu/javax/print/ipp/attribute/job/JobMoreInfo.java @@ -1,4 +1,4 @@ -/* JobMoreInfo.java -- +/* JobMoreInfo.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -47,7 +47,7 @@ import javax.print.attribute.URISyntax; * JobMoreInfo attribute as described in RFC 2911 section * 4.3.4 contains the URI where more information about a job * (e.g. through a HTML page) can be found. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class JobMoreInfo extends URISyntax implements Attribute diff --git a/gnu/javax/print/ipp/attribute/job/JobPrinterUri.java b/gnu/javax/print/ipp/attribute/job/JobPrinterUri.java index dce552020..9ff34f7d2 100644 --- a/gnu/javax/print/ipp/attribute/job/JobPrinterUri.java +++ b/gnu/javax/print/ipp/attribute/job/JobPrinterUri.java @@ -1,4 +1,4 @@ -/* JobPrinterUri.java -- +/* JobPrinterUri.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -47,7 +47,7 @@ import javax.print.attribute.URISyntax; * JobPrinterUri attribute as described in RFC 2911 section * 4.3.3 contains the URI of the printer which created and * processes a job. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class JobPrinterUri extends URISyntax implements Attribute diff --git a/gnu/javax/print/ipp/attribute/job/JobStateMessage.java b/gnu/javax/print/ipp/attribute/job/JobStateMessage.java index 0cf652307..51dcfa8ed 100644 --- a/gnu/javax/print/ipp/attribute/job/JobStateMessage.java +++ b/gnu/javax/print/ipp/attribute/job/JobStateMessage.java @@ -1,4 +1,4 @@ -/* JobStateMessage.java -- +/* JobStateMessage.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -46,10 +46,10 @@ import javax.print.attribute.TextSyntax; /** * JobStateMessage attribute describes information about the * job-state and job-state-reasons in human readable form. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class JobStateMessage +public final class JobStateMessage extends TextSyntax implements Attribute { diff --git a/gnu/javax/print/ipp/attribute/job/JobUri.java b/gnu/javax/print/ipp/attribute/job/JobUri.java index fa7e3f7b5..774006f95 100644 --- a/gnu/javax/print/ipp/attribute/job/JobUri.java +++ b/gnu/javax/print/ipp/attribute/job/JobUri.java @@ -1,4 +1,4 @@ -/* JobUri.java -- +/* JobUri.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -47,7 +47,7 @@ import javax.print.attribute.URISyntax; * JobUri attribute as described in RFC 2911 section * 4.3.1 contains the URI for a job generated by the printer * after a create request. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ public final class JobUri extends URISyntax implements Attribute diff --git a/gnu/javax/print/ipp/attribute/printer/CharsetConfigured.java b/gnu/javax/print/ipp/attribute/printer/CharsetConfigured.java index 7c8754588..927d00b99 100644 --- a/gnu/javax/print/ipp/attribute/printer/CharsetConfigured.java +++ b/gnu/javax/print/ipp/attribute/printer/CharsetConfigured.java @@ -1,4 +1,4 @@ -/* CharsetConfigured.java -- +/* CharsetConfigured.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -46,16 +46,16 @@ import javax.print.attribute.Attribute; * CharsetConfigured attribute as described in RFC 2911 section * 4.4.17 provides the charset which is configured by the * server to be used in the name and text syntax attribute types. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class CharsetConfigured extends CharsetSyntax +public final class CharsetConfigured extends CharsetSyntax implements Attribute { /** * Creates a <code>CharsetConfigured</code> object. - * + * * @param value the charset string value. */ public CharsetConfigured(String value) diff --git a/gnu/javax/print/ipp/attribute/printer/DocumentFormat.java b/gnu/javax/print/ipp/attribute/printer/DocumentFormat.java index e9abab464..d44910a50 100644 --- a/gnu/javax/print/ipp/attribute/printer/DocumentFormat.java +++ b/gnu/javax/print/ipp/attribute/printer/DocumentFormat.java @@ -1,4 +1,4 @@ -/* DocumentFormat.java -- +/* DocumentFormat.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -47,15 +47,15 @@ import javax.print.attribute.TextSyntax; /** * <code>DocumentFormatSupported</code> specifies the supported document * formats of a printer. Printer are supplying a set of this attribute. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class DocumentFormat extends TextSyntax +public final class DocumentFormat extends TextSyntax implements SupportedValuesAttribute { /** - * Creates a <code>DocumentFormat</code> object with the + * Creates a <code>DocumentFormat</code> object with the * given value and locale. * * @param value the value for this syntax @@ -68,12 +68,12 @@ public final class DocumentFormat extends TextSyntax { super(value, locale); } - + /** * Constructs a document format object for the given flavor. * The constructor reworkes the mimetype of the given flavor * to remove the quoted charset parameter if present. - * + * * @param flavor the flavor with the mimetype * @return The created document format. */ @@ -83,7 +83,7 @@ public final class DocumentFormat extends TextSyntax String mimetype = flavor.getMediaType() + "/" + flavor.getMediaSubtype(); if (charset != null) mimetype += "; charset=" + charset; - + return new DocumentFormat(mimetype, null); } diff --git a/gnu/javax/print/ipp/attribute/printer/MultipleOperationTimeOut.java b/gnu/javax/print/ipp/attribute/printer/MultipleOperationTimeOut.java index 8e54e0565..149f6c1ec 100644 --- a/gnu/javax/print/ipp/attribute/printer/MultipleOperationTimeOut.java +++ b/gnu/javax/print/ipp/attribute/printer/MultipleOperationTimeOut.java @@ -1,4 +1,4 @@ -/* MultipleOperationTimeOut.java -- +/* MultipleOperationTimeOut.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -46,10 +46,10 @@ import javax.print.attribute.IntegerSyntax; * 4.4.31 provides the minimum time ins second a printer object waits * before time out and recovery. The printer object waits e.g. for * additional SendDocument or SendUri operations. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class MultipleOperationTimeOut extends IntegerSyntax +public final class MultipleOperationTimeOut extends IntegerSyntax implements Attribute { diff --git a/gnu/javax/print/ipp/attribute/printer/NaturalLanguageConfigured.java b/gnu/javax/print/ipp/attribute/printer/NaturalLanguageConfigured.java index 8032c3aa7..90eeebc33 100644 --- a/gnu/javax/print/ipp/attribute/printer/NaturalLanguageConfigured.java +++ b/gnu/javax/print/ipp/attribute/printer/NaturalLanguageConfigured.java @@ -1,4 +1,4 @@ -/* NaturalLanguageConfigured.java -- +/* NaturalLanguageConfigured.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -43,19 +43,19 @@ import gnu.javax.print.ipp.attribute.NaturalLanguageSyntax; import javax.print.attribute.Attribute; /** - * NaturalLanguageConfigured attribute as described in RFC 2911 + * NaturalLanguageConfigured attribute as described in RFC 2911 * section 4.4.19 provides the natural language which is configured * by the server to be used in the name and text syntax attribute types. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class NaturalLanguageConfigured extends NaturalLanguageSyntax +public final class NaturalLanguageConfigured extends NaturalLanguageSyntax implements Attribute { /** * Creates a <code>NaturalLanguageConfigured</code> object. - * + * * @param value the charset string value. */ public NaturalLanguageConfigured(String value) diff --git a/gnu/javax/print/ipp/attribute/printer/PrinterCurrentTime.java b/gnu/javax/print/ipp/attribute/printer/PrinterCurrentTime.java index fe64ab0f7..1e4ade966 100644 --- a/gnu/javax/print/ipp/attribute/printer/PrinterCurrentTime.java +++ b/gnu/javax/print/ipp/attribute/printer/PrinterCurrentTime.java @@ -1,4 +1,4 @@ -/* PrinterCurrentTime.java -- +/* PrinterCurrentTime.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -48,10 +48,10 @@ import javax.print.attribute.PrintServiceAttribute; * 4.4.30 provides the current time of the print service. * Its to be used by other attributes like the date-time-at-xxx * attributes in the creation process. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class PrinterCurrentTime extends DateTimeSyntax +public final class PrinterCurrentTime extends DateTimeSyntax implements PrintServiceAttribute { @@ -72,7 +72,7 @@ public final class PrinterCurrentTime extends DateTimeSyntax * * @param obj the object to test * - * @return <code>true</code> if both objects are equal, + * @return <code>true</code> if both objects are equal, * <code>false</code> otherwise. */ public boolean equals(Object obj) @@ -82,7 +82,7 @@ public final class PrinterCurrentTime extends DateTimeSyntax return super.equals(obj); } - + /** * Returns category of this class. * diff --git a/gnu/javax/print/ipp/attribute/printer/PrinterDriverInstaller.java b/gnu/javax/print/ipp/attribute/printer/PrinterDriverInstaller.java index 8a70edf34..be9c425c2 100644 --- a/gnu/javax/print/ipp/attribute/printer/PrinterDriverInstaller.java +++ b/gnu/javax/print/ipp/attribute/printer/PrinterDriverInstaller.java @@ -1,4 +1,4 @@ -/* PrinterDriverInstaller.java -- +/* PrinterDriverInstaller.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -47,10 +47,10 @@ import javax.print.attribute.URISyntax; * PrinterDriverInstaller attribute as described in RFC 2911 section * 4.4.81 provides the URI where a printer driver installer * can be found. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class PrinterDriverInstaller extends URISyntax +public final class PrinterDriverInstaller extends URISyntax implements Attribute { diff --git a/gnu/javax/print/ipp/attribute/printer/PrinterStateMessage.java b/gnu/javax/print/ipp/attribute/printer/PrinterStateMessage.java index da463c4c9..ab59e9687 100644 --- a/gnu/javax/print/ipp/attribute/printer/PrinterStateMessage.java +++ b/gnu/javax/print/ipp/attribute/printer/PrinterStateMessage.java @@ -1,4 +1,4 @@ -/* PrinterStateMessage.java -- +/* PrinterStateMessage.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -48,15 +48,15 @@ import javax.print.attribute.TextSyntax; * 4.4.13 provides a textual representation of the attributes * printer-state and printer-state-reasons for consumption by * humans. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class PrinterStateMessage extends TextSyntax +public final class PrinterStateMessage extends TextSyntax implements PrintServiceAttribute { /** - * Creates a <code>PrinterStateMessage</code> object with the + * Creates a <code>PrinterStateMessage</code> object with the * given value and locale. * * @param value the value for this syntax diff --git a/gnu/javax/print/ipp/attribute/printer/PrinterUpTime.java b/gnu/javax/print/ipp/attribute/printer/PrinterUpTime.java index 7f9b1113f..f5fc1b13a 100644 --- a/gnu/javax/print/ipp/attribute/printer/PrinterUpTime.java +++ b/gnu/javax/print/ipp/attribute/printer/PrinterUpTime.java @@ -1,4 +1,4 @@ -/* PrinterUpTime.java -- +/* PrinterUpTime.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -44,12 +44,12 @@ import javax.print.attribute.IntegerSyntax; /** * PrinterUpTime attribute as described in RFC 2911 section * 4.4.29 provides the uptime of the printer object. This - * is a value in second starting at 1 after a initialization + * is a value in second starting at 1 after a initialization * or reboot of the printer object. - * + * * @author Wolfgang Baer (WBaer@gmx.de) */ -public final class PrinterUpTime extends IntegerSyntax +public final class PrinterUpTime extends IntegerSyntax implements Attribute { |