Revision 21239
trunk/libraries/libTopology/src/com/iver/utiles/swing/threads/TopologyValidationTask.java | ||
---|---|---|
52 | 52 |
import org.gvsig.topology.Topology; |
53 | 53 |
|
54 | 54 |
import com.iver.cit.gvsig.fmap.MapContext; |
55 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
|
56 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
|
57 | 55 |
|
58 | 56 |
public class TopologyValidationTask extends CancellableProgressTask { |
59 | 57 |
|
... | ... | |
72 | 70 |
public void run() throws Exception { |
73 | 71 |
topology.validate(this); |
74 | 72 |
if(topology.getNumberOfErrors() > 0 && ! isCanceled()){ |
75 |
//first of all, we check for a topology error layer for the same geometry |
|
76 |
FLayers mapContextLyrs = mapContext.getLayers(); |
|
77 |
for(int i = 0; i < mapContextLyrs.getLayersCount(); i++){ |
|
78 |
FLayer layer = mapContextLyrs.getLayer(i); |
|
79 |
if(layer.getName().equalsIgnoreCase(topology.getName()+"_error")){ |
|
80 |
mapContextLyrs.removeLayer(layer); |
|
81 |
} |
|
82 |
} |
|
83 |
mapContextLyrs.addLayer(topology.getErrorLayer()); |
|
73 |
// //first of all, we check for a topology error layer for the same geometry |
|
74 |
// FLayers mapContextLyrs = mapContext.getLayers(); |
|
75 |
// for(int i = 0; i < mapContextLyrs.getLayersCount(); i++){ |
|
76 |
// FLayer layer = mapContextLyrs.getLayer(i); |
|
77 |
// if(layer.getName().equalsIgnoreCase(topology.getName()+"_error")){ |
|
78 |
// mapContextLyrs.removeLayer(layer); |
|
79 |
// } |
|
80 |
// } |
|
81 |
topology.updateErrorLyr(); |
|
82 |
// mapContext.beginAtomicEvent(); |
|
83 |
// mapContextLyrs.replaceLayer(topology.getName(),topology); |
|
84 |
// mapContext.endAtomicEvent(); |
|
84 | 85 |
} |
85 | 86 |
finished = true; |
86 | 87 |
} |
Also available in: Unified diff