Examples of PreviewDialog


Examples of org.apache.fop.render.awt.viewer.PreviewDialog

                return new Dimension(bitmapWidth, bitmapHeight);
    }

    /** Creates and initialize the AWT Viewer main window */
    private PreviewDialog createPreviewDialog() {
        frame = new PreviewDialog(userAgent, this.renderable);
        frame.addWindowListener(new WindowAdapter() {
            public void windowClosed(WindowEvent we) {
                System.exit(0);
            }
        });
View Full Code Here

Examples of org.apache.fop.viewer.PreviewDialog

        "/org/apache/fop/viewer/resources/";

    protected PreviewDialog createPreviewDialog(
                AWTRenderer renderer,
                Translator res) {
        PreviewDialog frame = new PreviewDialog(renderer, res);
        frame.validate();
        frame.addWindowListener(new WindowAdapter() {
                public void windowClosed(WindowEvent we) {
                    System.exit(0);
                }
            });

        // center window
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        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

Examples of org.apache.fop.viewer.PreviewDialog

        //Setup renderer
        AWTRenderer renderer = new AWTRenderer(translator);

        //Create preview dialog (target for the AWTRenderer)
        PreviewDialog frame = createPreviewDialog(renderer, translator);
        renderer.setProgressListener(frame);
        renderer.setComponent(frame);

        //Setup Driver
        Driver driver = new Driver();
        driver.setLogger(new ConsoleLogger(ConsoleLogger.LEVEL_INFO));
        driver.setRenderer(renderer);

        try {
            // build FO tree: time
            frame.progress(translator.getString("Build FO tree") + " ...");

            //Load XSL-FO file (you can also do an XSL transformation here)
            TransformerFactory factory = TransformerFactory.newInstance();
            Transformer transformer = factory.newTransformer();
            Source src = new StreamSource(fo);
            Result res = new SAXResult(driver.getContentHandler());
            transformer.transform(src, res);

            //Show page
            frame.progress(translator.getString("Show"));
            frame.showPage();

        } catch (Exception e) {
            frame.reportException(e);
            if (e instanceof FOPException) {
                throw (FOPException)e;
            }
            throw new FOPException(e);
        }
View Full Code Here

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

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

        //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

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

     * @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

Examples of org.librebiz.pureport.ui.PreviewDialog

                    FontRenderContext frc = new FontRenderContext(null, true, true);
                    Formatter fmt = new Formatter(report, context, frc, pageStore);
                    long tm = System.currentTimeMillis();
                    tm = System.currentTimeMillis()-tm;
                    System.out.println("Time for formatting: " + tm + "ms");
                    PreviewDialog frame = new PreviewDialog(null, fmt, pageStore);
                    frame.setTitle("Print preview");
                    frame.setVisible(true);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog

  public static void main(String[] args)
      throws ReportDefinitionException
  {
    ClassicEngineBoot.getInstance().start();
    PaddingTestHandler handler = new PaddingTestHandler();
    PreviewDialog dialog = new PreviewDialog(handler.createReport());
    dialog.setSize(600, 700);
    dialog.setModal(true);
    dialog.setVisible(true);
    System.exit(0);
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog

  public static void main(String[] args)
      throws ReportDefinitionException
  {
    ClassicEngineBoot.getInstance().start();
    BorderTestHandler handler = new BorderTestHandler();
    PreviewDialog dialog = new PreviewDialog(handler.createReport());
    dialog.setSize(600, 700);
    dialog.setModal(true);
    dialog.setVisible(true);
    System.exit(0);
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog

  {
    try
    {
      final MasterReport report = handler.createReport();

      final PreviewDialog frame = new PreviewDialog(report);
      frame.setToolbarFloatable(true);
      frame.setReportController(new LocaleSelectionReportController());
      frame.pack();
      SwingUtil.positionFrameRandomly(frame);
      frame.setVisible(true);
      frame.requestFocus();
    }
    catch (ReportDefinitionException e)
    {
      AbstractDemoFrame.showExceptionDialog(handler.getPresentationComponent(), "report.definitionfailure", e);
    }
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.