/** Remove a message from the table */
 public void removeRow(int row) {
   SOAPMonitorData soap = null;
   if (filter_data == null) {
     soap = (SOAPMonitorData) data.elementAt(row);
     data.remove(soap);
   } else {
     soap = (SOAPMonitorData) filter_data.elementAt(row);
     filter_data.remove(soap);
     data.remove(soap);
   }
   fireTableRowsDeleted(row, row);
 }
Exemple #2
0
 public void removeConnectionListener(NCCPConnection.ConnectionListener l) {
   if (listeners.contains(l)) {
     // ExpCoordinator.printer.print(new String("NCCPConnection.removeConnectionListener to " +
     // toString()), 2);
     listeners.remove(l);
   }
 }
  public void remove(int index) {
    if (activeEditors.size() == 0)
      return; // it can get a bit excitable about removing element 0 ...

    PluggableEditor ed = (PluggableEditor) activeEditors.remove(index);
    ed.unload();
    super.remove(index);
  }
 public void addMenuItem(String text, String loc) {
   locations.put(text, loc);
   if (filenames.contains("Test Text")) {
     filenames.remove("Test Text");
     filenames.addElement(text);
   } else {
     filenames.addElement(text);
   }
   createPopupMenu();
 }
 public void unlink(oncotcap.datalayer.Persistible relatedPersistible) {
   if (relatedPersistible instanceof Keyword) {
     // 						System.out.println("removing the keyword p/c" + relatedPersistible);
     if (children != null) children.remove(relatedPersistible);
     if (parentKeywords != null) parentKeywords.remove(relatedPersistible);
   } else {
     // 					System.out.println("removing the keyword described instance"
     // 															 + relatedPersistible
     // 															 + " from list " + describedInstances);
     if (describedInstances != null) describedInstances.remove(relatedPersistible);
   }
 }
Exemple #6
0
  //	重写paint方法
  public void paint(Graphics g) {
    super.paint(g);
    //		float lineWidth = 3.0f;
    //	    ((Graphics2D)g).setStroke(new BasicStroke(lineWidth));
    //		将坦克的活动区域填充为默认黑色
    g.fillRect(0, 0, 800, 600);
    this.drawTank(hero.getX(), hero.getY(), g, hero.getDirection(), 1);

    for (int i = 0; i < hero.bombs.size(); i++) {
      Bomb myBomb = hero.bombs.get(i);
      // 画出一颗子弹
      if (myBomb != null && myBomb.isLive == true) {
        //			float lineWidth = 2.0f;
        //			((Graphics2D) g).setStroke(new BasicStroke(lineWidth));//设置线条为粗线
        g.draw3DRect(myBomb.x, myBomb.y, 2, 2, true);
      }
      if (myBomb.isLive == false) {
        hero.bombs.remove(myBomb);
      }
    }
    //		画出爆炸
    for (int i = 0; i < baozhas.size(); i++) {
      BaoZha bz = baozhas.get(i);
      System.out.println("baozhas.size()= " + baozhas.size());
      if (bz.life > 5) {
        g.drawImage(image3, bz.x, bz.y, 30, 30, this);
      } else if (bz.life > 3) {
        g.drawImage(image2, bz.x, bz.y, 30, 30, this);
      } else {
        g.drawImage(image1, bz.x, bz.y, 30, 30, this);
      }
      bz.liftDown();
      if (bz.life == 0) {
        baozhas.remove(bz);
      }
    }

    //		画出敌人的坦克
    for (int i = 0; i < ets.size(); i++) {
      EnemyTank et = ets.get(i);
      if (et.isLive) {

        this.drawTank(et.getX(), et.getY(), g, et.getDirection(), 0);
      }
    }
  }
 /** Update a message */
 public void updateData(SOAPMonitorData soap) {
   int row;
   if (filter_data == null) {
     // No filter, so just fire table updated
     row = data.indexOf(soap);
     if (row != -1) {
       fireTableRowsUpdated(row, row);
     }
   } else {
     // Check if the row was being displayed
     row = filter_data.indexOf(soap);
     if (row == -1) {
       // Row was not displayed, so check for if it
       // now needs to be displayed
       if (filterMatch(soap)) {
         int index = -1;
         row = data.indexOf(soap) + 1;
         while ((row < data.size()) && (index == -1)) {
           index = filter_data.indexOf(data.elementAt(row));
           if (index != -1) {
             // Insert at this location
             filter_data.add(index, soap);
           }
           row++;
         }
         if (index == -1) {
           // Insert at end
           index = filter_data.size();
           filter_data.addElement(soap);
         }
         fireTableRowsInserted(index, index);
       }
     } else {
       // Row was displayed, so check if it needs to
       // be updated or removed
       if (filterMatch(soap)) {
         fireTableRowsUpdated(row, row);
       } else {
         filter_data.remove(soap);
         fireTableRowsDeleted(row, row);
       }
     }
   }
 }
 /** Reaction to Add/Delete buttons. */
 public void actionPerformed(ActionEvent e) {
   String cmd = e.getActionCommand();
   if (cmdAdd.equals(cmd)) {
     Zone z = ((ControllerSWARM) controller).new Zone();
     Vector<AbstractNetworkElement> ml =
         ((AbstractControllerComplex) controller).getMyMonitor().getPredecessors();
     Vector<AbstractNetworkElement> cl =
         ((AbstractControllerComplex) controller).getMyMonitor().getSuccessors();
     if (ml.size() > 0) z.bottleneck = (AbstractLinkHWC) ml.firstElement();
     if (cl.size() > 0) {
       z.setFromOnramp((AbstractLinkHWC) cl.firstElement());
       z.setToOnramp((AbstractLinkHWC) cl.firstElement());
     }
     z.initialize();
     zones.add(z);
     zoneTM.fireTableStructureChanged();
     setUpBottleneckColumn();
     setUpFromOnrampColumn();
     setUpToOnrampColumn();
   }
   if (cmdDelete.equals(cmd)) {
     try {
       int[] selected = zonetab.getSelectedRows();
       if ((selected != null) && (selected.length > 0))
         for (int i = 0; i < selected.length; i++) {
           int idx = selected[i] - i;
           if ((idx >= 0) && (idx < zones.size())) {
             zones.remove(idx);
             zoneTM.fireTableStructureChanged();
             setUpBottleneckColumn();
             setUpFromOnrampColumn();
             setUpToOnrampColumn();
           }
         }
     } catch (Exception ex) {
     }
   }
   return;
 }
  public void client_leave(String msg) {
    try {
      Vector tempv = father.onlineList;
      tempv.remove(this);
      int size = tempv.size();
      String nl = "<#NICK_LIST#>";
      for (int i = 0; i < size; i++) {
        ServerAgentThread tempSat = (ServerAgentThread) tempv.get(i);
        tempSat.dout.writeUTF("<#MSG#>" + this.getName() + "is offline....");
        nl = nl + "|" + tempSat.getName();
      }

      for (int i = 0; i < size; i++) {
        ServerAgentThread tempSat = (ServerAgentThread) tempv.get(i);
        tempSat.dout.writeUTF(nl);
      }
      this.flag = false;
      father.refreshList();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
 public void removeActionListener(ActionListener l) {
   listeners.remove(l);
 }
 /**
  * Removes the specified registration listener so that it won't receive further notifications when
  * our registration state changes.
  *
  * @param listener the listener to remove.
  */
 public void removeRegistrationStateChangeListener(RegistrationStateChangeListener listener) {
   synchronized (registrationStateListeners) {
     registrationStateListeners.remove(listener);
   }
 }
Exemple #12
0
 /**
  * Remove a <code>ChangeListener</code> so it is no longer notified when the selected color
  * changes.
  */
 public void removeChangeListener(ChangeListener l) {
   if (changeListeners == null) return;
   changeListeners.remove(l);
 }
Exemple #13
0
 // methode pour supprimer des Observateurs a notre vecteur
 public void removeObserver(Observer obs) {
   observers.remove(obs);
 }
 /**
  * removeRowData
  *
  * @param row int
  */
 public void removeRowData(int row) {
   if (rowData.size() > row && row >= 0) {
     rowData.remove(row);
   }
   fireTableDataChanged();
 }
 /** Remove an existing listener of document change events. */
 public void removeDocumentChangeListener(DocumentChangeListener l) {
   if (l != null) dc_listeners.remove(l);
 }
 public void removeCollisionObject(GameObject obj) {
   //	for(int i=0;i<obj.length;i++){
   OBJECTS.remove(obj);
   // OBJECTS.add(obj[i]);
   // }
 }