Package javax.print.attribute

Examples of javax.print.attribute.AttributeSet


     */
    private static void removeUnsupportedAttributes(PrintService ps,
                                                    DocFlavor flavor,
                                                    AttributeSet aset)
    {
        AttributeSet asUnsupported = ps.getUnsupportedAttributes(flavor,
                                                                 aset);

        if (asUnsupported != null) {
      Attribute[] usAttrs = asUnsupported.toArray();

            for (int i=0; i<usAttrs.length; i++) {
                Class category = usAttrs[i].getCategory();

                if (ps.isAttributeCategorySupported(category)) {
View Full Code Here


     */
    private static void removeUnsupportedAttributes(PrintService ps,
                                                    DocFlavor flavor,
                                                    AttributeSet aset)
    {
        AttributeSet asUnsupported = ps.getUnsupportedAttributes(flavor,
                                                                 aset);

        if (asUnsupported != null) {
            Attribute[] usAttrs = asUnsupported.toArray();

            for (int i=0; i<usAttrs.length; i++) {
                Class category = usAttrs[i].getCategory();

                if (ps.isAttributeCategorySupported(category)) {
View Full Code Here

                    //uri = File.createTempFile("xxx", null).toURI();
                } catch (URISyntaxException e) {
                    fail();
                }

                AttributeSet attrs = new HashAttributeSet();
                attrs.add(Finishings.EDGE_STITCH);
                attrs.add(MediaSizeName.JAPANESE_DOUBLE_POSTCARD);
                attrs.add(new Destination(uri));
                attrs.add(new DocumentName("Doc X", Locale.US));
                attrs.add(new JobName("Job Y", Locale.US));
                attrs.add(new RequestingUserName("User Z", Locale.US));

                for (int j = 0; j < flavors.length; j++) {
                    if (services[i].isDocFlavorSupported(flavors[j])) {
                        AttributeSet aset = services[i]
                                .getUnsupportedAttributes(flavors[j], attrs);
                        if (aset == null) {
                            fail("At least one attribute is unsupported");
                        }
                        if (aset != null) {
                            Attribute[] aarr = aset.toArray();
                            System.out
                                    .println("Usupported attributes fo DocFlavor "
                                            + flavors[j]);
                            for (int k = 0, kk = aarr.length; k < kk; k++) {
                                System.out.println("\t" + aarr[k]);
View Full Code Here

        if (attrFidelity != null && attrFidelity == Fidelity.FIDELITY_TRUE) {
            fidelity = true;
        }

        if (fidelity == true) {
           AttributeSet unsupported =
               service.getUnsupportedAttributes(
                                         DocFlavor.SERVICE_FORMATTED.PAGEABLE,
                                         attributes);
           if (unsupported != null) {
               throw new PrinterException("Fidelity cannot be satisfied");
View Full Code Here

        if (attributes == null) {
            return null;
        }

        Attribute attr;
        AttributeSet unsupp = new HashAttributeSet();
        Attribute []attrs = attributes.toArray();
        for (int i=0; i<attrs.length; i++) {
            try {
                attr = attrs[i];
                if (!isAttributeCategorySupported(attr.getCategory())) {
                    unsupp.add(attr);
                }
                else if (!isAttributeValueSupported(attr, flavor, attributes)) {
                    unsupp.add(attr);
                }
            } catch (ClassCastException e) {
            }
        }
        if (unsupp.isEmpty()) {
            return null;
        } else {
            return unsupp;
        }
    }
View Full Code Here

        if (attributes == null) {
            return null;
        }

        Attribute attr;
        AttributeSet unsupp = new HashAttributeSet();
        Attribute[] attrs = attributes.toArray();
        for (int i=0; i<attrs.length; i++) {
            try {
                attr = attrs[i];
                if (!isAttributeCategorySupported(attr.getCategory())) {
                    unsupp.add(attr);
                } else if (!isAttributeValueSupported(attr, flavor,
                                                      attributes)) {
                    unsupp.add(attr);
                }
            } catch (ClassCastException e) {
            }
        }
        if (unsupp.isEmpty()) {
            return null;
        } else {
            return unsupp;
        }
    }
View Full Code Here

        if (attributes == null) {
            return null;
        }

        final AttributeSet result = new HashAttributeSet();

        for (Attribute attr : attributes.toArray()) {
            if (!isAttributeValueSupported(attr, flavor, attributes)) {
                result.add(attr);
            }
        }

        return result.size() > 0 ? result : null;
    }
View Full Code Here

        }

        ArrayList requestedServices = new ArrayList();
        for (int i = 0; i < cupsservices.length; i++) {
            try {
                AttributeSet unsupportedSet = cupsservices[i]
                        .getUnsupportedAttributes(flavor, attributes);
                if (unsupportedSet == null) {
                    requestedServices.add(cupsservices[i]);
                }
            } catch (IllegalArgumentException iae) {
View Full Code Here

        }

        ArrayList requestedServices = new ArrayList();
        for (int i = 0; i < cupsservices.length; i++) {
            try {
                AttributeSet unsupportedSet = cupsservices[i]
                        .getUnsupportedAttributes(flavor, attributes);
                if (unsupportedSet == null) {
                    requestedServices.add(cupsservices[i]);
                }
            } catch (IllegalArgumentException iae) {
View Full Code Here

        }
        ArrayList requestedServices = new ArrayList();
        for (int i = 0; i < services.length; i++) {
           
            try {
                AttributeSet unsupportedSet =
                    services[i].getUnsupportedAttributes(flavor, attributes);
                if (unsupportedSet == null && (flavor == null ||
                        services[i].isDocFlavorSupported(flavor))) {
                    requestedServices.add(services[i]);
                }
View Full Code Here

TOP

Related Classes of javax.print.attribute.AttributeSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.