irstv/orbisgis — pull request #471 by agouge (2013-07-04 14:26:44+00:00)
Title: Speed up the SimpleStyleEditor

The SimpleStyleEditor was really slow to start up due to numerous unnecessary ILegendPanel initializations (which were contained in the previous EPLegendHelper class, removed in 52889fd). In fact, all possible ILegendPanels were initialized every time the SimpleStyleEditor was loaded. In addition, all possible ILegendPanels corresponding to the Legends applicable to the current layer were initialized every time the LegendUIChooser was loaded. Both of these operations were extremely costly and really slowed down the interface.

I simplified the LegendUIChooser constructor so that its only parameter is the SimpleStyleEditor, from which we can recover the currently edited layer. From the layer, we populate an array of Strings containing only the names of the possible legends. When the user selects a legend and clicks OK, *only then* is one (and only one) new ILegendPanel instantiated (using the new ILegendPanelFactory). This makes things quite a bit snappier.

Note that with these changes, the LegendTree.addLegend() method has become significantly simpler.

In this PR, I also include all the missing preview images for interval classifications (thanks @gpetit).