Package javax.print.attribute.standard

Examples of javax.print.attribute.standard.PrinterLocation


    PrintServiceAttributeSet set1 = new HashPrintServiceAttributeSet();
    PrintServiceAttributeSet set2 = new HashPrintServiceAttributeSet(
            ColorSupported.SUPPORTED);
    PrintServiceAttributeSet set3 = new HashPrintServiceAttributeSet(set2);
    PrinterLocation location = new PrinterLocation("room 222", Locale.ENGLISH);
    PrintServiceAttribute [] arr = { location,
                                     ColorSupported.SUPPORTED };
    PrintServiceAttributeSet set4 = new HashPrintServiceAttributeSet(arr);
   
    assertTrue(set1.isEmpty());
    assertFalse(set2.isEmpty());
    assertTrue(set3.equals(set2));
    assertFalse(set3.equals(set1));
    set3.clear();
    assertEquals(set3, set1);
    set3.add(ColorSupported.SUPPORTED);
    set3.add(location);
    assertTrue(set3.containsKey(location.getClass()));
    assertFalse(set2.containsKey(MediaName.NA_LETTER_WHITE.getClass()));
    assertTrue(set4.equals(set3));
    assertEquals(set3.get(location.getClass()), location);
    set1.addAll(set3);
    assertEquals(set3, set1);
    set1.remove(location.getClass());
    assertEquals(set1.size(), 1);
}
View Full Code Here


            attributes.add(new PagesPerMinute(pagesPerMinute));
        }
       
        String printerLocation = getPrinterLocation(serviceName);
        if (printerLocation != null) {
            attributes.add(new PrinterLocation(printerLocation,
                    Locale.getDefault()));
        }
       
        int acceptingJobs = getPrinterIsAcceptingJobs(serviceName);
        if (acceptingJobs == 0) {
View Full Code Here

    PrintServiceAttributeSet set1 = new HashPrintServiceAttributeSet();
    PrintServiceAttributeSet set2 = new HashPrintServiceAttributeSet(
            ColorSupported.SUPPORTED);
    PrintServiceAttributeSet set3 = new HashPrintServiceAttributeSet(set2);
    PrinterLocation location = new PrinterLocation("room 222", Locale.ENGLISH);
    PrintServiceAttribute [] arr = { location,
                                     ColorSupported.SUPPORTED };
    PrintServiceAttributeSet set4 = new HashPrintServiceAttributeSet(arr);
   
    assertTrue(set1.isEmpty());
    assertFalse(set2.isEmpty());
    assertTrue(set3.equals(set2));
    assertFalse(set3.equals(set1));
    set3.clear();
    assertEquals(set3, set1);
    set3.add(ColorSupported.SUPPORTED);
    set3.add(location);
    assertTrue(set3.containsKey(location.getClass()));
    assertFalse(set2.containsKey(MediaName.NA_LETTER_WHITE.getClass()));
    assertTrue(set4.equals(set3));
    assertEquals(set3.get(location.getClass()), location);
    set1.addAll(set3);
    assertEquals(set3, set1);
    set1.remove(location.getClass());
    assertEquals(set1.size(), 1);
}
View Full Code Here

            attributes.add(new PagesPerMinute(pagesPerMinute));
        }
       
        String printerLocation = getPrinterLocation(serviceName);
        if (printerLocation != null) {
            attributes.add(new PrinterLocation(printerLocation,
                    Locale.getDefault()));
        }
       
        int acceptingJobs = getPrinterIsAcceptingJobs(serviceName);
        if (acceptingJobs == 0) {
View Full Code Here

            attributes.add(new PagesPerMinute(pagesPerMinute));
        }
       
        String printerLocation = getPrinterLocation(serviceName);
        if (printerLocation != null) {
            attributes.add(new PrinterLocation(printerLocation,
                    Locale.getDefault()));
        }
       
        int acceptingJobs = getPrinterIsAcceptingJobs(serviceName);
        if (acceptingJobs == 0) {
View Full Code Here

            }
        } else if (aname.equals("printer-location")) {
            for (int i = 0, ii = avalue.size(); i < ii; i++) {
                // TODO need to set locale corresponded to
                // attributes-charset/attributes-natural-language
                a = new PrinterLocation(new String((byte[]) avalue.get(i)),
                        Locale.US);
                if (a != null) {
                    attrx.add(a);
                }
            }
View Full Code Here

    PrintServiceAttributeSet set1 = new HashPrintServiceAttributeSet();
    PrintServiceAttributeSet set2 = new HashPrintServiceAttributeSet(
            ColorSupported.SUPPORTED);
    PrintServiceAttributeSet set3 = new HashPrintServiceAttributeSet(set2);
    PrinterLocation location = new PrinterLocation("room 222", Locale.ENGLISH);
    PrintServiceAttribute [] arr = { location,
                                     ColorSupported.SUPPORTED };
    PrintServiceAttributeSet set4 = new HashPrintServiceAttributeSet(arr);
   
    assertTrue(set1.isEmpty());
    assertFalse(set2.isEmpty());
    assertTrue(set3.equals(set2));
    assertFalse(set3.equals(set1));
    set3.clear();
    assertEquals(set3, set1);
    set3.add(ColorSupported.SUPPORTED);
    set3.add(location);
    assertTrue(set3.containsKey(location.getClass()));
    assertFalse(set2.containsKey(MediaName.NA_LETTER_WHITE.getClass()));
    assertTrue(set4.equals(set3));
    assertEquals(set3.get(location.getClass()), location);
    set1.addAll(set3);
    assertEquals(set3, set1);
    set1.remove(location.getClass());
    assertEquals(set1.size(), 1);
}
View Full Code Here

            }
        } else if (aname.equals("printer-location")) {
            for (int i = 0, ii = avalue.size(); i < ii; i++) {
                // TODO need to set locale corresponded to
                // attributes-charset/attributes-natural-language
                a = new PrinterLocation(new String((byte[]) avalue.get(i)),
                        Locale.US);
                if (a != null) {
                    attrx.add(a);
                }
            }
View Full Code Here

            attributes.add(new PagesPerMinute(pagesPerMinute));
        }
       
        String printerLocation = getPrinterLocation(serviceName);
        if (printerLocation != null) {
            attributes.add(new PrinterLocation(printerLocation,
                    Locale.getDefault()));
        }
       
        int acceptingJobs = getPrinterIsAcceptingJobs(serviceName);
        if (acceptingJobs == 0) {
View Full Code Here

TOP

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

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.