APIdia Launch Partner
Top Fields Constructors Methods
sun.print

public final Class UnixPrintService

extends Object
implements PrintService, AttributeUpdater, SunPrinterJobService
Class Inheritance
All Implemented Interfaces
sun.print.SunPrinterJobService, sun.print.AttributeUpdater, javax.print.PrintService
Imports
java.io.File, java.net.URI, .URISyntaxException, java.util.ArrayList, .Locale, java.awt.GraphicsEnvironment, .Toolkit, javax.print.DocFlavor, .DocPrintJob, .PrintService, .ServiceUIFactory, javax.print.attribute.Attribute, .AttributeSet, .AttributeSetUtilities, .HashAttributeSet, .PrintServiceAttribute, .PrintServiceAttributeSet, .HashPrintServiceAttributeSet, .Size2DSyntax, javax.print.attribute.standard.PrinterName, .PrinterIsAcceptingJobs, .QueuedJobCount, .JobName, .JobSheets, .RequestingUserName, .Chromaticity, .ColorSupported, .Copies, .CopiesSupported, .Destination, .DialogOwner, .DialogTypeSelection, .Fidelity, .Media, .MediaPrintableArea, .MediaSize, .MediaSizeName, .OrientationRequested, .PageRanges, .PrinterState, .PrinterStateReason, .PrinterStateReasons, .Severity, .SheetCollate, .Sides, javax.print.event.PrintServiceAttributeListener

Field Summary

Modifier and TypeField and Description
private static String
private boolean
private transient PrintServiceAttributeSet
pack-priv String[]
pack-priv String[]
private static int
private static final MediaSizeName[]
private static MediaPrintableArea[]
private PrinterName
private transient ServiceNotifier
private static final Class<?>[]
private String
private static final Class<?>[]
private static DocFlavor[]
private static final DocFlavor[]
private static final DocFlavor[]
private static DocFlavor

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
public DocPrintJob
createPrintJob()

Implements javax.print.PrintService.createPrintJob.

Creates and returns a PrintJob capable of handling data from any of the supported document flavors.

public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Implements javax.print.PrintService.equals.

Determines if two services are referring to the same underlying service.

protected static String[]
private PrintServiceAttributeSet
private MediaPrintableArea[]
public <T extends PrintServiceAttribute> T
getAttribute(Class<T> category)

Implements javax.print.PrintService.getAttribute.

Gets the value of the single specified service attribute.

public PrintServiceAttributeSet
getAttributes()

Implements javax.print.PrintService.getAttributes.

Obtains this print service's set of printer description attributes giving this Print Service's status.

private PrintServiceAttributeSet
public Object
getDefaultAttributeValue(Class<? extends Attribute> category)

Implements javax.print.PrintService.getDefaultAttributeValue.

Determines this print service's default printing attribute value in the given category.

private PrintServiceAttributeSet
public String
getName()

Implements javax.print.PrintService.getName.

Returns a string name for this print service which may be used by applications to request a particular print service.

private PrinterIsAcceptingJobs
private PrinterIsAcceptingJobs
private PrinterIsAcceptingJobs
private PrinterName
private PrinterState
private PrinterStateReasons
private QueuedJobCount
private QueuedJobCount
private QueuedJobCount
public ServiceUIFactory
getServiceUIFactory()

Implements javax.print.PrintService.getServiceUIFactory.

Returns a factory for UI components which allow users to interact with the service in various roles.

public Class<?>[]
getSupportedAttributeCategories()

Implements javax.print.PrintService.getSupportedAttributeCategories.

Determines the printing attribute categories a client can specify when setting up a job for this print service.

public Object
getSupportedAttributeValues(Class<? extends Attribute> category, DocFlavor flavor, AttributeSet attributes)

Implements javax.print.PrintService.getSupportedAttributeValues.

Determines the printing attribute values a client can specify in the given category when setting up a job for this print service.

public DocFlavor[]
getSupportedDocFlavors()

Implements javax.print.PrintService.getSupportedDocFlavors.

Determines the print data formats a client can specify when setting up a job for this PrintService.

public AttributeSet
getUnsupportedAttributes(DocFlavor flavor, AttributeSet attributes)

Implements javax.print.PrintService.getUnsupportedAttributes.

Identifies the attributes that are unsupported for a print request in the context of a particular DocFlavor.

public PrintServiceAttributeSet
public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements javax.print.PrintService.hashCode.

This method should be implemented consistently with equals(Object).

private void
public void
public boolean
isAttributeCategorySupported(Class<? extends Attribute> category)

Implements javax.print.PrintService.isAttributeCategorySupported.

Determines whether a client can specify the given printing attribute category when setting up a job for this print service.

public boolean
isAttributeValueSupported(Attribute attr, DocFlavor flavor, AttributeSet attributes)

Implements javax.print.PrintService.isAttributeValueSupported.

Determines whether a client can specify the given printing attribute value when setting up a job for this Print Service.

private boolean
public boolean
isDocFlavorSupported(DocFlavor flavor)

Implements javax.print.PrintService.isDocFlavorSupported.

Determines if this print service supports a specific DocFlavor.

private boolean
private boolean
private boolean
public void
removePrintServiceAttributeListener(PrintServiceAttributeListener listener)

Implements javax.print.PrintService.removePrintServiceAttributeListener.

Removes the print-service listener from this print service.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public boolean
usesClass(Class<?> c)

Implements sun.print.SunPrinterJobService.usesClass.

This returns true if this service is implemented using the platform's built-in subclass of PrinterJob.

public void
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

encodingback to summary
private static String encoding
isInvalidback to summary
private boolean isInvalid
lastSetback to summary
private transient PrintServiceAttributeSet lastSet
lpcQueueComback to summary
pack-priv String[] lpcQueueCom
lpcStatusComback to summary
pack-priv String[] lpcStatusCom
MAXCOPIESback to summary
private static int MAXCOPIES
mediaSizesback to summary
private static final MediaSizeName[] mediaSizes
mpasback to summary
private static MediaPrintableArea[] mpas
nameback to summary
private PrinterName name
notifierback to summary
private transient ServiceNotifier notifier
otherAttrCatsback to summary
private static final Class<?>[] otherAttrCats
printerback to summary
private String printer
serviceAttrCatsback to summary
private static final Class<?>[] serviceAttrCats
supportedDocFlavorsback to summary
private static DocFlavor[] supportedDocFlavors
supportedDocFlavorsInitback to summary
private static final DocFlavor[] supportedDocFlavorsInit
supportedHostDocFlavorsback to summary
private static final DocFlavor[] supportedHostDocFlavors
textByteFlavorback to summary
private static DocFlavor textByteFlavor

Constructor Detail

UnixPrintServiceback to summary
pack-priv UnixPrintService(String name)

Method Detail

addPrintServiceAttributeListenerback to summary
public void addPrintServiceAttributeListener(PrintServiceAttributeListener listener)

Implements javax.print.PrintService.addPrintServiceAttributeListener.

Doc from javax.print.PrintService.addPrintServiceAttributeListener.

Registers a listener for events on this PrintService.

Annotations
@Override
createPrintJobback to summary
public DocPrintJob createPrintJob()

Implements javax.print.PrintService.createPrintJob.

Doc from javax.print.PrintService.createPrintJob.

Creates and returns a PrintJob capable of handling data from any of the supported document flavors.

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Implements javax.print.PrintService.equals.

Doc from javax.print.PrintService.equals.

Determines if two services are referring to the same underlying service. Objects encapsulating a print service may not exhibit equality of reference even though they refer to the same underlying service.

Clients should call this method to determine if two services are referring to the same underlying service.

Services must implement this method and return true only if the service objects being compared may be used interchangeably by the client. Services are free to return the same object reference to an underlying service if that, but clients must not depend on equality of reference.

Annotations
@Override
filterPrinterNamesAIXback to summary
protected static String[] filterPrinterNamesAIX(String[] posPrinters)
getAIXServiceAttributesback to summary
private PrintServiceAttributeSet getAIXServiceAttributes()
getAllPrintableAreasback to summary
private MediaPrintableArea[] getAllPrintableAreas()
getAttributeback to summary
public <T extends PrintServiceAttribute> T getAttribute(Class<T> category)

Implements javax.print.PrintService.getAttribute.

Doc from javax.print.PrintService.getAttribute.

Gets the value of the single specified service attribute. This may be useful to clients which only need the value of one attribute and want to minimize overhead.

Annotations
@Override
@SuppressWarnings:unchecked
getAttributesback to summary
public PrintServiceAttributeSet getAttributes()

Implements javax.print.PrintService.getAttributes.

Doc from javax.print.PrintService.getAttributes.

Obtains this print service's set of printer description attributes giving this Print Service's status. The returned attribute set object is unmodifiable. The returned attribute set object is a "snapshot" of this Print Service's attribute set at the time of the getAttributes() method call: that is, the returned attribute set's contents will not be updated if this print service's attribute set's contents change in the future. To detect changes in attribute values, call getAttributes() again and compare the new attribute set to the previous attribute set; alternatively, register a listener for print service events.

Annotations
@Override
getBSDServiceAttributesback to summary
private PrintServiceAttributeSet getBSDServiceAttributes()
getDefaultAttributeValueback to summary
public Object getDefaultAttributeValue(Class<? extends Attribute> category)

Implements javax.print.PrintService.getDefaultAttributeValue.

Doc from javax.print.PrintService.getDefaultAttributeValue.

Determines this print service's default printing attribute value in the given category. A printing attribute value is an instance of a class that implements interface Attribute. If a client sets up a print job and does not specify any attribute value in the given category, this Print Service will use the default attribute value instead.

Some attributes may not be supported in a particular context (ie for a particular DocFlavor). Use one of the methods that include a DocFlavor to validate the request before submitting it, such as getSupportedAttributeValues(..).

Not all attributes have a default value. For example the service will not have a default value for RequestingUser i.e. a null return for a supported category means there is no service default value for that category. Use the isAttributeCategorySupported(Class) method to distinguish these cases.

Annotations
@Override
getDynamicAttributesback to summary
private PrintServiceAttributeSet getDynamicAttributes()
getNameback to summary
public String getName()

Implements javax.print.PrintService.getName.

Doc from javax.print.PrintService.getName.

Returns a string name for this print service which may be used by applications to request a particular print service. In a suitable context, such as a name service, this name must be unique. In some environments this unique name may be the same as the user friendly printer name defined as the PrinterName attribute.

Annotations
@Override
getPrinterIsAcceptingJobsback to summary
private PrinterIsAcceptingJobs getPrinterIsAcceptingJobs()
getPrinterIsAcceptingJobsAIXback to summary
private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsAIX()
getPrinterIsAcceptingJobsBSDback to summary
private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsBSD()
getPrinterNameback to summary
private PrinterName getPrinterName()
getPrinterStateback to summary
private PrinterState getPrinterState()
getPrinterStateReasonsback to summary
private PrinterStateReasons getPrinterStateReasons()
getQueuedJobCountback to summary
private QueuedJobCount getQueuedJobCount()
getQueuedJobCountAIXback to summary
private QueuedJobCount getQueuedJobCountAIX()
getQueuedJobCountBSDback to summary
private QueuedJobCount getQueuedJobCountBSD()
getServiceUIFactoryback to summary
public ServiceUIFactory getServiceUIFactory()

Implements javax.print.PrintService.getServiceUIFactory.

Doc from javax.print.PrintService.getServiceUIFactory.

Returns a factory for UI components which allow users to interact with the service in various roles. Services which do not provide any UI should return null. Print Services which do provide UI but want to be supported in an environment with no UI support should ensure that the factory is not initialised unless the application calls this method to obtain the factory. See ServiceUIFactory for more information.

Annotations
@Override
getSupportedAttributeCategoriesback to summary
public Class<?>[] getSupportedAttributeCategories()

Implements javax.print.PrintService.getSupportedAttributeCategories.

Doc from javax.print.PrintService.getSupportedAttributeCategories.

Determines the printing attribute categories a client can specify when setting up a job for this print service. A printing attribute category is designated by a Class that implements interface Attribute. This method returns just the attribute categories that are supported; it does not return the particular attribute values that are supported.

This method returns all the printing attribute categories this print service supports for any possible job. Some categories may not be supported in a particular context (ie for a particular DocFlavor). Use one of the methods that include a DocFlavor to validate the request before submitting it, such as getSupportedAttributeValues(..).

Annotations
@Override
getSupportedAttributeValuesback to summary
public Object getSupportedAttributeValues(Class<? extends Attribute> category, DocFlavor flavor, AttributeSet attributes)

Implements javax.print.PrintService.getSupportedAttributeValues.

Doc from javax.print.PrintService.getSupportedAttributeValues.

Determines the printing attribute values a client can specify in the given category when setting up a job for this print service. A printing attribute value is an instance of a class that implements interface Attribute.

If flavor is null and attributes is null or is an empty set, this method returns all the printing attribute values this Print Service supports for any possible job. If flavor is not null or attributes is not an empty set, this method returns just the printing attribute values that are compatible with the given doc flavor and/or set of attributes. That is, a null return value may indicate that specifying this attribute is incompatible with the specified DocFlavor. Also if DocFlavor is not null it must be a flavor supported by this PrintService, else IllegalArgumentException will be thrown.

If the attributes parameter contains an Attribute whose category is the same as the category parameter, the service must ignore this attribute in the AttributeSet.

DocAttributes which are to be specified on the Doc must be included in this set to accurately represent the context.

This method returns an Object because different printing attribute categories indicate the supported attribute values in different ways. The documentation for each printing attribute in package javax.print.attribute.standard describes how each attribute indicates its supported values. Possible ways of indicating support include:

  • Return a single instance of the attribute category to indicate that any value is legal -- used, for example, by an attribute whose value is an arbitrary text string. (The value of the returned attribute object is irrelevant.)
  • Return an array of one or more instances of the attribute category, containing the legal values -- used, for example, by an attribute with a list of enumerated values. The type of the array is an array of the specified attribute category type as returned by its getCategory(Class).
  • Return a single object (of some class other than the attribute category) that indicates bounds on the legal values -- used, for example, by an integer-valued attribute that must lie within a certain range.
Annotations
@Override
getSupportedDocFlavorsback to summary
public DocFlavor[] getSupportedDocFlavors()

Implements javax.print.PrintService.getSupportedDocFlavors.

Doc from javax.print.PrintService.getSupportedDocFlavors.

Determines the print data formats a client can specify when setting up a job for this PrintService. A print data format is designated by a "doc flavor" (class DocFlavor) consisting of a MIME type plus a print data representation class.

Note that some doc flavors may not be supported in combination with all attributes. Use getUnsupportedAttributes(..) to validate specific combinations.

Annotations
@Override
getUnsupportedAttributesback to summary
public AttributeSet getUnsupportedAttributes(DocFlavor flavor, AttributeSet attributes)

Implements javax.print.PrintService.getUnsupportedAttributes.

Doc from javax.print.PrintService.getUnsupportedAttributes.

Identifies the attributes that are unsupported for a print request in the context of a particular DocFlavor. This method is useful for validating a potential print job and identifying the specific attributes which cannot be supported. It is important to supply only a supported DocFlavor or an IllegalArgumentException will be thrown. If the return value from this method is null, all attributes are supported.

DocAttributes which are to be specified on the Doc must be included in this set to accurately represent the context.

If the return value is non-null, all attributes in the returned set are unsupported with this DocFlavor. The returned set does not distinguish attribute categories that are unsupported from unsupported attribute values.

A supported print request can then be created by removing all unsupported attributes from the original attribute set, except in the case that the DocFlavor is unsupported.

If any attributes are unsupported only because they are in conflict with other attributes then it is at the discretion of the service to select the attribute(s) to be identified as the cause of the conflict.

Use isDocFlavorSupported() to verify that a DocFlavor is supported before calling this method.

Annotations
@Override
getUpdatedAttributesback to summary
public PrintServiceAttributeSet getUpdatedAttributes()

Implements sun.print.AttributeUpdater.getUpdatedAttributes.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements javax.print.PrintService.hashCode.

Doc from javax.print.PrintService.hashCode.

This method should be implemented consistently with equals(Object).

Annotations
@Override
initSupportedDocFlavorsback to summary
private void initSupportedDocFlavors()
invalidateServiceback to summary
public void invalidateService()
isAttributeCategorySupportedback to summary
public boolean isAttributeCategorySupported(Class<? extends Attribute> category)

Implements javax.print.PrintService.isAttributeCategorySupported.

Doc from javax.print.PrintService.isAttributeCategorySupported.

Determines whether a client can specify the given printing attribute category when setting up a job for this print service. A printing attribute category is designated by a Class that implements interface Attribute. This method tells whether the attribute category is supported; it does not tell whether a particular attribute value is supported.

Some categories may not be supported in a particular context (ie for a particular DocFlavor). Use one of the methods which include a DocFlavor to validate the request before submitting it, such as getSupportedAttributeValues(..).

This is a convenience method to determine if the category would be a member of the result of getSupportedAttributeCategories().

Annotations
@Override
isAttributeValueSupportedback to summary
public boolean isAttributeValueSupported(Attribute attr, DocFlavor flavor, AttributeSet attributes)

Implements javax.print.PrintService.isAttributeValueSupported.

Doc from javax.print.PrintService.isAttributeValueSupported.

Determines whether a client can specify the given printing attribute value when setting up a job for this Print Service. A printing attribute value is an instance of a class that implements interface Attribute.

If flavor is null and attributes is null or is an empty set, this method tells whether this Print Service supports the given printing attribute value for some possible combination of doc flavor and set of attributes. If flavor is not null or attributes is not an empty set, this method tells whether this Print Service supports the given printing attribute value in combination with the given doc flavor and/or set of attributes.

Also if DocFlavor is not null it must be a flavor supported by this PrintService, else IllegalArgumentException will be thrown.

DocAttributes which are to be specified on the Doc must be included in this set to accurately represent the context.

This is a convenience method to determine if the value would be a member of the result of getSupportedAttributeValues(...).

Annotations
@Override
isAutoSenseback to summary
private boolean isAutoSense(DocFlavor flavor)
isDocFlavorSupportedback to summary
public boolean isDocFlavorSupported(DocFlavor flavor)

Implements javax.print.PrintService.isDocFlavorSupported.

Doc from javax.print.PrintService.isDocFlavorSupported.

Determines if this print service supports a specific DocFlavor. This is a convenience method to determine if the DocFlavor would be a member of the result of getSupportedDocFlavors().

Note that some doc flavors may not be supported in combination with all attributes. Use getUnsupportedAttributes(..) to validate specific combinations.

Annotations
@Override
isServiceFormattedFlavorback to summary
private boolean isServiceFormattedFlavor(DocFlavor flavor)
isSupportedCopiesback to summary
private boolean isSupportedCopies(Copies copies)
isSupportedMediaback to summary
private boolean isSupportedMedia(MediaSizeName msn)
removePrintServiceAttributeListenerback to summary
public void removePrintServiceAttributeListener(PrintServiceAttributeListener listener)

Implements javax.print.PrintService.removePrintServiceAttributeListener.

Doc from javax.print.PrintService.removePrintServiceAttributeListener.

Removes the print-service listener from this print service. This means the listener is no longer interested in PrintService events.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
usesClassback to summary
public boolean usesClass(Class<?> c)

Implements sun.print.SunPrinterJobService.usesClass.

Doc from sun.print.SunPrinterJobService.usesClass.

This returns true if this service is implemented using the platform's built-in subclass of PrinterJob. ie the same class as the caller.

Annotations
@Override
wakeNotifierback to summary
public void wakeNotifier()