Search in sources :

Example 1 with PrintServiceAttributeSet

use of javax.print.attribute.PrintServiceAttributeSet in project jdk8u_jdk by JetBrains.

the class UnixPrintService method getAIXServiceAttributes.

private PrintServiceAttributeSet getAIXServiceAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(getQueuedJobCountAIX());
    attrs.add(getPrinterIsAcceptingJobsAIX());
    return attrs;
}
Also used : HashPrintServiceAttributeSet(javax.print.attribute.HashPrintServiceAttributeSet) PrintServiceAttributeSet(javax.print.attribute.PrintServiceAttributeSet) HashPrintServiceAttributeSet(javax.print.attribute.HashPrintServiceAttributeSet)

Example 2 with PrintServiceAttributeSet

use of javax.print.attribute.PrintServiceAttributeSet in project jdk8u_jdk by JetBrains.

the class UnixPrintService method getAttributes.

public PrintServiceAttributeSet getAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(getPrinterName());
    attrs.add(getPrinterIsAcceptingJobs());
    PrinterState prnState = getPrinterState();
    if (prnState != null) {
        attrs.add(prnState);
    }
    PrinterStateReasons prnStateReasons = getPrinterStateReasons();
    if (prnStateReasons != null) {
        attrs.add(prnStateReasons);
    }
    attrs.add(getQueuedJobCount());
    return AttributeSetUtilities.unmodifiableView(attrs);
}
Also used : PrinterState(javax.print.attribute.standard.PrinterState) PrinterStateReasons(javax.print.attribute.standard.PrinterStateReasons) HashPrintServiceAttributeSet(javax.print.attribute.HashPrintServiceAttributeSet) PrintServiceAttributeSet(javax.print.attribute.PrintServiceAttributeSet) HashPrintServiceAttributeSet(javax.print.attribute.HashPrintServiceAttributeSet)

Example 3 with PrintServiceAttributeSet

use of javax.print.attribute.PrintServiceAttributeSet in project jdk8u_jdk by JetBrains.

the class UnixPrintService method getBSDServiceAttributes.

private PrintServiceAttributeSet getBSDServiceAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(getQueuedJobCountBSD());
    attrs.add(getPrinterIsAcceptingJobsBSD());
    return attrs;
}
Also used : HashPrintServiceAttributeSet(javax.print.attribute.HashPrintServiceAttributeSet) PrintServiceAttributeSet(javax.print.attribute.PrintServiceAttributeSet) HashPrintServiceAttributeSet(javax.print.attribute.HashPrintServiceAttributeSet)

Example 4 with PrintServiceAttributeSet

use of javax.print.attribute.PrintServiceAttributeSet in project jdk8u_jdk by JetBrains.

the class Win32MediaSize method getAttributes.

public PrintServiceAttributeSet getAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(getPrinterName());
    attrs.add(getPrinterIsAcceptingJobs());
    PrinterState prnState = getPrinterState();
    if (prnState != null) {
        attrs.add(prnState);
    }
    PrinterStateReasons prnStateReasons = getPrinterStateReasons();
    if (prnStateReasons != null) {
        attrs.add(prnStateReasons);
    }
    attrs.add(getQueuedJobCount());
    int caps = getPrinterCapabilities();
    if ((caps & DEVCAP_COLOR) != 0) {
        attrs.add(ColorSupported.SUPPORTED);
    } else {
        attrs.add(ColorSupported.NOT_SUPPORTED);
    }
    return AttributeSetUtilities.unmodifiableView(attrs);
}
Also used : PrinterState(javax.print.attribute.standard.PrinterState) PrinterStateReasons(javax.print.attribute.standard.PrinterStateReasons) HashPrintServiceAttributeSet(javax.print.attribute.HashPrintServiceAttributeSet) PrintServiceAttributeSet(javax.print.attribute.PrintServiceAttributeSet) HashPrintServiceAttributeSet(javax.print.attribute.HashPrintServiceAttributeSet)

Example 5 with PrintServiceAttributeSet

use of javax.print.attribute.PrintServiceAttributeSet in project jdk8u_jdk by JetBrains.

the class Win32MediaSize method getUpdatedAttributes.

public PrintServiceAttributeSet getUpdatedAttributes() {
    PrintServiceAttributeSet currSet = getDynamicAttributes();
    if (lastSet == null) {
        lastSet = currSet;
        return AttributeSetUtilities.unmodifiableView(currSet);
    } else {
        PrintServiceAttributeSet updates = new HashPrintServiceAttributeSet();
        Attribute[] attrs = currSet.toArray();
        for (int i = 0; i < attrs.length; i++) {
            Attribute attr = attrs[i];
            if (!lastSet.containsValue(attr)) {
                updates.add(attr);
            }
        }
        lastSet = currSet;
        return AttributeSetUtilities.unmodifiableView(updates);
    }
}
Also used : PrintServiceAttribute(javax.print.attribute.PrintServiceAttribute) Attribute(javax.print.attribute.Attribute) HashPrintServiceAttributeSet(javax.print.attribute.HashPrintServiceAttributeSet) PrintServiceAttributeSet(javax.print.attribute.PrintServiceAttributeSet) HashPrintServiceAttributeSet(javax.print.attribute.HashPrintServiceAttributeSet)

Aggregations

PrintServiceAttributeSet (javax.print.attribute.PrintServiceAttributeSet)15 HashPrintServiceAttributeSet (javax.print.attribute.HashPrintServiceAttributeSet)13 PrintService (javax.print.PrintService)5 Attribute (javax.print.attribute.Attribute)4 HashPrintRequestAttributeSet (javax.print.attribute.HashPrintRequestAttributeSet)4 PrintServiceAttribute (javax.print.attribute.PrintServiceAttribute)4 PrintRequestAttributeSet (javax.print.attribute.PrintRequestAttributeSet)3 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 MultiDocPrintService (javax.print.MultiDocPrintService)2 StreamPrintService (javax.print.StreamPrintService)2 PrintRequestAttribute (javax.print.attribute.PrintRequestAttribute)2 PrinterName (javax.print.attribute.standard.PrinterName)2 PrinterState (javax.print.attribute.standard.PrinterState)2 PrinterStateReasons (javax.print.attribute.standard.PrinterStateReasons)2 TemplateException (freemarker.template.TemplateException)1 HeadlessException (java.awt.HeadlessException)1 PrinterException (java.awt.print.PrinterException)1 PrinterIOException (java.awt.print.PrinterIOException)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1