javax.print.attribute.AttributeSetUtilities Java Examples
The following examples show how to use
javax.print.attribute.AttributeSetUtilities.
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: UnixPrintService.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
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 #2
Source File: UnixPrintService.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
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: Win32PrintService.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
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); }
Example #4
Source File: Win32PrintService.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
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 #5
Source File: Win32PrintService.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
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); }
Example #6
Source File: Win32PrintService.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
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 #7
Source File: Win32PrintService.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
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); }
Example #8
Source File: UnixPrintService.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
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 #9
Source File: Win32PrintService.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
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); }
Example #10
Source File: Win32PrintService.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
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 #11
Source File: Win32PrintService.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
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); }
Example #12
Source File: UnixPrintService.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
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 #13
Source File: UnixPrintService.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
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 #14
Source File: UnixPrintService.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
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 #15
Source File: Win32PrintService.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
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 #16
Source File: Win32PrintService.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
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); }
Example #17
Source File: Win32PrintService.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
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 #18
Source File: Win32PrintService.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
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 #19
Source File: Win32PrintService.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
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); }
Example #20
Source File: Win32PrintService.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
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 #21
Source File: PSStreamPrintJob.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public PrintJobAttributeSet getAttributes() { synchronized (this) { if (jobAttrSet == null) { /* just return an empty set until the job is submitted */ PrintJobAttributeSet jobSet = new HashPrintJobAttributeSet(); return AttributeSetUtilities.unmodifiableView(jobSet); } else { return jobAttrSet; } } }
Example #22
Source File: UnixPrintService.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
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 #23
Source File: SimpleDoc.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * Constructs a <code>SimpleDoc</code> with the specified * print data, doc flavor and doc attribute set. * @param printData the print data object * @param flavor the <code>DocFlavor</code> object * @param attributes a <code>DocAttributeSet</code>, which can * be <code>null</code> * @throws IllegalArgumentException if <code>flavor</code> or * <code>printData</code> is <code>null</code>, or the * <code>printData</code> does not correspond * to the specified doc flavor--for example, the data is * not of the type specified as the representation in the * <code>DocFlavor</code>. */ public SimpleDoc(Object printData, DocFlavor flavor, DocAttributeSet attributes) { if (flavor == null || printData == null) { throw new IllegalArgumentException("null argument(s)"); } Class repClass = null; try { String className = flavor.getRepresentationClassName(); sun.reflect.misc.ReflectUtil.checkPackageAccess(className); repClass = Class.forName(className, false, Thread.currentThread().getContextClassLoader()); } catch (Throwable e) { throw new IllegalArgumentException("unknown representation class"); } if (!repClass.isInstance(printData)) { throw new IllegalArgumentException("data is not of declared type"); } this.flavor = flavor; if (attributes != null) { this.attributes = AttributeSetUtilities.unmodifiableView(attributes); } this.printData = printData; }
Example #24
Source File: UnixPrintJob.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public PrintJobAttributeSet getAttributes() { synchronized (this) { if (jobAttrSet == null) { /* just return an empty set until the job is submitted */ PrintJobAttributeSet jobSet = new HashPrintJobAttributeSet(); return AttributeSetUtilities.unmodifiableView(jobSet); } else { return jobAttrSet; } } }
Example #25
Source File: Win32PrintJob.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public PrintJobAttributeSet getAttributes() { synchronized (this) { if (jobAttrSet == null) { /* just return an empty set until the job is submitted */ PrintJobAttributeSet jobSet = new HashPrintJobAttributeSet(); return AttributeSetUtilities.unmodifiableView(jobSet); } else { return jobAttrSet; } } }
Example #26
Source File: UnixPrintJob.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
public PrintJobAttributeSet getAttributes() { synchronized (this) { if (jobAttrSet == null) { /* just return an empty set until the job is submitted */ PrintJobAttributeSet jobSet = new HashPrintJobAttributeSet(); return AttributeSetUtilities.unmodifiableView(jobSet); } else { return jobAttrSet; } } }
Example #27
Source File: SimpleDoc.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Constructs a <code>SimpleDoc</code> with the specified * print data, doc flavor and doc attribute set. * @param printData the print data object * @param flavor the <code>DocFlavor</code> object * @param attributes a <code>DocAttributeSet</code>, which can * be <code>null</code> * @throws IllegalArgumentException if <code>flavor</code> or * <code>printData</code> is <code>null</code>, or the * <code>printData</code> does not correspond * to the specified doc flavor--for example, the data is * not of the type specified as the representation in the * <code>DocFlavor</code>. */ public SimpleDoc(Object printData, DocFlavor flavor, DocAttributeSet attributes) { if (flavor == null || printData == null) { throw new IllegalArgumentException("null argument(s)"); } Class repClass = null; try { String className = flavor.getRepresentationClassName(); sun.reflect.misc.ReflectUtil.checkPackageAccess(className); repClass = Class.forName(className, false, Thread.currentThread().getContextClassLoader()); } catch (Throwable e) { throw new IllegalArgumentException("unknown representation class"); } if (!repClass.isInstance(printData)) { throw new IllegalArgumentException("data is not of declared type"); } this.flavor = flavor; if (attributes != null) { this.attributes = AttributeSetUtilities.unmodifiableView(attributes); } this.printData = printData; }
Example #28
Source File: SimpleDoc.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Constructs a {@code SimpleDoc} with the specified * print data, doc flavor and doc attribute set. * @param printData the print data object * @param flavor the {@code DocFlavor} object * @param attributes a {@code DocAttributeSet}, which can * be {@code null} * @throws IllegalArgumentException if {@code flavor} or * {@code printData} is {@code null}, or the * {@code printData} does not correspond * to the specified doc flavor--for example, the data is * not of the type specified as the representation in the * {@code DocFlavor}. */ public SimpleDoc(Object printData, DocFlavor flavor, DocAttributeSet attributes) { if (flavor == null || printData == null) { throw new IllegalArgumentException("null argument(s)"); } Class<?> repClass = null; try { String className = flavor.getRepresentationClassName(); sun.reflect.misc.ReflectUtil.checkPackageAccess(className); repClass = Class.forName(className, false, Thread.currentThread().getContextClassLoader()); } catch (Throwable e) { throw new IllegalArgumentException("unknown representation class"); } if (!repClass.isInstance(printData)) { throw new IllegalArgumentException("data is not of declared type"); } this.flavor = flavor; if (attributes != null) { this.attributes = AttributeSetUtilities.unmodifiableView(attributes); } this.printData = printData; }
Example #29
Source File: PSStreamPrintJob.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public PrintJobAttributeSet getAttributes() { synchronized (this) { if (jobAttrSet == null) { /* just return an empty set until the job is submitted */ PrintJobAttributeSet jobSet = new HashPrintJobAttributeSet(); return AttributeSetUtilities.unmodifiableView(jobSet); } else { return jobAttrSet; } } }
Example #30
Source File: PSStreamPrintJob.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public PrintJobAttributeSet getAttributes() { synchronized (this) { if (jobAttrSet == null) { /* just return an empty set until the job is submitted */ PrintJobAttributeSet jobSet = new HashPrintJobAttributeSet(); return AttributeSetUtilities.unmodifiableView(jobSet); } else { return jobAttrSet; } } }