Package org.openscience.cdk.interfaces

Examples of org.openscience.cdk.interfaces.IBond


  public void undo() throws CannotUndoException {
    Set<IBond> keys = changedBondOrders.keySet();
    Iterator<IBond> it = keys.iterator();
    while (it.hasNext()) {
      IBond bond = (IBond) it.next();
      IBond.Order[] bondOrders = (IBond.Order[]) changedBondOrders.get(bond);
      bond.setOrder(bondOrders[1]);
      chemModelRelay.updateAtom(bond.getAtom(0));
      chemModelRelay.updateAtom(bond.getAtom(1));
    }
    Set<IBond> keysstereo = changedBondsStereo.keySet();
    Iterator<IBond> itint = keysstereo.iterator();
    while (itint.hasNext()) {
      IBond bond = (IBond) itint.next();
      IBond.Stereo[] bondOrders = changedBondsStereo.get(bond);
      bond.setStereo(bondOrders[1]);
    }
  }
View Full Code Here


        if(bondLength==0|| Double.isNaN(bondLength))
            bondLength=1.5;
       
        start = new Point2d(worldCoord);
        IAtom closestAtom = chemModelRelay.getClosestAtom(worldCoord);
        IBond closestBond = chemModelRelay.getClosestBond( worldCoord );

        IChemObject singleSelection = getHighlighted( worldCoord,
                                                      closestAtom,
                                                      closestBond );
View Full Code Here

      }
  }

  public void mouseMove(Point2d worldCoord) {
    IAtom atom = chemModelRelay.getClosestAtom(worldCoord);
    IBond bond = chemModelRelay.getClosestBond(worldCoord);
    JChemPaintRendererModel model =
        chemModelRelay.getRenderer().getRenderer2DModel();
   
    IChemObject obj = getHighlighted( worldCoord, atom,bond );
    if(obj == null)
View Full Code Here

    /* (non-Javadoc)
     * @see org.openscience.cdk.controller.ControllerModuleAdapter#mouseClickedDouble(javax.vecmath.Point2d)
     */
    public void mouseClickedDouble(Point2d p){
        IAtom closestAtom = chemModelRelay.getClosestAtom(p);
        IBond closestBond = chemModelRelay.getClosestBond(p);
        IChemObject singleSelection = getHighlighted( p,
                closestAtom,
                closestBond );
        if(singleSelection!=null){
            for (IAtomContainer isolatedSystem : ConnectivityChecker.partitionIntoMolecules(this.chemModelRelay.getIChemModel().getMoleculeSet().getAtomContainer(0)).atomContainers()) {
View Full Code Here

        // in case we are starting on an empty canvas
        if(bondLength==0 || Double.isNaN(bondLength))
            bondLength=1.5;
        start = new Point2d(worldCoord);
        IAtom closestAtom = chemModelRelay.getClosestAtom(worldCoord);
        IBond closestBond = chemModelRelay.getClosestBond( worldCoord );

        IChemObject singleSelection = getHighlighted( worldCoord,
                                                      closestAtom,
                                                      closestBond );
View Full Code Here

        }else {
            dest = AddBondDragModule.roundAngle(start, worldCoordTo, bondLength );
            IAtom atom = chemModelRelay.getIChemModel().getBuilder().
              newInstance(IAtom.class, chemModelRelay.getController2DModel().getDrawElement(), dest );
            IBond bond = chemModelRelay.getIChemModel().getBuilder().
              newInstance(IBond.class, source, atom, IBond.Order.SINGLE, stereoForNewBond );
            chemModelRelay.addPhantomBond( bond );
            // update phantom
        }
        chemModelRelay.updateView();
View Full Code Here

                atom.setMassNumber(chemModelRelay.getController2DModel().getDrawIsotopeNumber());

            IUndoRedoFactory factory = chemModelRelay.getUndoRedoFactory();
            UndoRedoHandler handler = chemModelRelay.getUndoRedoHandler();
            IAtomContainer containerForUndoRedo = chemModelRelay.getIChemModel().getBuilder().newInstance(IAtomContainer.class);
            IBond bond = chemModelRelay.addBond( newAtom, atom, stereoForNewBond);
            containerForUndoRedo.addBond(bond);
            if (factory != null && handler != null) {
                IUndoRedoable undoredo = chemModelRelay.getUndoRedoFactory().getAddAtomsAndBondsEdit
                (chemModelRelay.getIChemModel(), containerForUndoRedo, null, "Add Bond",chemModelRelay);
                handler.postEdit(undoredo);
View Full Code Here

TOP

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

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.