コード例 #1
0
  /**
   * Closes dialog box when the OK button is pressed and calls the algorithm.
   *
   * @param event Event that triggers function.
   */
  public void actionPerformed(ActionEvent event) {
    String command = event.getActionCommand();
    Object source = event.getSource();

    if (command.equals("OK")) {

      if (setVariables()) {
        callAlgorithm();
      }
    } else if (command.equals("Script")) {
      callAlgorithm();
    } else if (command.equals("Cancel")) {
      dispose();
    } else if (source == blueSmoothBox) {
      if (blueSmoothBox.isSelected()) {
        interpolationLabel.setEnabled(true);
        interpolationText.setEnabled(true);
      } else {
        interpolationLabel.setEnabled(false);
        interpolationText.setEnabled(false);
      }
    } else {
      super.actionPerformed(event);
    }
  }
コード例 #2
0
  /**
   * Closes dialog box when the OK button is pressed and calls the algorithm.
   *
   * @param event Event that triggers function.
   */
  public void actionPerformed(ActionEvent event) {
    String command = event.getActionCommand();

    if (command.equals("Script")) {
      callAlgorithm();
    } else if (command.equals("Cancel")) {
      dispose();
    } else {
      super.actionPerformed(event);
    }
  }