001    /*
002     * MainFrame.java
003     *
004     * Created on September 6, 2004, 1:19 AM
005     */
006    
007    package com.kitfox.svg.app;
008    
009    /**
010     *
011     * @author  kitfox
012     */
013    public class MainFrame extends javax.swing.JFrame
014    {
015        public static final long serialVersionUID = 1;
016        
017        /** Creates new form MainFrame */
018        public MainFrame()
019        {
020            initComponents();
021        }
022        
023        /** This method is called from within the constructor to
024         * initialize the form.
025         * WARNING: Do NOT modify this code. The content of this method is
026         * always regenerated by the Form Editor.
027         */
028        private void initComponents()//GEN-BEGIN:initComponents
029        {
030            jPanel1 = new javax.swing.JPanel();
031            bn_svgViewer = new javax.swing.JButton();
032            bn_svgViewer1 = new javax.swing.JButton();
033            jPanel2 = new javax.swing.JPanel();
034            bn_quit = new javax.swing.JButton();
035    
036            setTitle("SVG Salamander - Application Launcher");
037            addWindowListener(new java.awt.event.WindowAdapter()
038            {
039                public void windowClosing(java.awt.event.WindowEvent evt)
040                {
041                    exitForm(evt);
042                }
043            });
044    
045            jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.Y_AXIS));
046    
047            bn_svgViewer.setText("SVG Viewer (No animation)");
048            bn_svgViewer.addActionListener(new java.awt.event.ActionListener()
049            {
050                public void actionPerformed(java.awt.event.ActionEvent evt)
051                {
052                    bn_svgViewerActionPerformed(evt);
053                }
054            });
055    
056            jPanel1.add(bn_svgViewer);
057    
058            bn_svgViewer1.setText("SVG Player (Animation)");
059            bn_svgViewer1.addActionListener(new java.awt.event.ActionListener()
060            {
061                public void actionPerformed(java.awt.event.ActionEvent evt)
062                {
063                    bn_svgViewer1ActionPerformed(evt);
064                }
065            });
066    
067            jPanel1.add(bn_svgViewer1);
068    
069            getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
070    
071            bn_quit.setText("Quit");
072            bn_quit.addActionListener(new java.awt.event.ActionListener()
073            {
074                public void actionPerformed(java.awt.event.ActionEvent evt)
075                {
076                    bn_quitActionPerformed(evt);
077                }
078            });
079    
080            jPanel2.add(bn_quit);
081    
082            getContentPane().add(jPanel2, java.awt.BorderLayout.SOUTH);
083    
084            pack();
085        }//GEN-END:initComponents
086    
087        private void bn_svgViewer1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_bn_svgViewer1ActionPerformed
088        {//GEN-HEADEREND:event_bn_svgViewer1ActionPerformed
089            SVGPlayer.main(null);
090    
091            close();
092        }//GEN-LAST:event_bn_svgViewer1ActionPerformed
093    
094        private void bn_svgViewerActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_bn_svgViewerActionPerformed
095        {//GEN-HEADEREND:event_bn_svgViewerActionPerformed
096            SVGViewer.main(null);
097    
098            close();
099        }//GEN-LAST:event_bn_svgViewerActionPerformed
100    
101        private void bn_quitActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_bn_quitActionPerformed
102        {//GEN-HEADEREND:event_bn_quitActionPerformed
103            exitForm(null);
104        }//GEN-LAST:event_bn_quitActionPerformed
105        
106        /** Exit the Application */
107        private void exitForm(java.awt.event.WindowEvent evt)//GEN-FIRST:event_exitForm
108        {
109            System.exit(0);
110        }//GEN-LAST:event_exitForm
111        
112        private void close()
113        {
114            this.setVisible(false);
115            this.dispose();
116        }
117        
118        /**
119         * @param args the command line arguments
120         */
121        public static void main(String args[])
122        {
123            new MainFrame().setVisible(true);
124        }
125        
126        // Variables declaration - do not modify//GEN-BEGIN:variables
127        private javax.swing.JButton bn_quit;
128        private javax.swing.JButton bn_svgViewer;
129        private javax.swing.JButton bn_svgViewer1;
130        private javax.swing.JPanel jPanel1;
131        private javax.swing.JPanel jPanel2;
132        // End of variables declaration//GEN-END:variables
133        
134    }