From: <gil...@us...> - 2009-03-24 16:48:49
|
Revision: 14528 http://cdk.svn.sourceforge.net/cdk/?rev=14528&view=rev Author: gilleain Date: 2009-03-24 16:48:42 +0000 (Tue, 24 Mar 2009) Log Message: ----------- Check for null handler. Modified Paths: -------------- cdk/branches/jchempaint-primary/src/main/org/openscience/cdk/controller/ControllerHub.java Modified: cdk/branches/jchempaint-primary/src/main/org/openscience/cdk/controller/ControllerHub.java =================================================================== --- cdk/branches/jchempaint-primary/src/main/org/openscience/cdk/controller/ControllerHub.java 2009-03-24 15:53:38 UTC (rev 14527) +++ cdk/branches/jchempaint-primary/src/main/org/openscience/cdk/controller/ControllerHub.java 2009-03-24 16:48:42 UTC (rev 14528) @@ -517,15 +517,13 @@ public void addNewBond(Point2d worldCoordinate) { IAtomContainer undoRedoContainer = getIChemModel().getBuilder().newAtomContainer(); - String atomType = - getController2DModel().getDrawElement(); + String atomType = getController2DModel().getDrawElement(); IAtom atom = addAtomWithoutUndo(atomType, worldCoordinate); undoRedoContainer.addAtom(atom); IAtom newAtom = addAtomWithoutUndo(atomType, atom); undoRedoContainer.addAtom(newAtom); IAtomContainer atomContainer = - ChemModelManipulator.getRelevantAtomContainer( - getIChemModel(), newAtom); + ChemModelManipulator.getRelevantAtomContainer(getIChemModel(), newAtom); IBond newBond = atomContainer.getBond(atom, newAtom); undoRedoContainer.addBond(newBond); updateAtom(newBond.getAtom(0)); @@ -547,8 +545,7 @@ bond.setStereo(STEREO_BOND_NONE); }else{ // cycle the bond order up to maxOrder - IBond.Order maxOrder = - getController2DModel().getMaxOrder(); + IBond.Order maxOrder = getController2DModel().getMaxOrder(); if (BondManipulator.isLowerOrder(bond.getOrder(), maxOrder)) { BondManipulator.increaseBondOrder(bond); } else { @@ -571,8 +568,7 @@ } public IBond makeNewStereoBond(IAtom atom, Direction desiredDirection) { - String atomType = - getController2DModel().getDrawElement(); + String atomType = getController2DModel().getDrawElement(); IAtom newAtom = addAtomWithoutUndo(atomType, atom); IAtomContainer undoRedoContainer=getIChemModel().getBuilder().newAtomContainer(); @@ -1474,7 +1470,7 @@ } public void fireZoomEvent() { - changeHandler.zoomChanged(); + if (changeHandler != null) changeHandler.zoomChanged(); } private void structurePropertiesChanged() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |