Revision 18995 trunk/libraries/libTopology/src/com/iver/utiles/swing/threads/TopologyValidationTask.java
TopologyValidationTask.java | ||
---|---|---|
51 | 51 |
import org.gvsig.topology.Messages; |
52 | 52 |
import org.gvsig.topology.Topology; |
53 | 53 |
|
54 |
import com.iver.cit.gvsig.fmap.MapContext; |
|
55 |
|
|
54 | 56 |
public class TopologyValidationTask extends CancellableProgressTask { |
55 | 57 |
|
56 | 58 |
static final String NOTE_PREFIX = Messages.getText("VALIDANDO_REGLA"); |
57 | 59 |
Topology topology; |
60 |
MapContext mapContext; |
|
58 | 61 |
|
59 |
public TopologyValidationTask(Topology topology) { |
|
62 |
public TopologyValidationTask(Topology topology, MapContext mapContext) {
|
|
60 | 63 |
this.topology = topology; |
64 |
this.mapContext = mapContext; |
|
61 | 65 |
super.statusMessage = Messages.getText("VALIDANDO_TOPOLOGIA"); |
62 | 66 |
super.currentNote = NOTE_PREFIX |
63 | 67 |
+ Messages.getText(topology.getRule(0).getName()); |
... | ... | |
65 | 69 |
|
66 | 70 |
public void run() throws Exception { |
67 | 71 |
topology.validate(this); |
72 |
if(topology.getNumberOfErrors() > 0) |
|
73 |
mapContext.getLayers().addLayer(topology.getErrorLayer()); |
|
68 | 74 |
finished = true; |
69 | 75 |
} |
70 | 76 |
|
Also available in: Unified diff