Package org.openscience.jchempaint.controller.undoredo

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


      newMoleculeSet.removeAtomContainer(toRemove);
    }
    for (IAtomContainer ac: newMoleculeSet.atomContainers())
      updateAtoms(ac, ac.atoms());
    if (undoredofactory != null && undoredohandler != null) {
      IUndoRedoable undoredo = undoredofactory.getLoadNewModelEdit(
          getIChemModel(), this, oldMoleculeSet, null, newMoleculeSet, null, "Add Chain Fragment");
      undoredohandler.postEdit(undoredo);
    }
    chemModel.setMoleculeSet(newMoleculeSet);
    structureChanged();
View Full Code Here


          updateAtom(bond.getAtom(0));
      }
    }
    removeEmptyContainers(chemModel);
    if (undoredofactory != null && undoredohandler != null) {
      IUndoRedoable undoredo = undoredofactory
          .getRemoveAtomsAndBondsEdit(chemModel, removed, "Cut", this);
      undoredohandler.postEdit(undoredo);
    }
    adjustRgroup();
    structureChanged();
View Full Code Here

      }
      containers.get(i).remove(removeatoms);
      undoRedoContainer.add(removeatoms);
    }
    if (getUndoRedoFactory() != null && getUndoRedoHandler() != null) {
      IUndoRedoable undoredo = getUndoRedoFactory()
          .getRemoveAtomsAndBondsEdit(chemModel, undoRedoContainer,
              "Make explicit Hs implicit", this);
      getUndoRedoHandler().postEdit(undoredo);
    }
    structureChanged();
View Full Code Here

          undoRedoContainer.addBond(newBond);
        }
      }
    }
    if (getUndoRedoFactory() != null && getUndoRedoHandler() != null) {
      IUndoRedoable undoredo = getUndoRedoFactory()
          .getAddAtomsAndBondsEdit(chemModel, undoRedoContainer,
              null, "Make implicit Hs explicit", this);
      getUndoRedoHandler().postEdit(undoredo);
    }
    structureChanged();
View Full Code Here

  public void setImplicitHydrogenCount(IAtom atom, int intValue) {
    if (getUndoRedoFactory() != null && getUndoRedoHandler() != null) {
      HashMap<IAtom, Integer[]> atomhydrogenmap = new HashMap<IAtom, Integer[]>();
      atomhydrogenmap.put(atom, new Integer[] { intValue,
          atom.getImplicitHydrogenCount() });
      IUndoRedoable undoredo = getUndoRedoFactory()
          .getChangeHydrogenCountEdit(atomhydrogenmap,
              "Change hydrogen count to " + intValue);
      getUndoRedoHandler().postEdit(undoredo);
    }
    atom.setImplicitHydrogenCount(intValue);
View Full Code Here

      Iterator<IAtom> it2 = mergeMap.keySet().iterator();
      while (it2.hasNext()) {
        IAtom remove = it2.next();
        undoRedoContainer.removeAtom(remove);
      }
      IUndoRedoable moveundoredo = getUndoRedoFactory().getMoveAtomEdit(
          undoRedoContainer, movedDistance, "Move atom");
      IUndoRedoable undoredo = factory.getMergeMoleculesEdit(mergedAtoms,
          containers, droppedContainers, removedBondss,
          bondsWithReplacedAtoms, movedDistance, mergedPartnerAtoms,
          moveundoredo, oldRGroupHash, newRGroupHash,
          "Move and merge atoms", this);
      handler.postEdit(undoredo);
View Full Code Here

  }

  // OK
  public void setValence(IAtom atom, Integer newValence) {
    if (getUndoRedoFactory() != null && getUndoRedoHandler() != null) {
      IUndoRedoable undoredo = getUndoRedoFactory().getChangeValenceEdit(
          atom, atom.getValency(), newValence,
          "Change valence to " + newValence, this);
      getUndoRedoHandler().postEdit(undoredo);
    }
    if (!(atom instanceof IPseudoAtom)) {
View Full Code Here

          undoRedoContainer.addAtom(bondToRemove.getAtom(i));
        }
      }
    }
    removeEmptyContainers(chemModel);
    IUndoRedoable undoredo = getUndoRedoFactory()
        .getRemoveAtomsAndBondsEdit(chemModel, undoRedoContainer,
            "Delete Bond", this);
    getUndoRedoHandler().postEdit(undoredo);
   
    if(rGroupHandler!=null && !rGroupHandler.checkRGroupOkayForDelete(undoRedoContainer, this)) {
      undoredo.undo();
      return;
    }
   
  }
View Full Code Here

      IAtomContainer undoRedoContainer = chemModel.getBuilder()
          .newInstance(IAtomContainer.class);
      for (IAtom atom : atoms) {
        undoRedoContainer.addAtom(atom);
      }
      IUndoRedoable undoredo = getUndoRedoFactory().getMoveAtomEdit(
          undoRedoContainer, totalmove, "Move atom");
      getUndoRedoHandler().postEdit(undoredo);
    }
    if (move != null) {
      for (IAtom atom : atoms) {
View Full Code Here

            /* Post the rotation */
            IUndoRedoFactory factory = chemModelRelay.getUndoRedoFactory();
            UndoRedoHandler handler = chemModelRelay.getUndoRedoHandler();
            if (factory != null && handler != null) {
                IUndoRedoable undoredo = factory.getChangeCoordsEdit(
                        atomCoordsMap, "Rotation");
                handler.postEdit(undoredo);
            }
        }
    }
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.