Examples of PageRanges


Examples of javax.print.attribute.standard.PageRanges

    }

    //returns 1-based index for "From" page
    private final int getFromPageAttrib() {
        if (attributes != null) {
            PageRanges pageRangesAttr =
                (PageRanges)attributes.get(PageRanges.class);
            if (pageRangesAttr != null) {
                int[][] range = pageRangesAttr.getMembers();
                return range[0][0];
            }
        }
        return getMinPageAttrib();
    }
View Full Code Here

Examples of javax.print.attribute.standard.PageRanges

    }

    //returns 1-based index for "To" page
    private final int getToPageAttrib() {
        if (attributes != null) {
            PageRanges pageRangesAttr =
                (PageRanges)attributes.get(PageRanges.class);
            if (pageRangesAttr != null) {
                int[][] range = pageRangesAttr.getMembers();
                return range[range.length-1][1];
            }
        }
        return getMaxPageAttrib();
    }
View Full Code Here

Examples of javax.print.attribute.standard.PageRanges

     * is always "All".
    */
    void fillPrintRangeFields() {
        if (firstUse) {
            if (attrs.containsKey(PageRanges.class)) {
                PageRanges aRange = (PageRanges) (attrs.get(PageRanges.class));
                int [][] range = aRange.getMembers();
                fromTxt.setText(range.length > 0
                        ? Integer.toString(range[0][0]) : "1");
                toTxt.setText(range.length > 0
                        ? Integer.toString(range[0][1]) : "1");
                pageRngBtn.setSelected(true);
View Full Code Here

Examples of javax.print.attribute.standard.PageRanges

                int fromValue = Integer.valueOf(fromTxt.getText()).intValue();
                int toValue = Integer.valueOf(toTxt.getText()).intValue();
                if (fromValue > toValue) {
                    throw new NumberFormatException();
                }
                newAttrs.add(new PageRanges(fromValue, toValue));
            } catch (NumberFormatException e) {
                return false;
            } catch (IllegalArgumentException e) {
                return false;           
            }
View Full Code Here

Examples of javax.print.attribute.standard.PageRanges

        arr1 = new int[][] {{0,1}, {5}};
        set1 = new setOfIntegerSyntax(arr1);
        set2 = new setOfIntegerSyntax("0, 1, 5");
        assertTrue(set1.equals(set2));

        set1 = new PageRanges("2, 3-2");
        set2 = new PageRanges(2);
        assertTrue(set1.equals(set2));

        set1 = new NumberUpSupported(2, 10);
        set2 = new NumberUpSupported(2);
        assertFalse(set1.equals(set2));
View Full Code Here

Examples of javax.print.attribute.standard.PageRanges

     * is always "All".
    */
    void fillPrintRangeFields() {
        if (firstUse) {
            if (attrs.containsKey(PageRanges.class)) {
                PageRanges aRange = (PageRanges) (attrs.get(PageRanges.class));
                int [][] range = aRange.getMembers();
                fromTxt.setText(range.length > 0
                        ? Integer.toString(range[0][0]) : "1");
                toTxt.setText(range.length > 0
                        ? Integer.toString(range[0][1]) : "1");
                pageRngBtn.setSelected(true);
View Full Code Here

Examples of javax.print.attribute.standard.PageRanges

                int fromValue = Integer.valueOf(fromTxt.getText()).intValue();
                int toValue = Integer.valueOf(toTxt.getText()).intValue();
                if (fromValue > toValue) {
                    throw new NumberFormatException();
                }
                newAttrs.add(new PageRanges(fromValue, toValue));
            } catch (NumberFormatException e) {
                return false;
            } catch (IllegalArgumentException e) {
                return false;           
            }
View Full Code Here

Examples of javax.print.attribute.standard.PageRanges

     * is always "All".
    */
    void fillPrintRangeFields() {
        if (firstUse) {
            if (attrs.containsKey(PageRanges.class)) {
                PageRanges aRange = (PageRanges) (attrs.get(PageRanges.class));
                int [][] range = aRange.getMembers();
                fromTxt.setText(range.length > 0
                        ? Integer.toString(range[0][0]) : "1");
                toTxt.setText(range.length > 0
                        ? Integer.toString(range[0][1]) : "1");
                pageRngBtn.setSelected(true);
View Full Code Here

Examples of javax.print.attribute.standard.PageRanges

                int fromValue = Integer.valueOf(fromTxt.getText()).intValue();
                int toValue = Integer.valueOf(toTxt.getText()).intValue();
                if (fromValue > toValue) {
                    throw new NumberFormatException();
                }
                newAttrs.add(new PageRanges(fromValue, toValue));
            } catch (NumberFormatException e) {
                return false;
            } catch (IllegalArgumentException e) {
                return false;           
            }
View Full Code Here

Examples of javax.print.attribute.standard.PageRanges

                    attrx.add(a);
                }
            }
        } else if (aname.equals("page-ranges-supported")) {
            for (int i = 0, ii = avalue.size(); i < ii; i++) {
                a = new PageRanges(((Integer) avalue.get(i)).intValue());
                if (a != null) {
                    attrx.add(a);
                }
            }
        } else if (aname.equals("number-up")
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.