ThermistorTablePanel(int which, String titleText, int toolIndex /*ToolModel tool*/) {
      super(new MigLayout());
      this.which = which;
      // this.tool = tool;
      this.toolIndex = toolIndex;
      setBorder(BorderFactory.createTitledBorder(titleText));
      betaField.setColumns(FIELD_WIDTH);
      r0Field.setColumns(FIELD_WIDTH);
      t0Field.setColumns(FIELD_WIDTH);

      double beta = target.getBeta(which, toolIndex);
      if (beta == -1) beta = 4066;

      betaField.setValue((int) beta);
      add(new JLabel("Beta"));
      add(betaField, "wrap");

      double r0 = target.getR0(which, toolIndex);
      if (r0 == -1) r0 = 100000;

      r0Field.setValue((int) r0);
      add(new JLabel("Thermistor Resistance"));
      add(r0Field, "wrap");

      double t0 = target.getT0(which, toolIndex);
      if (t0 == -1) t0 = 25;

      t0Field.setValue((int) t0);
      add(new JLabel("Base Temperature"));
      add(t0Field, "wrap");
    }
예제 #2
0
  public CreateDialog(LayerPanel panel) {
    this.panel = panel;
    // setPreferredSize(new Dimension(200, 200));
    // setMinimumSize(new Dimension(200, 200));
    setLayout(new GridLayout(7, 0));
    XIn = new JFormattedTextField(NumberFormat.getNumberInstance());
    YIn = new JFormattedTextField(NumberFormat.getNumberInstance());
    ZIn = new JFormattedTextField(NumberFormat.getNumberInstance());

    create = new JButton("Create");
    ButtonListener buttonListener = new ButtonListener();
    create.addActionListener(buttonListener);
    XIn.setValue(new Integer(8));
    YIn.setValue(new Integer(8));
    ZIn.setValue(new Integer(8));
    XIn.addPropertyChangeListener(buttonListener);
    YIn.addPropertyChangeListener(buttonListener);
    ZIn.addPropertyChangeListener(buttonListener);
    add(new JLabel("Width:"));
    add(XIn);
    add(new JLabel("Height:"));
    add(YIn);
    add(new JLabel("Length:"));
    add(ZIn);
    add(create);
  }
예제 #3
0
  public FormattedTextFieldDemo() {
    super(new BorderLayout());
    setUpFormats();
    double payment = computePayment(amount, rate, numPeriods);

    // Create the labels.
    amountLabel = new JLabel(amountString);
    rateLabel = new JLabel(rateString);
    numPeriodsLabel = new JLabel(numPeriodsString);
    paymentLabel = new JLabel(paymentString);

    // Create the text fields and set them up.
    amountField = new JFormattedTextField(amountFormat);
    amountField.setValue(new Double(amount));
    amountField.setColumns(10);
    amountField.addPropertyChangeListener("value", this);

    rateField = new JFormattedTextField(percentFormat);
    rateField.setValue(new Double(rate));
    rateField.setColumns(10);
    rateField.addPropertyChangeListener("value", this);

    numPeriodsField = new JFormattedTextField();
    numPeriodsField.setValue(new Integer(numPeriods));
    numPeriodsField.setColumns(10);
    numPeriodsField.addPropertyChangeListener("value", this);

    paymentField = new JFormattedTextField(paymentFormat);
    paymentField.setValue(new Double(payment));
    paymentField.setColumns(10);
    paymentField.setEditable(false);
    paymentField.setForeground(Color.red);

    // Tell accessibility tools about label/textfield pairs.
    amountLabel.setLabelFor(amountField);
    rateLabel.setLabelFor(rateField);
    numPeriodsLabel.setLabelFor(numPeriodsField);
    paymentLabel.setLabelFor(paymentField);

    // Lay out the labels in a panel.
    JPanel labelPane = new JPanel(new GridLayout(0, 1));
    labelPane.add(amountLabel);
    labelPane.add(rateLabel);
    labelPane.add(numPeriodsLabel);
    labelPane.add(paymentLabel);

    // Layout the text fields in a panel.
    JPanel fieldPane = new JPanel(new GridLayout(0, 1));
    fieldPane.add(amountField);
    fieldPane.add(rateField);
    fieldPane.add(numPeriodsField);
    fieldPane.add(paymentField);

    // Put the panels in this panel, labels on left,
    // text fields on right.
    setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
    add(labelPane, BorderLayout.CENTER);
    add(fieldPane, BorderLayout.LINE_END);
  }
예제 #4
0
파일: FoodEditor.java 프로젝트: kba/neon
 protected void load() {
   nameField.setText(data.name);
   costField.setValue(data.cost);
   colorBox.setSelectedItem(data.color);
   charField.setValue(data.text);
   weightField.setValue(data.weight);
   spellBox.setSelectedItem(data.spell);
 }
예제 #5
0
 public void readValues() {
   portTextField.setValue(getPortFromOptionsFile());
   memoryTextField.setValue(getMemoryLimitFromOptionsFile());
   contextPathComboBox.setSelectedItem(getContextPathFromOptionsFile());
   int httpsPort = getHttpsPortFromOptionsFile();
   boolean httpsEnabled = httpsPort != 0;
   httpsPortTextField.setValue(httpsEnabled ? httpsPort : 443);
   httpsPortTextField.setEnabled(httpsEnabled);
   httpsPortCheckBox.setSelected(httpsEnabled);
 }
예제 #6
0
  public settings() {

    setUpFormats();
    setPreferredSize(new Dimension(100, 80));
    setBackground(Color.DARK_GRAY);
    ;
    setVisible(true);

    Font font = new Font("Verdana", Font.BOLD, 14);
    angleTag.setFont(font);
    depthTag.setFont(font);
    angleTag.setForeground(Color.white);
    depthTag.setForeground(Color.white);

    angleData = new JFormattedTextField(angleFormat);
    angleData.setValue(new Double(angleRange));
    angleData.setColumns(3);

    depthData = new JFormattedTextField(depthFormat);
    depthData.setValue(new Double(depthRange));
    depthData.setColumns(3);

    alter = new JButton("redraw");
    alter.addActionListener(new buttonListener());

    angleTag.setLabelFor(angleData);
    depthTag.setLabelFor(depthData);

    JPanel labelPanel = new JPanel(new GridLayout(0, 1));
    labelPanel.add(angleTag);
    labelPanel.add(depthTag);
    labelPanel.setBackground(Color.DARK_GRAY);

    JPanel dataPanel = new JPanel(new GridLayout(0, 1));
    dataPanel.add(angleData);
    dataPanel.add(depthData);
    dataPanel.setBackground(Color.DARK_GRAY);

    JPanel buttonPanel = new JPanel(new GridLayout(0, 1));
    buttonPanel.add(alter);
    dataPanel.setBackground(Color.DARK_GRAY);

    setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    add(labelPanel, BorderLayout.CENTER);
    add(dataPanel, BorderLayout.LINE_END);
    add(buttonPanel, BorderLayout.EAST);

    printthing();

    setVisible(true);
    // depthTag.setFont(font);
    // depthTag.setForeground(Color.white);
    // add(depthTag);

  }
예제 #7
0
  public ToneMapPanel() {

    final JLabel midpointLabel = new JLabel("Midpoint:");

    toneMappingChoice.add(noTRButton);
    toneMappingChoice.add(wardTRButton);
    toneMappingChoice.add(reinhardTRButton);

    noTRButton.setSelected(true);
    final ActionListener delegatingActionListener =
        new ActionListener() {
          @Override
          public void actionPerformed(final ActionEvent evt) {
            midpointValue.setEnabled(reinhardTRButton.isSelected());
            midpointLabel.setEnabled(reinhardTRButton.isSelected());
            fireActionEvent();
          }
        };
    noTRButton.addActionListener(delegatingActionListener);
    wardTRButton.addActionListener(delegatingActionListener);
    reinhardTRButton.addActionListener(delegatingActionListener);

    midpointValue.setColumns(4);
    midpointValue.setValue(0.18);
    midpointValue.addActionListener(delegatingActionListener);
    midpointValue.setEnabled(reinhardTRButton.isSelected());
    midpointLabel.setEnabled(reinhardTRButton.isSelected());

    maxLumValue.setValue(0.0);
    maxLumValue.setColumns(6);
    maxLumValue.addActionListener(delegatingActionListener);
    // midpointValue.addFocusListener(new FocusAdapter() {
    //
    // @Override
    // public void focusLost(FocusEvent e) {
    // super.focusLost(e);
    // }
    //
    // });

    setLayout(
        new MigLayout(
            "wrap 2, ax center", "[align right, sg 1]r[align left, sg 1]", "[]r[]r[]r[]u[]r[]"));

    add(new JLabel("Mapping:"));
    add(noTRButton);
    add(wardTRButton, "skip 1");
    add(reinhardTRButton, "skip 1");
    add(midpointLabel);
    add(midpointValue);
    add(new JLabel("White Point: "));
    add(maxLumValue);
    add(new JLabel("(0=>auto)"), "skip 1");
  }
예제 #8
0
  private void limpaCampos() {

    txtEvento.setText("");
    txtDataInicio.setText("");
    txtDataFim.setText("");
    txtHorario.setText("");
    rdbtnNao.setSelected(true);
    txtQtdIngresso.setText("");
    txtSemana.setValue(null);
    txtFds.setValue(null);
  }
예제 #9
0
 public void updatePixelUnit(CoordinateReferenceSystem crs) {
   final CoordinateSystem coordinateSystem = crs.getCoordinateSystem();
   final String unitX = coordinateSystem.getAxis(0).getUnit().toString();
   if (!unitX.equals(pixelXUnit.getText())) {
     pixelXUnit.setText(unitX);
     pixelSizeXField.setValue(unitMap.get(unitX));
   }
   final String unitY = coordinateSystem.getAxis(1).getUnit().toString();
   if (!unitY.equals(pixelYUnit.getText())) {
     pixelYUnit.setText(unitY);
     pixelSizeYField.setValue(unitMap.get(unitY));
   }
 }
예제 #10
0
파일: GraphIso2.java 프로젝트: wackerl/bats
  private void makeReg() {
    slope = Func.slope(data.get(dataType), x, y);
    slopeField.setValue(slope[0]);
    slopeErrField.setValue(slope[1]);
    rField.setValue(slope[2]);
    //		Setting.getElement("/bat/isotope/calc/bg/factor").setText(((Double)slope[0]).toString());
    //		Setting.getElement("/bat/isotope/calc/bg/error").setText(((Double)slope[1]).toString());
    //		for (int i=0;i<data.corrList.size();i++) {
    //			data.corrList.get(i).isoFact=(Double)slope[0];
    //			data.corrList.get(i).isoErr=(Double)slope[1];
    //		}

  }
예제 #11
0
 public void setParameters(ProblemDescriptors descriptors) {
   if (descriptors == null) {
     problemSizeEdit.setText("");
     stockLengthEdit.setText("");
     orderLengthLowerBoundEdit.setText("");
     orderLengthUpperBoundEdit.setText("");
     averageDemandEdit.setText("");
   } else {
     problemSizeEdit.setValue(descriptors.getSize());
     stockLengthEdit.setValue(descriptors.getStockLength());
     orderLengthLowerBoundEdit.setValue(descriptors.getOrderLengthLowerBound());
     orderLengthUpperBoundEdit.setValue(descriptors.getOrderLengthUpperBound());
     averageDemandEdit.setValue(descriptors.getAverageDemand());
   }
 }
예제 #12
0
  public ToolheadIndexer(Frame parent, final Driver d) {
    super(parent, "Set Toolhead Index", true);
    Container c = getContentPane();
    c.setLayout(new MigLayout("fillx,pack pref pref"));
    c.add(new JLabel(instructions), "wrap,wmax 500px");
    c.add(new JLabel("Tool index:"), "split");
    NumberFormat.getNumberInstance();

    final JFormattedTextField toolIndexField =
        new JFormattedTextField(NumberFormat.getIntegerInstance());
    toolIndexField.setColumns(4);
    toolIndexField.setValue(new Integer(0));
    c.add(toolIndexField);
    JButton cancelButton = new JButton("Cancel");
    cancelButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            setVisible(false);
          }
        });
    JButton indexButton = new JButton("Set Index");
    indexButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            int value = ((Number) toolIndexField.getValue()).intValue();
            Base.logger.info("Setting toolhead index to " + Integer.toString(value));
            ((MultiTool) d).setConnectedToolIndex(value);
            setVisible(false);
          }
        });
    c.add(indexButton);
    c.add(cancelButton);
    pack();
  }
  @Override
  public void setSettings() {
    ThreadPoolConfig threadPool =
        config.getProject().getExporter().getSystem().getThreadPool().getDefaultPool();
    GmlIdLookupServerConfig geometry =
        config.getProject().getExporter().getSystem().getGmlIdLookupServer().getGeometry();
    GmlIdLookupServerConfig feature =
        config.getProject().getExporter().getSystem().getGmlIdLookupServer().getFeature();

    int minThreads = ((Number) expResMinThreadsText.getValue()).intValue();
    int maxThreads = ((Number) expResMaxThreadsText.getValue()).intValue();

    if (minThreads > maxThreads) {
      minThreads = maxThreads;
      expResMinThreadsText.setValue(minThreads);
    }

    threadPool.setMinThreads(minThreads);
    threadPool.setMaxThreads(maxThreads);

    geometry.setCacheSize(((Number) expResGeomCacheText.getValue()).intValue());
    feature.setCacheSize(((Number) expResFeatCacheText.getValue()).intValue());
    geometry.setPageFactor(((Number) expResGeomDrainText.getValue()).floatValue() / 100);
    feature.setPageFactor(((Number) expResFeatDrainText.getValue()).floatValue() / 100);
    geometry.setPartitions(((Number) expResGeomPartText.getValue()).intValue());
    feature.setPartitions(((Number) expResFeatPartText.getValue()).intValue());
  }
예제 #14
0
  /**
   * Lets the user know that the text they entered is bad. Returns true if the user elects to revert
   * to the last good value. Otherwise, returns false, indicating that the user wants to continue
   * editing.
   */
  protected boolean userSaysRevert() {
    Toolkit.getDefaultToolkit().beep();
    ftf.selectAll();
    Object[] options = {"Editar", "Revertir"};
    String mensaje = "El valor debe ser ";
    if (minimum != null && maximum != null)
      mensaje += "mayor a " + minimum + " y menor a " + maximum;
    else {
      if (minimum != null) mensaje += "mayor a " + minimum;
      if (maximum != null) mensaje += "menor a " + maximum;
    }
    int answer =
        JOptionPane.showOptionDialog(
            SwingUtilities.getWindowAncestor(ftf),
            mensaje + ".\n" + "¿Deseas editar el número " + "o revertir los cambios?",
            "Valor ingresado no válido",
            JOptionPane.YES_NO_OPTION,
            JOptionPane.ERROR_MESSAGE,
            null,
            options,
            options[1]);

    if (answer == 1) { // Revert!
      ftf.setValue(ftf.getValue());
      return true;
    }
    return false;
  }
예제 #15
0
  public void initialize(Instrument instrument) {
    ExpireTimeSpinnerModel model = new ExpireTimeSpinnerModel(instrument);
    this.setModel(model);

    JFormattedTextField textField = ((DateEditor) this.getEditor()).getTextField();
    textField.setValue(model._value);
    textField.addFocusListener(
        new FocusListener() {
          public void focusGained(FocusEvent e) {}

          public void focusLost(FocusEvent e) {
            ExpireTimeSpinnerModel model = (ExpireTimeSpinnerModel) getModel();
            JFormattedTextField textField = ((DateEditor) getEditor()).getTextField();
            try {
              DateTime newTime = DateTime.fromDate((Date) getValue());
              if (newTime.compareTo(model.getEndTime()) > 0) {
                textField.setValue(model.getEndTime());
              } else if (newTime.compareTo(model.getBeginTime()) < 0) {
                textField.setValue(model.getBeginTime());
              } else if (DeliveryHoliday.instance.isHoliday(newTime)) {
                textField.setValue(model.getNextAvaliableTime(newTime));
              }
            } catch (IllegalArgumentException exception) // the input maybe out of datetime range
            {
              textField.setValue(model.getEndTime());
            }
          }
        });
  }
예제 #16
0
    /** Constructs cell editor. */
    public CellEditor() {
      super(new JFormattedTextField());
      final JFormattedTextField ftf = (JFormattedTextField) getComponent();

      // Set GUI behaviour of text field
      ftf.setValue(null);
      ftf.setHorizontalAlignment(JTextField.LEADING);
      ftf.setFocusLostBehavior(JFormattedTextField.PERSIST);

      // Set that one click on cell is enough for editing
      setClickCountToStart(1);

      // Special handling code for ENTER
      ftf.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "check");
      ftf.getActionMap()
          .put(
              "check",
              new AbstractAction() {
                public void actionPerformed(ActionEvent e) {
                  if (!ftf.isEditValid()) {
                    if (askEditOrRevert(ftf, null)) {
                      ftf.setValue(ftf.getValue());
                      ftf.postActionEvent();
                    }
                  } else
                    try {
                      ftf.commitEdit();
                      ftf.postActionEvent();
                    } catch (java.text.ParseException exc) {
                      // nothing to do
                    }
                }
              });
    }
  public void update() {
    mySaveTransientModelsCheckBox.setSelected(myGenerationSettings.isSaveTransientModels());
    myCheckModelsBeforeGenerationCheckBox.setSelected(
        myGenerationSettings.isCheckModelsBeforeGeneration());
    myUseNewGenerator.setSelected(myGenerationSettings.isParallelGenerator());
    myIncremental.setSelected(myGenerationSettings.isIncremental());
    myIncrementalCache.setSelected(myGenerationSettings.isIncrementalUseCache());
    if (InternalFlag.isInternalMode()) {
      myDebugIncrementalDependencies.setSelected(
          myGenerationSettings.isDebugIncrementalDependencies());
      myDebugIncrementalDependencies.setEnabled(
          myGenerationSettings.isStrictMode() && myGenerationSettings.isIncremental());
    }
    myInplaceTransform.setSelected(myGenerationSettings.useInplaceTransofrmations());

    myStrictMode.setSelected(myGenerationSettings.isStrictMode());
    myUseNewGenerator.setEnabled(myGenerationSettings.isStrictMode());
    myIncremental.setEnabled(myGenerationSettings.isStrictMode());
    myIncrementalCache.setEnabled(
        myGenerationSettings.isStrictMode() && myGenerationSettings.isIncremental());
    myNumberOfParallelThreads.setEditable(
        myGenerationSettings.isParallelGenerator() && myGenerationSettings.isStrictMode());
    myNumberOfParallelThreads.setValue(myGenerationSettings.getNumberOfParallelThreads());

    myShowInfo.setSelected(myGenerationSettings.isShowInfo());
    myShowWarnings.setSelected(myGenerationSettings.isShowWarnings());
    myKeepModelsWithWarnings.setEnabled(myGenerationSettings.isShowWarnings());
    myKeepModelsWithWarnings.setSelected(myGenerationSettings.isKeepModelsWithWarnings());
    myShowBadChildWarnings.setEnabled(myGenerationSettings.isShowWarnings());
    myShowBadChildWarnings.setSelected(myGenerationSettings.isShowBadChildWarning());
    myNumberOfModelsToKeep.setEditable(myGenerationSettings.getNumberOfModelsToKeep() != -1);
    myNumberOfModelsToKeep.setValue(
        myGenerationSettings.getNumberOfModelsToKeep() == -1
            ? 16
            : myGenerationSettings.getNumberOfModelsToKeep());
    myLimitNumberOfModels.setSelected(myGenerationSettings.getNumberOfModelsToKeep() != -1);

    myFailOnMissingTextgen.setSelected(myGenerationSettings.isFailOnMissingTextGen());
    myGenerateDebugInfo.setSelected(myGenerationSettings.isGenerateDebugInfo());

    final JRadioButton[] allbuttons = {myTraceNone, myTraceSteps, myTraceLanguages, myTraceTypes};
    allbuttons[myGenerationSettings.getPerformanceTracingLevel()].setSelected(true);

    myButtonState.reset(); // memorize the new state
  }
예제 #18
0
 @Override
 public Component getTableCellEditorComponent(
     JTable table, Object value, boolean isSelected, int row, int column) {
   JFormattedTextField ftf = (JFormattedTextField) getComponent();
   ftf.setFormatterFactory(null);
   ftf.setValue(value);
   ftf.setFormatterFactory(formatterFactory);
   return super.getTableCellEditorComponent(table, value, isSelected, row, column);
 }
예제 #19
0
 // Override to invoke setValue on the formatted text field.
 @Override
 public Component getTableCellEditorComponent(
     JTable table, Object value, boolean isSelected, int row, int column) {
   JFormattedTextField ftf1 =
       (JFormattedTextField)
           super.getTableCellEditorComponent(table, value, isSelected, row, column);
   ftf1.setValue(new Float(value.toString()));
   return ftf1;
 }
예제 #20
0
  /** Updates the text field when the main data model is updated. */
  public void stateChanged(ChangeEvent e) {
    int min = sliderModel.getMinimum();
    int max = sliderModel.getMaximum();
    double value = sliderModel.getDoubleValue();
    NumberFormatter formatter = (NumberFormatter) textField.getFormatter();

    formatter.setMinimum(new Double(min));
    formatter.setMaximum(new Double(max));
    textField.setValue(new Double(value));
  }
예제 #21
0
  public void updateSize(int size) {

    sizetf.setValue(size);
    sizesl.setValue(size);
    getCanvas().repaint();
    getParticlePicker().setSize(size);
    // updateMicrographsModel();
    if (particlesdialog != null) loadParticles(true);
    getParticlePicker().saveConfig();
  }
예제 #22
0
  @Override
  public void loadOptions() {
    scaleTextField.setValue(new Float(options.getOption(OptionsEnum.scalePos).getFloat()));
    dimensionsSpinner.setValue(options.getOption(OptionsEnum.dim).getInt());
    numOfIterationsSpinner.setValue(options.getOption(OptionsEnum.iter).getInt());
    autoStopIteratingCheckBox.setSelected(
        options.getOption(OptionsEnum.autoStopIterating).getBool());
    initialLayoutTextField.setText(options.getOption(OptionsEnum.initLayout).getString());
    attractionExponentTextField.setValue(new Float(options.attrExponent));
    gravitationTextField.setValue(new Float(options.gravitation));
    repulsionExponentTextField.setValue(new Float(options.repuExponent));
    weightedCheckbox.setSelected(!options.noWeight);
    animationCheckBox.setSelected(options.getOption(OptionsEnum.anim).getBool());

    if (options.vertRepu) {
      repulsionTypeTextField.setSelectedIndex(1);
    } else {
      repulsionTypeTextField.setSelectedIndex(0);
    }
  }
    PIDPanel(int which, String name, int toolIndex) {
      this.which = which;
      this.toolIndex = toolIndex;
      setLayout(new MigLayout());
      setBorder(BorderFactory.createTitledBorder(name));
      pField.setColumns(FIELD_WIDTH);
      iField.setColumns(FIELD_WIDTH);
      dField.setColumns(FIELD_WIDTH);

      add(new JLabel("P parameter"));
      add(pField, "wrap");
      add(new JLabel("I parameter"));
      add(iField, "wrap");
      add(new JLabel("D parameter"));
      add(dField, "wrap");
      OnboardParameters.PIDParameters pp = target.getPIDParameters(which, toolIndex);
      pField.setValue(pp.p);
      iField.setValue(pp.i);
      dField.setValue(pp.d);
    }
예제 #24
0
 private void initComponents() {
   fechaInicial = new JXDatePicker();
   Date ini = DateUtils.addMonths(new Date(), -2);
   fechaInicial.setDate(ini);
   fechaInicial.setFormats("dd/MM/yyyy");
   fechaFinal = new JXDatePicker();
   fechaFinal.setFormats("dd/MM/yyyy");
   sucursalControl = createSucursalControl();
   lineaControl = buildLineaControl();
   NumberFormatter formatter = new NumberFormatter(NumberFormat.getNumberInstance());
   formatter.setValueClass(Double.class);
   // formatter.setMaximum(new Integer(0));
   meses = new JFormattedTextField(formatter);
   meses.setValue(new Double(0));
   ordenBox = new JComboBox(TIPO_DE_ORDENAMIENTO);
   formaBox = new JComboBox(ORDENAMIENTO);
   filtrosBox =
       new JComboBox(
           new Object[] {
             new ParamLabelValue("TODOS", " LIKE '%'"),
             new ParamLabelValue("ALCANCE MAYOR", ">$P{MESESF}"),
             new ParamLabelValue("ALCANCE MENOR", "<=$P{MESESF}")
           });
   mesesF = new JFormattedTextField(formatter);
   mesesF.setValue(new Double(0));
   alcance = new JCheckBox("", false);
   todasLasSucursales = new JCheckBox("", false);
   todasLasSucursales.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent e) {
           sucursalControl.setEnabled(!todasLasSucursales.isSelected());
         }
       });
   filtro2Box =
       new JComboBox(
           new Object[] {
             new ParamLabelValue("TODOS", " "),
             new ParamLabelValue("DE LINEA", "AND DELINEA IS TRUE"),
             new ParamLabelValue("ESPECIALES", "AND DELINEA IS FALSE")
           });
 }
예제 #25
0
 /** Performs "1-point" calibration updating the offset but not the slope. */
 private void updateCalibrationOffset() {
   try {
     double rate = (Double) rateField_.getValue();
     // bypass cached positions in positions_ in case they aren't current
     double currentScanner = positions_.getUpdatedPosition(micromirrorDeviceKey_, Directions.Y);
     double currentPiezo = positions_.getUpdatedPosition(piezoImagingDeviceKey_);
     double newOffset = currentPiezo - rate * currentScanner;
     offsetField_.setValue((Double) newOffset);
   } catch (Exception ex) {
     MyDialogUtils.showError(ex);
   }
 }
예제 #26
0
  /** Called when a field's "value" property changes. */
  public void propertyChange(PropertyChangeEvent e) {
    Object source = e.getSource();
    if (source == amountField) {
      amount = ((Number) amountField.getValue()).doubleValue();
    } else if (source == rateField) {
      rate = ((Number) rateField.getValue()).doubleValue();
    } else if (source == numPeriodsField) {
      numPeriods = ((Number) numPeriodsField.getValue()).intValue();
    }

    double payment = computePayment(amount, rate, numPeriods);
    paymentField.setValue(new Double(payment));
  }
예제 #27
0
  /** Create the frame */
  public DateTimer() {
    super();
    setTitle("v14 CountDown");
    getContentPane().setLayout(null);
    setBounds(100, 100, 500, 375);

    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    final JLabel finishtimeLabel = new JLabel();
    finishtimeLabel.setText("CountDown Time");
    finishtimeLabel.setBounds(10, 36, 119, 15);
    getContentPane().add(finishtimeLabel);
    finishtime =
        new JFormattedTextField(
            new DateFormatter(new SimpleDateFormat("MM/dd/yyyy hh:mm:ss aa", Locale.ENGLISH)));
    finishtime.addActionListener(
        new ActionListener() {
          public void actionPerformed(final ActionEvent e) {}
        });

    finishtime.setValue(new Date());
    finishtime.setBounds(135, 34, 187, 19);
    getContentPane().add(finishtime);

    final JButton startButton = new JButton();
    startButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(final ActionEvent e) {
            startCount();
          }
        });
    startButton.setText("Start!!!");
    startButton.setBounds(334, 31, 111, 25);
    getContentPane().add(startButton);

    countLabel = new JLabel();
    countLabel.setHorizontalAlignment(SwingConstants.CENTER);
    countLabel.setHorizontalTextPosition(SwingConstants.CENTER);
    countLabel.setFont(new Font("Lucida Grande", Font.PLAIN, 14));
    countLabel.setBorder(new LineBorder(Color.black, 1, false));
    countLabel.setText("Countdown not Started");
    countLabel.setBounds(10, 162, 435, 47);
    getContentPane().add(countLabel);

    final JLabel credits = new JLabel();
    credits.setHorizontalAlignment(SwingConstants.RIGHT);
    credits.setText("");
    credits.setBounds(253, 328, 237, 15);
    getContentPane().add(credits);
  }
  /**
   * Updates the available settings according to the opened file. This should be called e.g. after
   * loading a PIA intermediate file
   */
  public void applyLoadedSettings(NodeSettingsRO settings) {

    checkCreatePSMSets.setSelected(
        settings.getBoolean(
            PIASettings.CREATE_PSMSETS.getKey(), PIASettings.CREATE_PSMSETS.getDefaultBoolean()));
    fdrThreshold.setValue(
        settings.getDouble(
            PIASettings.FDR_THRESHOLD.getKey(), PIASettings.FDR_THRESHOLD.getDefaultDouble()));

    if (settings
        .getString(
            PIASettings.ALL_DECOY_STRATEGY.getKey(),
            PIASettings.ALL_DECOY_STRATEGY.getDefaultString())
        .equals(FDRData.DecoyStrategy.ACCESSIONPATTERN.toString())) {
      decoyStrategy_pattern.setSelected(true);
    } else {
      decoyStrategy_searchengine.setSelected(true);
    }

    decoyPattern_pattern.setText(
        settings.getString(
            PIASettings.ALL_DECOY_PATTERN.getKey(),
            PIASettings.ALL_DECOY_PATTERN.getDefaultString()));

    if (settings.getInt(
            PIASettings.ALL_USED_IDENTIFICATIONS.getKey(),
            PIASettings.ALL_USED_IDENTIFICATIONS.getDefaultInteger())
        == 0) {
      usedIdentifications_all.setSelected(true);
    } else {
      usedIdentifications_top.setSelected(true);
    }

    preferredScoresModel.removeAllElements();
    for (String scoreShort :
        settings.getStringArray(
            PIASettings.FDR_PREFERRED_SCORES.getKey(),
            PIASettings.FDR_PREFERRED_SCORES.getDefaultStringArray())) {
      ScoreModelEnum modelType = ScoreModelEnum.getModelByDescription(scoreShort);
      ScoreModel model;

      if (modelType.equals(ScoreModelEnum.UNKNOWN_SCORE)) {
        model = new ScoreModel(0.0, scoreShort, scoreShort);
      } else {
        model = new ScoreModel(0.0, modelType);
      }

      preferredScoresModel.addElement(model);
    }
  }
  public void init() {
    // 添加按钮
    JPanel buttonPanel = new JPanel();
    buttonPanel.add(okButton);

    mainPanel.setLayout(new GridLayout(0, 3));
    mainWin.add(mainPanel, BorderLayout.CENTER);

    JFormattedTextField intField0 =
        new JFormattedTextField(
            new InternationalFormatter(NumberFormat.getIntegerInstance()) {
              protected DocumentFilter getDocumentFilter() {
                return new NumberFilter();
              }
            });
    intField0.setValue(100);
    addRow("只接受数字的文本框", intField0);

    JFormattedTextField intField1 = new JFormattedTextField(NumberFormat.getIntegerInstance());
    intField1.setValue(new Integer(100));
    // 添加输入校验器
    intField1.setInputVerifier(new FormattedTextFieldVerifier());
    addRow("带输入校验器的文本框", intField1);

    // 创建自定义格式器对象
    IPAddressFormatter ipFormatter = new IPAddressFormatter();
    ipFormatter.setOverwriteMode(false);
    // 以自定义格式器对象创建格式化文本框
    JFormattedTextField ipField = new JFormattedTextField(ipFormatter);
    ipField.setValue(new byte[] {(byte) 192, (byte) 168, 4, 1});
    addRow("IP地址格式", ipField);

    mainWin.add(buttonPanel, BorderLayout.SOUTH);
    mainWin.pack();
    mainWin.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    mainWin.setVisible(true);
  }
    BackoffPanel(int toolIndex /*ToolModel tool*/) {
      this.toolIndex = toolIndex;

      setLayout(new MigLayout());
      setBorder(BorderFactory.createTitledBorder("Reversal parameters"));
      stopMsField.setColumns(FIELD_WIDTH);
      reverseMsField.setColumns(FIELD_WIDTH);
      forwardMsField.setColumns(FIELD_WIDTH);
      triggerMsField.setColumns(FIELD_WIDTH);

      add(new JLabel("Time to pause (ms)"));
      add(stopMsField, "wrap");
      add(new JLabel("Time to reverse (ms)"));
      add(reverseMsField, "wrap");
      add(new JLabel("Time to advance (ms)"));
      add(forwardMsField, "wrap");
      add(new JLabel("Min. extrusion time before reversal (ms)"));
      add(triggerMsField, "wrap");
      OnboardParameters.BackoffParameters bp = target.getBackoffParameters(toolIndex);
      stopMsField.setValue(bp.stopMs);
      reverseMsField.setValue(bp.reverseMs);
      forwardMsField.setValue(bp.forwardMs);
      triggerMsField.setValue(bp.triggerMs);
    }