irstv/orbisgis — pull request #186 by agueganno (2012-10-17 13:32:27+00:00)
Title: Collection in toc

This commit adds collections in the TOC. It was not the original goal of this work... but, as I'm about to explain, it is linked too.

I've worked on this piece of code in order to improve the behaviour explained in #155. The problem was linked to the way we add layers to a LayerCollection : we call a method (setVisible) on the collection that makes visible all the layers it contains. As the root of our toc is just a LayerCollection... all the layers became visible when adding a new one in the toc.

As I was dealing with LayerCollections in the Toc, I decided to add them back. They are required by the MapContext, so it seemed quite logical to me. It was the opportunity to test deeper some changes necessary for #155. So here we are...

LayerCollections are back. You can add them, mix them, move them, remove them... I've been forced to make some work on listeners and co, as I obtained some strange behaviours. I've improved the way we manage drag and drop in the TOC too to be sure we can't send a LayerCollection in one of its children... Thinkgs like that...

Waiting for your comments :-)