Package org.openscience.cdk.interfaces

Examples of org.openscience.cdk.interfaces.IAtomContainer


    }
    Assert.assertEquals(2, atomCount);
        Assert.assertEquals(1, bondCount);
    Assert.assertEquals(4, implicitHCount);
   
        IAtomContainer ethylene = panel.getChemModel().getMoleculeSet().getAtomContainer(0);
    Renderer r = panel.getRenderPanel().getRenderer();
    Point2d atompos0=ethylene.getAtom(0).getPoint2d();
    Point2d atompos1=ethylene.getAtom(1).getPoint2d();
    Point2d bondpos = r.toScreenCoordinates((atompos0.x + atompos1.x)/2, (atompos0.y + atompos1.y)/2);
    panel.get2DHub().mouseClickedDown((int)bondpos.x, (int)bondpos.y);
    panel.get2DHub().updateView();
    applet.panel("renderpanel").robot.waitForIdle();
    panel.get2DHub().mouseClickedUp((int)bondpos.x, (int)bondpos.y);
View Full Code Here


        JPanelFixture jcppanel=applet.panel("appletframe");
        JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
        applet.button("C").click();
        applet.button("bondTool").click();
        applet.panel("renderpanel").robot.click(applet.panel("renderpanel").component(),new Point(100,100));
    IAtomContainer ethane = panel.getChemModel().getMoleculeSet().getAtomContainer(0);
    IAtomContainer selected = ethane.getBuilder().newInstance(IAtomContainer.class);
    selected.addAtom(ethane.getAtom(0));
    panel.getRenderPanel().getHub().deleteFragment(selected);
       
        /*
        applet.button("C").click();
        applet.button("bondTool").click();
View Full Code Here

        JPanelFixture jcppanel=applet.panel("appletframe");
        JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
        applet.button("C").click();
        applet.button("bondTool").click();
        applet.panel("renderpanel").robot.click(applet.panel("renderpanel").component(),new Point(100,100));
    IAtomContainer ethane = panel.getChemModel().getMoleculeSet().getAtomContainer(0);
    IAtomContainer selected = ethane.getBuilder().newInstance(IAtomContainer.class);
    selected.addAtom(ethane.getAtom(0));
    panel.getRenderPanel().getHub().deleteFragment(selected);
       
        /*
        applet.button("C").click();
        applet.button("bondTool").click();
View Full Code Here

                out.write(inchi.getAuxInfo()+eol);
                out.write(inchi.getKey()+eol);
            }
        }
        else if (object instanceof IAtomContainer) {
            IAtomContainer atc = (IAtomContainer) object;
            InChI inchi = InChITool.generateInchi(atc);
            out.write(inchi.getInChI()+eol);
            out.write(inchi.getAuxInfo()+eol);
            out.write(inchi.getKey()+eol);
        }
View Full Code Here

        {
            cow.addChemObjectIOListener(new SwingGUIListener(jcpPanel, IOSetting.Importance.HIGH));
        }
        Iterator containers = ChemModelManipulator.getAllAtomContainers(model).iterator();
        while (containers.hasNext()) {
            IAtomContainer ac = (IAtomContainer)containers.next();
            if (ac != null) {
                cow.write(ac);
            } else {
                System.err.println("AC == null!");
            }
View Full Code Here

     *    {R3.a} {R3.b} {R3.c} ...
     *    ....
     *    ..
     */
    final double MARGIN=2;
    IAtomContainer rootStruct=rGroupQuery.getRootStructure();
    double xLeft=(findBoundary(rootStruct,true,true,Double.POSITIVE_INFINITY));
    double yBottom=(findBoundary(rootStruct,false,true,Double.POSITIVE_INFINITY))-MARGIN;
    double minListYBottom=yBottom;

    for (int rgrpNum : sortRGroupNumbers()) {
View Full Code Here

    if (rGroupQuery!=null) {
      for (Iterator<IAtom> it = hub.getRenderer().getRenderer2DModel().getMerge().keySet().iterator(); it.hasNext();) {
        IAtom mergedAtom = it.next();
        IAtom mergedPartnerAtom = hub.getRenderer().getRenderer2DModel().getMerge().get(mergedAtom);
        IAtomContainer container1 = ChemModelManipulator.getRelevantAtomContainer(hub.getChemModel(), mergedAtom);
        IAtomContainer container2 = ChemModelManipulator.getRelevantAtomContainer(hub.getChemModel(), mergedPartnerAtom);

        if(container1!=container2) {
          List<IAtomContainer> substitutes = rGroupQuery.getSubstituents();
          if ((container1==rGroupQuery.getRootStructure() && substitutes.contains(container2))
             || (container2==rGroupQuery.getRootStructure() && substitutes.contains(container1))) {
View Full Code Here

   * @param at
   * @param hub
   * @return
   */
  public boolean checkRGroupOkayForDelete(IAtom at,IChemModelRelay hub ) {
    IAtomContainer tmp = at.getBuilder().newInstance(IAtomContainer.class);
    tmp.addAtom(at);
    return (checkRGroupOkayForDelete(tmp,hub));
  }
View Full Code Here

        return null;
    }

    public IAtomContainer getConnectedAtomContainer() {
        if (this.chemModel != null) {
            IAtomContainer ac = this.chemModel.getBuilder().newInstance(IAtomContainer.class);
            for (IAtomContainer other :
                ChemModelManipulator.getAllAtomContainers(chemModel)) {
                ac.add(other);
            }
            return ac;
        }
        return null;
    }
View Full Code Here

     * (non-Javadoc)
     * @see org.openscience.cdk.renderer.ISelection#getConnectedAtomContainer()
     */
    public IAtomContainer getConnectedAtomContainer() {
       
        IAtomContainer ac = new AtomContainer();
        if (atoms.size() != 0) {
           ac = atoms.get(0).getBuilder().newInstance(IAtomContainer.class);
           for (IAtom atom : atoms) {
              ac.addAtom(atom);
           }
        }
       
        for (IBond bond : bonds) {
           ac.addBond(bond);
        }
       
        return ac;
    }
View Full Code Here

TOP

Related Classes of org.openscience.cdk.interfaces.IAtomContainer

Copyright © 2018 www.massapicom. 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.