示例#1
0
 public void actionPerformed(java.awt.event.ActionEvent e) {
   if (e.getSource() == CorbalocDialog.this.getOKButton()) {
     oKButton_ActionPerformed(e);
     connEtoM1(e);
   }
   if (e.getSource() == CorbalocDialog.this.getManagerField()) connEtoM2(e);
   if (e.getSource() == CorbalocDialog.this.getRepositoryField()) connEtoM3(e);
 };
  /** Invoked when an action occurs. */
  public void actionPerformed(java.awt.event.ActionEvent event) {
    // System.out.println("command=" + event.getActionCommand());

    if (event.getSource() == bCancel) {
      dispose();
      return;
    }

    if (event.getSource() == bAdd) actionAdd();
    else actionOK();
  }
示例#3
0
  public void actionPerformed(java.awt.event.ActionEvent event) {
    if (TRACE) System.out.println("CutPanelView actionPerformed: view: " + viewName);

    if (event.getSource() == closeButn) {
      JToggleButton jtb = (JToggleButton) event.getSource();
      jtb.setSelected(false);
      // System.out.println("Close!");
      vm.hideView(this);
      toolbarButton.setSelected(false);
    } else if (toolbarButton.isSelected()) {
      vm.showView(this);
    } else vm.hideView(this);
  }
示例#4
0
 public void actionPerformed(java.awt.event.ActionEvent event) {
   Object object = event.getSource();
   if (object == cancelButton) cancelButton_actionPerformed(event);
   else if (object == okButton) okButton_actionPerformed(event);
   else if (object == applyButton) applyButton_actionPerformed(event);
   else if (object == markEditor) markEditor_actionPerformed(event);
 }
 private void remainderComBoxActionPerformed(java.awt.event.ActionEvent evt) {
   int selected = ((JComboBox) evt.getSource()).getSelectedIndex();
   String remType = "";
   String param = round.getGenerator().getParam();
   if (round.getGenerator().getClass() != DivisionGenerator.class) {
     param = '/' + param.substring(1) + ".0n";
   }
   switch (selected) {
     case 0:
       remType = "n";
       ansDecPlacesText.setEnabled(false);
       remainder = false;
       break;
     case 1:
       remType = "i";
       ansDecPlacesText.setEnabled(false);
       remainder = true;
       break;
     case 2:
       remType = "d";
       ansDecPlacesText.setEnabled(true);
       remainder = false;
       break;
   }
   round =
       new Round(
           new DivisionGenerator(
               param.substring(0, param.length()) + remType, new ValidDivisionChecker()),
           round.getNumProblems());
   resetProblems();
 }
示例#6
0
 public void actionPerformed(final java.awt.event.ActionEvent e) {
   if (e.getSource() == buttonStart) {
     FtrMain um = new FtrMain(); // ejecución del modelo FTRs
     // um.start();
     um.run();
   }
 }
 private void numOfProblemsTextActionPerformed(java.awt.event.ActionEvent evt) {
   round =
       new Round(
           round.getGenerator(),
           Integer.parseInt(
               ((Long) ((JFormattedTextField) evt.getSource()).getValue()).toString()));
   resetProblems();
 }
 private void operationComBoxActionPerformed(java.awt.event.ActionEvent evt) {
   int selected = ((JComboBox) evt.getSource()).getSelectedIndex();
   String operator = "";
   switch (selected) {
     case 0:
       operator = "+";
       addCarrying.setVisible(true);
       subBorrowing.setVisible(false);
       divPanel.setVisible(false);
       remainder = false;
       break;
     case 1:
       operator = "-";
       addCarrying.setVisible(false);
       subBorrowing.setVisible(true);
       divPanel.setVisible(false);
       remainder = false;
       break;
     case 2:
       operator = "*";
       addCarrying.setVisible(false);
       subBorrowing.setVisible(false);
       divPanel.setVisible(false);
       remainder = false;
       break;
     default:
       break;
   }
   String param;
   if (round.getGenerator().getClass() == DivisionGenerator.class) {
     param = operator + ((DivisionGenerator) round.getGenerator()).getGeneralParam().substring(1);
   } else {
     param = operator + round.getGenerator().getParam().substring(1);
   }
   round = new Round(new Generator(param, new EmptyChecker()), round.getNumProblems());
   if (selected == 3) {
     round =
         new Round(
             new DivisionGenerator(
                 ("/" + round.getGenerator().getParam().substring(1) + ".0n"),
                 new ValidDivisionChecker()),
             round.getNumProblems());
     addCarrying.setVisible(false);
     subBorrowing.setVisible(false);
     divPanel.setVisible(true);
     remainder = false;
     remainderComBox.setSelectedIndex(0);
     ansDecPlacesText.setEnabled(
         ((DivisionGenerator) round.getGenerator()).getRemainderType() == 'd');
     pack();
     setSize(getSize().width, getSize().height + 60);
   }
   resetProblems();
 }
 private void subBorrowingActionPerformed(java.awt.event.ActionEvent evt) {
   if (((JCheckBox) evt.getSource()).isSelected())
     round =
         new Round(
             new Generator(round.getGenerator().getParam(), new SubCarryChecker()),
             round.getNumProblems());
   else
     round =
         new Round(
             new Generator(round.getGenerator().getParam(), new EmptyChecker()),
             round.getNumProblems());
   resetProblems();
 }
示例#10
0
 public void actionPerformed(java.awt.event.ActionEvent event) {
   Object object = event.getSource();
   if (object == BClose) BClose_actionPerformed(event);
 }
示例#11
0
 public void actionPerformed(java.awt.event.ActionEvent e) {
   if (e.getActionCommand() == "render") {
     display.render();
   }
 }
 private void ansDecPlacesTextActionPerformed(java.awt.event.ActionEvent evt) {
   ((DivisionGenerator) round.getGenerator())
       .setAnsDecPlaces((int) ((JFormattedTextField) evt.getSource()).getValue());
   round = new Round(round.getGenerator(), round.getNumProblems());
   resetProblems();
 }
 public void actionPerformed(final java.awt.event.ActionEvent e) {
   if (packageComboBox == e.getSource()) {
     updateText();
   }
 }
示例#14
0
 private void jcboCPActionPerformed(java.awt.event.ActionEvent evt) {
   // TODO add your handling code here:
   if (evt.getModifiers() != 0) {
     escogerSector();
   }
 }