/*
PseudoCode Interpreted Language (PCIL): Part of the algoviz@vt collection of algorithm visualizations.
Copyright (C) 2008 Brandon Malone, Frank Hadlock
This file is part of the PseudoCode Interpreted Language.
PseudoCode Interpreted Language is free software: you can redistribute
it and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the License,
or (at your option) any later version.
PseudoCode Interpreted Language is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with
PseudoCode Interpreted Language. If not, see
.
*/
/*
* Main.java
*
* Created on September 17, 2007, 9:58 PM
*/
package dynamicmvc;
import java.awt.BorderLayout;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
/**
*
* @author Compaq_Owner
*/
public class Main extends javax.swing.JFrame {
View v;
/** Creates new form Main */
public Main() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (InstantiationException ex) {
ex.printStackTrace();
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
} catch (UnsupportedLookAndFeelException ex) {
ex.printStackTrace();
} catch (IllegalAccessException ex) {
ex.printStackTrace();
}
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Visualizing Algorithms for Learning");
initComponents();
v = new View();
setSize(v.getPreferredSize());
add(v, BorderLayout.CENTER);
}
/** 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.
*/
// //GEN-BEGIN:initComponents
private void initComponents() {
jMenuBar1 = new javax.swing.JMenuBar();
mnuFile = new javax.swing.JMenu();
jmiOpen = new javax.swing.JMenuItem();
jmiExit = new javax.swing.JMenuItem();
mnuVisibility = new javax.swing.JMenu();
jmiFunctions = new javax.swing.JMenuItem();
jmiVariables = new javax.swing.JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Visualizing Algorithms for Learning");
mnuFile.setText("File");
jmiOpen.setText("Open");
jmiOpen.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jmiOpenActionPerformed(evt);
}
});
mnuFile.add(jmiOpen);
jmiExit.setText("Exit");
jmiExit.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jmiExitMouseClicked(evt);
}
});
jmiExit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jmiExitActionPerformed(evt);
}
});
mnuFile.add(jmiExit);
jMenuBar1.add(mnuFile);
mnuVisibility.setText("Visibility");
jmiFunctions.setText("Functions");
jmiFunctions.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jmiFunctionsActionPerformed(evt);
}
});
mnuVisibility.add(jmiFunctions);
jmiVariables.setText("Variables");
jmiVariables.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jmiVariablesActionPerformed(evt);
}
});
mnuVisibility.add(jmiVariables);
jMenuBar1.add(mnuVisibility);
setJMenuBar(jMenuBar1);
pack();
}// //GEN-END:initComponents
private void jmiVariablesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiVariablesActionPerformed
// TODO add your handling code here:
v.getVariables();
}//GEN-LAST:event_jmiVariablesActionPerformed
private void jmiFunctionsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiFunctionsActionPerformed
// TODO add your handling code here:
v.getFunctions();
}//GEN-LAST:event_jmiFunctionsActionPerformed
private void jmiExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiExitActionPerformed
// TODO add your handling code here:
System.exit(0);
}//GEN-LAST:event_jmiExitActionPerformed
private void jmiExitMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jmiExitMouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_jmiExitMouseClicked
private void jmiOpenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmiOpenActionPerformed
// TODO add your handling code here:
v.openFile();
}//GEN-LAST:event_jmiOpenActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Main().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jmiExit;
private javax.swing.JMenuItem jmiFunctions;
private javax.swing.JMenuItem jmiOpen;
private javax.swing.JMenuItem jmiVariables;
private javax.swing.JMenu mnuFile;
private javax.swing.JMenu mnuVisibility;
// End of variables declaration//GEN-END:variables
}