Package javax.print.attribute

Examples of javax.print.attribute.HashPrintJobAttributeSet


}

public void testHashPrintJobAttributeSet() {
    startTest("HashPrintJobAttributeSet class testing...");

    PrintJobAttributeSet set1 = new HashPrintJobAttributeSet();
    PrintJobAttributeSet set2 =
        new HashPrintJobAttributeSet(OrientationRequested.LANDSCAPE);
    PrintJobAttributeSet set3 = new HashPrintJobAttributeSet(set2);
    PrintJobAttribute [] arr = {OrientationRequested.LANDSCAPE,
                                MediaName.NA_LETTER_WHITE};
    PrintJobAttributeSet set4 = new HashPrintJobAttributeSet(arr);
    Attribute [] attrArr;
   
    assertTrue(set1.isEmpty());
    assertFalse(set2.isEmpty());
    assertTrue(set3.equals(set2));
    assertFalse(set3.equals(set1));
    set3.clear();
    assertEquals(set3, set1);
    set3.add(OrientationRequested.LANDSCAPE);
    set3.add(MediaName.NA_LETTER_WHITE);
    assertTrue(set3.containsKey(OrientationRequested.LANDSCAPE.getClass()));
    assertFalse(set2.containsKey(MediaName.NA_LETTER_WHITE.getClass()));
    assertTrue(set3.containsValue(OrientationRequested.LANDSCAPE));
    assertFalse(set3.containsValue(OrientationRequested.PORTRAIT));
    assertFalse(set3.containsValue(PrintQuality.DRAFT));
    assertEquals(set1.size(), 0);
    assertEquals(set2.size(), 1);
    assertEquals(set3.size(), 2);
    assertTrue(set4.equals(set3));
    assertEquals(set3.get(OrientationRequested.PORTRAIT.getClass()),
                 OrientationRequested.LANDSCAPE);
    assertFalse((set3.get(OrientationRequested.PORTRAIT.getClass()))
            .equals(OrientationRequested.PORTRAIT));
    set1.addAll(set3);
View Full Code Here


    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;
            }
        }
View Full Code Here

                attrListeners = new Vector();
                listenedAttributeSets = new Vector();
            }
            attrListeners.add(listener);
            if (attributes == null) {
                attributes = new HashPrintJobAttributeSet();
            }
            listenedAttributeSets.add(attributes);
        }
    }
View Full Code Here

     */
    private synchronized void
        initializeAttributeSets(Doc doc, PrintRequestAttributeSet reqSet) {

        reqAttrSet = new HashPrintRequestAttributeSet();
        jobAttrSet = new HashPrintJobAttributeSet();

        Attribute[] attrs;
        if (reqSet != null) {
            reqAttrSet.addAll(reqSet);
            attrs = reqSet.toArray();
View Full Code Here

    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;
            }
        }
View Full Code Here

                attrListeners = new Vector();
                listenedAttributeSets = new Vector();
            }
            attrListeners.add(listener);
            if (attributes == null) {
                attributes = new HashPrintJobAttributeSet();
            }
            listenedAttributeSets.add(attributes);
        }
    }
View Full Code Here

     */
    private synchronized void
        initializeAttributeSets(Doc doc, PrintRequestAttributeSet reqSet) {

        reqAttrSet = new HashPrintRequestAttributeSet();
        jobAttrSet = new HashPrintJobAttributeSet();

        Attribute[] attrs;
        if (reqSet != null) {
            reqAttrSet.addAll(reqSet);
            attrs = reqSet.toArray();
View Full Code Here

    protected All2PSDocPrintJob(StreamPrintService printService) {
        super();
        begetPrintService = printService;
        printJobListeners = new ArrayList();
        printJobAttributeListeners = new ArrayList();
        printJobAttributeSet = new HashPrintJobAttributeSet();
        jobName = "PS printing";
        copies = 1;
        outstream = new PrintStream(printService.getOutputStream());
    }
View Full Code Here

        if (printservice == null) {
            throw new NullPointerException("Argument is null");
        }
        this.printService = printservice;
        this.printClient = printService.getPrintClient();
        printJobAS = new HashPrintJobAttributeSet();
        busyFlag = false;
    }
View Full Code Here

    protected All2PSDocPrintJob(StreamPrintService printService) {
        super();
        begetPrintService = printService;
        printJobListeners = new ArrayList();
        printJobAttributeListeners = new ArrayList();
        printJobAttributeSet = new HashPrintJobAttributeSet();
        jobName = "PS printing";
        copies = 1;
        outstream = new PrintStream(printService.getOutputStream());
    }
View Full Code Here

TOP

Related Classes of javax.print.attribute.HashPrintJobAttributeSet

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.