irstv/orbisgis — pull request #524 by agueganno (2013-09-10 13:39:01+00:00)
Title: Management of optional strokes and fills

In some places, it is possible to disable stroke or both stroke and fill. This feature was quite buggy sometimes. #523 illustrates that - trying to open the simple style editor with a style containing a unique symbol area with a null stroke led to an exception. Some other problems I've found while working on it:
- Trying to edit a proportional point with a null stroke led to an NPE.
- Editing the single or fallback values of the mapped legend opens a dedicated editor. The line configuration panel was always active, even when the stroke was disabled.

This PR intends to solve these problems. I've worked in the simple editor in three different places. First, in LinePanel and AreaPanel, I've found a way to be able to build the UIs even if the associated legend element was null. Considering the coupling between these objects and their listeners, I've decided to use an internal field. This gives us stateful objects, but it seems to be working anyway. You'll notice that I disable the fields even when the checkbox is not shown. This way, we can disable the fields when editing mapped legend values.

In ProportionalPoint, I've greatly improved the strategy used to affect the values from the temporary unique symbol to the proportional point. I've isolated the code in a dedicated method in order to improve readability.

In MappedLegend editors for normal and fallback configurations, I've added a test that checks if the stroke is enabled so that we can disable it when needed in the temporary unique symbol legend.

intensive testing is needed here. I may have missed a corner case... Testers need to check that the states are well retrieved when closing the editor and opening it back, for all the mentioned configurations... It may take some time ;-)