Revision 5104
trunk/extensions/extCAD/src/com/iver/cit/gvsig/StartEditing.java | ||
---|---|---|
1 | 1 |
package com.iver.cit.gvsig; |
2 | 2 |
|
3 |
import com.hardcode.gdbms.engine.data.driver.DriverException; |
|
3 | 4 |
import com.iver.andami.PluginServices; |
4 | 5 |
import com.iver.andami.plugins.Extension; |
5 | 6 |
import com.iver.cit.gvsig.fmap.FMap; |
... | ... | |
8 | 9 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
9 | 10 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
10 | 11 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
12 |
import com.iver.cit.gvsig.gui.Table; |
|
11 | 13 |
import com.iver.cit.gvsig.gui.View; |
12 | 14 |
import com.iver.cit.gvsig.gui.cad.CADTool; |
13 | 15 |
import com.iver.cit.gvsig.gui.tokenmarker.ConsoleToken; |
16 |
import com.iver.cit.gvsig.project.ProjectFactory; |
|
14 | 17 |
import com.iver.cit.gvsig.project.ProjectTable; |
15 | 18 |
import com.iver.cit.gvsig.project.ProjectView; |
16 | 19 |
import com.iver.utiles.console.jedit.KeywordMap; |
... | ... | |
50 | 53 |
vista.getConsolePanel().setTokenMarker(consoletoken); |
51 | 54 |
vista.showConsole(); |
52 | 55 |
MapControl mapControl = (MapControl) vista.getMapControl(); |
53 |
CADExtension.getEditionManager().setMapControl(mapControl); |
|
56 |
EditionManager editionManager=CADExtension.getEditionManager(); |
|
57 |
editionManager.setMapControl(mapControl); |
|
58 |
|
|
54 | 59 |
ProjectView model = vista.getModel(); |
55 | 60 |
FMap mapa = model.getMapContext(); |
56 | 61 |
FLayers layers = mapa.getLayers(); |
57 |
|
|
58 | 62 |
for (int i = 0; i < layers.getLayersCount(); i++) { |
59 | 63 |
if (layers.getLayer(i) instanceof FLyrVect |
60 | 64 |
&& layers.getLayer(i).isActive()) { |
... | ... | |
78 | 82 |
ProjectExtension pe = (ProjectExtension) PluginServices |
79 | 83 |
.getExtension(ProjectExtension.class); |
80 | 84 |
ProjectTable pt = pe.getProject().getTable(lv); |
81 |
if (pt != null) |
|
85 |
if (pt != null){
|
|
82 | 86 |
pt.setModel(vea); |
83 |
|
|
87 |
changeModelTable(pt); |
|
88 |
} |
|
84 | 89 |
return; |
85 | 90 |
} |
86 | 91 |
} |
... | ... | |
104 | 109 |
// vista.getMapControl().drawMap(false); |
105 | 110 |
} |
106 | 111 |
} |
112 |
private void changeModelTable(ProjectTable pt){ |
|
113 |
com.iver.andami.ui.mdiManager.View[] views = (com.iver.andami.ui.mdiManager.View[]) PluginServices.getMDIManager().getAllViews(); |
|
107 | 114 |
|
115 |
for (int i=0 ; i<views.length ; i++){ |
|
116 |
if (views[i] instanceof Table){ |
|
117 |
Table table=(Table)views[i]; |
|
118 |
ProjectTable model =table.getModel(); |
|
119 |
if (model.equals(pt)){ |
|
120 |
table.setModel(pt); |
|
121 |
} |
|
122 |
} |
|
123 |
} |
|
124 |
} |
|
108 | 125 |
/** |
109 | 126 |
* @see com.iver.andami.plugins.IExtension#isEnabled() |
110 | 127 |
*/ |
Also available in: Unified diff