Exemple #1
0
  /** Rimuove tutti i link collegati all'oggetto preso in input. */
  public void removeAllLink(ElementoSeqLink seq) {
    ElementoConstraint con;
    int i = 0;

    if (lista == null) return;
    try {
      while (i < lista.size()) {
        con = (ElementoConstraint) lista.get(i);
        if (con != null) {
          if ((ElementoSeqLink) con.getLink() == seq) {
            lista.remove(i);
            i = 0;
            continue;
          }
        }
        i++;
      }
    } catch (IndexOutOfBoundsException e) {
      String s =
          "Indice fuori dai limiti ammessi \n dentro la classe ListaCanale$removeAllLink().\n"
              + e.toString();
      JOptionPane.showMessageDialog(null, s, "Condizione di errore!", JOptionPane.WARNING_MESSAGE);
      return;
    }
  }
Exemple #2
0
 /**
  * Aggiorna la posizione di tutti i canali collegati all'oggetto passato come parametro
  * d'ingresso.
  */
 public void updateListaConstraintPosizione(ElementoSeqLink prc) {
   ElementoConstraint tmpCon;
   for (int i = 0; i < lista.size(); i++) {
     tmpCon = (ElementoConstraint) lista.get(i);
     if (prc.equals(tmpCon.getLink())) {
       tmpCon.updateConstraintPosizione();
     }
   }
 }
Exemple #3
0
 /** Seleziona un link se l'elemento di partenza e di arrivo sono stati selezionati. */
 public void setSelectedIfInRectangle() {
   ElementoConstraint con;
   if ((lista != null) && (!lista.isEmpty())) {
     for (int i = 0; i < lista.size(); i++) {
       con = (ElementoConstraint) lista.get(i);
       if (con.getLink().isSelected()) {
         con.setSelected(true);
       }
     }
   }
 }
Exemple #4
0
 /** @author Michele Stoduto rimuove tutti i processi selezionati (attributo selected = true) */
 public void removeAllSelected() {
   boolean ctrl;
   ElementoConstraint con;
   if (this.size() > 0) {
     Iterator ite = lista.iterator();
     while (ite.hasNext()) {
       con = (ElementoConstraint) ite.next();
       if (con.getLink().isSelected()) {
         isTransaction = true;
         removeElement(con);
         ite = lista.iterator();
       }
     }
     isTransaction = false;
   }
 }
Exemple #5
0
 /** Rimuove il Constraint specificato come parametro. */
 public boolean removeElement(ElementoConstraint con) {
   int i;
   if (lista == null) return false;
   if (lista.isEmpty() == true) return false;
   try {
     i = lista.indexOf(con);
   } catch (IndexOutOfBoundsException e) {
     String s =
         "Indice fuori dai limiti ammessi \ndentro la classe ListaCanale$removeChannel.\n"
             + e.toString();
     JOptionPane.showMessageDialog(null, s, "Condizione di errore!", JOptionPane.WARNING_MESSAGE);
     return false;
   }
   ElementoSeqLink link = con.getLink();
   link.removeConstraint(con);
   lista.remove(i);
   return true;
 }