Package org.apache.harmony.x.print

Examples of org.apache.harmony.x.print.ServiceUIDialog


    Window activeWindow = KeyboardFocusManager.getCurrentKeyboardFocusManager()
            .getActiveWindow();
    Window dialogOwner = getDialogOwner(activeWindow);

    ServiceUIDialog dialog = new ServiceUIDialog(gc, x, y, services,
            initialIndex, flavor, attributes, dialogOwner);

    dialog.show();

    if (dialogOwner != activeWindow) {
        dialogOwner.dispose();
    }

    if (dialog.getResult() == ServiceUIDialog.APPROVE_PRINT) {
        attributes.clear();
        attributes.addAll(dialog.getAttributes());
        return dialog.getPrintService();
    }

    return null;
}
View Full Code Here


        }
        int initialIndex = checkServices(services, defaultService, attributes);
        Window activeWindow = KeyboardFocusManager.getCurrentKeyboardFocusManager()
                .getActiveWindow();
        Window dialogOwner = getDialogOwner(activeWindow);
        ServiceUIDialog dialog = new ServiceUIDialog(gc, x, y, services, initialIndex, flavor,
                attributes, dialogOwner);
        dialog.show();
        if (dialogOwner != activeWindow) {
            dialogOwner.dispose();
        }
        if (dialog.getResult() == ServiceUIDialog.APPROVE_PRINT) {
            attributes.clear();
            attributes.addAll(dialog.getAttributes());
            return dialog.getPrintService();
        }
        return null;
    }
View Full Code Here

        Rectangle screen = GraphicsEnvironment.getLocalGraphicsEnvironment()
                .getDefaultScreenDevice().getDefaultConfiguration().getBounds();

        /* create and show the page dialog */
        ServiceUIDialog dialog = new ServiceUIDialog(null,
                                                     screen.width/3,
                                                     screen.height/3,
                                                     getPrintService(),
                                                     sum,
                                                     owner);
        dialog.show();

        if (owner != wnd) {
            owner.dispose();
        }

        /* update this.attrs attribute set and result page format to return */
        if (dialog.getResult() == ServiceUIDialog.APPROVE_PRINT) {
            PrintRequestAttributeSet newattrs = dialog.getAttributes();

            if (!newattrs.containsKey(Media.class)) {
                this.attrs.remove(Media.class);
            }
            if (!newattrs.containsKey(OrientationRequested.class)) {
View Full Code Here

        }
        int initialIndex = checkServices(services, defaultService, attributes);
        Window activeWindow = KeyboardFocusManager.getCurrentKeyboardFocusManager()
                .getActiveWindow();
        Window dialogOwner = getDialogOwner(activeWindow);
        ServiceUIDialog dialog = new ServiceUIDialog(gc, x, y, services, initialIndex, flavor,
                attributes, dialogOwner);
        dialog.show();
        if (dialogOwner != activeWindow) {
            dialogOwner.dispose();
        }
        if (dialog.getResult() == ServiceUIDialog.APPROVE_PRINT) {
            attributes.clear();
            attributes.addAll(dialog.getAttributes());
            return dialog.getPrintService();
        }
        return null;
    }
View Full Code Here

        Rectangle screen = GraphicsEnvironment.getLocalGraphicsEnvironment()
                .getDefaultScreenDevice().getDefaultConfiguration().getBounds();

        /* create and show the page dialog */
        ServiceUIDialog dialog = new ServiceUIDialog(null,
                                                     screen.width/3,
                                                     screen.height/3,
                                                     getPrintService(),
                                                     sum,
                                                     owner);
        dialog.show();

        if (owner != wnd) {
            owner.dispose();
        }

        /* update this.attrs attribute set and result page format to return */
        if (dialog.getResult() == ServiceUIDialog.APPROVE_PRINT) {
            PrintRequestAttributeSet newattrs = dialog.getAttributes();

            if (!newattrs.containsKey(Media.class)) {
                this.attrs.remove(Media.class);
            }
            if (!newattrs.containsKey(OrientationRequested.class)) {
View Full Code Here

        final Window owner = (((wnd instanceof Dialog) || (wnd instanceof Frame))
                        ? wnd : new Frame());
        final Rectangle screen = GraphicsEnvironment
                        .getLocalGraphicsEnvironment().getDefaultScreenDevice()
                        .getDefaultConfiguration().getBounds();
        final ServiceUIDialog dialog = new ServiceUIDialog(null,
                        screen.width / 3, screen.height / 3, getPrintService(),
                        attributes, owner);

        dialog.show();

        if (owner != wnd) {
            owner.dispose();
        }

        if (attributes != dialog.getAttributes()) {
            attributes.addAll(dialog.getAttributes());
        }

        return (dialog.getResult() == ServiceUIDialog.APPROVE_PRINT)
                        ? attrsToFormat(attributes) : null;
    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.x.print.ServiceUIDialog

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.