Package org.apache.fop.render.awt.viewer

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


    transformer.transform(createVelocityStream(), new SAXResult(fop.getDefaultHandler()));
   
    if(progress != null)
      progress.setValue(90);

    PreviewPanel previewPanel = new PreviewPanel(agent, null, renderer);
    previewPanel.setScaleFactor(0.2);
    previewPanel.setDisplayMode(PreviewPanel.CONTINUOUS);
    previewPanel.reload();

    if(progress != null)
      progress.setValue(100);
   
    return previewPanel;
View Full Code Here


    agent.setRendererOverride(renderer);
    renderer.setPreviewDialogDisplayed(false);
    renderer.setUserAgent(agent);
    renderer.clearViewportList();

    final PreviewPanel previewPanel = new PreviewPanel(agent, null, renderer);

    zoom.addChangeListener(new ChangeListener() {
      @Override
      public void stateChanged(ChangeEvent e) {
        double value = zoom.getValue();
        previewPanel.setScaleFactor(value/100);
      }
    });

    final JProgressBar progress = new JProgressBar(0, 100);

    JDialog dialog = new JDialog(parent);
    dialog.getContentPane().setLayout(new BorderLayout());
    dialog.getContentPane().add(zoom, BorderLayout.NORTH);
    dialog.getContentPane().add(previewPanel, BorderLayout.CENTER);
    dialog.getContentPane().add(progress, BorderLayout.SOUTH);
    dialog.setSize(600, 800);
    dialog.setVisible(true);

    SwingWorker swingWorker = new SwingWorker() {
      @Override
      protected Object doInBackground() throws Exception {
        Source source = createXSLStream();
        progress.setValue(10);

        Transformer transformer = TransformerFactory.newInstance().newTemplates(source).newTransformer();
        Fop fop = fopFactory.newFop(agent);
        StreamSource streamSource = createVelocityStream();
        progress.setValue(50);

        SAXResult saxr = new SAXResult(fop.getDefaultHandler());
        progress.setValue(65);

        transformer.transform(streamSource, saxr);
        progress.setValue(90);

        previewPanel.setScaleFactor(0.5);
        previewPanel.setDisplayMode(PreviewPanel.CONTINUOUS);
        previewPanel.reload();
        progress.setValue(100);
        return null;
      }
    };
View Full Code Here

TOP

Related Classes of org.apache.fop.render.awt.viewer.PreviewPanel

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.