コード例 #1
0
 /**
  * Called when there was a change in one of the pin values. The event contains the changed value
  * in a string representation and a boolean which is true if the user pressed the 'ok' button and
  * false if the user pressed the 'cancel' button.
  */
 public void pinValueChanged(PinValueEvent e) {
   pinsTable.setEnabled(true);
   if (e.getIsOk()) {
     valuesStr[pinsTable.getSelectedRow()] = e.getValueStr();
     partPins[pinsTable.getSelectedRow()].value =
         Format.translateValueToShort(e.getValueStr(), dataFormat);
   }
   notifyListeners(
       pinsTable.getSelectedRow(), Format.translateValueToShort(e.getValueStr(), dataFormat));
 }
コード例 #2
0
    /** Sets the value at a specific row and column. */
    public void setValueAt(Object value, int row, int col) {

      String data = ((String) value).trim();
      try {
        valuesStr[row] = data;
        partPins[row].value = Format.translateValueToShort(data, dataFormat);
        notifyListeners((short) row, partPins[row].value);
      } catch (NumberFormatException nfe) {
        notifyErrorListeners("Illegal value");
        valuesStr[row] = Format.translateValueToString(partPins[row].value, dataFormat);
      }
      repaint();
    }
コード例 #3
0
 /** Sets the value at a specific row and column. */
 public void setValueAt(Object value, int row, int col) {
   String data = ((String) value).trim();
   if (!getStrAt(row).equals(data)) {
     try {
       short currentValue;
       if (data.equals("") && hideNullValue) currentValue = nullValue;
       else currentValue = Format.translateValueToShort(data, memory.dataFormat);
       notifyListeners((short) row, currentValue);
     } catch (NumberFormatException nfe) {
       notifyErrorListeners("Illegal value");
     }
     repaint();
   }
 }