Package org.openscience.cdk.interfaces

Examples of org.openscience.cdk.interfaces.IAtomContainer.addAtom()


        IChemModel chemModel = theJcpp.getChemModel();
        rendererModel.setExternalHighlightColor(Color.RED);
        IAtomContainer ac = chemModel.getMoleculeSet().getBuilder()
                .newInstance(IAtomContainer.class);
        if(atom!=-1){
            ac.addAtom(chemModel.getMoleculeSet().getAtomContainer(0).getAtom(atom));
            rendererModel.setExternalSelectedPart(ac);
        }else{
            rendererModel.setExternalSelectedPart(null);
        }
        getTheJcpp().get2DHub().updateView();
View Full Code Here


   
    IAtomContainer ac = atom.getBuilder().newInstance(IAtomContainer.class);
    if(rGroupHandler!=null && !rGroupHandler.checkRGroupOkayForDelete(atom, this))
      return ac;
   
    ac.addAtom(atom);
    Iterator<IBond> connbonds = ChemModelManipulator
        .getRelevantAtomContainer(chemModel, atom)
        .getConnectedBondsList(atom).iterator();
    while (connbonds.hasNext()) {
      IBond connBond = connbonds.next();
View Full Code Here

   */
  public IAtom addAtom(String atomType, int isotopeNumber,
      Point2d worldCoord, boolean makePseudoAtom) {
    IAtomContainer undoRedoContainer = chemModel.getBuilder()
        .newInstance(IAtomContainer.class);
    undoRedoContainer.addAtom(addAtomWithoutUndo(atomType, isotopeNumber,
        worldCoord, makePseudoAtom));
    if (getUndoRedoFactory() != null && getUndoRedoHandler() != null) {
      IUndoRedoable undoredo = getUndoRedoFactory()
          .getAddAtomsAndBondsEdit(chemModel, undoRedoContainer,
              null, "Add Atom", this);
View Full Code Here

    // FIXME : there should be an initial hierarchy?
    IAtomContainerSet molSet = chemModel.getMoleculeSet();
    if (molSet == null) {
      molSet = chemModel.getBuilder().newInstance(IAtomContainerSet.class);
      IAtomContainer ac = chemModel.getBuilder().newInstance(IAtomContainer.class);
      ac.addAtom(newAtom);
      molSet.addAtomContainer(ac);
      chemModel.setMoleculeSet(molSet);
    }
    IAtomContainer newAtomContainer = chemModel.getBuilder().newInstance(IAtomContainer.class);
    if (chemModel.getMoleculeSet().getAtomContainer(0).getAtomCount() == 0)
View Full Code Here

    if (chemModel.getMoleculeSet().getAtomContainer(0).getAtomCount() == 0)
      newAtomContainer = (IAtomContainer) chemModel.getMoleculeSet()
          .getAtomContainer(0);
    else
      molSet.addAtomContainer(newAtomContainer);
    newAtomContainer.addAtom(newAtom);
    updateAtom(newAtom);
    JChemPaintRendererModel model = this.getRenderer().getRenderer2DModel();
    double nudgeDistance = model.getHighlightDistance() / model.getScale();
    if (getClosestAtom(newAtom) != null)
      newAtom.getPoint2d().x += nudgeDistance;
View Full Code Here

  }

  // OK
  public IAtom addAtom(String atomType, IAtom atom, boolean makePseudoAtom) {
    IAtomContainer undoRedoContainer = atom.getBuilder().newInstance(IAtomContainer.class);
    undoRedoContainer.addAtom(addAtomWithoutUndo(atomType, atom,
        makePseudoAtom));
    IAtomContainer atomContainer = ChemModelManipulator
        .getRelevantAtomContainer(getIChemModel(), undoRedoContainer
            .getAtom(0));
    IBond newBond = atomContainer.getBond(atom, undoRedoContainer
View Full Code Here

      vec1.scale(bondLength);
      newAtomPoint.add(vec1);
      newAtom.setPoint2d(newAtomPoint);
    } else if (connectedAtoms.size() == 1) {
      IAtomContainer ac = atomCon.getBuilder().newInstance(IAtomContainer.class);
      ac.addAtom(atom);
      ac.addAtom(newAtom);
      Point2d distanceMeasure = new Point2d(0, 0); // XXX not sure about
      // this?
      IAtom connectedAtom = connectedAtoms.get(0);
      Vector2d v = atomPlacer.getNextBondVector(atom, connectedAtom,
View Full Code Here

      newAtomPoint.add(vec1);
      newAtom.setPoint2d(newAtomPoint);
    } else if (connectedAtoms.size() == 1) {
      IAtomContainer ac = atomCon.getBuilder().newInstance(IAtomContainer.class);
      ac.addAtom(atom);
      ac.addAtom(newAtom);
      Point2d distanceMeasure = new Point2d(0, 0); // XXX not sure about
      // this?
      IAtom connectedAtom = connectedAtoms.get(0);
      Vector2d v = atomPlacer.getNextBondVector(atom, connectedAtom,
          distanceMeasure, true);
View Full Code Here

          distanceMeasure, true);
      atomPlacer.placeLinearChain(ac, v, bondLength);
    } else {
      IAtomContainer placedAtoms = atomCon.getBuilder().newInstance(IAtomContainer.class);
      for (IAtom conAtom : connectedAtoms)
        placedAtoms.addAtom(conAtom);
      Point2d center2D = GeometryTools.get2DCenter(placedAtoms);

      IAtomContainer unplacedAtoms = atomCon.getBuilder()
          .newInstance(IAtomContainer.class);
      unplacedAtoms.addAtom(newAtom);
View Full Code Here

        placedAtoms.addAtom(conAtom);
      Point2d center2D = GeometryTools.get2DCenter(placedAtoms);

      IAtomContainer unplacedAtoms = atomCon.getBuilder()
          .newInstance(IAtomContainer.class);
      unplacedAtoms.addAtom(newAtom);

      atomPlacer.distributePartners(atom, placedAtoms, center2D,
          unplacedAtoms, bondLength);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.