Package org.openscience.jchempaint.controller.undoredo

Examples of org.openscience.jchempaint.controller.undoredo.IUndoRedoable


                    try {
                        IChemModel chemModel = null;
                            chemModel = JChemPaint.readFromFile(f, null, jcpPanel);
                        if (jcpPanel.get2DHub().getUndoRedoFactory() != null
                                && jcpPanel.get2DHub().getUndoRedoHandler() != null) {
                            IUndoRedoable undoredo = jcpPanel.get2DHub()
                                    .getUndoRedoFactory().getLoadNewModelEdit(
                                            jcpPanel.getChemModel(),
            null,
                                            jcpPanel.getChemModel()
                                                    .getMoleculeSet(),
View Full Code Here


        IUndoRedoFactory undoRedoFactory= chemPaintPanel.get2DHub().getUndoRedoFactory();
        UndoRedoHandler undoRedoHandler= chemPaintPanel.get2DHub().getUndoRedoHandler();
       
        if (undoRedoFactory!=null) {
            IUndoRedoable undoredo = undoRedoFactory.getAddAtomsAndBondsEdit(chemPaintPanel.get2DHub().getIChemModel(),
            molecule, null, "Paste", chemPaintPanel.get2DHub());
            undoRedoHandler.postEdit(undoredo);
        }
       
        chemPaintPanel.getChemModel().setMoleculeSet(moleculeSet);
View Full Code Here

          }
      }


      if (hub.getUndoRedoFactory() != null && jcpPanel.get2DHub().getUndoRedoHandler() != null) {
        IUndoRedoable undoredo = jcpPanel.get2DHub().getUndoRedoFactory().getRGroupEdit
        ( type, isNewRgroup, hub,rGroupHandler, existingAtomDistr, existingBondDistr,
            existingRoot, existingRootAttachmentPoints, existingRGroupApo, existingRgroupLists,molecule);
        jcpPanel.get2DHub().getUndoRedoHandler().postEdit(undoredo);
      }
View Full Code Here

                                            .getSelectedFile().toURI().toURL(),
                                            chooser.getSelectedFile().toURI()
                                                    .toString(), type, jcpPanel);
                        if (jcpPanel.get2DHub().getUndoRedoFactory() != null
                                && jcpPanel.get2DHub().getUndoRedoHandler() != null) {
                            IUndoRedoable undoredo = jcpPanel.get2DHub()
                                    .getUndoRedoFactory().getLoadNewModelEdit(
                                            jcpPanel.getChemModel(),
                      null,
                                            jcpPanel.getChemModel()
                                                    .getMoleculeSet(),
View Full Code Here

  //OK TODO this could do with less partitioning
  public IAtomContainer removeAtom(IAtom atom) {
    IAtomContainer ac = removeAtomWithoutUndo(atom);
        removeEmptyContainers(chemModel);
      if(getUndoRedoFactory()!=null && getUndoRedoHandler()!=null){
        IUndoRedoable undoredo = getUndoRedoFactory().getRemoveAtomsAndBondsEdit(getIChemModel(), ac, "Remove Atom",this);
        getUndoRedoHandler().postEdit(undoredo);
      }
    return ac;
  }
View Full Code Here

    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);
      getUndoRedoHandler().postEdit(undoredo);
    }
    return undoRedoContainer.getAtom(0);
View Full Code Here

            .getAtom(0));
    IBond newBond = atomContainer.getBond(atom, undoRedoContainer
        .getAtom(0));
    undoRedoContainer.addBond(newBond);
    if (getUndoRedoFactory() != null && getUndoRedoHandler() != null) {
      IUndoRedoable undoredo = getUndoRedoFactory()
          .getAddAtomsAndBondsEdit(chemModel, undoRedoContainer,
              null, "Add Atom", this);
      getUndoRedoHandler().postEdit(undoredo);
    }
    return undoRedoContainer.getAtom(0);
View Full Code Here

    updateAtom(newBond.getAtom(0));
    updateAtom(newBond.getAtom(1));

    structureChanged();
    if (undoredofactory != null && undoredohandler != null) {
      IUndoRedoable undoredo = undoredofactory.getAddAtomsAndBondsEdit(
          getIChemModel(), undoRedoContainer, null, "Add Bond", this);
      undoredohandler.postEdit(undoredo);
    }
  }
View Full Code Here

    bond.getAtom(1).setHybridization(null);
    updateAtom(bond.getAtom(0));
    updateAtom(bond.getAtom(1));
    structureChanged();
    if (undoredofactory != null && undoredohandler != null) {
      IUndoRedoable undoredo = undoredofactory
          .getAdjustBondOrdersEdit(changedBonds, changedBondsStereo,
              "Adjust Bond Order", this);
      undoredohandler.postEdit(undoredo);
    }
  }
View Full Code Here

      newBond.setStereo(IBond.Stereo.E_OR_Z);
    }
    undoRedoContainer.addAtom(newAtom);
    undoRedoContainer.addBond(newBond);
    if (getUndoRedoFactory() != null && getUndoRedoHandler() != null) {
      IUndoRedoable undoredo = getUndoRedoFactory()
          .getAddAtomsAndBondsEdit(getIChemModel(),
              undoRedoContainer, null, "Add Stereo Bond", this);
      getUndoRedoHandler().postEdit(undoredo);
    }
    return newBond;
View Full Code Here

TOP

Related Classes of org.openscience.jchempaint.controller.undoredo.IUndoRedoable

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.