コード例 #1
0
 private void stopButtonActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_stopButtonActionPerformed
   String portName = this.portComboBox.getSelectedItem().toString();
   if (DeviceManager.isDeviceOpen(portName)) {
     DeviceManager.closeDevice(portName);
     stopButton.setEnabled(false);
     startButton.setEnabled(true);
   }
 } // GEN-LAST:event_stopButtonActionPerformed
コード例 #2
0
 public LiveTopComponent() {
   initComponents();
   setName(Bundle.CTL_LiveTopComponent());
   setToolTipText(Bundle.HINT_LiveTopComponent());
   liveTable.setDefaultRenderer(Object.class, new LiveTableRenderer());
   DeviceManager.addListener(this);
 }
コード例 #3
0
 private void setPortList() {
   String[] deviceList = DeviceManager.getDeviceList();
   if (deviceList.length > 0) {
     this.portComboBox.removeAllItems();
     for (String device : deviceList) {
       this.portComboBox.addItem(device);
     }
   }
 }
コード例 #4
0
  private void startButtonActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_startButtonActionPerformed
    String portName = this.portComboBox.getSelectedItem().toString();
    if (portName.equals("None")) {
      // no device selected, do nothing
      return;
    }
    int speed = this.bitRateComboBox.getSelectedIndex();

    DeviceManager.openDevice(portName, speed);
    startButton.setEnabled(false);
    stopButton.setEnabled(true);
  } // GEN-LAST:event_startButtonActionPerformed
コード例 #5
0
 private void portComboBoxActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_portComboBoxActionPerformed
   if (this.portComboBox.getSelectedItem() == null) {
     return;
   }
   String portName = this.portComboBox.getSelectedItem().toString();
   if (DeviceManager.isDeviceOpen(portName)) {
     startButton.setEnabled(false);
     stopButton.setEnabled(true);
   } else {
     startButton.setEnabled(true);
     stopButton.setEnabled(false);
   }
 } // GEN-LAST:event_portComboBoxActionPerformed