package GUI; import Exceptions.UnsupportedFileTypeException; import Experiment.SingleDataExperiment; import GUI.Main; import ImportedCode.GoogleMail; import com.cloudgarden.layout.AnchorConstraint; import com.cloudgarden.layout.AnchorLayout; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.mail.MessagingException; import javax.swing.AbstractAction; import javax.swing.ButtonGroup; import javax.swing.ComboBoxModel; import javax.swing.DefaultComboBoxModel; import java.awt.Insets; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JFileChooser; import javax.swing.JFormattedTextField; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPasswordField; import javax.swing.JProgressBar; import javax.swing.JScrollPane; import javax.swing.JSeparator; import javax.swing.JSpinner; import javax.swing.JTabbedPane; import javax.swing.JTable; import javax.swing.JTextField; import javax.swing.JTree; import javax.swing.ListModel; import javax.swing.SpinnerListModel; import javax.swing.JFileChooser; import javax.swing.filechooser.FileFilter; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.*; import java.util.concurrent.ExecutionException; import javax.swing.event.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.WindowConstants; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableModel; import javax.swing.SwingUtilities; //import org.eclipse.swt.graphics.Color; //import org.eclipse.swt.widgets.Shell; //import org.eclipse.swt.widgets.Display; /** * This code was edited or generated using CloudGarden's Jigloo * SWT/Swing GUI Builder, which is free for non-commercial * use. If Jigloo is being used commercially (ie, by a corporation, * company or business for any purpose whatever) then you * should purchase a license for each developer using Jigloo. * Please visit www.cloudgarden.com for details. * Use of Jigloo implies acceptance of these licensing terms. * A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR * THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED * LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE. */ public class MainGUI extends javax.swing.JFrame { { //Set Look & Feel try { javax.swing.UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch(Exception e) { e.printStackTrace(); } } //Display display = new Display(); //Shell shell = new Shell(display); private JLabel jLabel27; private JLabel jLabel10; private JLabel jLabel3; private JLabel jLabel26; private JLabel jLabel25; private JLabel jLabel24; private JLabel jLabel23; private JButton jButton10; private JLabel jLabel22; private JScrollPane jScrollPane1; private JTextField jTextField5; private JButton jButton9; private JButton jButton6; private JList jList2; private JPanel jPanel3; private JLabel jLabelDataSet44; private JLabel jLabelDataSet43; private JLabel jLabelDataSet42; private JLabel jLabelDataSet41; private JLabel jLabelDataSet40; private JTextField jTextFieldDataSetName; private JScrollPane jScrollPane2; private JList jList1; private JButton jButton8; private Vector newDataSetEmails = new Vector(); private Vector dataSetNamesVector = new Vector(); private Vector dataSetEmailsVector = new Vector(); private Vector dataSetRecommendationsVector = new Vector(); private String[] dataSetNames = {"Pick One", "Test Data Set", "Running Data Set"}; private String[][] dataSetEmails ={ {}, {"wsica@mix.wvu.edu", "vrogers@mix.wvu.edu"}, {"someBoss@busines.org", "Minion1@busines.org", "Minion2@business.org"}}; private String[][][] dataSetRecommendations ={ {}, { //preprocessor, learner, MRE, MDMRE, Pred(25) {"none", "NNet", "12", "0.3", "4.5672"}, {"preprocessor", "learner", "12", "0.3", "4.5672"}, {"preprocessor", "learner", "12", "0.3", "4.5672"}, {"preprocessor", "learner", "12", "0.3", "4.5672"}, {"preprocessor", "learner", "12", "0.3", "4.5672"} }, {} }; private String[] myLearnerNames = { "none", "Learner 1", "Learner 2"}; private String[] myPreprocessorNames = { "none","Preprocessor 1", "Preprocessor 2","Preprocessor 3"}; //------------------------------------- private String[] allLearnerNames = {"Learner 1", "Learner 2"}; private String[] allPreprocessorNames = {"Preprocessor 1", "Preprocessor 2","Preprocessor 3"}; //------------------------------------- private String currentUser = ""; private Vector userNames = new Vector(); private Vector userPasswords = new Vector(); private Vector userEmails = new Vector(); private Vector files = new Vector(); private DefaultListModel jList1Model = new DefaultListModel(); private DefaultListModel jList2Model = new DefaultListModel(); private File file; //Create a file chooser final JFileChooser fc = new JFileChooser(); private JButton jButton3; private JLabel jLabel8; private JLabel jLabel7; private JLabel jLabel6; private JPasswordField RegisterPassword2; private JPasswordField RegisterPassword1; private JTextField jTextField1; private JPanel jPanelRegister; private JLabel jLabel34; private JButton jButton20; private JButton jButton19; private JButton jButton18; private JButton jButton17; private JButton jButton16; private JList jList4; private JScrollPane jScrollPane4; private JLabel jLabel33; private JPanel jPanel11; private JPanel jPanel10; private JPanel jPanel9; private JLabel jLabel32; private JComboBox jComboBox1; private JPanel jPanel8; private JTabbedPane jTabbedPaneLearners; private JRadioButton jRadioButton4; private JRadioButton jRadioButton3; private JButton jButton15; private JTextField jTextField8; private JButton jButton14; private JButton jButton13; private JList jList3; private JScrollPane jScrollPane3; private JLabel jLabel31; private JTextField jTextField7; private JLabel jLabel30; private JTextField jTextField6; private JLabel WelcomeMessage; private JTextPane EstimatedEffort; private JButton PerformEstimate; private JTextField TestData; private JComboBox PreprocessorSelection; private JComboBox LearnerSelection; private JTable jTable1; private JTextField DatasetSelection; private JButton DatasetSelector; private JPanel Estimator; private JPanel ResultsOpener; private JTable ResultsTable; private JTable ResultsView; private JTextField FileLocation2; private JButton jButton11; private JPanel ResultsViewer; private JButton jButton12; private JPanel jPanel7; private JPanel jPanel6; private JPanel jPanel5; private JPanel jPanel4; private JTabbedPane jTabbedPaneDeveloper; private JLabel jLabel29; private JRadioButton jRadioButton2; private JRadioButton jRadioButton1; private JPasswordField jPasswordField1; private JLabel jLabelDataSet34; private JLabel jLabelDataSet33; private JLabel jLabelDataSet32; private JLabel jLabelDataSet31; private JLabel jLabelDataSet30; private JLabel jLabelDataSet04; private JLabel jLabelDataSet03; private JLabel jLabelDataSet02; private JLabel jLabelDataSet01; private JLabel jLabelDataSet00; private JLabel jLabelDataSet20; private JLabel jLabelDataSet10; private JLabel jLabelDataSet24; private JLabel jLabelDataSet23; private JLabel jLabelDataSet22; private JLabel jLabelDataSet21; private JLabel jLabel21; private JProgressBar jProgressBar1; private JPanel jPanel2; private JLabel jLabelDataSet14; private JLabel jLabelDataSet13; private JLabel jLabelDataSet12; private JLabel jLabelDataSet11; private JSeparator jSeparator7; private JSeparator jSeparator6; private JSeparator jSeparator5; private JSeparator jSeparator4; private JSeparator jSeparator3; private JSeparator jSeparator2; private JLabel jLabel20; private JLabel jLabel19; private JLabel jLabel18; private JLabel jLabel17; private JLabel jLabel11; private JButton jButtonRun5; private JButton jButtonRun4; private JButton jButtonRun3; private JButton jButtonRun2; private JButton jButtonRun1; private JPanel jPanel1; private JLabel jLabel16; private JButton jButton5; private JLabel jLabel15; private JTextField jTextField4; private JButton jButtonFinish; private JTextField jTextDataSetFileName; private JLabel jLabel14; private JLabel jLabel13; private JButton jButton7; private JTextField jTextField3; private JPanel jPanelSetDetails; private JPanel jPanelFileChooser; private JPanel jPanelNewDataSet; private JLabel jLabel12; private JComboBox jComboBoxDataSets; private JSeparator jSeparator1; private JPanel jPanelYourDataSets; private JPanel jPanelMainMenuTab; private JTabbedPane jTabbedPan; private JLabel jLabel5; private JButton jButton4; private TableModel resultsModel = new DefaultTableModel( new String[][] {{ "Preprocessor", "Learner","Percent Losses","MMRE"}, { "N/A","N/A","N/A","N/A" },{ "N/A","N/A","N/A","N/A"},{ "N/A","N/A","N/A","N/A"},{ "N/A","N/A","N/A","N/A"},{ "N/A","N/A","N/A","N/A"} }, new String[] { "Preprocessor", "Learner","Percent Losses","MMRE"}); private JTextField UserNameField; private JLabel jLabel1; private JLabel jLabel2; private JButton jButton1; private JButton jButton2; private JLabel jLabel4; private JPanel jPanelLogIn; private JMenuItem About; private JMenu aboutAction; private AbstractAction aboutACtion; private JMenu jMenu1; /** * Auto-generated main method to display this JFrame */ public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { MainGUI inst = new MainGUI(); inst.setLocationRelativeTo(null); inst.setVisible(true); } }); } public MainGUI() { super(); initGUI(); } private void initGUI() { try { dataSetNamesVector.add("Pick One"); dataSetEmailsVector.add(new Vector()); dataSetRecommendationsVector.add(new Vector()); //------------------------------------- //create user names and passwords userNames.add("vrogers"); userNames.add("wsica"); //passwords userPasswords.add("password"); userPasswords.add("password"); //emails userEmails.add("vrogers@mix.wvu.edu"); userEmails.add("wsica@mi.wvu.edu"); //----------------------------------------------------- //----------------------------------------------------- GridBagLayout thisLayout = new GridBagLayout(); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); thisLayout.rowWeights = new double[] {0.1}; thisLayout.rowHeights = new int[] {20}; thisLayout.columnWeights = new double[] {0.1}; thisLayout.columnWidths = new int[] {7}; getContentPane().setLayout(thisLayout); getContentPane().setBackground(new java.awt.Color(255,255,255)); getContentPane().add(getjPanelLogIn(false), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); getContentPane().add(getjPanelRegister(false), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); getContentPane().add(getJTabbedPan(true), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); getContentPane().add(getJTabbedPaneDeveloper(false), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); pack(); this.setSize(800, 500); } catch (Exception e) { //add your error handling code here e.printStackTrace(); } } private AbstractAction getAboutACtion() { if(aboutACtion == null) { aboutACtion = new AbstractAction("about", null) { public void actionPerformed(ActionEvent evt) { } }; } return aboutACtion; } private JPanel getjPanelLogIn(boolean visible) { if(jPanelLogIn == null) { jPanelLogIn = new JPanel(); GridBagLayout jPanelLogInLayout = new GridBagLayout(); jPanelLogInLayout.rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1}; jPanelLogInLayout.rowHeights = new int[] {179, 37, 22, 32, 31, 36, 28, 20}; jPanelLogInLayout.columnWeights = new double[] {0.0, 0.0, 0.0, 0.1}; jPanelLogInLayout.columnWidths = new int[] {175, 137, 130, 7}; jPanelLogIn.setLayout(jPanelLogInLayout); jPanelLogIn.setVisible(visible); jPanelLogIn.setBackground(new java.awt.Color(255,255,255)); jPanelLogIn.add(getJLabel4(), new GridBagConstraints(1, 5, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelLogIn.add(getJButton2(), new GridBagConstraints(1, 6, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelLogIn.add(getJButton1(), new GridBagConstraints(1, 4, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelLogIn.add(getJLabel2(), new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelLogIn.add(getJLabel1(), new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelLogIn.add(getUserNameField(), new GridBagConstraints(1, 2, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanelLogIn.add(getJPasswordField1(), new GridBagConstraints(1, 3, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanelLogIn.add(getJLabel5(), new GridBagConstraints(0, 1, 4, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelLogIn.add(getJLabel3(), new GridBagConstraints(0, 0, 4, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelLogIn.add(getJRadioButton1(), new GridBagConstraints(1, 7, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelLogIn.add(getJRadioButton2(), new GridBagConstraints(2, 7, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelLogIn.add(getJLabel29(), new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); } return jPanelLogIn; } private JLabel getJLabel4() { if(jLabel4 == null) { jLabel4 = new JLabel(); jLabel4.setText("New? Register Here:"); } return jLabel4; } private JButton getJButton2() { if(jButton2 == null) { jButton2 = new JButton(); jButton2.setText("Register"); jButton2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jPanelLogIn.setVisible(false); jPanelRegister.setVisible(true); } }); } return jButton2; } private void LogMeIn() { int selectedPswd = -1; int selectedUser = userNames.indexOf(UserNameField.getText()); if(selectedUser >= 0){ selectedPswd = userPasswords.indexOf(jPasswordField1.getText()); } if((selectedUser < 0) || (selectedPswd < 0)){ jLabel5.setText("Incorrect UserName or Password"); } else { Vector temp = new Vector(); Vector temp2 = new Vector(); jPanelLogIn.setVisible(false); jLabel5.setText(" "); currentUser = UserNameField.getText(); if(jRadioButton1.isSelected()){ //----------------------------------- jTabbedPan.setVisible(true); //jLabel9.setText("Welcome " + UserNameField.getText()); //jLabel28.setText((String)userEmails.get(userNames.indexOf(UserNameField.getText()))); UserNameField.setText(""); jPasswordField1.setText(""); if(currentUser.equals("vrogers")){ //--------------------------------------- //temp data set info temp = new Vector(); dataSetNamesVector.add("TestDataSet"); temp.add("vrogers@mix.wvu.edu"); temp.add("wsica@mix.wvu.edu"); dataSetEmailsVector.add(temp); temp = new Vector(); temp2.add("none"); temp2.add("NNet"); temp2.add("12"); temp2.add("0.3"); temp2.add("4.5672"); temp.add(temp2); temp2 = new Vector(); temp2.add("preprocessor"); temp2.add("learner"); temp2.add("12"); temp2.add("0.3"); temp2.add("4.5672"); temp.add(temp2); temp2 = new Vector(); temp2.add("preprocessor"); temp2.add("learner"); temp2.add("12"); temp2.add("0.3"); temp2.add("4.5672"); temp.add(temp2); temp2 = new Vector(); temp2.add("preprocessor"); temp2.add("learner"); temp2.add("12"); temp2.add("0.3"); temp2.add("4.5672"); temp.add(temp2); temp2 = new Vector(); temp2.add("preprocessor"); temp2.add("learner"); temp2.add("12"); temp2.add("0.3"); temp2.add("4.5672"); temp.add(temp2); dataSetRecommendationsVector.add(temp); //running data set dataSetNamesVector.add("RunningSet"); temp = new Vector(); temp.add("someBoss@business.org"); temp.add("minion1@business.org"); temp.add("minion2@business.org"); dataSetEmailsVector.add(temp); temp = new Vector(); dataSetRecommendationsVector.add(temp); } } else { } } } private JButton getJButton1() { if(jButton1 == null) { jButton1 = new JButton(); jButton1.setText("Login"); jButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { LogMeIn(); } }); } return jButton1; } private JLabel getJLabel2() { if(jLabel2 == null) { jLabel2 = new JLabel(); jLabel2.setText("Password:"); } return jLabel2; } private JLabel getJLabel1() { if(jLabel1 == null) { jLabel1 = new JLabel(); jLabel1.setText("UserName:"); } return jLabel1; } private JTextField getUserNameField() { if(UserNameField == null) { UserNameField = new JTextField(); } return UserNameField; } private JPasswordField getJPasswordField1() { if(jPasswordField1 == null) { jPasswordField1 = new JPasswordField(); jPasswordField1.setText(""); jPasswordField1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(e.ACTION_PERFORMED == 1001){ LogMeIn(); } } }); } return jPasswordField1; } private JPanel getjPanelRegister(boolean visible) { if(jPanelRegister == null) { jPanelRegister = new JPanel(); GridBagLayout jPanelRegisterLayout = new GridBagLayout(); jPanelRegisterLayout.rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1}; jPanelRegisterLayout.rowHeights = new int[] {208, 31, 32, 24, 28, 32, 20}; jPanelRegisterLayout.columnWeights = new double[] {0.0, 0.0, 0.0, 0.1}; jPanelRegisterLayout.columnWidths = new int[] {179, 130, 128, 7}; jPanelRegister.setLayout(jPanelRegisterLayout); jPanelRegister.setVisible(visible); jPanelRegister.setBackground(new java.awt.Color(255,255,255)); jPanelRegister.add(getJTextField1(), new GridBagConstraints(1, 2, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanelRegister.add(getRegisterPassword1(), new GridBagConstraints(1, 3, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanelRegister.add(getRegisterPassword2(), new GridBagConstraints(1, 4, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanelRegister.add(getJLabel6(), new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelRegister.add(getJLabel7(), new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelRegister.add(getJLabel8(), new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelRegister.add(getJButton3(), new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelRegister.add(getJButton4(), new GridBagConstraints(2, 5, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelRegister.add(getJTextField4(), new GridBagConstraints(1, 1, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanelRegister.add(getJLabel15(), new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelRegister.add(getJLabel24(), new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelRegister.add(getJLabel25(), new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelRegister.add(getJLabel26(), new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelRegister.add(getJLabel10(), new GridBagConstraints(0, 0, 4, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); } return jPanelRegister; } private JTextField getJTextField1() { if(jTextField1 == null) { jTextField1 = new JTextField(); } return jTextField1; } private JPasswordField getRegisterPassword1() { if(RegisterPassword1 == null) { RegisterPassword1 = new JPasswordField(); } return RegisterPassword1; } private JPasswordField getRegisterPassword2() { if(RegisterPassword2 == null) { RegisterPassword2 = new JPasswordField(); } return RegisterPassword2; } private JLabel getJLabel6() { if(jLabel6 == null) { jLabel6 = new JLabel(); jLabel6.setText("Email:"); } return jLabel6; } private JLabel getJLabel7() { if(jLabel7 == null) { jLabel7 = new JLabel(); jLabel7.setText("Password:"); } return jLabel7; } private JLabel getJLabel8() { if(jLabel8 == null) { jLabel8 = new JLabel(); jLabel8.setText("Confirm Password:"); } return jLabel8; } private JButton getJButton3() { if(jButton3 == null) { jButton3 = new JButton(); jButton3.setText("Resgister"); jButton3.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jLabel24.setText(" "); jLabel25.setText(" "); jLabel26.setText(" "); String[] blah; blah = jTextField1.getText().split("@"); if(blah.length > 1) { blah = blah[1].split("\\."); } else { blah = new String[0];} Boolean working = true; if(! RegisterPassword1.getText().equals(RegisterPassword2.getText())){ jLabel26.setText("Passwords Don't Match"); working = false; }else if((RegisterPassword1.getText().equals("")) || (RegisterPassword2.getText().equals(""))){ jLabel26.setText("Enter Password"); working = false; } if(jTextField4.getText().equals("")) { jLabel24.setText("Enter User Name"); working = false; }else if(userNames.indexOf(jTextField4.getText()) > -1){ jLabel24.setText("User Name Already In Use"); working = false; } if(blah.length < 1){ jLabel25.setText("Invalid Email"); working = false; } if(working){ userNames.add(jTextField4.getText()); userEmails.add(jTextField1.getText()); userPasswords.add(RegisterPassword1.getText()); jTabbedPan.setVisible(true); jPanelRegister.setVisible(false); currentUser = jTextField4.getText(); //jLabel9.setText("Welcome " + UserNameField.getText()); } } }); } return jButton3; } private JButton getJButton4() { if(jButton4 == null) { jButton4 = new JButton(); jButton4.setText("Cancel"); jButton4.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jPanelLogIn.setVisible(true); jPanelRegister.setVisible(false); } }); } return jButton4; } private JLabel getJLabel5() { if(jLabel5 == null) { jLabel5 = new JLabel(); jLabel5.setText(" "); jLabel5.setForeground(new java.awt.Color(255,0,0)); } return jLabel5; } private JTabbedPane getJTabbedPan(boolean visible) { if(jTabbedPan == null) { jTabbedPan = new JTabbedPane(); jTabbedPan.setVisible(visible); jTabbedPan.addTab("Main", null, getJPanelMainMenuTab(), null); jTabbedPan.addTab("New Data Set", null, getJPanelNewDataSet(), null); jTabbedPan.addTab("Your Data Sets", null, getJPanelYourDataSets(), null); jTabbedPan.addTab("View Results", null, getResultsViewer(), null); jTabbedPan.addTab("Make Estimate", null, getEstimator(), null); jTabbedPan.setTabPlacement(JTabbedPane.LEFT); } return jTabbedPan; } private JPanel getJPanelMainMenuTab() { if(jPanelMainMenuTab == null) { jPanelMainMenuTab = new JPanel(); jPanelMainMenuTab.setLayout(null); jPanelMainMenuTab.add(getJLabel27(), "Center"); jPanelMainMenuTab.add(getWelcomeMessage(), "South"); } return jPanelMainMenuTab; } private JPanel getJPanelYourDataSets() { if(jPanelYourDataSets == null) { jPanelYourDataSets = new JPanel(); GridBagLayout jPanelYourDataSetsLayout = new GridBagLayout(); jPanelYourDataSetsLayout.rowWeights = new double[] {0.0, 0.0, 0.0, 0.0}; jPanelYourDataSetsLayout.rowHeights = new int[] {24, 15, 190, 192}; jPanelYourDataSetsLayout.columnWeights = new double[] {0.0, 0.0, 0.0, 0.1}; jPanelYourDataSetsLayout.columnWidths = new int[] {58, 96, 288, 20}; jPanelYourDataSets.setLayout(jPanelYourDataSetsLayout); jPanelYourDataSets.add(getJSeparator1(), new GridBagConstraints(0, 1, 4, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanelYourDataSets.add(getJComboBoxDataSets(), new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanelYourDataSets.add(getJLabel12(), new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelYourDataSets.add(getJPanel1(false), new GridBagConstraints(0, 2, 4, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); jPanelYourDataSets.add(getJPanel2(false), new GridBagConstraints(0, 2, 4, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); jPanelYourDataSets.add(getJPanel3(false), new GridBagConstraints(0, 3, 5, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); } return jPanelYourDataSets; } private JSeparator getJSeparator1() { if(jSeparator1 == null) { jSeparator1 = new JSeparator(); } return jSeparator1; } private void FillDataList(){ for (int i = 0; i < ((Vector)dataSetEmailsVector.get(jComboBoxDataSets.getSelectedIndex())).size(); i++) { jList2Model.addElement(((Vector)dataSetEmailsVector.get(jComboBoxDataSets.getSelectedIndex())).get(i)); } } private void DoNothingSometimeMaybe(){ Vector temp = new Vector(); if(((Vector)dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).size() > 0){ jPanel1.setVisible(true); jPanel2.setVisible(false); jButton10.setVisible(true); jLabelDataSet00.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(0)).get(0)); jLabelDataSet01.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(0)).get(1)); jLabelDataSet02.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(0)).get(2)); jLabelDataSet03.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(0)).get(3)); jLabelDataSet04.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(0)).get(4)); //------------------------------------------------------------------------------------------- jLabelDataSet10.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(1)).get(0)); jLabelDataSet11.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(1)).get(1)); jLabelDataSet12.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(1)).get(2)); jLabelDataSet13.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(1)).get(3)); jLabelDataSet14.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(1)).get(4)); //------------------------------------------------------------------------------------------ jLabelDataSet20.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(2)).get(0)); jLabelDataSet21.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(2)).get(1)); jLabelDataSet22.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(2)).get(2)); jLabelDataSet23.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(2)).get(3)); jLabelDataSet24.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(2)).get(4)); //------------------------------------------------------------------------------------------ jLabelDataSet30.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(3)).get(0)); jLabelDataSet31.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(3)).get(1)); jLabelDataSet32.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(3)).get(2)); jLabelDataSet33.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(3)).get(3)); jLabelDataSet34.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(3)).get(4)); //------------------------------------------------------------------------------------------ jLabelDataSet40.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(4)).get(0)); jLabelDataSet41.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(4)).get(1)); jLabelDataSet42.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(4)).get(2)); jLabelDataSet43.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(4)).get(3)); jLabelDataSet44.setText((String)((Vector)((Vector) dataSetRecommendationsVector.get(jComboBoxDataSets.getSelectedIndex())).get(4)).get(4)); } else { jPanel1.setVisible(false); jPanel2.setVisible(true); jButton10.setVisible(false); } jLabel23.setText(" "); jList2Model.clear(); jTextField5.setText("New Email"); FillDataList(); if(jComboBoxDataSets.getSelectedIndex() == 0){ jPanel1.setVisible(false); jPanel2.setVisible(false); jPanel3.setVisible(false); } else { jPanel3.setVisible(true); } } private JComboBox getJComboBoxDataSets() { if(jComboBoxDataSets == null) { ComboBoxModel jComboBoxDataSetsModel = new DefaultComboBoxModel(dataSetNamesVector); //ComboBoxModel jComboBoxDataSetsModel = new DefaultComboBoxModel(dataSetNames); jComboBoxDataSets = new JComboBox(); jComboBoxDataSets.setModel(jComboBoxDataSetsModel); jComboBoxDataSets.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (jComboBoxDataSets.getSelectedIndex() > 0) { Main.setCurrentExperiment((String) jComboBoxDataSets.getSelectedItem()); jProgressBar1.setValue((int) Main.getProgress()); } DoNothingSometimeMaybe(); } }); } return jComboBoxDataSets; } private JLabel getJLabel12() { if(jLabel12 == null) { jLabel12 = new JLabel(); jLabel12.setText("Pick a Data Set:"); } return jLabel12; } private JPanel getJPanelNewDataSet() { if(jPanelNewDataSet == null) { jPanelNewDataSet = new JPanel(); jPanelNewDataSet.add(getJPanelSetDetails(true)); jPanelNewDataSet.add(getJPanelFileChooser(false)); } return jPanelNewDataSet; } private JPanel getJPanelFileChooser(boolean visible) { if(jPanelFileChooser == null) { jPanelFileChooser = new JPanel(); jPanelFileChooser.setVisible(visible); } return jPanelFileChooser; } private JPanel getJPanelSetDetails(boolean visible) { if(jPanelSetDetails == null) { jPanelSetDetails = new JPanel(); GridBagLayout jPanelSetDetailsLayout = new GridBagLayout(); jPanelSetDetails.setPreferredSize(new java.awt.Dimension(523, 396)); jPanelSetDetailsLayout.rowWeights = new double[] {0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1}; jPanelSetDetailsLayout.rowHeights = new int[] {20, 20, 25, 25, 19, 164, 27, 21, 27, 20}; jPanelSetDetailsLayout.columnWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.1}; jPanelSetDetailsLayout.columnWidths = new int[] {94, 179, 90, 79, 7}; jPanelSetDetails.setLayout(jPanelSetDetailsLayout); jPanelSetDetails.setVisible(visible); jPanelSetDetails.add(getJTextField3(), new GridBagConstraints(1, 7, 3, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanelSetDetails.add(getJButton7(), new GridBagConstraints(2, 6, 2, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanelSetDetails.add(getJButton8(), new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanelSetDetails.add(getJScrollPane2(), new GridBagConstraints(1, 5, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); jPanelSetDetails.add(getJTextFieldDataSetName(), new GridBagConstraints(1, 3, 3, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanelSetDetails.add(getJLabel13(), new GridBagConstraints(1, 2, 3, 1, 0.0, 0.0, GridBagConstraints.SOUTH, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelSetDetails.add(getJLabel14(), new GridBagConstraints(1, 4, 3, 1, 0.0, 0.0, GridBagConstraints.SOUTH, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelSetDetails.add(getJTextField2(), new GridBagConstraints(1, 1, 3, 1, 0.0, 0.0, GridBagConstraints.SOUTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanelSetDetails.add(getJButtonFinish(), new GridBagConstraints(1, 9, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelSetDetails.add(getJButton5(), new GridBagConstraints(1, 0, 3, 1, 0.0, 0.0, GridBagConstraints.SOUTH, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanelSetDetails.add(getJLabel16(), new GridBagConstraints(1, 8, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); } return jPanelSetDetails; } private JTextField getJTextField3() { if(jTextField3 == null) { jTextField3 = new JTextField(); jTextField3.setText("New Email"); } return jTextField3; } private JButton getJButton7() { if(jButton7 == null) { jButton7 = new JButton(); jButton7.setText("Add New"); jButton7.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String[] blah; blah = jTextField3.getText().split("@"); if(blah.length > 1) { blah = blah[1].split("\\.");} if(blah.length > 1){ if(jList1Model.contains(jTextField3.getText())){ jLabel16.setText("Email already exists"); }else{ newDataSetEmails.add(jTextField3.getText()); jList1Model.addElement(jTextField3.getText()); jLabel16.setText(" "); } } else { jLabel16.setText("Incorrect Email"); } } }); } return jButton7; } private JButton getJButton8() { if(jButton8 == null) { jButton8 = new JButton(); jButton8.setText("Remove Selected"); jButton8.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(jList1Model.size() > 0){ jList1Model.removeElementAt(jList1.getSelectedIndex()); newDataSetEmails.remove(jList1.getSelectedIndex()); } } }); } return jButton8; } private JScrollPane getJScrollPane2() { if(jScrollPane2 == null) { jList1 = new JList(); jList1.setModel(jList1Model); //jList1Model.addElement((Vector)dataSetEmailsVector.get(1)); jScrollPane2 = new JScrollPane(jList1); //jScrollPane2.setViewportView(jList1); } return jScrollPane2; } private JTextField getJTextFieldDataSetName() { if(jTextFieldDataSetName == null) { jTextFieldDataSetName = new JTextField(); jTextFieldDataSetName.setText("DataSetName"); } return jTextFieldDataSetName; } private JLabel getJLabel13() { if(jLabel13 == null) { jLabel13 = new JLabel(); jLabel13.setText("DataSetName"); } return jLabel13; } private JLabel getJLabel14() { if(jLabel14 == null) { jLabel14 = new JLabel(); jLabel14.setText("List of Emails to Notify on a Completed Run:"); } return jLabel14; } private JTextField getJTextField2() { if(jTextDataSetFileName == null) { jTextDataSetFileName = new JTextField(); jTextDataSetFileName.setText("File Location"); jTextDataSetFileName.setEditable(false); } return jTextDataSetFileName; } private JButton getJButtonFinish() { if(jButtonFinish == null) { jButtonFinish = new JButton(); jButtonFinish.setText("Finish and Run"); jButtonFinish.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(file != null){ if(newDataSetEmails.size() > 0){ dataSetNamesVector.add(jTextFieldDataSetName.getText()); dataSetEmailsVector.add(newDataSetEmails); // Add dataset to experiment SwingWorker worker = new SwingWorker() { @Override public SingleDataExperiment doInBackground() { SingleDataExperiment e = Main.getExperiment(); try { e.runSingle("","./results/" + e.getDataset() + ".csv"); } catch (IOException e1) { JOptionPane.showMessageDialog(new JFrame(), "File " + jTextDataSetFileName.getText() + " not found."); } catch (UnsupportedFileTypeException e1) { JOptionPane.showMessageDialog(new JFrame(), "Specified filetype not supported."); } return e; } @Override public void done() { try { get(); GoogleMail emailer = new GoogleMail(); String[] s = new String[((Vector) dataSetEmailsVector.get(get().getID() + 1)).size()]; ((Vector) dataSetEmailsVector.get(get().getID() + 1)).copyInto((Object[]) s); emailer.sendSSLMessage(s, "Dataset " + get().getDataset() + " has finished executing" , "Dataset " + get().getDataset() + " has finished executing. Return to COMBA to view the results.", "COMBA"); } catch (InterruptedException ex) { ex.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } catch (MessagingException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }; Main.newExperiment(new SingleDataExperiment(Main.experiments.size(), jTextDataSetFileName.getText(), jTextFieldDataSetName.getText())); Main.setCurrentExperiment(jTextFieldDataSetName.getText()); Main.startExperiment(worker); newDataSetEmails = new Vector(); dataSetRecommendationsVector.add(new Vector()); jTextFieldDataSetName.setText("DataSetName"); jTextDataSetFileName.setText("File Location"); jList1Model.clear(); files.add(file); file = null; jLabel16.setText(" "); jTextField3.setText("New Email"); jTabbedPan.setSelectedIndex(2); jComboBoxDataSets.setSelectedIndex(dataSetNamesVector.size() - 1); DoNothingSometimeMaybe(); } else { jLabel16.setText("No Emails Entered"); } } else { jLabel16.setText("Please Enter a File"); } } }); } return jButtonFinish; } private JTextField getJTextField4() { if(jTextField4 == null) { jTextField4 = new JTextField(); } return jTextField4; } private JLabel getJLabel15() { if(jLabel15 == null) { jLabel15 = new JLabel(); jLabel15.setText("Desired User Name:"); } return jLabel15; } private JButton getJButton5() { if(jButton5 == null) { jButton5 = new JButton(); jButton5.setText("OpenFile"); jButton5.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { FileFilter filter1 = new ExtensionFileFilter("CSV", "CSV"); fc.setFileFilter(filter1); int returnVal = fc.showOpenDialog(MainGUI.this); if (returnVal == JFileChooser.APPROVE_OPTION) { file = fc.getSelectedFile(); jTextDataSetFileName.setText(fc.getCurrentDirectory() + "/" + file.getName()); jTextFieldDataSetName.setText(file.getName()); } else { jTextDataSetFileName.setText("Cannot Open File"); } } }); } return jButton5; } private JLabel getJLabel16() { if(jLabel16 == null) { jLabel16 = new JLabel(); jLabel16.setText(" "); jLabel16.setForeground(new java.awt.Color(255,0,0)); } return jLabel16; } private JPanel getJPanel1(boolean visible) { if(jPanel1 == null) { jPanel1 = new JPanel(); GridBagLayout jPanel1Layout = new GridBagLayout(); jPanel1Layout.rowWeights = new double[] {0.1, 0.0, 0.0, 0.0, 0.0, 0.0}; jPanel1Layout.rowHeights = new int[] {20, 31, 35, 37, 37, 41}; jPanel1Layout.columnWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.1}; jPanel1Layout.columnWidths = new int[] {118, 126, 71, 60, 66, 20}; jPanel1.setLayout(jPanel1Layout); jPanel1.setVisible(visible); jPanel1.add(getJButtonRun1(), new GridBagConstraints(5, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJButtonRun2(), new GridBagConstraints(5, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJButtonRun3(), new GridBagConstraints(5, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJButtonRun4(), new GridBagConstraints(5, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJButtonRun5(), new GridBagConstraints(5, 5, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabel11(), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabel17(), new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabel18(), new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabel19(), new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabel20(), new GridBagConstraints(4, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJSeparator2(), new GridBagConstraints(0, 1, 5, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJSeparator3(), new GridBagConstraints(0, 2, 5, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJSeparator4(), new GridBagConstraints(0, 3, 5, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJSeparator5(), new GridBagConstraints(0, 4, 5, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJSeparator6(), new GridBagConstraints(0, 5, 5, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJSeparator7(), new GridBagConstraints(0, 5, 5, 1, 0.0, 0.0, GridBagConstraints.SOUTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet11(), new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet12(), new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet13(), new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet14(), new GridBagConstraints(4, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet21(), new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet22(), new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet23(), new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet24(), new GridBagConstraints(4, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet10(), new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet20(), new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet00(), new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet01(), new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet02(), new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet03(), new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet04(), new GridBagConstraints(4, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet30(), new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet31(), new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet32(), new GridBagConstraints(2, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet33(), new GridBagConstraints(3, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet34(), new GridBagConstraints(4, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet40(), new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet41(), new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet42(), new GridBagConstraints(2, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet43(), new GridBagConstraints(3, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel1.add(getJLabelDataSet44(), new GridBagConstraints(4, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); } return jPanel1; } private JButton getJButtonRun1() { if(jButtonRun1 == null) { jButtonRun1 = new JButton(); jButtonRun1.setText("Run"); } return jButtonRun1; } private JButton getJButtonRun2() { if(jButtonRun2 == null) { jButtonRun2 = new JButton(); jButtonRun2.setText("Run"); } return jButtonRun2; } private JButton getJButtonRun3() { if(jButtonRun3 == null) { jButtonRun3 = new JButton(); jButtonRun3.setText("Run"); } return jButtonRun3; } private JButton getJButtonRun4() { if(jButtonRun4 == null) { jButtonRun4 = new JButton(); jButtonRun4.setText("Run"); } return jButtonRun4; } private JButton getJButtonRun5() { if(jButtonRun5 == null) { jButtonRun5 = new JButton(); jButtonRun5.setText("Run"); } return jButtonRun5; } private JLabel getJLabel11() { if(jLabel11 == null) { jLabel11 = new JLabel(); jLabel11.setText("Preprocessor"); } return jLabel11; } private JLabel getJLabel17() { if(jLabel17 == null) { jLabel17 = new JLabel(); jLabel17.setText("Learner"); } return jLabel17; } private JLabel getJLabel18() { if(jLabel18 == null) { jLabel18 = new JLabel(); jLabel18.setText("MRE"); } return jLabel18; } private JLabel getJLabel19() { if(jLabel19 == null) { jLabel19 = new JLabel(); jLabel19.setText("MDMRE"); } return jLabel19; } private JLabel getJLabel20() { if(jLabel20 == null) { jLabel20 = new JLabel(); jLabel20.setText("Pred(25)"); } return jLabel20; } private JSeparator getJSeparator2() { if(jSeparator2 == null) { jSeparator2 = new JSeparator(); } return jSeparator2; } private JSeparator getJSeparator3() { if(jSeparator3 == null) { jSeparator3 = new JSeparator(); } return jSeparator3; } private JSeparator getJSeparator4() { if(jSeparator4 == null) { jSeparator4 = new JSeparator(); } return jSeparator4; } private JSeparator getJSeparator5() { if(jSeparator5 == null) { jSeparator5 = new JSeparator(); } return jSeparator5; } private JSeparator getJSeparator6() { if(jSeparator6 == null) { jSeparator6 = new JSeparator(); } return jSeparator6; } private JSeparator getJSeparator7() { if(jSeparator7 == null) { jSeparator7 = new JSeparator(); } return jSeparator7; } private JLabel getJLabelDataSet11() { if(jLabelDataSet11 == null) { jLabelDataSet11 = new JLabel(); jLabelDataSet11.setText(" "); } return jLabelDataSet11; } private JLabel getJLabelDataSet12() { if(jLabelDataSet12 == null) { jLabelDataSet12 = new JLabel(); jLabelDataSet12.setText(" "); } return jLabelDataSet12; } private JLabel getJLabelDataSet13() { if(jLabelDataSet13 == null) { jLabelDataSet13 = new JLabel(); jLabelDataSet13.setText(" "); } return jLabelDataSet13; } private JLabel getJLabelDataSet14() { if(jLabelDataSet14 == null) { jLabelDataSet14 = new JLabel(); jLabelDataSet14.setText(" "); } return jLabelDataSet14; } private JPanel getJPanel2(boolean visible) { if(jPanel2 == null) { jPanel2 = new JPanel(); GridBagLayout jPanel2Layout = new GridBagLayout(); jPanel2Layout.rowWeights = new double[] {0.1, 0.1, 0.1}; jPanel2Layout.rowHeights = new int[] {7, 7, 7}; jPanel2Layout.columnWeights = new double[] {0.1, 0.1, 0.1, 0.1}; jPanel2Layout.columnWidths = new int[] {7, 7, 7, 7}; jPanel2.setLayout(jPanel2Layout); jPanel2.setVisible(visible); jPanel2.add(getJProgressBar1(), new GridBagConstraints(1, 1, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel2.add(getJLabel21(), new GridBagConstraints(1, 0, 2, 1, 0.0, 0.0, GridBagConstraints.SOUTH, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); } return jPanel2; } private JProgressBar getJProgressBar1() { if(jProgressBar1 == null) { jProgressBar1 = new JProgressBar(); jProgressBar1.setValue(0); } return jProgressBar1; } private JLabel getJLabel21() { if(jLabel21 == null) { jLabel21 = new JLabel(); jLabel21.setText("Currently Running:"); } return jLabel21; } private JLabel getJLabelDataSet21() { if(jLabelDataSet21 == null) { jLabelDataSet21 = new JLabel(); jLabelDataSet21.setText(" "); } return jLabelDataSet21; } private JLabel getJLabelDataSet22() { if(jLabelDataSet22 == null) { jLabelDataSet22 = new JLabel(); jLabelDataSet22.setText(" "); } return jLabelDataSet22; } private JLabel getJLabelDataSet23() { if(jLabelDataSet23 == null) { jLabelDataSet23 = new JLabel(); jLabelDataSet23.setText(" "); } return jLabelDataSet23; } private JLabel getJLabelDataSet24() { if(jLabelDataSet24 == null) { jLabelDataSet24 = new JLabel(); jLabelDataSet24.setText(" "); } return jLabelDataSet24; } private JLabel getJLabelDataSet10() { if(jLabelDataSet10 == null) { jLabelDataSet10 = new JLabel(); jLabelDataSet10.setText(" "); } return jLabelDataSet10; } private JLabel getJLabelDataSet20() { if(jLabelDataSet20 == null) { jLabelDataSet20 = new JLabel(); jLabelDataSet20.setText(" "); } return jLabelDataSet20; } private JLabel getJLabelDataSet00() { if(jLabelDataSet00 == null) { jLabelDataSet00 = new JLabel(); jLabelDataSet00.setText(" "); } return jLabelDataSet00; } private JLabel getJLabelDataSet01() { if(jLabelDataSet01 == null) { jLabelDataSet01 = new JLabel(); jLabelDataSet01.setText(" "); } return jLabelDataSet01; } private JLabel getJLabelDataSet02() { if(jLabelDataSet02 == null) { jLabelDataSet02 = new JLabel(); jLabelDataSet02.setText(" "); } return jLabelDataSet02; } private JLabel getJLabelDataSet03() { if(jLabelDataSet03 == null) { jLabelDataSet03 = new JLabel(); jLabelDataSet03.setText(" "); } return jLabelDataSet03; } private JLabel getJLabelDataSet04() { if(jLabelDataSet04 == null) { jLabelDataSet04 = new JLabel(); jLabelDataSet04.setText(" "); } return jLabelDataSet04; } private JLabel getJLabelDataSet30() { if(jLabelDataSet30 == null) { jLabelDataSet30 = new JLabel(); jLabelDataSet30.setText(" "); } return jLabelDataSet30; } private JLabel getJLabelDataSet31() { if(jLabelDataSet31 == null) { jLabelDataSet31 = new JLabel(); jLabelDataSet31.setText(" "); } return jLabelDataSet31; } private JLabel getJLabelDataSet32() { if(jLabelDataSet32 == null) { jLabelDataSet32 = new JLabel(); jLabelDataSet32.setText(" "); } return jLabelDataSet32; } private JLabel getJLabelDataSet33() { if(jLabelDataSet33 == null) { jLabelDataSet33 = new JLabel(); jLabelDataSet33.setText(" "); } return jLabelDataSet33; } private JLabel getJLabelDataSet34() { if(jLabelDataSet34 == null) { jLabelDataSet34 = new JLabel(); jLabelDataSet34.setText(" "); } return jLabelDataSet34; } private JLabel getJLabelDataSet40() { if(jLabelDataSet40 == null) { jLabelDataSet40 = new JLabel(); jLabelDataSet40.setText(" "); } return jLabelDataSet40; } private JLabel getJLabelDataSet41() { if(jLabelDataSet41 == null) { jLabelDataSet41 = new JLabel(); jLabelDataSet41.setText(" "); } return jLabelDataSet41; } private JLabel getJLabelDataSet42() { if(jLabelDataSet42 == null) { jLabelDataSet42 = new JLabel(); jLabelDataSet42.setText(" "); } return jLabelDataSet42; } private JLabel getJLabelDataSet43() { if(jLabelDataSet43 == null) { jLabelDataSet43 = new JLabel(); jLabelDataSet43.setText(" "); } return jLabelDataSet43; } private JLabel getJLabelDataSet44() { if(jLabelDataSet44 == null) { jLabelDataSet44 = new JLabel(); jLabelDataSet44.setText(" "); } return jLabelDataSet44; } private JPanel getJPanel3(boolean visible) { if(jPanel3 == null) { jPanel3 = new JPanel(); GridBagLayout jPanel3Layout = new GridBagLayout(); jPanel3Layout.rowWeights = new double[] {0.0, 0.0, 0.0, 0.1, 0.1, 0.1}; jPanel3Layout.rowHeights = new int[] {21, 29, 28, 7, 20, 20}; jPanel3Layout.columnWeights = new double[] {0.0, 0.1}; jPanel3Layout.columnWidths = new int[] {193, 7}; jPanel3.setLayout(jPanel3Layout); jPanel3.setVisible(visible); jPanel3.add(getJButton6(), new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.SOUTHEAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel3.add(getJButton9(), new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel3.add(getJTextField5(), new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanel3.add(getJScrollPane1(), new GridBagConstraints(1, 0, 1, 6, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); jPanel3.add(getJLabel22(), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel3.add(getJButton10(), new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel3.add(getJLabel23(), new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); } return jPanel3; } private JButton getJButton6() { if(jButton6 == null) { jButton6 = new JButton(); jButton6.setText("Add New"); jButton6.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String[] blah; blah = jTextField5.getText().split("@"); if(blah.length > 1) { blah = blah[1].split("\\.");} if(blah.length > 1){ if(jList2Model.contains(jTextField5.getText())){ jLabel23.setText("Email already exists"); }else{ ((Vector)dataSetEmailsVector.get(jComboBoxDataSets.getSelectedIndex())).add(jTextField5.getText()); jList2Model.addElement(jTextField5.getText()); jLabel23.setText(" "); } } else { jLabel23.setText("Incorrect Email"); } } }); } return jButton6; } private JButton getJButton9() { if(jButton9 == null) { jButton9 = new JButton(); jButton9.setText("Remove Selected"); jButton9.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(jList2Model.size() > 0){ ((Vector)dataSetEmailsVector.get(jComboBoxDataSets.getSelectedIndex())).remove(jList2.getSelectedIndex()); jList2Model.removeElementAt(jList2.getSelectedIndex()); } } }); } return jButton9; } private JTextField getJTextField5() { if(jTextField5 == null) { jTextField5 = new JTextField(); jTextField5.setText("New Email"); } return jTextField5; } private JScrollPane getJScrollPane1() { if(jScrollPane1 == null) { jList2 = new JList(); jList2.setModel(jList2Model); jScrollPane1 = new JScrollPane(jList2); } return jScrollPane1; } private JLabel getJLabel22() { if(jLabel22 == null) { jLabel22 = new JLabel(); jLabel22.setText("Email Notifications:"); } return jLabel22; } private JButton getJButton10() { if(jButton10 == null) { jButton10 = new JButton(); jButton10.setText("Remove Data Set"); jButton10.setForeground(new java.awt.Color(255,0,0)); jButton10.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { //getContentPane().add(testing); } }); } return jButton10; } private JLabel getJLabel23() { if(jLabel23 == null) { jLabel23 = new JLabel(); jLabel23.setText(" "); jLabel23.setForeground(new java.awt.Color(255,0,0)); } return jLabel23; } private JLabel getJLabel24() { if(jLabel24 == null) { jLabel24 = new JLabel(); jLabel24.setText(" "); jLabel24.setForeground(new java.awt.Color(255,0,0)); } return jLabel24; } private JLabel getJLabel25() { if(jLabel25 == null) { jLabel25 = new JLabel(); jLabel25.setText(" "); jLabel25.setForeground(new java.awt.Color(255,0,0)); } return jLabel25; } private JLabel getJLabel26() { if(jLabel26 == null) { jLabel26 = new JLabel(); jLabel26.setText(" "); jLabel26.setForeground(new java.awt.Color(255,0,0)); } return jLabel26; } private JLabel getJLabel3() { if(jLabel3 == null) { jLabel3 = new JLabel(); jLabel3.setIcon(new ImageIcon(getClass().getClassLoader().getResource("COOMBA_logo.png"))); } return jLabel3; } private JLabel getJLabel10() { if(jLabel10 == null) { jLabel10 = new JLabel(); jLabel10.setIcon(new ImageIcon(getClass().getClassLoader().getResource("COOMBA_logo.png"))); } return jLabel10; } private JLabel getJLabel27() { if(jLabel27 == null) { jLabel27 = new JLabel(); BorderLayout jLabel27Layout = new BorderLayout(); jLabel27.setLayout(jLabel27Layout); jLabel27.setIcon(new ImageIcon(getClass().getClassLoader().getResource("COOMBA_logo.png"))); jLabel27.setBounds(240, 0, 250, 250); } return jLabel27; } private JRadioButton getJRadioButton1() { if(jRadioButton1 == null) { jRadioButton1 = new JRadioButton(); jRadioButton1.setSelected(true); jRadioButton1.setText("Business"); jRadioButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(jRadioButton1.isSelected()){ jRadioButton2.setSelected(false); } } }); } return jRadioButton1; } private JRadioButton getJRadioButton2() { if(jRadioButton2 == null) { jRadioButton2 = new JRadioButton(); jRadioButton2.setText("Developer"); jRadioButton2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(jRadioButton2.isSelected()){ jRadioButton1.setSelected(false); } } }); } return jRadioButton2; } private JLabel getJLabel29() { if(jLabel29 == null) { jLabel29 = new JLabel(); jLabel29.setText("What version are you using:"); } return jLabel29; } private JTabbedPane getJTabbedPaneDeveloper(boolean visible) { if(jTabbedPaneDeveloper == null) { jTabbedPaneDeveloper = new JTabbedPane(); jTabbedPaneDeveloper.setVisible(visible); jTabbedPaneDeveloper.setTabPlacement(JTabbedPane.LEFT); jTabbedPaneDeveloper.addTab("Add New", null, getJPanel5(), null); jTabbedPaneDeveloper.addTab("My Learners", null, getJPanel6(), null); jTabbedPaneDeveloper.addTab("My Preprocessors", null, getJPanel7(), null); jTabbedPaneDeveloper.addTab("Welcome", null, getJPanel4(), null); } return jTabbedPaneDeveloper; } private JPanel getJPanel4() { if(jPanel4 == null) { jPanel4 = new JPanel(); GridBagLayout jPanel4Layout = new GridBagLayout(); jPanel4Layout.rowWeights = new double[] {0.1, 0.1, 0.1, 0.1}; jPanel4Layout.rowHeights = new int[] {7, 7, 7, 7}; jPanel4Layout.columnWeights = new double[] {0.0, 0.0, 0.0, 0.1}; jPanel4Layout.columnWidths = new int[] {106, 130, 125, 7}; jPanel4.setLayout(jPanel4Layout); jPanel4.add(getJButton19(), new GridBagConstraints(1, 3, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel4.add(getJButton20(), new GridBagConstraints(1, 2, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel4.add(getJLabel34(), new GridBagConstraints(0, 0, 4, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); } return jPanel4; } private JPanel getJPanel5() { if(jPanel5 == null) { jPanel5 = new JPanel(); GridBagLayout jPanel5Layout = new GridBagLayout(); jPanel5Layout.rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1}; jPanel5Layout.rowHeights = new int[] {18, 20, 23, 22, 26, 138, 24, 24, 21, 34, 20}; jPanel5Layout.columnWeights = new double[] {0.0, 0.0, 0.0, 0.1}; jPanel5Layout.columnWidths = new int[] {73, 169, 171, 7}; jPanel5.setLayout(jPanel5Layout); jPanel5.add(getJButton12(), new GridBagConstraints(1, 0, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel5.add(getJTextField6(), new GridBagConstraints(1, 1, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanel5.add(getJLabel30(), new GridBagConstraints(1, 2, 2, 1, 0.0, 0.0, GridBagConstraints.SOUTH, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel5.add(getJTextField7(), new GridBagConstraints(1, 3, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanel5.add(getJLabel31(), new GridBagConstraints(1, 4, 2, 1, 0.0, 0.0, GridBagConstraints.SOUTH, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel5.add(getJScrollPane3(), new GridBagConstraints(1, 5, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); jPanel5.add(getJButton13(), new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanel5.add(getJButton14(), new GridBagConstraints(2, 6, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanel5.add(getJTextField8(), new GridBagConstraints(1, 7, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); jPanel5.add(getJButton15(), new GridBagConstraints(1, 10, 2, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel5.add(getJRadioButton3(), new GridBagConstraints(1, 8, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel5.add(getJRadioButton4(), new GridBagConstraints(2, 8, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel5.add(getJLabel32(), new GridBagConstraints(1, 9, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); } return jPanel5; } private JPanel getJPanel6() { if(jPanel6 == null) { jPanel6 = new JPanel(); GridBagLayout jPanel6Layout = new GridBagLayout(); jPanel6Layout.rowWeights = new double[] {0.0, 0.0, 0.1}; jPanel6Layout.rowHeights = new int[] {42, 350, 20}; jPanel6Layout.columnWeights = new double[] {0.0, 0.0, 0.1}; jPanel6Layout.columnWidths = new int[] {16, 443, 20}; jPanel6.setLayout(jPanel6Layout); jPanel6.add(getJTabbedPaneLearners(), new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); jPanel6.add(getJComboBox1(), new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); } return jPanel6; } private JPanel getJPanel7() { if(jPanel7 == null) { jPanel7 = new JPanel(); GridBagLayout jPanel7Layout = new GridBagLayout(); jPanel7Layout.rowWeights = new double[] {0.1, 0.1, 0.1, 0.1}; jPanel7Layout.rowHeights = new int[] {7, 7, 7, 7}; jPanel7Layout.columnWeights = new double[] {0.1, 0.1, 0.1, 0.1}; jPanel7Layout.columnWidths = new int[] {7, 7, 7, 7}; jPanel7.setLayout(jPanel7Layout); } return jPanel7; } private JButton getJButton12() { if(jButton12 == null) { jButton12 = new JButton(); jButton12.setText("Open File"); } return jButton12; } private JTextField getJTextField6() { if(jTextField6 == null) { jTextField6 = new JTextField(); jTextField6.setText("File Location"); jTextField6.setEditable(false); } return jTextField6; } private JLabel getJLabel30() { if(jLabel30 == null) { jLabel30 = new JLabel(); jLabel30.setText("File Name"); } return jLabel30; } private JTextField getJTextField7() { if(jTextField7 == null) { jTextField7 = new JTextField(); jTextField7.setText("File Name"); } return jTextField7; } private JLabel getJLabel31() { if(jLabel31 == null) { jLabel31 = new JLabel(); jLabel31.setText("List of Emails to Notify on a Completed Run:"); } return jLabel31; } private JScrollPane getJScrollPane3() { if(jScrollPane3 == null) { jScrollPane3 = new JScrollPane(); jScrollPane3.setViewportView(getJList3()); } return jScrollPane3; } private JList getJList3() { if(jList3 == null) { ListModel jList3Model = new DefaultComboBoxModel( new String[] { }); jList3 = new JList(); jList3.setModel(jList3Model); } return jList3; } private JButton getJButton13() { if(jButton13 == null) { jButton13 = new JButton(); jButton13.setText("Remove Selected"); } return jButton13; } private JButton getJButton14() { if(jButton14 == null) { jButton14 = new JButton(); jButton14.setText("Add New"); } return jButton14; } private JTextField getJTextField8() { if(jTextField8 == null) { jTextField8 = new JTextField(); jTextField8.setText("New Email"); } return jTextField8; } private JButton getJButton15() { if(jButton15 == null) { jButton15 = new JButton(); jButton15.setText("Finish and Continue"); } return jButton15; } private JRadioButton getJRadioButton3() { if(jRadioButton3 == null) { jRadioButton3 = new JRadioButton(); jRadioButton3.setText("Learner"); jRadioButton3.setSelected(true); } return jRadioButton3; } private JRadioButton getJRadioButton4() { if(jRadioButton4 == null) { jRadioButton4 = new JRadioButton(); jRadioButton4.setText("Preprocessor"); } return jRadioButton4; } private JTabbedPane getJTabbedPaneLearners() { if(jTabbedPaneLearners == null) { jTabbedPaneLearners = new JTabbedPane(); jTabbedPaneLearners.addTab("Preprocessors", null, getJPanel8(), null); jTabbedPaneLearners.addTab("Data Sets", null, getJPanel10(), null); jTabbedPaneLearners.addTab("Learner Settings", null, getJPanel9(), null); jTabbedPaneLearners.addTab("Run", null, getJPanel11(), null); } return jTabbedPaneLearners; } private JPanel getJPanel8() { if(jPanel8 == null) { jPanel8 = new JPanel(); GridBagLayout jPanel8Layout = new GridBagLayout(); jPanel8.setPreferredSize(new java.awt.Dimension(470, 315)); jPanel8Layout.rowWeights = new double[] {0.0, 0.0, 0.1}; jPanel8Layout.rowHeights = new int[] {24, 249, 7}; jPanel8Layout.columnWeights = new double[] {0.0, 0.0, 0.1}; jPanel8Layout.columnWidths = new int[] {135, 161, 7}; jPanel8.setLayout(jPanel8Layout); jPanel8.setBackground(new java.awt.Color(192,192,192)); jPanel8.add(getJLabel33(), new GridBagConstraints(0, 0, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel8.add(getJScrollPane4(), new GridBagConstraints(0, 1, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); jPanel8.add(getJButton16(), new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel8.add(getJButton17(), new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel8.add(getJButton18(), new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); } return jPanel8; } private JComboBox getJComboBox1() { if(jComboBox1 == null) { ComboBoxModel jComboBox1Model = new DefaultComboBoxModel(myLearnerNames); jComboBox1 = new JComboBox(); jComboBox1.setModel(jComboBox1Model); } return jComboBox1; } private JLabel getJLabel32() { if(jLabel32 == null) { jLabel32 = new JLabel(); jLabel32.setText("jLabel32"); jLabel32.setForeground(new java.awt.Color(255,0,0)); } return jLabel32; } private JPanel getJPanel9() { if(jPanel9 == null) { jPanel9 = new JPanel(); } return jPanel9; } private JPanel getJPanel10() { if(jPanel10 == null) { jPanel10 = new JPanel(); } return jPanel10; } private JPanel getJPanel11() { if(jPanel11 == null) { jPanel11 = new JPanel(); } return jPanel11; } private JLabel getJLabel33() { if(jLabel33 == null) { jLabel33 = new JLabel(); jLabel33.setText("Select Preprocessors you wish to use:"); } return jLabel33; } private JScrollPane getJScrollPane4() { if(jScrollPane4 == null) { jScrollPane4 = new JScrollPane(); jScrollPane4.setBackground(new java.awt.Color(255,255,255)); jScrollPane4.setViewportView(getJList4()); } return jScrollPane4; } private JList getJList4() { if(jList4 == null) { ListModel jList4Model = new DefaultComboBoxModel(allPreprocessorNames); jList4 = new JList(); jList4.setModel(jList4Model); jList4.setPreferredSize(new java.awt.Dimension(121, 246)); } return jList4; } private JButton getJButton16() { if(jButton16 == null) { jButton16 = new JButton(); jButton16.setText("Select All"); } return jButton16; } private JButton getJButton17() { if(jButton17 == null) { jButton17 = new JButton(); jButton17.setText("DE-select All"); } return jButton17; } private JButton getJButton18() { if(jButton18 == null) { jButton18 = new JButton(); jButton18.setText("Preprocessor Settings"); } return jButton18; } private JButton getJButton19() { if(jButton19 == null) { jButton19 = new JButton(); jButton19.setText("Switch to Business Mode"); jButton19.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { jTabbedPan.setVisible(true); jTabbedPaneDeveloper.setVisible(false); } }); } return jButton19; } private JButton getJButton20() { if(jButton20 == null) { jButton20 = new JButton(); jButton20.setText("Log Out"); jButton20.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { currentUser = ""; jPanelLogIn.setVisible(true); jTabbedPan.setVisible(false); jTabbedPaneDeveloper.setVisible(false); } }); } return jButton20; } private JLabel getJLabel34() { if(jLabel34 == null) { jLabel34 = new JLabel(); jLabel34.setIcon(new ImageIcon(getClass().getClassLoader().getResource("COOMBA_logo.png"))); } return jLabel34; } private JPanel getResultsViewer() { if(ResultsViewer == null) { ResultsViewer = new JPanel(); ResultsViewer.setLayout(null); ResultsViewer.add(getResultsOpener()); ResultsViewer.add(getJTable1()); } return ResultsViewer; } private JButton getJButton11() { if(jButton11 == null) { jButton11 = new JButton(); BoxLayout jButton11Layout = new BoxLayout(jButton11, javax.swing.BoxLayout.X_AXIS); jButton11.setLayout(jButton11Layout); jButton11.setText("OpenFile"); jButton11.setBounds(15, 25, 84, 25); jButton11.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { FileFilter filter1 = new ExtensionFileFilter("CSV", "CSV"); fc.setFileFilter(filter1); int returnVal = fc.showOpenDialog(MainGUI.this); if (returnVal == JFileChooser.APPROVE_OPTION) { file = fc.getSelectedFile(); FileLocation2.setText(fc.getCurrentDirectory() + "/" + file.getName()); // Modify the tables display File f = new File(FileLocation2.getText()); Scanner s; try { s = new Scanner(f); String[] s0, s1, s2, s3; s0 = new String[5]; s1 = new String[5]; s2 = new String[5]; s3 = new String[5]; String[] temp; String temp2; for (int i = 0; i < 5; i++) { if (s.hasNext()) { temp2 = s.next(); temp = temp2.split(","); if (temp.length >= 4) { s0[i] = temp[0]; s1[i] = temp[1]; s2[i] = temp[2]; s3[i] = temp[3]; } else { s0[i] = "N/A"; s1[i] ="N/A"; s2[i] = "N/A"; s3[i] = "N/A"; } } else { s0[i] = "N/A"; s1[i] ="N/A"; s2[i] = "N/A"; s3[i] = "N/A"; } } s.close(); TableModel newModel = new DefaultTableModel( new String[][] {{ "Preprocessor", "Learner","Percent Losses","MMRE"}, { s0[0],s1[0],s2[0],s3[0]},{ s0[1],s1[1],s2[1],s3[1]},{s0[2],s1[2],s2[2],s3[2]},{ s0[3],s1[3],s2[3],s3[3]},{ s0[4],s1[4],s2[4],s3[4]} }, new String[] { "Preprocessor", "Learner","Percent Losses","MMRE"}); ResultsTable.setModel(newModel); resultsModel = newModel; } catch (FileNotFoundException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } else { FileLocation2.setText("Cannot Open File"); } } }); } return jButton11; } private JTextField getJTextField2x() { if(FileLocation2 == null) { FileLocation2 = new JTextField(); FileLocation2.setText("File Location"); FileLocation2.setEditable(false); FileLocation2.setBounds(105, 25, 500, 25); FileLocation2.add(getResultsView()); } return FileLocation2; } private JTable getResultsView() { if(ResultsView == null) { TableModel ResultsViewModel = new DefaultTableModel( new String[][] { { "One", "Two" }, { "Three", "Four" } }, new String[] { "Column 1", "Column 2" }); ResultsView = new JTable(); ResultsView.setModel(ResultsViewModel); ResultsView.setPreferredSize(new java.awt.Dimension(58, 40)); } return ResultsView; } private JTable getJTable1() { if(ResultsTable == null) { ResultsTable = new JTable(); ResultsTable.setModel(resultsModel); ResultsTable.setRowSelectionAllowed(false); ResultsTable.setBounds(40, 70, 600, 95); } return ResultsTable; } private JPanel getResultsOpener() { if(ResultsOpener == null) { ResultsOpener = new JPanel(); ResultsOpener.setLayout(null); ResultsOpener.setBounds(0, 0, 686, 70); ResultsOpener.add(getJButton11()); ResultsOpener.add(getJTextField2x()); } return ResultsOpener; } private JPanel getEstimator() { if(Estimator == null) { Estimator = new JPanel(); Estimator.setLayout(null); Estimator.add(getJButton22()); Estimator.add(getJTextField2xx()); Estimator.add(getLearnerSelection()); Estimator.add(getPreprocessorSelection()); Estimator.add(getTestData()); Estimator.add(getPerformEstimate()); Estimator.add(getEstimatedEffort()); } return Estimator; } private JButton getJButton22() { if(DatasetSelector == null) { DatasetSelector = new JButton(); FlowLayout DatasetSelectorLayout = new FlowLayout(); DatasetSelector.setText("Select Dataset"); DatasetSelector.setLayout(DatasetSelectorLayout); DatasetSelector.setMargin(new java.awt.Insets(2, 2, 2, 2)); DatasetSelector.setBounds(20, 5, 150, 50); DatasetSelector.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { FileFilter filter1 = new ExtensionFileFilter("CSV", "CSV"); fc.setFileFilter(filter1); int returnVal = fc.showOpenDialog(MainGUI.this); if (returnVal == JFileChooser.APPROVE_OPTION) { file = fc.getSelectedFile(); DatasetSelection.setText(fc.getCurrentDirectory() + "/" + file.getName()); } else { FileLocation2.setText("Cannot Open File"); } } }); } return DatasetSelector; } private JTextField getJTextField2xx() { if(DatasetSelection == null) { DatasetSelection = new JTextField(); DatasetSelection.setText("File Location"); DatasetSelection.setEditable(false); DatasetSelection.setBounds(200, 5, 450, 50); DatasetSelection.add(getJTable1x()); } return DatasetSelection; } private JTable getJTable1x() { if(jTable1 == null) { TableModel jTable1Model = new DefaultTableModel( new String[][] { { "One", "Two" }, { "Three", "Four" } }, new String[] { "Column 1", "Column 2" }); jTable1 = new JTable(); } return jTable1; } private JComboBox getLearnerSelection() { if(LearnerSelection == null) { ComboBoxModel LearnerSelectionModel = new DefaultComboBoxModel(Main.getLearners()); LearnerSelection = new JComboBox(); LearnerSelection.setModel(LearnerSelectionModel); LearnerSelection.setBounds(200, 100, 150, 24); } return LearnerSelection; } private JComboBox getPreprocessorSelection() { if(PreprocessorSelection == null) { ComboBoxModel PreprocessorSelectionModel = new DefaultComboBoxModel(Main.getPreprocessors()); PreprocessorSelection = new JComboBox(); PreprocessorSelection.setModel(PreprocessorSelectionModel); PreprocessorSelection.setBounds(20, 100, 150, 24); } return PreprocessorSelection; } private JTextField getTestData() { if(TestData == null) { TestData = new JTextField(); TestData.setText("Enter unkown project data here"); TestData.setBounds(20, 150, 400, 19); } return TestData; } private JButton getPerformEstimate() { if(PerformEstimate == null) { PerformEstimate = new JButton(); PerformEstimate.setText("Estimate Effort"); PerformEstimate.setBounds(450, 90, 160, 80); PerformEstimate.setFont(new java.awt.Font("Dialog",1,16)); PerformEstimate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { EstimatedEffort.setText("Estimated Effort: " + Main.runUnitTest(Main.findLearner((String) LearnerSelection.getSelectedItem()), Main.findPreprocessor((String) PreprocessorSelection.getSelectedItem()), TestData.getText(), DatasetSelection.getText())); }}); } return PerformEstimate; } private JTextPane getEstimatedEffort() { if(EstimatedEffort == null) { EstimatedEffort = new JTextPane(); EstimatedEffort.setText("Estimated Effort: N/A"); EstimatedEffort.setBounds(20, 200, 500, 40); } return EstimatedEffort; } private JLabel getWelcomeMessage() { if(WelcomeMessage == null) { WelcomeMessage = new JLabel(); WelcomeMessage.setText("Welcome to COMBA! Click the tabs on the left to begin."); WelcomeMessage.setBounds(90, 250, 500, 15); WelcomeMessage.setFont(new java.awt.Font("Dialog",1,14)); } return WelcomeMessage; } } class ExtensionFileFilter extends FileFilter { String description; String extensions[]; public ExtensionFileFilter(String description, String extension) { this(description, new String[] { extension }); } public ExtensionFileFilter(String description, String extensions[]) { if (description == null) { this.description = extensions[0]; } else { this.description = description; } this.extensions = (String[]) extensions.clone(); toLower(this.extensions); } private void toLower(String array[]) { for (int i = 0, n = array.length; i < n; i++) { array[i] = array[i].toLowerCase(); } } public String getDescription() { return description; } public boolean accept(File file) { if (file.isDirectory()) { return true; } else { String path = file.getAbsolutePath().toLowerCase(); for (int i = 0, n = extensions.length; i < n; i++) { String extension = extensions[i]; if ((path.endsWith(extension) && (path.charAt(path.length() - extension.length() - 1)) == '.')) { return true; } } } return false; } }