Package org.foray.render.awt.viewer

Examples of org.foray.render.awt.viewer.PreviewDialog


     * @return The newly-created PreviewDialog.
     * @throws OutputException For errors loading resources.
     */
    protected PreviewDialog createPreviewDialog(final AWTRenderer renderer, final Translator res)
            throws OutputException {
        final PreviewDialog frame = new PreviewDialog(renderer, res);
        frame.validate();
        frame.addWindowListener(new WindowAdapter() {
            public void windowClosed(final WindowEvent we) {
                /* Checkstyle-GenericIllegalRegexp-Off. */
                /* TODO: Is there a better way to do this. */
                System.exit(0);
                /* Checkstyle-GenericIllegalRegexp-On. */
            }
        });

        // center window
        final Dimension screenSize = Toolkit.getDefaultToolkit()
                .getScreenSize();
        final Dimension frameSize = frame.getSize();
        if (frameSize.height > screenSize.height) {
            frameSize.height = screenSize.height;
        }
        if (frameSize.width > screenSize.width) {
            frameSize.width = screenSize.width;
        }
        frame.setLocation((screenSize.width - frameSize.width) / 2,
                          (screenSize.height - frameSize.height) / 2);
        frame.setVisible(true);
        return frame;
    }
View Full Code Here


        //Setup FOrayTarget
        new FOrayTarget(document, renderer, null, null);

        //Create preview dialog (target for the AWTRenderer)
        PreviewDialog frame;
        try {
            frame = createPreviewDialog(renderer, translator);
        } catch (final OutputException e) {
            throw new FOrayException(e);
        }
        renderer.setComponent(frame);

        // TODO: This is probably not right. Needs to run session.process().
        // build FO tree: time
        frame.progress(translator.getString("Build FO tree") + " ...");

        //Show page
        frame.progress(translator.getString("Show"));
        frame.showPage();
    }
View Full Code Here

     * @return The newly-created preview dialog.
     * @throws OutputException For errors loading resources.
     */
    protected PreviewDialog createPreviewDialog(final AWTRenderer renderer, final Translator res)
            throws OutputException {
        final PreviewDialog frame = new PreviewDialog(renderer, res);
        frame.validate();
        frame.addWindowListener(new WindowAdapter() {
            public void windowClosed(final WindowEvent we) {
                /* Checkstyle-GenericIllegalRegexp-Off. */
                /* TODO: Is there a better way to handle this? */
                System.exit(0);
                /* Checkstyle-GenericIllegalRegexp-On. */
            }
        });

        // center window
        final Dimension screenSize = Toolkit.getDefaultToolkit()
                .getScreenSize();
        final Dimension frameSize = frame.getSize();
        if (frameSize.height > screenSize.height) {
            frameSize.height = screenSize.height;
        }
        if (frameSize.width > screenSize.width) {
            frameSize.width = screenSize.width;
        }
        frame.setLocation((screenSize.width - frameSize.width) / 2,
                          (screenSize.height - frameSize.height) / 2);
        frame.setVisible(true);
        return frame;
    }
View Full Code Here

TOP

Related Classes of org.foray.render.awt.viewer.PreviewDialog

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.