示例#1
0
  /** Executes the specified command */
  public void run() {
    if (popup != null) {
      popup.show(popupComponent, popupX, popupY);
      popup = null;
      return;
    }

    if (cmd == null) return;

    switch (cmd.commandType) {
        // Open an UrlConnection
      case CommandInfo.COMMAND_TYPE_GET:
        try {
          cmd.commandURL.openConnection();

          BufferedReader in =
              new BufferedReader(new InputStreamReader(cmd.commandURL.openStream()));
          String strLine;
          Debug.println("Server responded:");
          while ((strLine = in.readLine()) != null) {
            Debug.println(strLine);
          }
          in.close();
        } catch (IOException e) {
        }
        break;
        // Open a port
      case CommandInfo.COMMAND_TYPE_OPEN:
        try {
          Socket sockServerConnection = new Socket(cmd.commandHost, (int) cmd.commandPort);
          BufferedReader in =
              new BufferedReader(new InputStreamReader(sockServerConnection.getInputStream()));
          String strLine;
          Debug.println("Server responded:");
          while ((strLine = in.readLine()) != null) {
            Debug.println(strLine);
          }
          in.close();
          sockServerConnection.close();
        } catch (IOException e) {
        }
        break;
    }
    cmd = null;
    Debug.println("Action terminated");
  }
  public void actionPerformed(ActionEvent event) {
    if (Debug.isActive()) Debug.println("Action for Collapse Tree button");

    tree_view.collapseLevel();
    toolbar.getYaxisTreeCommitButton().doClick();

    // Set toolbar buttons to reflect status
    toolbar.resetYaxisTreeButtons();
  }
示例#3
0
  public void actionPerformed(ActionEvent event) {
    Window window;
    String msg;

    if (model.isZoomUndoStackEmpty()) {
      window = SwingUtilities.windowForComponent((JToolBar) toolbar);
      msg = "Zoom Undo Stack is empty";
      Dialogs.warn(window, msg);
    } else model.zoomUndo();

    // Set toolbar buttons to reflect status
    if (toolbar != null) toolbar.resetZoomButtons();

    if (Debug.isActive()) Debug.println("Action for Zoom Undo button.");
  }