Ejemplo 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();
  }
Ejemplo n.º 2
0
 /**
  * Adds a LonePair to this Atom.
  *
  * @param atomID The atom number to which the LonePair is added in [0,..]
  */
 public void addLonePair(int atomID) {
   ILonePair lonePair = getBuilder().newInstance(ILonePair.class, atoms[atomID]);
   lonePair.addListener(this);
   addLonePair(lonePair);
   /* no notifyChanged() here because addElectronContainer() does
   it already */
 }
 public void addLonePair(int atomID) {
   logger.debug("Adding lone pair: ", atomID);
   super.addLonePair(atomID);
 }
 public void addLonePair(ILonePair ec) {
   logger.debug("Adding lone pair: ", ec);
   super.addLonePair(ec);
 }