Beispiel #1
0
  private void onOK() {
    System.out.println("pase por aqui");
    int tamanyHidato = (int) spinnerTamanyHidato.getValue();
    int forats = (int) spinnerForats.getValue();
    int numerosPrecolocats = (int) spinnerNumerosPrecolocats.getValue();
    String dificultat = (String) comboBoxDificultat.getSelectedItem();

    ControladorHidato.fesCreacioAutomatica(tamanyHidato, forats, numerosPrecolocats, dificultat);
    dispose();
  }
 private void onOK() {
   // add your code here
   game = new Game(((Number) numberOfRounds.getValue()).intValue());
   game.setMaxProcessorSpeed(((Number) maxCpu.getValue()).intValue());
   for (RobotSource factory : entrantsModel.getList()) {
     try {
       game.addEntrant(factory.createFactory());
     } catch (IOException e) {
       throw new RuntimeException(e);
     }
   }
   dispose();
 }
 private void preferredIndexFieldChanged(ChangeEvent e) {
   Integer indx = (Integer) (preferredIndexField.getValue());
   int index = indx.intValue();
   if (index != objEntityViewField.getPrefIndex()) {
     objEntityViewField.setPrefIndex(index);
   }
 }
  private void makeGridOverlay(int centerX, int centerY) {
    IJ.setTool(Toolbar.SPARE2);
    Overlay overlay = vad_.getImagePlus().getOverlay();
    if (overlay == null || overlay.size() == 0) {
      overlay = new Overlay();
    } else {
      overlay.clear();
    }

    int gridWidth = (Integer) gridXSpinner_.getValue();
    int gridHeight = (Integer) gridYSpinner_.getValue();
    int roiWidth = gridWidth * tileWidth_;
    int roiHeight = gridHeight * tileHeight_;

    Roi rectangle = new Roi(centerX - roiWidth / 2, centerY - roiHeight / 2, roiWidth, roiHeight);
    rectangle.setStrokeWidth(20f);
    overlay.add(rectangle);
    vad_.getImagePlus().setOverlay(overlay);
  }
  private void onOK() {

    String columnNames[] = {"Clerk", "Salary"};
    int month = (int) monthSpinner.getValue();
    Object rowData[][] = saleSystem.salaryCheck.salaryRowDataProduce(month);

    JTable table = new JTable(rowData, columnNames);

    tcl = new TableCellListener(table, action);

    tableInitialise(table);
  }
 private void resetPanel() {
   cal =
       new GregorianCalendar(
           Integer.parseInt(yearSpi.getValue().toString()),
           monthBox.getSelectedIndex(),
           Integer.parseInt(lastLabel.getText()));
   startPoint_x = 20;
   startPoint_y = 10;
   panel.removeAll();
   panel.repaint();
   initCalPanel();
 }
  // Add course method
  public void addCourse() {
    try {
      Database db = new Database();

      String coursename = (String) coursecombobox.getSelectedItem();
      if (coursecombobox.getSelectedIndex() == 0) {
        throw new Exception("No course selected");
      }

      float fees = db.getCoursefees(coursename);
      float totalfees = fees + (ims.main.Settings.getInstallment() * (int) spinner.getValue());

      long id = (long) table.getValueAt((int) table.getSelectionModel().getMinSelectionIndex(), 0);

      db.addCourseToCurrentStudent(id, totalfees, (int) spinner.getValue(), coursename);

      updateFeesData(id);
      courseReset();
    } catch (Exception e) {
      JOptionPane.showMessageDialog(this, e.getMessage(), null, JOptionPane.ERROR_MESSAGE);
    }
  }
  // calculate and display amounts
  private void calculateJButtonActionPerformed(ActionEvent event) {
    // declare variables to store user input
    double principal = Double.parseDouble(principalJTextField.getText());
    double rate = Double.parseDouble(interestRateJTextField.getText());

    Integer integerObject = (Integer) yearsJSpinner.getValue();
    Integer year = integerObject.intValue();

    yearlyBalanceJTextArea.setText("Year\tAmount on Deposit");
    DecimalFormat dollars = new DecimalFormat("$0.00");

    // calculate the total value for each year
    for (int count = 1; count <= year; count++) {
      double amount = principal * Math.pow((1 + rate / 100), count);
      yearlyBalanceJTextArea.append("\n" + count + "\t" + dollars.format(amount));
    } // end for
  } // end method calculateJButtonActionPerformed
 public static int getInterval() {
   return (Integer) interval.getValue() * 60000;
 }
Beispiel #10
0
 private int getSelectedHour() {
   return ((Integer) hourSpin.getValue()).intValue();
 }
 public void configure() {
   String type = (String) typeList.getSelectedItem();
   if ("Control Change".equals(type)) {
     eventhandler.configureControlChange(
         getOperationMode(),
         this.type,
         (Integer) channel.getValue(),
         (Integer) cc.getValue(),
         (Integer) min.getValue(),
         (Integer) max.getValue());
   } else if ("NRPN".equals(type)) {
     eventhandler.configureNRPN(
         getOperationMode(),
         this.type,
         (Integer) channel.getValue(),
         (Integer) cc.getValue(),
         (Integer) min.getValue(),
         (Integer) max.getValue());
   } else if ("Pitch Bend".equals(type)) {
     eventhandler.configurePitchBend(
         getOperationMode(),
         this.type,
         (Integer) channel.getValue(),
         (Integer) min.getValue(),
         (Integer) max.getValue());
   } else if ("Basenote".equals(type)) {
     eventhandler.configureBaseNoteChange(
         getOperationMode(), this.type, (Integer) min.getValue(), (Integer) max.getValue());
   } else if ("Scale".equals(type)) {
     eventhandler.configureScaleChange(getOperationMode(), this.type);
   } else if ("Mode Change".equals(type)) {
     eventhandler.configureModeChange(
         getOperationMode(), this.type, (String) modeList.getSelectedItem());
   } else if ("Unassigned".equals(type)) {
     eventhandler.configureUnassigned(getOperationMode(), this.type);
   }
 }
Beispiel #12
0
 private int getSelectedYear() {
   return ((Integer) yearSpin.getValue()).intValue();
 }
Beispiel #13
0
 @Override
 public String getSelectedAI() {
   return (String) aiChoices.getValue();
 }
  public StnPlotSpecification createPlotSpec() {
    StnPlotSpecification ps = new StnPlotSpecification();
    // get the colors
    ps.setFGColor(axesColor.getColor());
    ps.setBGColor(plotBg.getColor());

    ps.setSectionType(mOffset);
    ps.setFileViewer(mFileViewer);
    ps.setXStnVarCode(mSelYParam);
    ps.setYStnVarName(new String((String) mYParamList.getJList().getSelectedValue()));
    ps.setWinTitle(mNameField.getText());
    ps.setYGrid(mPlotYGrid.isSelected());
    ps.setXGrid(mPlotXGrid.isSelected());
    ps.setReverseY(mReverseY.isSelected());
    ps.setSymbol(mCurrSymbol);
    ps.setSymbolSize(((Integer) mSizeField.getValue()).intValue());
    ps.setConnectObs(mConnectObs.isSelected());
    ps.setLineColor(mLineColorSwatch.getColor());
    ps.setSymbolColor(mSymbolColorSwatch.getColor());

    boolean error = false;
    try {
      ps.setWinYPlotMin(Double.valueOf(yMin.getText()).doubleValue());
    } catch (NumberFormatException ex) {
      error = true;
    }

    try {
      ps.setWinYPlotMax(Double.valueOf(yMax.getText()).doubleValue());
    } catch (NumberFormatException ex) {
      error = true;
    }

    try {
      ps.setYInc(Double.valueOf(yInc.getText()).doubleValue());
    } catch (NumberFormatException ex) {
      error = true;
    }

    ps.setYTics(((Integer) yTics.getValue()).intValue());

    if (mOffset == JOAConstants.PROFSEQUENCE || mOffset == JOAConstants.PROFDISTANCE) {
      try {
        ps.setWinXPlotMin(Double.valueOf(xMin.getText()).doubleValue());
      } catch (NumberFormatException ex) {
        error = true;
      }

      try {
        ps.setWinXPlotMax(Double.valueOf(xMax.getText()).doubleValue());
      } catch (NumberFormatException ex) {
        error = true;
      }

      try {
        ps.setXInc(Double.valueOf(xInc.getText()).doubleValue());
      } catch (NumberFormatException ex) {
        error = true;
      }
    } else {

      long startTime = ((Date) mStartSpinner.getValue()).getTime();
      long endTime = ((Date) mEndSpinner.getValue()).getTime();

      ps.setWinXPlotMin(startTime);
      ps.setWinXPlotMax(endTime);
    }

    ps.setXTics(((Integer) xTics.getValue()).intValue());

    if (error) {
      // post alert
    }
    return ps;
  }
 @Override
 protected String getEnabledValue() {
   return string(((Double) spinner.getValue()).doubleValue());
 }
Beispiel #16
0
 private int getSelectedMonth() {
   return ((Integer) monthSpin.getValue()).intValue();
 }
 /** Saves controller properties. */
 public synchronized void save() {
   ((ControllerSimpleSignal) controller).setOffset(((Double) offset.getValue()) / conversion);
   ((ControllerSimpleSignal) controller).setCycleTable(cycledata);
   super.save();
   return;
 }