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 public void windowClosing(java.awt.event.WindowEvent evt) 070 { 071 exitForm(evt); 072 } 073 }); 074 075 jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.Y_AXIS)); 076 077 bn_svgViewer.setText("SVG Viewer (No animation)"); 078 bn_svgViewer.addActionListener(new java.awt.event.ActionListener() 079 { 080 public void actionPerformed(java.awt.event.ActionEvent evt) 081 { 082 bn_svgViewerActionPerformed(evt); 083 } 084 }); 085 086 jPanel1.add(bn_svgViewer); 087 088 bn_svgViewer1.setText("SVG Player (Animation)"); 089 bn_svgViewer1.addActionListener(new java.awt.event.ActionListener() 090 { 091 public void actionPerformed(java.awt.event.ActionEvent evt) 092 { 093 bn_svgViewer1ActionPerformed(evt); 094 } 095 }); 096 097 jPanel1.add(bn_svgViewer1); 098 099 getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER); 100 101 bn_quit.setText("Quit"); 102 bn_quit.addActionListener(new java.awt.event.ActionListener() 103 { 104 public void actionPerformed(java.awt.event.ActionEvent evt) 105 { 106 bn_quitActionPerformed(evt); 107 } 108 }); 109 110 jPanel2.add(bn_quit); 111 112 getContentPane().add(jPanel2, java.awt.BorderLayout.SOUTH); 113 114 pack(); 115 }//GEN-END:initComponents 116 117 private void bn_svgViewer1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_bn_svgViewer1ActionPerformed 118 {//GEN-HEADEREND:event_bn_svgViewer1ActionPerformed 119 SVGPlayer.main(null); 120 121 close(); 122 }//GEN-LAST:event_bn_svgViewer1ActionPerformed 123 124 private void bn_svgViewerActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_bn_svgViewerActionPerformed 125 {//GEN-HEADEREND:event_bn_svgViewerActionPerformed 126 SVGViewer.main(null); 127 128 close(); 129 }//GEN-LAST:event_bn_svgViewerActionPerformed 130 131 private void bn_quitActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_bn_quitActionPerformed 132 {//GEN-HEADEREND:event_bn_quitActionPerformed 133 exitForm(null); 134 }//GEN-LAST:event_bn_quitActionPerformed 135 136 /** Exit the Application */ 137 private void exitForm(java.awt.event.WindowEvent evt)//GEN-FIRST:event_exitForm 138 { 139 System.exit(0); 140 }//GEN-LAST:event_exitForm 141 142 private void close() 143 { 144 this.setVisible(false); 145 this.dispose(); 146 } 147 148 /** 149 * @param args the command line arguments 150 */ 151 public static void main(String args[]) 152 { 153 new MainFrame().setVisible(true); 154 } 155 156 // Variables declaration - do not modify//GEN-BEGIN:variables 157 private javax.swing.JButton bn_quit; 158 private javax.swing.JButton bn_svgViewer; 159 private javax.swing.JButton bn_svgViewer1; 160 private javax.swing.JPanel jPanel1; 161 private javax.swing.JPanel jPanel2; 162 // End of variables declaration//GEN-END:variables 163 164}