Exemple #1
0
 /**
  * removes a user from the user list
  *
  * @param un the name of the user to be removed
  */
 public void userDel(String un) {
   users.remove(users.indexOf(un));
   if (ignores.contains(un)) {
     ignores.remove(ignores.indexOf(un));
   }
   if (afks.contains(un)) {
     afks.remove(afks.indexOf(un));
   }
   if (admins.contains(un)) {
     admins.remove(admins.indexOf(un));
   }
   updateList();
   serverMessage(un + " has left " + server.channel);
   privates.serverMessage(un, un + " has left");
 }
 public void sendToBack(Figure figure) {
   if (children.remove(figure)) {
     children.add(0, figure);
     needsSorting = true;
     fireAreaInvalidated(figure.getDrawingArea());
   }
 }
 public void bringToFront(Figure figure) {
   if (children.remove(figure)) {
     children.add(figure);
     needsSorting = true;
     fireAreaInvalidated(figure.getDrawingArea());
   }
 }
 public Figure basicRemoveChild(int index) {
   Figure figure = children.get(index);
   children.remove(index);
   quadTree.remove(figure);
   figure.removeFigureListener(figureHandler);
   needsSorting = true;
   return figure;
 }
Exemple #5
0
 /**
  * changes the name of a user, updating list of admins, afks, ignoes, and master user list
  *
  * @param on old username
  * @param nn new username
  */
 public void rename(String on, String nn) {
   if (admins.contains(on)) {
     admins.remove(admins.indexOf(on));
     admins.add(nn);
   }
   if (afks.contains(on)) {
     afks.remove(afks.indexOf(on));
     afks.add(nn);
   }
   if (ignores.contains(on)) {
     ignores.remove(ignores.indexOf(on));
     ignores.add(nn);
   }
   users.remove(on);
   users.add(nn);
   updateList();
   serverMessage(on + " renamed to " + nn);
 }
Exemple #6
0
  // this constructor takes as an arg the list of file names that are gonna be displayed
  ShowFiles(ArrayList<String> myFiles) {

    // if it is an empty file list, do nothing
    if (myFiles.size() == 0) return;

    // remember the list of files
    myFileList = myFiles;

    // this is the current file to display
    myFName = myFiles.remove(0);

    try {

      // open up the file to display
      FileReader myFile = new FileReader(myFName);
      BufferedReader myReader = new BufferedReader(myFile);
      String myString;

      // and build up the string to display
      stringToCheck = "";
      while ((myString = myReader.readLine()) != null) {
        stringToCheck += (myString + "\n");
      }

      // close the reader when done
      myReader.close();
    } catch (Exception e) {
      throw new RuntimeException("Problem opening/reading file");
    }

    // start up the window and wait until it is done
    (new Thread(this)).start();
    waitUntilDone();

    // and recursively display the rest of the files
    ShowFiles temp = new ShowFiles(myFiles);
    myFiles.add(0, myFName);
  }
 public void removeChangeListener(ChangeListener changeListener) {
   _listeners.remove(changeListener);
 }