Package org.openscience.cdk.interfaces

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


                IsotopeFactory ifa=XMLIsotopeFactory.getInstance(chemModelRelay.getIChemModel().getBuilder());
                IIsotope iso=ifa.getMajorIsotope(x);
                if(iso!=null){
                    if(closestAtom==null){
                        IAtomContainer addatom=chemModelRelay.getIChemModel().getBuilder().newInstance(IAtomContainer.class);
                        addatom.addAtom(chemModelRelay.addAtomWithoutUndo(x, worldCoord, false));
                        if(chemModelRelay.getUndoRedoFactory()!=null && chemModelRelay.getUndoRedoHandler()!=null){
                            IUndoRedoable undoredo = chemModelRelay.getUndoRedoFactory().getAddAtomsAndBondsEdit(chemModelRelay.getIChemModel(), addatom, null, GT.get("Add Atom"), chemModelRelay);
                            chemModelRelay.getUndoRedoHandler().postEdit(undoredo);
                        }
                    }else{
View Full Code Here


            IChemObjectSelection sel = null;
            if (shiftPressed && curSel != null && curSel.isFilled()) {
                IAtomContainer container = new AtomContainer(curSel.getConnectedAtomContainer());               
                if (singleSelection instanceof IAtom) {
                    IAtom atom = (IAtom) singleSelection;
                    if (!container.contains(atom))  container.addAtom(atom);
                    else container.removeAtom(atom);
                } else if (singleSelection instanceof IBond) {
                    IBond bond = (IBond) singleSelection;
                    if (!container.contains(bond))  container.addBond(bond);
                    else container.addBond(bond);
View Full Code Here

          if(source==null){
            startAtom = getBuilder().newInstance(IAtom.class, chemModelRelay.getController2DModel().getDrawElement(), start );
          }else{
            startAtom=source;
          }  
          phantoms.addAtom(startAtom);
          //make atoms and bonds as needed
          for(int i=0;i<numberofbonds;i++){
            IAtom nextAtom = getBuilder().newInstance(IAtom.class, chemModelRelay.getController2DModel().getDrawElement(), new Point2d(startAtom.getPoint2d().x+bondLength, startAtom.getPoint2d().y));
            phantoms.addAtom(nextAtom);
            phantoms.addBond(getBuilder().newInstance(IBond.class, startAtom, nextAtom, IBond.Order.SINGLE));
View Full Code Here

          }  
          phantoms.addAtom(startAtom);
          //make atoms and bonds as needed
          for(int i=0;i<numberofbonds;i++){
            IAtom nextAtom = getBuilder().newInstance(IAtom.class, chemModelRelay.getController2DModel().getDrawElement(), new Point2d(startAtom.getPoint2d().x+bondLength, startAtom.getPoint2d().y));
            phantoms.addAtom(nextAtom);
            phantoms.addBond(getBuilder().newInstance(IBond.class, startAtom, nextAtom, IBond.Order.SINGLE));
            startAtom = nextAtom;
          }
         
          // The algorithm is 1. calc point a bondlength away in the mouse direction
View Full Code Here

                atomsToMove.add(atom);
            }
            for (IBond bond : selectedAC.bonds()) {
                for (IAtom atom : bond.atoms()){
                    atomsToMove.add(atom);
                    selectedAC.addAtom(atom);
                }
            }

            Point2d current = GeometryTools.get2DCenter(selectedAC);
            start2DCenter = current;
View Full Code Here

        IAtomContainer containerForUndoRedo = chemModelRelay.getIChemModel().getBuilder().newInstance(IAtomContainer.class);
       
        IAtom newAtom;
        if(newSource) {
            newAtom = chemModelRelay.addAtomWithoutUndo( chemModelRelay.getController2DModel().getDrawElement(), start, chemModelRelay.getController2DModel().getDrawPseudoAtom() );
            containerForUndoRedo.addAtom(newAtom);
        }
        else
            newAtom = source;

        // if merge is set either form a bond or add and form
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.