Пример #1
0
 private void connButtonActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_connButtonActionPerformed
   if (!ipBox.getSelectedItem().toString().isEmpty()
       && !portBox.getText().isEmpty()
       && !versionBox.getText().isEmpty()) {
     ys.ip = ipBox.getSelectedItem().toString();
     ys.port = portBox.getText();
     ys.version = versionBox.getText();
     try {
       if (!ys.connected) ys.connect();
       else ys.disconnect();
     } catch (IOException ex) {
       ex.printStackTrace();
     }
     if (!ys.connected) connButton.setText("Connect!");
     else connButton.setText("Disconnect!");
   }
 } // GEN-LAST:event_connButtonActionPerformed
Пример #2
0
 private void makeLocalDB() {
   if (!ysDir.isEmpty()) {
     localDB = new ArrayList<String>();
     File aircraftDir = new File(ysDir + "/aircraft");
     String list[] = aircraftDir.list();
     for (String lst : list) {
       if (lst.lastIndexOf(".") != -1)
         if (lst.substring(lst.lastIndexOf(".")).equalsIgnoreCase(".lst"))
           readLST(ysDir + "/aircraft/" + lst);
     }
     ys.localAddons = localDB;
   }
 }