Revision 5227 trunk/extensions/extCAD/src/com/iver/cit/gvsig/EditionManager.java
EditionManager.java | ||
---|---|---|
6 | 6 |
import com.iver.andami.PluginServices; |
7 | 7 |
import com.iver.cit.gvsig.fmap.MapControl; |
8 | 8 |
import com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter; |
9 |
import com.iver.cit.gvsig.fmap.layers.CancelationException; |
|
9 | 10 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
10 | 11 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
12 |
import com.iver.cit.gvsig.fmap.layers.LayerCollectionEvent; |
|
13 |
import com.iver.cit.gvsig.fmap.layers.LayerCollectionListener; |
|
11 | 14 |
import com.iver.cit.gvsig.fmap.layers.LayerEvent; |
12 | 15 |
import com.iver.cit.gvsig.fmap.layers.LayerListener; |
16 |
import com.iver.cit.gvsig.fmap.layers.LayerPositionEvent; |
|
17 |
import com.iver.cit.gvsig.gui.View; |
|
13 | 18 |
import com.iver.cit.gvsig.layers.FactoryLayerEdited; |
14 | 19 |
import com.iver.cit.gvsig.layers.ILayerEdited; |
15 | 20 |
import com.iver.cit.gvsig.layers.VectorialLayerEdited; |
... | ... | |
37 | 42 |
* para permitir tener varias vistas con temas en edici?n |
38 | 43 |
* |
39 | 44 |
*/ |
40 |
public class EditionManager implements LayerListener { |
|
45 |
public class EditionManager implements LayerListener,LayerCollectionListener {
|
|
41 | 46 |
private ArrayList editedLayers = new ArrayList(); |
42 | 47 |
private ArrayList editedTables = new ArrayList(); |
43 | 48 |
//private ArrayList activeLayerEdited = new ArrayList(); |
... | ... | |
66 | 71 |
} |
67 | 72 |
|
68 | 73 |
public void activationChanged(LayerEvent e) { |
69 |
if (e.getSource().isActive()) |
|
74 |
if (e.getSource().isActive()){
|
|
70 | 75 |
ile=getLayerEdited(e.getSource()); |
76 |
View view=(View)PluginServices.getMDIManager().getActiveView(); |
|
77 |
if (e.getSource().isEditing()){ |
|
78 |
view.showConsole(); |
|
79 |
}else{ |
|
80 |
view.hideConsole(); |
|
81 |
} |
|
82 |
|
|
83 |
} |
|
71 | 84 |
if (ile==null || ile.getLayer().equals(e.getSource())){ |
72 | 85 |
|
73 | 86 |
if (ile!=null && !ile.getLayer().isActive()) { |
... | ... | |
171 | 184 |
{ |
172 | 185 |
this.mapCtrl = mapCtrl; |
173 | 186 |
mapCtrl.getMapContext().getLayers().addLayerListener(this); |
187 |
mapCtrl.getMapContext().getLayers().addLayerCollectionListener(this); |
|
174 | 188 |
} |
175 | 189 |
} |
176 | 190 |
|
191 |
public void layerAdded(LayerCollectionEvent e) { |
|
192 |
// TODO Auto-generated method stub |
|
177 | 193 |
|
194 |
} |
|
195 |
|
|
196 |
public void layerMoved(LayerPositionEvent e) { |
|
197 |
// TODO Auto-generated method stub |
|
198 |
|
|
199 |
} |
|
200 |
|
|
201 |
public void layerRemoved(LayerCollectionEvent e) { |
|
202 |
VectorialLayerEdited vle=(VectorialLayerEdited)getActiveLayerEdited(); |
|
203 |
FLyrVect lv=(FLyrVect)vle.getLayer(); |
|
204 |
if (e.getAffectedLayer().equals(lv)){ |
|
205 |
View view=(View)PluginServices.getMDIManager().getActiveView(); |
|
206 |
view.hideConsole(); |
|
207 |
view.validate(); |
|
208 |
view.repaint(); |
|
209 |
} |
|
210 |
|
|
211 |
} |
|
212 |
|
|
213 |
public void layerAdding(LayerCollectionEvent e) throws CancelationException { |
|
214 |
// TODO Auto-generated method stub |
|
215 |
|
|
216 |
} |
|
217 |
|
|
218 |
public void layerMoving(LayerPositionEvent e) throws CancelationException { |
|
219 |
// TODO Auto-generated method stub |
|
220 |
|
|
221 |
} |
|
222 |
|
|
223 |
public void layerRemoving(LayerCollectionEvent e) throws CancelationException { |
|
224 |
// TODO Auto-generated method stub |
|
225 |
|
|
226 |
} |
|
227 |
|
|
228 |
public void activationChanged(LayerCollectionEvent e) throws CancelationException { |
|
229 |
// TODO Auto-generated method stub |
|
230 |
|
|
231 |
} |
|
232 |
|
|
233 |
public void visibilityChanged(LayerCollectionEvent e) throws CancelationException { |
|
234 |
// TODO Auto-generated method stub |
|
235 |
|
|
236 |
} |
|
237 |
|
|
238 |
|
|
178 | 239 |
} |
Also available in: Unified diff