Пример #1
0
 public void actionPerformed(ActionEvent E) {
   if (E.getSource() == yes) {
     dispose();
     server.shutdown();
     return;
   } else if (E.getSource() == cancel) {
     dispose();
     return;
   }
 }
Пример #2
0
  public void actionPerformed(ActionEvent E) {
    if (E.getSource() == userAdmin) {
      babylonUserToolDialog userTool = new babylonUserToolDialog(this);
      return;
    }

    if (E.getSource() == console) {
      babylonInfoDialog tmp =
          new babylonInfoDialog(
              this,
              server.strings.get(thisClass, "loading"),
              false,
              server.strings.get(thisClass, "startingclient"),
              server.strings.get("ok"));

      consoleWindow =
          new babylonWindow(
              new babylonPanel(
                  "Administrator",
                  "",
                  "localhost",
                  Integer.toString(server.port),
                  true,
                  server.myURL));
      tmp.dispose();

      consoleWindow.contentPanel.adminConsole = true;
      consoleWindow.contentPanel.lockSettings = true;
      consoleWindow.contentPanel.requirePassword = false;

      // Show the window
      consoleWindow.show();

      // Connect
      consoleWindow.contentPanel.connect();

      return;
    }

    if (E.getSource() == disconnect) {
      String disconnectUser;

      synchronized (userList) {
        disconnectUser = userList.getSelectedItem();
      }

      if (disconnectUser != null) {
        // Loop through all of the current connections to find
        // the object that corresponds to this name

        for (int count = 0; count < server.currentConnections; count++) {
          babylonClientSocket tempuser = (babylonClientSocket) server.connections.elementAt(count);

          if (tempuser.user.name.equals(disconnectUser)) {
            server.disconnect(tempuser, true);
            break;
          }
        }
      }
      return;
    }

    if (E.getSource() == disconnectAll) {
      server.disconnectAll(true);
      return;
    }

    if (E.getSource() == shutdown) {
      if (server.currentConnections > 0) new babylonServerShutdownDialog(this, server);
      else server.shutdown();
      return;
    }
  }
Пример #3
0
 public void actionPerformed(ActionEvent E) {
   if (E.getSource() == dismissButton) {
     dispose();
     return;
   }
 }