Package javax.print.attribute

Examples of javax.print.attribute.Attribute


    final Attribute[] printAttribs = reportAttributes.toArray();
    boolean invalidConfig = false;
    for (int i = 0; i < printAttribs.length; i++)
    {
      final Attribute attrib = printAttribs[i];
      if (attributes.containsValue(attrib) == false)
      {
        invalidConfig = true;
        break;
      }
View Full Code Here


    final Attribute[] printAttribs = reportAttributes.toArray();
    boolean invalidConfig = false;
    for (int i = 0; i < printAttribs.length; i++)
    {
      final Attribute attrib = printAttribs[i];
      if (attributes.containsValue(attrib) == false)
      {
        invalidConfig = true;
        break;
      }
View Full Code Here

        Vector attrx = new Vector();
        Class claz;
        String aname;
        byte atag;
        Vector avalue;
        Attribute a = null;

        aname = new String(attr.getName());
        claz = getClassByIppAttributeName(aname);
        atag = attr.getTag();
        avalue = attr.getValue();
View Full Code Here

void fillCollateBox() {
    boolean isSupported =
        myService.isAttributeCategorySupported(SheetCollate.class);
    SheetCollate [] supported = (SheetCollate []) (myService
            .getSupportedAttributeValues(SheetCollate.class, flavor, attrs));
    Attribute attr = attrs.get(SheetCollate.class);
    int spinnerValue = ((Integer) cpSpinner.getValue()).intValue();
   
    if ((supported == null) || !isSupported) {
        if (attrs.containsKey(SheetCollate.class)) {
            collateBox.setSelected(attr.equals(SheetCollate.COLLATED));
        }
    } else {
        boolean isValueSupported = myService.isAttributeValueSupported(
                SheetCollate.COLLATED, flavor, attrs);
        if (attrs.containsKey(SheetCollate.class) && isValueSupported) {
            collateBox.setSelected(attr.equals(SheetCollate.COLLATED));
        } else {
            Object defaul =
                    myService.getDefaultAttributeValue(SheetCollate.class);
            collateBox.setSelected(defaul != null
                    ? defaul.equals(SheetCollate.COLLATED)
View Full Code Here

* get last selected Chromaticity button
*/
private boolean getLastColor() {
    if (firstUse) {
        if (attrs.containsKey(Chromaticity.class)) {
            Attribute value = attrs.get(Chromaticity.class);
            return value.equals(Chromaticity.MONOCHROME);
        }
       
        Object defaul = myService.getDefaultAttributeValue(Chromaticity.class);
        return (myService.isAttributeCategorySupported(Chromaticity.class)
                    && (defaul != null))
View Full Code Here

    JobSheets [] supported =
            (myService.isAttributeCategorySupported(JobSheets.class)
            ? (JobSheets[]) (myService.getSupportedAttributeValues(
                    JobSheets.class, flavor, attrs))
            : null);
    Attribute value = attrs.get(JobSheets.class);

    if ((supported != null) && (supported.length == 0)) {
        supported = null;
    }

    if (supported == null) {
        /* if PrintService does not supported any JobSheets, set current
           meaning from attribute set (if present) and disable checkbox */
        if (firstUse && attrs.containsKey(JobSheets.class)) {
            bannerBox.setSelected(value.equals(JobSheets.STANDARD));
        }
    } else {
        if (supported.length == 1) {
            bannerBox.setSelected(supported[0] == JobSheets.STANDARD);
        } else if (attrs.containsKey(JobSheets.class)) {
            bannerBox.setSelected(value.equals(JobSheets.STANDARD));
        else {
            Object def = myService.getDefaultAttributeValue(JobSheets.class);
            bannerBox.setSelected(def == null
                    ? false
                    : def.equals(JobSheets.STANDARD));
View Full Code Here

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

                if (ps.isAttributeCategorySupported(category)) {
                    Attribute attr =
                        (Attribute)ps.getDefaultAttributeValue(category);

                    if (attr != null) {
                        aset.add(attr);
                    } else {
View Full Code Here

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

                if (ps.isAttributeCategorySupported(category)) {
                    Attribute attr =
                        (Attribute)ps.getDefaultAttributeValue(category);

                    if (attr != null) {
                        aset.add(attr);
                    } else {
View Full Code Here

        PrinterProducer producer = new PrinterProducer(endpoint, configuration);
        producer.start();
        PrinterOperations printerOperations = producer.getPrinterOperations();
        PrintRequestAttributeSet attributeSet = printerOperations.getPrintRequestAttributeSet();

        Attribute attribute = attributeSet.get(javax.print.attribute.standard.Media.class);
        assertNotNull(attribute);
        assertTrue(attribute instanceof MediaTray);
        MediaTray mediaTray = (MediaTray) attribute;
        assertEquals("middle", mediaTray.toString());
    }
View Full Code Here

        PrinterProducer producer = new PrinterProducer(endpoint, configuration);
        producer.start();
        PrinterOperations printerOperations = producer.getPrinterOperations();
        PrintRequestAttributeSet attributeSet = printerOperations.getPrintRequestAttributeSet();

        Attribute attribute = attributeSet.get(OrientationRequested.class);
        assertNotNull(attribute);
        assertEquals("reverse-landscape", attribute.toString());
    }
View Full Code Here

TOP

Related Classes of javax.print.attribute.Attribute

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.