Beispiel #1
0
  public void actionPerformed(ActionEvent e) {
    if (e.getActionCommand().equals("Load Graph")) {
      Explorer explorer = new Explorer();
      String path = explorer.showDialog(this);
      System.out.println("DEBUG: The graph selected is: " + path);
      if (!(path.equals(""))) {
        Vector graphNodes = utils.parseFile(path);
        algorithm_View.setGraphNodes(graphNodes);
        drawer.paintGraph(graphNodes);
        for (int i = 0; i < graphNodes.size(); i++) {
          System.out.print("Service " + (i + 1) + ":    ");
          Vector si = (Vector) graphNodes.elementAt(i);
          for (int j = 0; j < si.size(); j++) {
            String siValue =
                ((ServiceImplementation) si.elementAt(j)).getId()
                    + "-"
                    + ((ServiceImplementation) si.elementAt(j)).getSid();
            System.out.print(siValue);
            System.out.print("    ");
          }
          System.out.println();
        }
        algorithm_View.setGraphPanel(drawer.getGComponent());
      }
    }
    if (e.getActionCommand().equals("Reset View")) {}

    if (e.getActionCommand().equals("About...")) {
      JOptionPane.showMessageDialog(
          frame, "Version v0.2\nPatricia Uriol\nFelipe Ibañez\nDREQUIEM\nUC3M");
    }
    if (e.getActionCommand().equals("Manual")) {
      JOptionPane.showMessageDialog(frame, helpManual);
    }
  }
Beispiel #2
0
  private void jTabbedPane5MouseClicked(
      java.awt.event.MouseEvent evt) { // GEN-FIRST:event_jTabbedPane5MouseClicked
    /*
     *  Performed at Tab change
     *
     *
     */
    if (Config.isRootDir()) {
      fileSystem fs = fileSystem.getInstance();
      fs.setNewFileSystem(Config.getCurrentIp(), Config.getRootDir());
      out.print("(GUI - TabChange) Lokales fileSystem wurde eingelesen");
    }

    /*check Network state*/
    setOnOffState();

    ActiveTabIndex = jTabbedPane5.getSelectedIndex();
    out.print("Panel: " + jTabbedPane5.getTitleAt(ActiveTabIndex) + " wurde geöffnet");

    switch (jTabbedPane5.getTitleAt(ActiveTabIndex)) {
      case "Config":
        break;
      case "Explorer":
        {
          if (Interfaces.interfaceNetworkOnline() == true) {
            explorer.addTab(jTabbedPane5, ActiveTabIndex);
          }
        }
        break;
      case "Admin":
        if (admin != null) {
          admin.refresh();
        }
        break;
    }
  } // GEN-LAST:event_jTabbedPane5MouseClicked
 @Override
 public ExploreResponse explore(final ExploreRequest request) throws Exception {
   return Explorer.explore(request);
 }