Package org.openscience.jchempaint.controller.undoredo

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


        IAtomContainer undoRedoContainer = chemModel.getBuilder()
            .newInstance(IAtomContainer.class);
        undoRedoContainer.addAtom(atom);
        Vector2d end = new Vector2d();
        end.sub(worldCoords, atom.getPoint2d());
        IUndoRedoable undoredo = getUndoRedoFactory().getMoveAtomEdit(
            undoRedoContainer, end, "Move atom");
        getUndoRedoHandler().postEdit(undoredo);
      }
      moveToWithoutUndo(atom, worldCoords);
    }
View Full Code Here


            .newInstance(IAtomContainer.class);
        undoRedoContainer.addAtom(bond.getAtom(0));
        undoRedoContainer.addAtom(bond.getAtom(1));
        Vector2d end = new Vector2d();
        end.sub(point, bond.getAtom(0).getPoint2d());
        IUndoRedoable undoredo = getUndoRedoFactory().getMoveAtomEdit(
            undoRedoContainer, end, "Move atom");
        getUndoRedoHandler().postEdit(undoredo);
      }
      moveToWithoutUndo(bond, point);
    }
View Full Code Here

  }

  // OK
  public void setCharge(IAtom atom, int charge) {
    if (getUndoRedoFactory() != null && getUndoRedoHandler() != null) {
      IUndoRedoable undoredo = getUndoRedoFactory().getChangeChargeEdit(
          atom, atom.getFormalCharge(), charge,
          "Change charge to " + charge, this);
      getUndoRedoHandler().postEdit(undoredo);
    }
    atom.setFormalCharge(charge);
View Full Code Here

  }

  // OK
  public void setMassNumber(IAtom atom, int massNumber) {
    if (getUndoRedoFactory() != null && getUndoRedoHandler() != null) {
      IUndoRedoable undoredo = getUndoRedoFactory().getChangeIsotopeEdit(
          atom, atom.getMassNumber(), massNumber,
          "Change Atomic Mass to " + massNumber);
      getUndoRedoHandler().postEdit(undoredo);
    }
    atom.setMassNumber(massNumber);
View Full Code Here

    updateAtom(bond.getAtom(0));
    updateAtom(bond.getAtom(1));
    structurePropertiesChanged();

    if (getUndoRedoFactory() != null && getUndoRedoHandler() != null) {
      IUndoRedoable undoredo = getUndoRedoFactory()
          .getAdjustBondOrdersEdit(
              changedBonds,
              changedStereo,
              "Changed Bond Order/Stereo to " + order + "/"
                  + stereo, this);
View Full Code Here

   * If an exception happens, the massNumber is set to null.
   * @see org.openscience.jchempaint.controller.IAtomBondEdits#setSymbol(org.openscience.cdk.interfaces.IAtom, java.lang.String)
   */
  public void setSymbol(IAtom atom, String symbol) {
    if (getUndoRedoFactory() != null && getUndoRedoHandler() != null) {
      IUndoRedoable undoredo = getUndoRedoFactory()
          .getChangeAtomSymbolEdit(atom, atom.getSymbol(), symbol,
              "Change Atom Symbol to " + symbol, this);
      getUndoRedoHandler().postEdit(undoredo);
    }
    if (atom instanceof IPseudoAtom) {
View Full Code Here

          }
        }
      }
    }
    if (getUndoRedoFactory() != null && getUndoRedoHandler() != null) {
      IUndoRedoable undoredo = getUndoRedoFactory()
          .getChangeHydrogenCountEdit(atomHydrogenCountsMap,
              "Update implicit hydrogen count");
      getUndoRedoHandler().postEdit(undoredo);
    }
    structurePropertiesChanged();
View Full Code Here

    structurePropertiesChanged();
  }

  public void zap() {
    if (getUndoRedoFactory() != null && getUndoRedoHandler() != null) {
      IUndoRedoable undoredo = getUndoRedoFactory().getClearAllEdit(
          chemModel, chemModel.getMoleculeSet(),
          chemModel.getReactionSet(), "Clear Panel");
      getUndoRedoHandler().postEdit(undoredo);
    }
    if (chemModel.getMoleculeSet() != null) {
View Full Code Here

    changedBondsStereo.put(bond, stereos);
    updateAtom(bond.getAtom(0));
    updateAtom(bond.getAtom(1));
    structureChanged();
    if (getUndoRedoFactory() != null && getUndoRedoHandler() != null) {
      IUndoRedoable undoredo = getUndoRedoFactory()
          .getAdjustBondOrdersEdit(changedBonds, changedBondsStereo,
              "Adjust Bond Stereo", this);
      getUndoRedoHandler().postEdit(undoredo);
    }
  }
View Full Code Here

      }
    }
    avoidOverlap(chemModel);
    coordinatesChanged();
    if (getUndoRedoFactory() != null && getUndoRedoHandler() != null) {
      IUndoRedoable undoredo = getUndoRedoFactory().getChangeCoordsEdit(
          coords, "Clean Up");
      getUndoRedoHandler().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.