MM: I think you solution of attaching an "undoable command" to a layer is an elegant solution to the problem we discussed.
I'm thinking it would be cool at some point to allow the user to set the start and end points of a group of undoable commands. That way we could remove one "group" of commands from the undo stack if needed, while preserving the other groups. Perhaps this would be something like the "Editing Sessions" they use in ArcGIS. In fact, I remember an EditSession class or something like it that enables undo functionality in OpenJUMP. Just thinking out loud here. Landon On Sun, Jan 20, 2013 at 10:55 AM, Michaël Michaud <michael.mich...@free.fr> wrote: > Hi all, > > I just made two fixes which should solve the memory leaks observed by Jukka > (r3247). > > First is a one-line fix in AddNewFeaturesPlugIn which retained the whole > text added as WKT. > Now EnterWKTDialog free the resources before returning. > > Second is a much larger fix on undo/redo mechanism with possible side > effects. > Here is how it used to work : > - modify layer A > - modify layer B > - modify layer C > - remove layer B > - undo : undo modification on layer C > - undo : throws an exception (try to modifiy a layer which has been removed) > > The modification : > Now, a UndoableCommand can be linked to a Layer. > In that case, a listener is added to deactivate the command if the Layer is > removed : > It is not possible to remove the command from the undo stack (I could not > find a way) but it is possible to free resources related to the modification > and to deactivate the command so that it is skipped. > > Some modifications work on the whole workbench, some have to done > where new UndoableCommand are created (work in progress). > Now : > - modify layer A > - modify layer B > - modify layer C > - remove layer B > - undo : undo modification on layer C > - undo : undo modification on layer A > > One possible side effect is a slow down of the whole system, > because listeners added to each single command are listening all feature > events and all layer events. > > Please, try and report, > > Michaël > > > Good observations MM. > > Does OJ currently have a way to clear the undo queue? > > If not, I might look into to adding that functionality next week. > > Landon > > On Sat, Jan 19, 2013 at 4:40 AM, Michaël Michaud > <michael.mich...@free.fr> wrote: > > Hi Jukka, > > I started analysing the problem and I think there are different > things in your observations. > > 1) features kept in the undo stack. Yes, they are. I think this is the > normal behaviour as you may want to undo the "add wkt geometry" > action, but in this case, this takes a lot of memory. > 2) undo data related to a layer is probably not released when the layer > is removed (your observation). This is a bug. Another consequence is > that an exception is thrown if you undo an action adding features to a > layer which does not exists any more. > I'll try to fix this bug, but It's not very simple, so let's see... > 3) The slowness of right click on a layername seems to be related to the > windows clipboard, not the openjump undo stack. If you empty the > clipboard (just select an empty string), openjump behaves normally > again. I don't think it is necessary to go further with this one. > > Regards, > > Michaël > > > Hi, > > My data were just polygons from BBOXes. I believe you can make the first > test by making 200000 copies of one polygon with a text editor and > copy-paste them all into WKT input box. > POLYGON ((40 280, 40 320, 80 320, 80 280, 40 280)) > > -Jukka- > > Landon Blake wrote: > > Jukka: > Can you send me you data so I can do some testing. > I remember this same issue being raised on the mailing list before, > and I thought it had been corrected. Maybe not. At any rate, I'd like > to do some poking around with the data you are using to see if I can > verify a problem. > Landon > > On Fri, Jan 18, 2013 at 7:10 AM, Rahkonen Jukka > <jukka.rahko...@mmmtike.fi> wrote: > > Hi, > > While playing with BBOXes converted into polygons I noticed that OJ does not > work extremely well after pasting for example 200000 polygons as WKT from > clipboard into the WKT input box. The conversion into OJ features is > surprisingly fast, but after the polygons have been inserted into the layer > there are some issues. > > - A lot of memory is reserved and Garbage collect does not free it. Even > deleting the layer does not help. I guess that features are kept in undo > buffer or something. Perhaps we should have a button for clearing the Undo? > - Right click context menu does not work for layers in the Table of content. > It does work for layer groups, but slowly. > > -Jukka Rahkonen- > > ------------------------------------------------------------------------------ > Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and > much more. Get web development skills now with LearnDevNow - > 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. > SALE $99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122812 > _______________________________________________ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. SALE $99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122912 > _______________________________________________ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. SALE $99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122912 > _______________________________________________ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. SALE $99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122912 > _______________________________________________ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. SALE $99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122912 > _______________________________________________ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > > > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnmore_123012 > _______________________________________________ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > ------------------------------------------------------------------------------ Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel