Java 类javax.print.attribute.AttributeSetUtilities 实例源码

项目:OpenJSharp    文件:Win32PrintService.java   
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);
    }
}
项目:OpenJSharp    文件:Win32PrintService.java   
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);
    }
项目:OpenJSharp    文件:UnixPrintService.java   
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);
    }
}
项目:jdk8u-jdk    文件:Win32PrintService.java   
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);
    }
}
项目:jdk8u-jdk    文件:Win32PrintService.java   
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);
    }
项目:jdk8u-jdk    文件:UnixPrintService.java   
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);
    }
}
项目:openjdk-jdk10    文件:UnixPrintService.java   
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);
    }
}
项目:openjdk-jdk10    文件:Win32PrintService.java   
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);
    }
}
项目:openjdk-jdk10    文件:Win32PrintService.java   
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);
    }
项目:openjdk9    文件:UnixPrintService.java   
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);
    }
}
项目:openjdk9    文件:Win32PrintService.java   
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);
    }
}
项目:openjdk9    文件:Win32PrintService.java   
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);
    }
项目:jdk8u_jdk    文件:Win32PrintService.java   
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);
    }
}
项目:jdk8u_jdk    文件:Win32PrintService.java   
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);
    }
项目:jdk8u_jdk    文件:UnixPrintService.java   
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);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:Win32PrintService.java   
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);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:Win32PrintService.java   
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);
    }
项目:lookaside_java-1.8.0-openjdk    文件:UnixPrintService.java   
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);
    }
}
项目:javify    文件:IppPrintService.java   
/**
 * @see javax.print.PrintService#getAttributes()
 */
public PrintServiceAttributeSet getAttributes()
{
  PrintServiceAttributeSet set = new HashPrintServiceAttributeSet();

  for (Set<Attribute> attrSet : printerAttr.values())
    {
      for (Attribute attr : attrSet)
        {
          if (attr instanceof PrintServiceAttribute)
            set.add(attr);
        }
    }

  return AttributeSetUtilities.unmodifiableView(set);
}
项目:jvm-stm    文件:IppPrintService.java   
/**
 * @see javax.print.PrintService#getAttributes()
 */
public PrintServiceAttributeSet getAttributes()
{
  PrintServiceAttributeSet set = new HashPrintServiceAttributeSet();

  Iterator it = printerAttr.values().iterator();
  while (it.hasNext())
    {        
      Iterator it2 = ((Set) it.next()).iterator();
      while (it2.hasNext())
        {
          Attribute attr = (Attribute) it2.next();
          if (attr instanceof PrintServiceAttribute)
            set.add(attr);
        }
    }

  return AttributeSetUtilities.unmodifiableView(set);
}
项目:infobip-open-jdk-8    文件:Win32PrintService.java   
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);
    }
}
项目:infobip-open-jdk-8    文件:Win32PrintService.java   
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);
    }
项目:infobip-open-jdk-8    文件:UnixPrintService.java   
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);
    }
}
项目:jdk8u-dev-jdk    文件:Win32PrintService.java   
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);
    }
}
项目:jdk8u-dev-jdk    文件:Win32PrintService.java   
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);
    }
项目:jdk8u-dev-jdk    文件:UnixPrintService.java   
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);
    }
}
项目:jdk7-jdk    文件:SimpleDoc.java   
/**
 * 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 {
        repClass = Class.forName(flavor.getRepresentationClassName());
   } 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;
}
项目:jdk7-jdk    文件:Win32PrintService.java   
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);
    }
}
项目:jdk7-jdk    文件:Win32PrintService.java   
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);
    }
项目:jdk7-jdk    文件:UnixPrintService.java   
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);
    }
}
项目:openjdk-source-code-learn    文件:SimpleDoc.java   
/**
 * 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 {
        repClass = Class.forName(flavor.getRepresentationClassName());
   } 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;
}
项目:openjdk-source-code-learn    文件:Win32PrintService.java   
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);
    }
}
项目:openjdk-source-code-learn    文件:Win32PrintService.java   
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);
    }
项目:openjdk-source-code-learn    文件:UnixPrintService.java   
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);
    }
}
项目:OLD-OpenJDK8    文件:Win32PrintService.java   
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);
    }
}
项目:OLD-OpenJDK8    文件:Win32PrintService.java   
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);
    }
项目:OLD-OpenJDK8    文件:UnixPrintService.java   
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);
    }
}
项目:JamVM-PH    文件:IppPrintService.java   
/**
 * @see javax.print.PrintService#getAttributes()
 */
public PrintServiceAttributeSet getAttributes()
{
  PrintServiceAttributeSet set = new HashPrintServiceAttributeSet();

  Iterator it = printerAttr.values().iterator();
  while (it.hasNext())
    {        
      Iterator it2 = ((Set) it.next()).iterator();
      while (it2.hasNext())
        {
          Attribute attr = (Attribute) it2.next();
          if (attr instanceof PrintServiceAttribute)
            set.add(attr);
        }
    }

  return AttributeSetUtilities.unmodifiableView(set);
}
项目:openjdk-jdk7u-jdk    文件:Win32PrintService.java   
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);
    }
}
项目:openjdk-jdk7u-jdk    文件:Win32PrintService.java   
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);
    }