Examples of XHTMLPanel


Examples of org.xhtmlrenderer.simple.XHTMLPanel

     * @param args PARAM
     */
    public HTMLTest(String[] args) {
        super(BASE_TITLE);
        //Toolkit.getDefaultToolkit().setDynamicLayout(true);
        panel = new XHTMLPanel();
        int width = 360;
        int height = 500;
        panel.setPreferredSize(new Dimension(width, height));
        JScrollPane scroll = new JScrollPane(panel);
        scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
View Full Code Here

Examples of org.xhtmlrenderer.simple.XHTMLPanel

    private void run(String[] args) {
        loadAndCheckArgs(args);

        // Create a JPanel subclass to render the page
        final XHTMLPanel panel = setupPanel();

        // Set the XHTML document to render. We use the simplest form
        // of the API call, which uses a File reference. There
        // are a variety of overloads for setDocument().
        try {
            panel.setDocument(new File(fileName));
        } catch (Exception e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
        }

        // Put our panel in a scrolling pane. You can use
        // a regular JScrollPane here, or our FSScrollPane.
        // FSScrollPane is already set up to move the correct
        // amount when scrolling 1 line or 1 page
        FSScrollPane scroll = new FSScrollPane(panel);

        JFrame frame = new JFrame("Flying Saucer: " + panel.getDocumentTitle());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(scroll, BorderLayout.CENTER);
        frame.getContentPane().add(new JButton(new AbstractAction() {
            public void actionPerformed(ActionEvent event) {
                System.out.println("\n\n\nRELOAD\n\n\n");
                panel.setDocument(panel.getDocument(), panel.getSharedContext().getBaseURL());
            }
        }), BorderLayout.NORTH);
        frame.pack();
        frame.setSize(1024, 768);
        frame.setVisible(true);
View Full Code Here

Examples of org.xhtmlrenderer.simple.XHTMLPanel

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

    private XHTMLPanel setupPanel() {
        XHTMLPanel panel = new XHTMLPanel();
        DelegatingReplacedElementFactory delegatingFactory = new DelegatingReplacedElementFactory();
        delegatingFactory.addReplacer(new SwingImageReplacer());
        panel.getSharedContext().setReplacedElementFactory(delegatingFactory);
        return 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

Examples of org.xhtmlrenderer.simple.XHTMLPanel

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

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

        panel.setDocument("demo:/demos/about.xhtml");

        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 run(String[] args) {
        loadAndCheckArgs(args);

        // Create a JPanel subclass to render the page
        final XHTMLPanel panel = new XHTMLPanel();

        // Set the XHTML document to render. We use the simplest form
        // of the API call, which uses a File reference. There
        // are a variety of overloads for setDocument().
        try {
            panel.setDocument(new File(fileName));
        } catch (Exception e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
        }

        // Put our panel in a scrolling pane. You can use
        // a regular JScrollPane here, or our FSScrollPane.
        // FSScrollPane is already set up to move the correct
        // amount when scrolling 1 line or 1 page
        FSScrollPane scroll = new FSScrollPane(panel);

        JFrame frame = new JFrame("Flying Saucer: " + panel.getDocumentTitle());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(BorderLayout.CENTER, scroll);

        panel.setFontScalingFactor(1.15F);
        panel.setMinFontScale(0.01F);
        panel.setMaxFontScale(12F);
        JButton smaller = new JButton("F-");
        smaller.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                panel.decrementFontSize();
                System.out.println("decremented");
            }
        });
        JButton def = new JButton("F0");
        def.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                panel.resetFontSize();

                System.out.println("reset");
            }
        });
        JButton larger = new JButton("F+");
        larger.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                panel.incrementFontSize();
                System.out.println("incremented");
            }
        });
        JPanel top = new JPanel(new FlowLayout());
        top.add(smaller);
View Full Code Here

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

                deferredChangePage(curFrom);
            }
        });

        // Create a JPanel subclass to render the page
        xpanel = new XHTMLPanel();
        xpanel.addDocumentListener(new DefaultDocumentListener() {
            public void documentLoaded() {
                frame.setCursor(Cursor.getDefaultCursor());
            }
        });
View Full Code Here

Examples of org.xhtmlrenderer.simple.XHTMLPanel

    private void run(String[] args) {
        loadAndCheckArgs(args);

        // Create a JPanel subclass to render the page
        XHTMLPanel panel = new XHTMLPanel();

        // Set the XHTML document to render. We use the simplest form
        // of the API call, which uses a File reference. There
        // are a variety of overloads for setDocument().
        try {
            panel.setDocument(new File(fileName));
        } catch (Exception e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
        }

        // Put our panel in a scrolling pane. You can use
        // a regular JScrollPane here, or our FSScrollPane.
        // FSScrollPane is already set up to move the correct
        // amount when scrolling 1 line or 1 page
        FSScrollPane scroll = new FSScrollPane(panel);

        JFrame frame = new JFrame("Flying Saucer: " + panel.getDocumentTitle());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(scroll);
        frame.pack();
        frame.setSize(1024, 768);
        frame.setVisible(true);
View Full Code Here

Examples of org.xhtmlrenderer.simple.XHTMLPanel

    private void run(String[] args) {
        loadAndCheckArgs(args);

        // Create a JPanel subclass to render the page
        XHTMLPanel panel = new XHTMLPanel();
        panel.setInteractive(false);
        panel.getSharedContext().setPrint(true);
        panel.setBackground(Color.LIGHT_GRAY);
        panel.setCenteredPagedView(true);

        // Set the XHTML document to render. We use the simplest form
        // of the API call, which uses a File reference. There
        // are a variety of overloads for setDocument().
        try {
            panel.setDocument(new File(fileName));
        } catch (Exception e) {
            e.printStackTrace();
        }

        // Put our panel in a scrolling pane. You can use
        // a regular JScrollPane here, or our FSScrollPane.
        // FSScrollPane is already set up to move the correct
        // amount when scrolling 1 line or 1 page
        FSScrollPane scroll = new FSScrollPane(panel);

        JFrame frame = new JFrame("Flying Saucer: " + panel.getDocumentTitle());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(scroll, BorderLayout.CENTER);
        frame.pack();
        frame.setSize(1024, 768);
        frame.setVisible(true);
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.