Revision 81
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultEditingBehavior.java | ||
---|---|---|
51 | 51 |
import org.gvsig.vectorediting.lib.api.EditingService; |
52 | 52 |
import org.gvsig.vectorediting.lib.api.EditingServiceParameter; |
53 | 53 |
import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE; |
54 |
import org.gvsig.vectorediting.lib.api.exceptions.ChangeCurrentLayerException; |
|
55 | 54 |
import org.gvsig.vectorediting.lib.api.exceptions.CreateEditingBehaviorException; |
56 | 55 |
import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException; |
57 | 56 |
import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException; |
... | ... | |
122 | 121 |
getMapControl().setTool("VectorEditing"); |
123 | 122 |
} |
124 | 123 |
else if (!layer.isEditing() && layer.isActive()) { |
125 |
// try{ |
|
126 |
// // changeCurrentLayer((FLyrVect) layer); |
|
127 |
// } |
|
128 |
// catch (ChangeCurrentLayerException e1) { |
|
129 |
// //TODO Auto-generated catch block |
|
130 |
// e1.printStackTrace(); |
|
131 |
// } |
|
132 | 124 |
hideConsole(); |
133 | 125 |
getMapControl().setTool("zoomIn"); |
134 | 126 |
} |
135 |
try { |
|
136 | 127 |
changeCurrentLayer((FLyrVect) layer); |
137 |
} |
|
138 |
catch (ChangeCurrentLayerException e1) { |
|
139 |
// TODO Auto-generated catch block |
|
140 |
e1.printStackTrace(); |
|
141 |
} |
|
142 |
|
|
143 | 128 |
} |
144 | 129 |
|
145 | 130 |
} |
... | ... | |
174 | 159 |
FLayers layers = mapControl.getMapContext().getLayers(); |
175 | 160 |
for (int i = 0; i < layers.getLayersCount(); i++) { |
176 | 161 |
if (layers.getLayer(i) instanceof FLyrVect |
177 |
&& layers.getLayer(i).isActive()) try {
|
|
162 |
&& layers.getLayer(i).isActive()) |
|
178 | 163 |
changeCurrentLayer((FLyrVect) layers.getLayer(i)); |
179 |
} |
|
180 |
catch (ChangeCurrentLayerException e) { |
|
181 |
throw new CreateEditingBehaviorException(e); |
|
182 |
} |
|
183 | 164 |
} |
184 | 165 |
} |
185 | 166 |
} |
... | ... | |
472 | 453 |
* @param layer |
473 | 454 |
*/ |
474 | 455 |
private void changeCurrentLayer(FLyrVect layer) |
475 |
throws ChangeCurrentLayerException {
|
|
456 |
{ |
|
476 | 457 |
this.currentLayer = layer; |
477 | 458 |
if (currentLayer != null) { |
478 | 459 |
this.featureStore = (FeatureStore) currentLayer.getFeatureStore(); |
... | ... | |
484 | 465 |
} |
485 | 466 |
if (getActiveService() != null && layer.isActive()) { |
486 | 467 |
getNextParameter(); |
487 |
// MainFrame main = PluginServices.getMainFrame(); |
|
488 |
// main.setSelectedTool(getActiveService().getName()); |
|
489 | 468 |
} |
490 | 469 |
} |
491 | 470 |
|
Also available in: Unified diff