Package org.openscience.cdk.interfaces

Examples of org.openscience.cdk.interfaces.IRing.atoms()


    if (!phantom)
      updateAtoms(sourceContainer, newRing.atoms());

    JChemPaintRendererModel rModel = this.getRenderer().getRenderer2DModel();
    double d = rModel.getHighlightDistance() / rModel.getScale();
    for (IAtom atom : newRing.atoms()) {
      if (atom != firstAtom && atom != secondAtom
          && getClosestAtom(atom) != null) {
        atom.getPoint2d().x += d;
      }
    }
View Full Code Here


    } else { // assume Order.DOUBLE, so only need to add 2 double bonds
      newRing.getBond(2).setOrder(IBond.Order.DOUBLE);
      newRing.getBond(4).setOrder(IBond.Order.DOUBLE);
    }
    // add the new atoms and bonds
    for (IAtom ringAtom : newRing.atoms()) {
      if (ringAtom != firstAtom && ringAtom != secondAtom) {
        if (phantom)
          this.addPhantomAtom(ringAtom);
        else
          sourceContainer.addAtom(ringAtom);
View Full Code Here

        else
          sourceContainer.addBond(ringBond);
      }
    }
    if (!phantom)
      updateAtoms(sourceContainer, newRing.atoms());

    JChemPaintRendererModel rModel = this.getRenderer().getRenderer2DModel();
    double d = rModel.getHighlightDistance() / rModel.getScale();
    for (IAtom atom : newRing.atoms()) {
      if (atom != firstAtom && atom != secondAtom
View Full Code Here

    if (!phantom)
      updateAtoms(sourceContainer, newRing.atoms());

    JChemPaintRendererModel rModel = this.getRenderer().getRenderer2DModel();
    double d = rModel.getHighlightDistance() / rModel.getScale();
    for (IAtom atom : newRing.atoms()) {
      if (atom != firstAtom && atom != secondAtom
          && getClosestAtom(atom) != null) {
        atom.getPoint2d().x += d;
      }
    }
View Full Code Here

        if (singleSelection == null) {
            //we add the ring
        IRing newRing = this.addRingToEmptyCanvas(worldCoord);
            chemModelRelay.getRenderer().getRenderer2DModel().getMerge().clear();
            //we look if it would merge
            for(IAtom atom : newRing.atoms()){
                IAtom closestAtomInRing = this.chemModelRelay.getClosestAtom(atom);
                if( closestAtomInRing != null) {
                        chemModelRelay.getRenderer().getRenderer2DModel().getMerge().put(atom, closestAtomInRing);
                }
            }
View Full Code Here

                try {
                    IAtom toleave = chemModelRelay.getRenderer().getRenderer2DModel().getMerge().keySet().iterator().next();
                    IAtom toshift = (IAtom)chemModelRelay.getRenderer().getRenderer2DModel().getMerge().get(chemModelRelay.getRenderer().getRenderer2DModel().getMerge().keySet().iterator().next()).clone();
                    toleave.getPoint2d().sub(toshift.getPoint2d());
                    Point2d pointSub = new Point2d(toleave.getPoint2d().x, toleave.getPoint2d().y);
                    for(IAtom atom: newRing.atoms()){
                        atom.getPoint2d().sub(pointSub);
                    }
                } catch (CloneNotSupportedException e) {
                    //should not happen
                }
View Full Code Here

            }
            double bondLength = ((ControllerHub)this.chemModelRelay).calculateAverageBondLength(this.chemModelRelay.getIChemModel().getMoleculeSet());
           
            ringPlacer.placeRing(ring, worldCoord, bondLength, RingPlacer.jcpAngles);
           
            for(IAtom atom : ring.atoms())
                this.chemModelRelay.addPhantomAtom(atom);
            for(IBond atom : ring.bonds())
                this.chemModelRelay.addPhantomBond(atom);
            //and look if it would merge somewhere
            chemModelRelay.getRenderer().getRenderer2DModel().getMerge().clear();
View Full Code Here

                this.chemModelRelay.addPhantomAtom(atom);
            for(IBond atom : ring.bonds())
                this.chemModelRelay.addPhantomBond(atom);
            //and look if it would merge somewhere
            chemModelRelay.getRenderer().getRenderer2DModel().getMerge().clear();
            for(IAtom atom : ring.atoms()){
                IAtom closestAtomInRing = this.chemModelRelay.getClosestAtom(atom);
                if( closestAtomInRing != null) {
                        chemModelRelay.getRenderer().getRenderer2DModel().getMerge().put(closestAtomInRing, atom);
                }
            }
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.