public void actionPerformed(final ActionEvent e) {
   // browse alignmentfile button
   if (e.getSource() == _alignment_button) {
     showChooseAlignmentFile();
   }
   // alignmenttype dna radio button
   else if (e.getSource() == _dna_radio) {
     showDnaTypeOptions();
     hideAaTypeOptions();
     hidePartitionedTypeOptions();
   }
   // alignmenttype aa radio buttion
   else if (e.getSource() == _aa_radio) {
     hideDnaTypeOptions();
     showAaTypeOptions();
     hidePartitionedTypeOptions();
   }
   // alignmenttype partitioned radio button
   else if (e.getSource() == _partitioned_radio) {
     hideDnaTypeOptions();
     hideAaTypeOptions();
     showPartitionedTypeOptions();
   }
   // partitionfile browse button
   else if (e.getSource() == _partitionfile_button && _partitioned_radio.isSelected()) {
     showChoosePartitionFile();
   }
   // bootstrapping checkbox etc
   else if (e.getSource() == _use_bootstrapping_checkbox) {
     if (_use_bootstrapping_checkbox.isSelected()) {
       showBootstrapOptions();
     } else {
       hideBootstrapOptions();
     }
   }
   // Save Results Destination browse button
   else if (e.getSource() == _jobfolder_button) {
     showChooseJobDir();
   }
   // submit button
   else if (e.getSource() == _submit_button) {
     collectRemainingParameters();
     validateInput();
     if (_input_errors.size() < 1) {
       _job.getMainFrame().getWorkflowPanel().setUsableSubmissionPanel(null);
       submitJob(false);
     } else {
       showErrors();
     }
   }
   // reset button
   else if (e.getSource() == _reset_button) {
     resetForm();
   } else if (e.getSource() == _confirmation_button) {
     _job.getMainFrame().setEnabled(true);
     _confirmation_frame.setVisible(false);
   }
 }
  public void submitJob(boolean testing) {
    _configuration.setWorkspace(_parameters.get(_jobfolder));
    _jobpath = _configuration.getWorkspace() + _parameters.get(_jobname);
    _configuration.setWorkspace(_jobpath);
    String[] submission_parameters = parametersCommand();

    boolean status = new File(_jobpath).mkdir();
    // execute shellfile
    if (_job.getMainFrame().isVisible()) { // don't show confirmation dialogue when testing
      _job.switchToWaitingPanel();
      //        	_job.getMainFrame().setEnabled(false);
    }
    Submission sub = new Submission(submission_parameters, _job, Submission.Jobtype.SGA, testing);
    _job.setSubmissionThread(sub);
    Thread t = new Thread(sub);
    t.start();
    if (testing) {
      try {
        t.join();
      } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        Util.printErrors(e);
      }
    }
  }
  public TreeBuilderFormPanel(LayoutManager mgr, Job parent) {
    _job = parent;
    _configuration = _job.getMainFrame().getConfiguration();
    _jobpath = _job.getMainFrame().getConfiguration().getWorkspace() + _parameters.get(_jobname);
    this.setLayout(mgr);
    _parameters.put(_alignmentfile, null);
    _parameters.put(_alignmenttype, null);
    _parameters.put(_het_model, null);
    _parameters.put(_partitionfile, null);
    _parameters.put(_cores, null);
    _parameters.put(_use_bootstrap, null);
    _parameters.put(_random_seed, null);
    _parameters.put(_samples, null);
    _parameters.put(_jobname, null);
    _parameters.put(_jobfolder, null);
    _parameters.put(_treebuilder, "true");
    _parameters.put(_parsimony_rnd_seed, null);
    _filechooser = _job.getMainFrame().getFilechooser();

    buildForm();
    resetForm();
  }
  private void showErrors() {

    Set<String> errors = _input_errors.keySet();
    for (String error : errors) {
      System.out.println(error + " : " + _input_errors.get(error));
      if (error.equals(_alignmentfile)) {
        highlightError(_alignment_label, _input_errors.get(error));
      } else if (error.equals(_partitionfile)) {
        highlightError(_partitionfile_label, _input_errors.get(error));
      } else if (error.equals(_cores)) {
        highlightError(_cores_label, _input_errors.get(error));
      } else if (error.equals(_samples)) {
        highlightError(_bootstrap_samples_label, _input_errors.get(error));
      } else if (error.equals(_random_seed)) {
        highlightError(_bootstrap_rnd_seed_label, _input_errors.get(error));
      } else if (error.equals(_jobname)) {
        highlightError(_jobname_label, _input_errors.get(error));
      } else if (error.equals(_jobfolder)) {
        highlightError(_jobfolder_label, _input_errors.get(error));
      }
    }

    if (_input_errors.get(_alignmentfile) == null) {
      _alignment_label.setForeground(null);
    } else if (_input_errors.get(_partitionfile) == null) {
      _partitionfile_label.setForeground(null);
    } else if (_input_errors.get(_cores) == null) {
      _cores_label.setForeground(null);
    } else if (_input_errors.get(_samples) == null) {
      _bootstrap_samples_label.setForeground(null);
    } else if (_input_errors.get(_random_seed) == null) {
      _bootstrap_rnd_seed_label.setForeground(null);
    } else if (_input_errors.get(_jobfolder) == null) {
      _jobfolder_label.setForeground(null);
    } else if (_input_errors.get(_jobname) == null) {
      _jobname_label.setForeground(null);
    }

    if (_job.getMainFrame().isVisible()) { // don't show confirmation dialogue when testing
      JOptionPane.showMessageDialog(
          this, errorsToString(), "There some errors in your input!", JOptionPane.ERROR_MESSAGE);
    }
  }