コード例 #1
0
ファイル: SessionPanel.java プロジェクト: wokaka/cedp
  private void launchButtonActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_launchButtonActionPerformed
    launchButton.disable();
    parent.hide();
    if (typeCombo.getSelectedIndex() == 0) { // Performance - Java
      for (int i = 0; i < clientTable.getModel().getRowCount(); i++) {
        String addr = (String) clientTable.getModel().getValueAt(i, 0);
        int port = Integer.parseInt((String) clientTable.getModel().getValueAt(i, 1), 10);
        String id = (String) clientTable.getModel().getValueAt(i, 2);
        String pwd = (String) clientTable.getModel().getValueAt(i, 3);
        String vpa =
            basePath
                + nameField.getText()
                + File.separator
                + (String) clientTable.getModel().getValueAt(i, 4);
        String cfg = (String) clientTable.getModel().getValueAt(i, 5);

        PerfJavaNode perfJava =
            new PerfJavaNode(
                basePath + nameField.getText() + File.separator,
                addr + ":" + port,
                new VpaProgram(vpa),
                cfg);
        perfJava.Launch(addr, port, id, pwd);
      }
    }

    /*
          if(typeCombo.getSelectedIndex() == 0){ // OS Injector Master
              for(i=0; i<clientTable.getModel().getRowCount(); i++){
                  addr = (String)clientTable.getModel().getValueAt(i, 0);
                  port = Integer.parseInt((String)clientTable.getModel().getValueAt(i, 1), 10);

                  mainFrame.CreateMasterInjector(i, addr+":"+port);
    //                mainFrame.GetInjector(i).SetInjector(addr, port, Integer.parseInt(serverPortField.getText(), 10), typeCombo.getSelectedIndex());
    //                mainFrame.GetInjector(i).GetResetClientPanel().SetReset(resetServerField.getText(), Integer.parseInt(resetPortField.getText()), (String)clientTable.getModel().getValueAt(i, 2));
                  if(!mainFrame.GetInjector(i).Launch()){
                      mainFrame.RemoveInjector(i);
                  }
              }
          }
          else if(typeCombo.getSelectedIndex() == 1){ // OS Injector Slave
              for(i=0; i<clientTable.getModel().getRowCount(); i++){
                  addr = (String)clientTable.getModel().getValueAt(i, 0);
                  port = Integer.parseInt((String)clientTable.getModel().getValueAt(i, 1), 10);

                  mainFrame.CreateSlaveInjector(i, addr+":"+port);
    //                mainFrame.GetInjector(i).SetInjector(addr, port, Integer.parseInt(serverPortField.getText(), 10), typeCombo.getSelectedIndex());
    //                mainFrame.GetInjector(i).GetResetClientPanel().SetReset(resetServerField.getText(), Integer.parseInt(resetPortField.getText()), (String)clientTable.getModel().getValueAt(i, 2));
                  if(!mainFrame.GetInjector(i).Launch()){
                      mainFrame.RemoveInjector(i);
                  }
              }
          }
          else if(typeCombo.getSelectedIndex() == 2){ // Memory Profiler
              mainFrame.CreateProfiler();
              mainFrame.GetProfiler().Launch();
          }
          else if(typeCombo.getSelectedIndex() == 3){ // VMM
              addr = (String)clientTable.getModel().getValueAt(0, 0);
              port = Integer.parseInt((String)clientTable.getModel().getValueAt(0, 1), 10);
              id = (String)clientTable.getModel().getValueAt(0, 2);
              pwd = (String)clientTable.getModel().getValueAt(0, 3);

              mainFrame.CreateQemuManager(addr+":"+port);
              mainFrame.GetQemuManager().Launch(addr, port, id, pwd);
              mainFrame.Hide();
          }
          else if(typeCombo.getSelectedIndex() == 4){
              mainFrame.CreateAnalyzer();
              mainFrame.GetAnalyzer().Launch();
          }
          else if(typeCombo.getSelectedIndex() == 5){
              addr = (String)clientTable.getModel().getValueAt(0, 0);
              port = Integer.parseInt((String)clientTable.getModel().getValueAt(0, 1), 10);
              id = (String)clientTable.getModel().getValueAt(0, 2);
              pwd = (String)clientTable.getModel().getValueAt(0, 3);

              mainFrame.CreateSWFaultManager(addr+":"+port);
              mainFrame.GetSWFaultManager().Launch(addr, port, id, pwd);
              mainFrame.Hide();
          }
          else if(typeCombo.getSelectedIndex() == 6){
              addr = (String)clientTable.getModel().getValueAt(0, 0);
              port = Integer.parseInt((String)clientTable.getModel().getValueAt(0, 1), 10);
              id = (String)clientTable.getModel().getValueAt(0, 2);
              pwd = (String)clientTable.getModel().getValueAt(0, 3);

              mainFrame.CreateRigelManager(addr+":"+port);
              mainFrame.GetRigelManager().Launch(addr, port, id, pwd);
              mainFrame.Hide();
          }
          //mainFrame.FocusLogPanel();
           */
  } // GEN-LAST:event_launchButtonActionPerformed
コード例 #2
0
 /**
  * Needed to avoid memory leak: we register this EmbeddedFrame as a listener with
  * KeyboardFocusManager of applet's AppContext. We don't want the KFM to keep reference to our
  * EmbeddedFrame forever if the Frame is no longer in use, so we add listeners in show() and
  * remove them in hide().
  */
 public void hide() {
   if (appletKFM != null) {
     removeTraversingOutListeners(appletKFM);
   }
   super.hide();
 }