コード例 #1
0
ファイル: StreamClientJFrame.java プロジェクト: dami-gg/ramp
  private void jButtonFindRemoteServicesActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButtonFindRemoteServicesActionPerformed
    jTextAreaStreamList.setText("");
    jTextAreaRemoteServices.setText("");

    String[] emptyList = {};
    DefaultComboBoxModel emptyDcbm = new DefaultComboBoxModel(emptyList);
    jComboBoxFileList.setModel(emptyDcbm);
    jComboBoxRemoteServices.setModel(emptyDcbm);

    try {
      int ttl = Integer.parseInt(jTextFieldTTL.getText());
      int timeout = Integer.parseInt(jTextFieldTimeout.getText());
      int serviceAmount = Integer.parseInt(jTextFieldServiceAmount.getText());
      availableServices = sc.findStreamService(ttl, timeout, serviceAmount);
      String text = "";
      String[] items = new String[availableServices.size()];
      for (int i = 0; i < availableServices.size(); i++) {
        text += availableServices.elementAt(i) + "\n";
        items[i] = "" + availableServices.elementAt(i);
      }
      jTextAreaRemoteServices.setText(text);
      DefaultComboBoxModel dcm = new DefaultComboBoxModel(items);
      jComboBoxRemoteServices.setModel(dcm);
    } catch (Exception e) {
      e.printStackTrace();
    }
  } // GEN-LAST:event_jButtonFindRemoteServicesActionPerformed
コード例 #2
0
ファイル: StreamClientJFrame.java プロジェクト: dami-gg/ramp
 private void jButtonRequireStreamListActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButtonRequireStreamListActionPerformed
   try {
     int index = jComboBoxRemoteServices.getSelectedIndex();
     if (index != -1) {
       ServiceResponse service = availableServices.elementAt(index);
       String[] streams = sc.streamList(service);
       String text = "";
       String[] items = new String[streams.length];
       for (int i = 0; i < streams.length; i++) {
         System.out.println(
             "StreamClientJFrame.jButtonRequireStreamListActionPerformed streams["
                 + i
                 + "] "
                 + streams[i]);
         text += streams[i] + "\n";
         items[i] = streams[i];
       }
       jTextAreaStreamList.setText(text);
       DefaultComboBoxModel dcm = new DefaultComboBoxModel(items);
       jComboBoxFileList.setModel(dcm);
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
 } // GEN-LAST:event_jButtonRequireStreamListActionPerformed
コード例 #3
0
ファイル: StreamClientJFrame.java プロジェクト: dami-gg/ramp
  /** Creates new form FileSharingClientJFrame */
  public StreamClientJFrame(StreamClient sc) {
    initComponents();

    this.sc = sc;
    String[] empty = new String[0];
    DefaultComboBoxModel dcm = new DefaultComboBoxModel(empty);
    jComboBoxRemoteServices.setModel(dcm);
    jComboBoxFileList.setModel(dcm);
    jTextFieldVlcDirectory.setText(sc.getVlcDirectory());
  }
コード例 #4
0
ファイル: StreamClientJFrame.java プロジェクト: dami-gg/ramp
 private void formWindowClosing(
     java.awt.event.WindowEvent evt) { // GEN-FIRST:event_formWindowClosing
   sc.stopClient();
 } // GEN-LAST:event_formWindowClosing
コード例 #5
0
ファイル: StreamClientJFrame.java プロジェクト: dami-gg/ramp
 private void jButtonChangeVlcDirectoryActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButtonChangeVlcDirectoryActionPerformed
   sc.setVlcDirectory(jTextFieldVlcDirectory.getText());
 } // GEN-LAST:event_jButtonChangeVlcDirectoryActionPerformed