Esempio n. 1
0
  /**
   * Adds all atoms and electronContainers of a given atomcontainer to this container.
   *
   * @param atomContainer The atomcontainer to be added
   */
  public void add(IAtomContainer atomContainer) {
    for (int f = 0; f < atomContainer.getAtomCount(); f++) {
      if (!contains(atomContainer.getAtom(f))) {
        addAtom(atomContainer.getAtom(f));
      }
    }
    for (int f = 0; f < atomContainer.getBondCount(); f++) {
      if (!contains(atomContainer.getBond(f))) {
        addBond(atomContainer.getBond(f));
      }
    }
    for (int f = 0; f < atomContainer.getLonePairCount(); f++) {
      if (!contains(atomContainer.getLonePair(f))) {
        addLonePair(atomContainer.getLonePair(f));
      }
    }
    for (int f = 0; f < atomContainer.getSingleElectronCount(); f++) {
      if (!contains(atomContainer.getSingleElectron(f))) {
        addSingleElectron(atomContainer.getSingleElectron(f));
      }
    }

    for (IStereoElement se : atomContainer.stereoElements()) stereoElements.add(se);

    notifyChanged();
  }
Esempio n. 2
0
 /**
  * Adds a LonePair to this Atom.
  *
  * @param atomID The atom number to which the LonePair is added in [0,..]
  */
 public void addSingleElectron(int atomID) {
   ISingleElectron singleElectron = getBuilder().newInstance(ISingleElectron.class, atoms[atomID]);
   singleElectron.addListener(this);
   addSingleElectron(singleElectron);
   /* no notifyChanged() here because addSingleElectron() does
   it already */
 }
 public void addSingleElectron(int atomID) {
   logger.debug("Adding single electron: ", atomID);
   super.addSingleElectron(atomID);
 }
 public void addSingleElectron(ISingleElectron ec) {
   logger.debug("Adding single electron: ", ec);
   super.addSingleElectron(ec);
 }