Search in sources :

Example 1 with HashPrintServiceAttributeSet

use of javax.print.attribute.HashPrintServiceAttributeSet 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 HashPrintServiceAttributeSet

use of javax.print.attribute.HashPrintServiceAttributeSet 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 HashPrintServiceAttributeSet

use of javax.print.attribute.HashPrintServiceAttributeSet 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 HashPrintServiceAttributeSet

use of javax.print.attribute.HashPrintServiceAttributeSet 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 HashPrintServiceAttributeSet

use of javax.print.attribute.HashPrintServiceAttributeSet 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

HashPrintServiceAttributeSet (javax.print.attribute.HashPrintServiceAttributeSet)12 PrintServiceAttributeSet (javax.print.attribute.PrintServiceAttributeSet)12 Attribute (javax.print.attribute.Attribute)4 PrintServiceAttribute (javax.print.attribute.PrintServiceAttribute)4 ArrayList (java.util.ArrayList)2 MultiDocPrintService (javax.print.MultiDocPrintService)2 PrintService (javax.print.PrintService)2 HashPrintRequestAttributeSet (javax.print.attribute.HashPrintRequestAttributeSet)2 PrintRequestAttribute (javax.print.attribute.PrintRequestAttribute)2 PrintRequestAttributeSet (javax.print.attribute.PrintRequestAttributeSet)2 PrinterState (javax.print.attribute.standard.PrinterState)2 PrinterStateReasons (javax.print.attribute.standard.PrinterStateReasons)2 PrinterName (javax.print.attribute.standard.PrinterName)1 PrintServiceAttributeEvent (javax.print.event.PrintServiceAttributeEvent)1 PrintServiceAttributeListener (javax.print.event.PrintServiceAttributeListener)1