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();
}
Aggregations