Examples of XHTMLPanel


Examples of org.xhtmlrenderer.simple.XHTMLPanel

     */
    public AboutBox(String text, String url) {
        super();
        Uu.p("starting the about box");
        setTitle(text);
        XHTMLPanel panel = new XHTMLPanel(new DemoUserAgent());
        int w = 400;
        int h = 500;
        panel.setPreferredSize(new Dimension(w, h));

        scroll = new JScrollPane(panel);
        scroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        scroll.setPreferredSize(new Dimension(w, h));
View Full Code Here

Examples of org.xhtmlrenderer.simple.XHTMLPanel

    private void run(final String uri) {
        frame = new JFrame("Show Sample DocBook XML Rendered with Pure CSS");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        final XHTMLPanel panel = new XHTMLPanel();
        panel.getSharedContext().setUserAgentCallback(new ResourceLoadingUserAgent());
        setAntiAlias(panel);

        FSScrollPane fsp = new FSScrollPane(panel);
        frame.getContentPane().add(fsp, BorderLayout.CENTER);

        frame.pack();
        frame.setSize(1024, 768);
        frame.setVisible(true);

        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                URL url = ShowDocBookPage.class.getResource(uri);
                String urls = url.toExternalForm();
                XRLog.general("Loading URI: " + urls);
                panel.setDocument(urls);

                showAboutDialog();
            }
        });
    }
View Full Code Here

Examples of org.xhtmlrenderer.simple.XHTMLPanel

    private void showAboutDialog() {
        final JDialog aboutDlg = new JDialog(frame);
        aboutDlg.setSize(new Dimension(500, 450));

        XHTMLPanel panel = new XHTMLPanel();
        setAntiAlias(panel);
        panel.setOpaque(false);

        URL url = ShowDocBookPage.class.getResource("/docbook/xhtml/intro.xhtml");
        panel.setDocument(url.toExternalForm());

        JPanel outer = new JPanel(new BorderLayout());
        outer.add(panel, BorderLayout.CENTER);
        final JButton btn = new JButton(new AbstractAction("OK") {
            public void actionPerformed(ActionEvent e) {
View Full Code Here

Examples of org.xhtmlrenderer.simple.XHTMLPanel

            }
        });
    }

    private void initPanel() {
        panel = new XHTMLPanel();

        try {
            panel.setDocumentFromString(
                    "<html style='position: absolute;'>" +
                            "This line was in the original document. Press the button to add a new node to " +
View Full Code Here

Examples of org.xhtmlrenderer.simple.XHTMLPanel

        // replaced element, then for SVG elements.
        ChainedReplacedElementFactory cef = new ChainedReplacedElementFactory();
        cef.addFactory(new SwingReplacedElementFactory());
        cef.addFactory(new SVGSalamanderReplacedElementFactory());

        final XHTMLPanel panel = new XHTMLPanel();
        panel.getSharedContext().setReplacedElementFactory(cef);

        FSScrollPane fsp = new FSScrollPane(panel);
        frame.getContentPane().add(fsp, BorderLayout.CENTER);

        frame.setSize(1024, 768);
        frame.setVisible(true);

        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                XRLog.general("URI is: " + uri);
                URL url = ShowSVGPage.class.getResource(uri);
                String urls = url.toExternalForm();
                XRLog.general("Loading URI: " + urls);
                panel.setDocument(urls);
            }
        });
    }
View Full Code Here

Examples of org.xhtmlrenderer.simple.XHTMLPanel

            }
        }
    }

    private void printURL(String url) {
        XHTMLPanel panel = new XHTMLPanel();
        panel.getSharedContext().setPrint(true);
        panel.getSharedContext().setInteractive(false);

        try {
            panel.setDocument(url);
        } catch (Exception e) {
            e.printStackTrace();
        }

        printPanel(panel);
View Full Code Here

Examples of org.xhtmlrenderer.simple.XHTMLPanel

        loadAndCheckArgs(args);

        EventQueue.invokeLater(new Runnable() {
            public void run() {
                // Create a JPanel subclass to render the page
                panel = new XHTMLPanel();
                setupDocumentListener(panel);
                setupUserAgentCallback(panel);

                // Put our panel in a scrolling pane. You can use
                // a regular JScrollPane here, or our FSScrollPane.
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.