コード例 #1
0
  /*.................................................................................................................*/
  public void actionPerformed(ActionEvent e) {
    if (e.getActionCommand().equalsIgnoreCase("setToDefaults")) {
      setDefaultTNTCommandsSearchOptions();
      searchField.setText(searchArguments);
      bootstrapSearchField.setText(bootstrapSearchArguments);
      harvestOnlyStrictConsensusBox.setState(harvestOnlyStrictConsensus);
      resamplingAllConsensusTreesBox.setState(!resamplingAllConsensusTrees);
      bootStrapRepsField.setValue(bootstrapreps);

    } else if (e.getActionCommand().equalsIgnoreCase("setToDefaultsOtherOptions")) {
      setDefaultTNTCommandsOtherOptions();
      otherOptionsField.setText(otherOptions);
      convertGapsBox.setState(convertGapsToMissing);
    } else if (e.getActionCommand().equalsIgnoreCase("browseSearchScript")
        && searchScriptPathField != null) {
      MesquiteString directoryName = new MesquiteString();
      MesquiteString fileName = new MesquiteString();
      String path =
          MesquiteFile.openFileDialog("Choose Search Script File", directoryName, fileName);
      if (StringUtil.notEmpty(path)) searchScriptPathField.setText(path);
    } else if (e.getActionCommand().equalsIgnoreCase("browseBootSearchScript")
        && bootSearchScriptPathField != null) {

      MesquiteString directoryName = new MesquiteString();
      MesquiteString fileName = new MesquiteString();
      String path =
          MesquiteFile.openFileDialog(
              "Choose Resampling Search Script File", directoryName, fileName);
      if (StringUtil.notEmpty(path)) bootSearchScriptPathField.setText(path);
    }
  }
コード例 #2
0
 /*.................................................................................................................*/
 public void actionPerformed(ActionEvent e) {
   if ("Equal".equals(e.getActionCommand())) {
     double probEach = 1.0 / getNumStates();
     for (int i = 0; i < getNumStates(); i++) stateFrequenciesTemp[i] = probEach;
     setOptions();
     // setStateFrequencies(stateFrequenciesTemp);
   } else if ("Norm+-".equals(e.getActionCommand())) {
     double total = 0;
     for (int i = 0; i < getNumStates(); i++) total += stateFreqField[i].getValue();
     double difference = (total - 1.0) / getNumStates();
     for (int i = 0; i < getNumStates(); i++)
       stateFrequenciesTemp[i] = stateFreqField[i].getValue() - difference;
     setOptions();
   } else if ("Norm*/".equals(e.getActionCommand())) {
     double total = 0;
     for (int i = 0; i < getNumStates(); i++) total += stateFreqField[i].getValue();
     for (int i = 0; i < getNumStates(); i++)
       stateFrequenciesTemp[i] = stateFreqField[i].getValue() / total;
     setOptions();
   }
 }