From: <sh...@us...> - 2009-05-26 14:40:32
|
Revision: 14598 http://cdk.svn.sourceforge.net/cdk/?rev=14598&view=rev Author: shk3 Date: 2009-05-26 14:40:20 +0000 (Tue, 26 May 2009) Log Message: ----------- using arvids new dragging bond paint Modified Paths: -------------- jchempaint/trunk/src/main/org/openscience/jchempaint/JCPToolBar.java jchempaint/trunk/src/main/org/openscience/jchempaint/RenderPanel.java jchempaint/trunk/src/main/org/openscience/jchempaint/action/ChangeModeAction.java Modified: jchempaint/trunk/src/main/org/openscience/jchempaint/JCPToolBar.java =================================================================== --- jchempaint/trunk/src/main/org/openscience/jchempaint/JCPToolBar.java 2009-05-22 15:48:07 UTC (rev 14597) +++ jchempaint/trunk/src/main/org/openscience/jchempaint/JCPToolBar.java 2009-05-26 14:40:20 UTC (rev 14598) @@ -42,7 +42,7 @@ import javax.swing.JToolBar; import javax.swing.SwingConstants; -import org.openscience.cdk.controller.AddBondModule; +import org.openscience.cdk.controller.AddBondDragModule; import org.openscience.cdk.tools.LoggingTool; import org.openscience.jchempaint.action.ChangeModeAction; import org.openscience.jchempaint.action.JCPAction; @@ -254,7 +254,7 @@ { button.setBackground(Color.GRAY); chemPaintPanel.setLastActionButton(button); - chemPaintPanel.get2DHub().setActiveDrawModule(new AddBondModule(chemPaintPanel.get2DHub())); + chemPaintPanel.get2DHub().setActiveDrawModule(new AddBondDragModule(chemPaintPanel.get2DHub())); chemPaintPanel.updateStatusBar(); } else { Modified: jchempaint/trunk/src/main/org/openscience/jchempaint/RenderPanel.java =================================================================== --- jchempaint/trunk/src/main/org/openscience/jchempaint/RenderPanel.java 2009-05-22 15:48:07 UTC (rev 14597) +++ jchempaint/trunk/src/main/org/openscience/jchempaint/RenderPanel.java 2009-05-26 14:40:20 UTC (rev 14598) @@ -50,6 +50,7 @@ import org.openscience.cdk.controller.ControllerHub; import org.openscience.cdk.controller.ControllerModel; import org.openscience.cdk.controller.IViewEventRelay; +import org.openscience.cdk.controller.PhantomBondGenerator; import org.openscience.cdk.controller.SwingMouseEventRelay; import org.openscience.cdk.controller.undoredo.IUndoListener; import org.openscience.cdk.controller.undoredo.IUndoRedoable; @@ -101,6 +102,8 @@ private UndoManager undoManager=new UndoManager(); private boolean debug=false; + + private PhantomBondGenerator pbg = new PhantomBondGenerator(); public RenderPanel(IChemModel chemModel, int width, int height, boolean fitToScreen, boolean debug) { @@ -148,6 +151,7 @@ this, undoredohandler, new SwingUndoRedoFactory()); + pbg.setControllerHub(hub); // connect mouse events from Panel to the Hub this.mouseEventRelay = new SwingMouseEventRelay(this.hub); @@ -171,6 +175,7 @@ generators.add(new SelectAtomGenerator()); generators.add(new SelectBondGenerator()); generators.add(new MergeAtomsGenerator()); + generators.add(pbg); return generators; } Modified: jchempaint/trunk/src/main/org/openscience/jchempaint/action/ChangeModeAction.java =================================================================== --- jchempaint/trunk/src/main/org/openscience/jchempaint/action/ChangeModeAction.java 2009-05-22 15:48:07 UTC (rev 14597) +++ jchempaint/trunk/src/main/org/openscience/jchempaint/action/ChangeModeAction.java 2009-05-26 14:40:20 UTC (rev 14598) @@ -35,7 +35,7 @@ import javax.swing.JComponent; import org.openscience.cdk.controller.AddAtomModule; -import org.openscience.cdk.controller.AddBondModule; +import org.openscience.cdk.controller.AddBondDragModule; import org.openscience.cdk.controller.AddRingModule; import org.openscience.cdk.controller.AlterBondStereoModule; import org.openscience.cdk.controller.AtomAtomMappingModule; @@ -74,7 +74,7 @@ } else if (type.equals("minus")) { hub.setActiveDrawModule(new ChangeFormalChargeModule(hub, -1)); } else if (type.equals("bond")) { - hub.setActiveDrawModule(new AddBondModule(hub)); + hub.setActiveDrawModule(new AddBondDragModule(hub)); hub.getController2DModel().setDrawElement("C"); } else if (type.equals("cyclesymbol")) { hub.setActiveDrawModule(new CycleSymbolModule(hub)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |