From: John M. <jo...@eb...> - 2014-01-06 21:52:10
|
Hi All, Fixes bugs in our JChemPaint-Hofix - does anyone know how to do compound edits with IRelayChemForward etc. I currently have this getUndoRedoHandler().postEdit(getUndoRedoFactory().getAdjustBondOrdersEdit(orders, stereos, "Stereo bond assignment", this)); getUndoRedoHandler().postEdit(getUndoRedoFactory().getChangeCoordsEdit(coords, "Clean Up")); I think was due to be in cdk-control so there must be a way to do the following (using the JDK undo/redo framework). CompoundEdit edit = new CompoundEdit(); edit.addEdit(firstEdit); edit.addEdit(secondEdit); edit.end(); Thanks, J |
From: gilleain t. <gil...@gm...> - 2014-01-07 14:12:22
|
Hi, Hmmm. So I don't see any suitable 'CompoundEdit' class in the o.o.j.controller.undoredo package. It might not be so hard to make a class that implements IUndoRedoable and maintains a list of child IUndoRedoable classes. Not that I'm encouraging more drift between versions of Jchempaint of course, not not me… gilleain On 1/6/14, John May <jo...@eb...> wrote: > Hi All, > > Fixes bugs in our JChemPaint-Hofix - does anyone know how to do compound > edits with IRelayChemForward etc. I currently have this > > getUndoRedoHandler().postEdit(getUndoRedoFactory().getAdjustBondOrdersEdit(orders, > > stereos, > "Stereo bond > assignment", > > this)); > getUndoRedoHandler().postEdit(getUndoRedoFactory().getChangeCoordsEdit(coords, > "Clean Up")); > > I think was due to be in cdk-control so there must be a way to do the > following (using the JDK undo/redo framework). > > CompoundEdit edit = new CompoundEdit(); > edit.addEdit(firstEdit); > edit.addEdit(secondEdit); > edit.end(); > > Thanks, > J |
From: John M. <joh...@gm...> - 2014-01-07 19:59:20
|
In the end I wrote an adapter - it turns out JChemPaint tries to cast to the Swing UndoableEdit anyways so I just need to intimidate the IUndoRedoable enough to not complain. I was getting a class cast exception when I tried to do it properly. I might actually refactor the undoable/edits I remember Ralf had problems and a much simpler solution is to simply store the entire chem model on the Undo/Redo stack. Thanks, J On 7 Jan 2014, at 14:12, gilleain torrance <gil...@gm...> wrote: > Hi, > > Hmmm. So I don't see any suitable 'CompoundEdit' class in the > o.o.j.controller.undoredo package. It might not be so hard to make a > class that implements IUndoRedoable and maintains a list of child > IUndoRedoable classes. > > Not that I'm encouraging more drift between versions of Jchempaint of > course, not not me… > > gilleain > > On 1/6/14, John May <jo...@eb...> wrote: >> Hi All, >> >> Fixes bugs in our JChemPaint-Hofix - does anyone know how to do compound >> edits with IRelayChemForward etc. I currently have this >> >> getUndoRedoHandler().postEdit(getUndoRedoFactory().getAdjustBondOrdersEdit(orders, >> >> stereos, >> "Stereo bond >> assignment", >> >> this)); >> getUndoRedoHandler().postEdit(getUndoRedoFactory().getChangeCoordsEdit(coords, >> "Clean Up")); >> >> I think was due to be in cdk-control so there must be a way to do the >> following (using the JDK undo/redo framework). >> >> CompoundEdit edit = new CompoundEdit(); >> edit.addEdit(firstEdit); >> edit.addEdit(secondEdit); >> edit.end(); >> >> Thanks, >> J > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > Cdk-devel mailing list > Cdk...@li... > https://lists.sourceforge.net/lists/listinfo/cdk-devel |