Package javax.print.attribute.standard

Examples of javax.print.attribute.standard.Copies


        for (int i = 0; i < requestAttrs.length; i++) {
            Class category = requestAttrs[i].getCategory();
            if (!isAttributeValueSupported(requestAttrs[i], flavor, attrs)) {
                // Do nothing or throw PrintException if Fidelity supported.
            } else if (category.equals(Copies.class)) {
                Copies copies = (Copies)requestAttrs[i];
                printAttributes[COPIES_INDEX] = copies.getValue();
            } else if (category.equals(Sides.class)) {
                Sides sides = (Sides)requestAttrs[i];
                printAttributes[SIDES_INDEX] = 1;
                if (sides.equals(Sides.DUPLEX) ||
                    sides.equals(Sides.TWO_SIDED_LONG_EDGE)) {
View Full Code Here



    final DocFlavor docFlavor = TestUtils.getPropertyValue(messageHandler, "docFlavor", DocFlavor.class);
    assertEquals(DocFlavor.STRING.TEXT_PLAIN, docFlavor);

    final Copies copies = TestUtils.getPropertyValue(messageHandler, "copies", Copies.class);
    assertEquals(14, copies.getValue());

    final Sides sides = TestUtils.getPropertyValue(messageHandler, "sides", Sides.class);
    assertEquals(Sides.DUPLEX, sides);

  }
View Full Code Here

            throw new HeadlessException();
        }

        PrintRequestAttributeSet attributes =
            new HashPrintRequestAttributeSet();
        attributes.add(new Copies(getCopies()));
        attributes.add(new JobName(getJobName(), null));

        try {
            setAttributes(attributes);
        } catch (PrinterException e) {
        }
        this.attributes = attributes;

        boolean doPrint = printDialog(attributes);
        if (doPrint) {
            JobName jobName = (JobName)attributes.get(JobName.class);
            if (jobName != null) {
                setJobName(jobName.getValue());
            }
            Copies copies = (Copies)attributes.get(Copies.class);
            if (copies != null) {
                setCopies(copies.getValue());
            }

            Destination dest = (Destination)attributes.get(Destination.class);

            if (dest != null) {
View Full Code Here

        pageRangesAttr =  (PageRanges)attributes.get(PageRanges.class);
        if (!isSupportedValue(pageRangesAttr, attributes)) {
            pageRangesAttr = null;
        }

        Copies copies = (Copies)attributes.get(Copies.class);
        if (isSupportedValue(copies,  attributes) ||
            (!fidelity & copies != null)) {
            copiesAttr = copies.getValue();
        } else {
            copiesAttr = getCopies();
        }

        Destination destination =
View Full Code Here

        }

        if (attributes == null) {
            attributes = new HashPrintRequestAttributeSet();
        }
        attributes.add(new Copies(getCopies()));
        attributes.add(new JobName(getJobName(), null));
        boolean doPrint = printDialog(attributes);
        if (doPrint) {
            JobName jobName = (JobName)attributes.get(JobName.class);
            if (jobName != null) {
                setJobName(jobName.getValue());
            }
            Copies copies = (Copies)attributes.get(Copies.class);
            if (copies != null) {
                setCopies(copies.getValue());
            }

            Destination dest = (Destination)attributes.get(Destination.class);

            if (dest != null) {
View Full Code Here

      // copies jspinner state
      public void stateChanged(ChangeEvent event)
      {
        int value = ((Integer) copies.getValue()).intValue();
        atts.add(new Copies(value));

        if (value > 1 && categorySupported(SheetCollate.class))
          sort.setEnabled(true);
        else
          sort.setEnabled(false);
View Full Code Here

        if (categorySupported(Copies.class))
          {
            copies.setEnabled(true);
            copies_lb.setEnabled(true);

            Copies copies = (Copies) attribute(Copies.class);
            if (copies != null)
              copiesModel.setValue(new Integer(copies.getValue()));

            if (((Integer)copiesModel.getValue()).intValue() > 1
                && categorySupported(SheetCollate.class))
              {
                sort.setEnabled(true);
                Attribute collate = attribute(SheetCollate.class);
                if (collate != null && collate.equals(SheetCollate.COLLATED))
                  sort.setSelected(true);
              }
            else
              sort.setEnabled(false);
          }
        else
          {
            copies.setEnabled(false);
            copies_lb.setEnabled(false);
          }
      }
View Full Code Here

          attributes.add(SheetCollate.COLLATED);
        } else {
          attributes.add(SheetCollate.UNCOLLATED);
        }

        attributes.add(new Copies(jobAttributes.getCopies()));

        if (pageAttributes.getColor() == PageAttributes.ColorType.COLOR) {
            attributes.add(Chromaticity.COLOR);
        } else {
            attributes.add(Chromaticity.MONOCHROME);
View Full Code Here

            return null;
        }

        if (category == Copies.class) {
            if (defCopies > 0) {
                return new Copies(defCopies);
            } else {
                return new Copies(1);
            }
        } else if (category == Chromaticity.class) {
            if (!isColorSup) {
                return Chromaticity.MONOCHROME;
            } else {
View Full Code Here

        if (!isAttributeCategorySupported(category)) {
            return null;
        }

        if (category == Copies.class) {
            return new Copies(1);
        } else if (category == Chromaticity.class) {
            return Chromaticity.COLOR;
        } else if (category == Destination.class) {
            try {
                return new Destination((new File("out.ps")).toURI());
View Full Code Here

TOP

Related Classes of javax.print.attribute.standard.Copies

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.