001/*
002 * SVG Salamander
003 * Copyright (c) 2004, Mark McKay
004 * All rights reserved.
005 *
006 * Redistribution and use in source and binary forms, with or 
007 * without modification, are permitted provided that the following
008 * conditions are met:
009 *
010 *   - Redistributions of source code must retain the above 
011 *     copyright notice, this list of conditions and the following
012 *     disclaimer.
013 *   - Redistributions in binary form must reproduce the above
014 *     copyright notice, this list of conditions and the following
015 *     disclaimer in the documentation and/or other materials 
016 *     provided with the distribution.
017 *
018 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
019 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
020 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
021 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
022 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
023 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
024 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
025 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
026 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
027 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
028 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
029 * OF THE POSSIBILITY OF SUCH DAMAGE. 
030 * 
031 * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
032 * projects can be found at http://www.kitfox.com
033 *
034 * Created on September 6, 2004, 1:19 AM
035 */
036
037package com.kitfox.svg.app;
038
039/**
040 *
041 * @author  kitfox
042 */
043public class MainFrame extends javax.swing.JFrame
044{
045    public static final long serialVersionUID = 1;
046    
047    /** Creates new form MainFrame */
048    public MainFrame()
049    {
050        initComponents();
051    }
052    
053    /** This method is called from within the constructor to
054     * initialize the form.
055     * WARNING: Do NOT modify this code. The content of this method is
056     * always regenerated by the Form Editor.
057     */
058    private void initComponents()//GEN-BEGIN:initComponents
059    {
060        jPanel1 = new javax.swing.JPanel();
061        bn_svgViewer = new javax.swing.JButton();
062        bn_svgViewer1 = new javax.swing.JButton();
063        jPanel2 = new javax.swing.JPanel();
064        bn_quit = new javax.swing.JButton();
065
066        setTitle("SVG Salamander - Application Launcher");
067        addWindowListener(new java.awt.event.WindowAdapter()
068        {
069            @Override
070            public void windowClosing(java.awt.event.WindowEvent evt)
071            {
072                exitForm(evt);
073            }
074        });
075
076        jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.Y_AXIS));
077
078        bn_svgViewer.setText("SVG Viewer (No animation)");
079        bn_svgViewer.addActionListener(new java.awt.event.ActionListener()
080        {
081            public void actionPerformed(java.awt.event.ActionEvent evt)
082            {
083                bn_svgViewerActionPerformed(evt);
084            }
085        });
086
087        jPanel1.add(bn_svgViewer);
088
089        bn_svgViewer1.setText("SVG Player (Animation)");
090        bn_svgViewer1.addActionListener(new java.awt.event.ActionListener()
091        {
092            public void actionPerformed(java.awt.event.ActionEvent evt)
093            {
094                bn_svgViewer1ActionPerformed(evt);
095            }
096        });
097
098        jPanel1.add(bn_svgViewer1);
099
100        getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
101
102        bn_quit.setText("Quit");
103        bn_quit.addActionListener(new java.awt.event.ActionListener()
104        {
105            public void actionPerformed(java.awt.event.ActionEvent evt)
106            {
107                bn_quitActionPerformed(evt);
108            }
109        });
110
111        jPanel2.add(bn_quit);
112
113        getContentPane().add(jPanel2, java.awt.BorderLayout.SOUTH);
114
115        pack();
116    }//GEN-END:initComponents
117
118    private void bn_svgViewer1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_bn_svgViewer1ActionPerformed
119    {//GEN-HEADEREND:event_bn_svgViewer1ActionPerformed
120        SVGPlayer.main(null);
121
122        close();
123    }//GEN-LAST:event_bn_svgViewer1ActionPerformed
124
125    private void bn_svgViewerActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_bn_svgViewerActionPerformed
126    {//GEN-HEADEREND:event_bn_svgViewerActionPerformed
127        SVGViewer.main(null);
128
129        close();
130    }//GEN-LAST:event_bn_svgViewerActionPerformed
131
132    private void bn_quitActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_bn_quitActionPerformed
133    {//GEN-HEADEREND:event_bn_quitActionPerformed
134        exitForm(null);
135    }//GEN-LAST:event_bn_quitActionPerformed
136    
137    /** Exit the Application */
138    private void exitForm(java.awt.event.WindowEvent evt)//GEN-FIRST:event_exitForm
139    {
140        System.exit(0);
141    }//GEN-LAST:event_exitForm
142    
143    private void close()
144    {
145        this.setVisible(false);
146        this.dispose();
147    }
148    
149    /**
150     * @param args the command line arguments
151     */
152    public static void main(String args[])
153    {
154        new MainFrame().setVisible(true);
155    }
156    
157    // Variables declaration - do not modify//GEN-BEGIN:variables
158    private javax.swing.JButton bn_quit;
159    private javax.swing.JButton bn_svgViewer;
160    private javax.swing.JButton bn_svgViewer1;
161    private javax.swing.JPanel jPanel1;
162    private javax.swing.JPanel jPanel2;
163    // End of variables declaration//GEN-END:variables
164    
165}