Search in sources :

Example 1 with SVGElement

use of com.kitfox.svg.SVGElement in project pivot by apache.

the class TestPanel method initComponents.

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">
private void initComponents() {
    panelDisplay = new javax.swing.JPanel();
    button1 = new javax.swing.JButton();
    button2 = new javax.swing.JButton();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    panelDisplay.setLayout(new java.awt.BorderLayout());
    getContentPane().add(panelDisplay, java.awt.BorderLayout.CENTER);
    button1.setText("Visible");
    button1.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SVGElement root = Pivot964Swing.this.panel.root;
            try {
                root.setAttribute("viewBox", AnimationElement.AT_XML, "0 0 2368 1652");
                root.updateTime(0f);
                repaint();
            } catch (SVGElementException e) {
                e.printStackTrace();
            } catch (SVGException e) {
                e.printStackTrace();
            }
        }
    });
    button2.setText("Invisible");
    button2.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SVGElement root = Pivot964Swing.this.panel.root;
            try {
                root.setAttribute("viewBox", AnimationElement.AT_XML, "800 0 2368 1652");
                root.updateTime(0f);
                repaint();
            } catch (SVGElementException e) {
                e.printStackTrace();
            } catch (SVGException e) {
                e.printStackTrace();
            }
        }
    });
    panelDisplay.add(button1, java.awt.BorderLayout.EAST);
    panelDisplay.add(button2, java.awt.BorderLayout.WEST);
    pack();
}
Also used : SVGElement(com.kitfox.svg.SVGElement) SVGException(com.kitfox.svg.SVGException) SVGElementException(com.kitfox.svg.SVGElementException) BorderLayout(java.awt.BorderLayout) JPanel(javax.swing.JPanel)

Aggregations

SVGElement (com.kitfox.svg.SVGElement)1 SVGElementException (com.kitfox.svg.SVGElementException)1 SVGException (com.kitfox.svg.SVGException)1 BorderLayout (java.awt.BorderLayout)1 JPanel (javax.swing.JPanel)1