Java Code Examples for javax.print.attribute.PrintServiceAttributeSet#add()

The following examples show how to use javax.print.attribute.PrintServiceAttributeSet#add() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Win32PrintService.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example 2
Source File: UnixPrintService.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public PrintServiceAttributeSet getUpdatedAttributes() {
    PrintServiceAttributeSet currSet = getDynamicAttributes();
    if (lastSet == null) {
        lastSet = currSet;
        return AttributeSetUtilities.unmodifiableView(currSet);
    } else {
        PrintServiceAttributeSet updates =
            new HashPrintServiceAttributeSet();
        Attribute []attrs = currSet.toArray();
        Attribute attr;
        for (int i=0; i<attrs.length; i++) {
            attr = attrs[i];
            if (!lastSet.containsValue(attr)) {
                updates.add(attr);
            }
        }
        lastSet = currSet;
        return AttributeSetUtilities.unmodifiableView(updates);
    }
}
 
Example 3
Source File: UnixPrintService.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public PrintServiceAttributeSet getUpdatedAttributes() {
    PrintServiceAttributeSet currSet = getDynamicAttributes();
    if (lastSet == null) {
        lastSet = currSet;
        return AttributeSetUtilities.unmodifiableView(currSet);
    } else {
        PrintServiceAttributeSet updates =
            new HashPrintServiceAttributeSet();
        Attribute []attrs = currSet.toArray();
        Attribute attr;
        for (int i=0; i<attrs.length; i++) {
            attr = attrs[i];
            if (!lastSet.containsValue(attr)) {
                updates.add(attr);
            }
        }
        lastSet = currSet;
        return AttributeSetUtilities.unmodifiableView(updates);
    }
}
 
Example 4
Source File: UnixPrintService.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 5
Source File: UnixPrintService.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 6
Source File: UnixPrintService.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private PrintServiceAttributeSet getBSDServiceAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(getQueuedJobCountBSD());
    attrs.add(getPrinterIsAcceptingJobsBSD());
    return attrs;
}
 
Example 7
Source File: UnixPrintService.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private PrintServiceAttributeSet getSysVServiceAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(getQueuedJobCountSysV());
    attrs.add(getPrinterIsAcceptingJobsSysV());
    return attrs;
}
 
Example 8
Source File: UnixPrintService.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private PrintServiceAttributeSet getAIXServiceAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(getQueuedJobCountAIX());
    attrs.add(getPrinterIsAcceptingJobsAIX());
    return attrs;
}
 
Example 9
Source File: UnixPrintService.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private PrintServiceAttributeSet getSysVServiceAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(getQueuedJobCountSysV());
    attrs.add(getPrinterIsAcceptingJobsSysV());
    return attrs;
}
 
Example 10
Source File: UnixPrintService.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private PrintServiceAttributeSet getAIXServiceAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(getQueuedJobCountAIX());
    attrs.add(getPrinterIsAcceptingJobsAIX());
    return attrs;
}
 
Example 11
Source File: UnixPrintService.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private PrintServiceAttributeSet getSysVServiceAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(getQueuedJobCountSysV());
    attrs.add(getPrinterIsAcceptingJobsSysV());
    return attrs;
}
 
Example 12
Source File: PSStreamPrintService.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public PrintServiceAttributeSet getAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(ColorSupported.SUPPORTED);

    return AttributeSetUtilities.unmodifiableView(attrs);
}
 
Example 13
Source File: PSStreamPrintService.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public PrintServiceAttributeSet getAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(ColorSupported.SUPPORTED);

    return AttributeSetUtilities.unmodifiableView(attrs);
}
 
Example 14
Source File: Win32PrintService.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private PrintServiceAttributeSet getDynamicAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(getPrinterIsAcceptingJobs());
    attrs.add(getQueuedJobCount());
    return attrs;
}
 
Example 15
Source File: UnixPrintService.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private PrintServiceAttributeSet getSysVServiceAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(getQueuedJobCountSysV());
    attrs.add(getPrinterIsAcceptingJobsSysV());
    return attrs;
}
 
Example 16
Source File: PSStreamPrintService.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public PrintServiceAttributeSet getAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(ColorSupported.SUPPORTED);

    return AttributeSetUtilities.unmodifiableView(attrs);
}
 
Example 17
Source File: UnixPrintService.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
private PrintServiceAttributeSet getBSDServiceAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(getQueuedJobCountBSD());
    attrs.add(getPrinterIsAcceptingJobsBSD());
    return attrs;
}
 
Example 18
Source File: Win32PrintService.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private PrintServiceAttributeSet getDynamicAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(getPrinterIsAcceptingJobs());
    attrs.add(getQueuedJobCount());
    return attrs;
}
 
Example 19
Source File: PSStreamPrintService.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public PrintServiceAttributeSet getAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(ColorSupported.SUPPORTED);

    return AttributeSetUtilities.unmodifiableView(attrs);
}
 
Example 20
Source File: PSStreamPrintService.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
public PrintServiceAttributeSet getAttributes() {
    PrintServiceAttributeSet attrs = new HashPrintServiceAttributeSet();
    attrs.add(ColorSupported.SUPPORTED);

    return AttributeSetUtilities.unmodifiableView(attrs);
}