Revision 7410 trunk/extensions/extCAD/src/com/iver/cit/gvsig/EditionUtilities.java
EditionUtilities.java | ||
---|---|---|
5 | 5 |
import com.iver.andami.PluginServices; |
6 | 6 |
import com.iver.cit.gvsig.fmap.DriverException; |
7 | 7 |
import com.iver.cit.gvsig.fmap.MapContext; |
8 |
import com.iver.cit.gvsig.fmap.drivers.FieldDescription; |
|
9 | 8 |
import com.iver.cit.gvsig.fmap.drivers.ILayerDefinition; |
10 | 9 |
import com.iver.cit.gvsig.fmap.drivers.LayerDefinition; |
11 | 10 |
import com.iver.cit.gvsig.fmap.drivers.VectorialDatabaseDriver; |
12 | 11 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
13 | 12 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
14 | 13 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
15 |
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
|
16 |
import com.iver.cit.gvsig.project.documents.view.ProjectView; |
|
14 |
import com.iver.cit.gvsig.project.documents.view.IProjectView; |
|
17 | 15 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
18 |
import com.iver.utiles.NumberUtilities; |
|
19 | 16 |
|
20 | 17 |
/** |
21 | 18 |
* @author fjp |
22 |
*
|
|
19 |
* |
|
23 | 20 |
* Clase con m?todos muy ?tiles a la hora de hacer nuevas extensiones, y otras |
24 | 21 |
* cosas que puedan ser gen?ricas para este plugin. |
25 | 22 |
* |
26 | 23 |
*/ |
27 | 24 |
public class EditionUtilities { |
28 |
|
|
25 |
|
|
29 | 26 |
public static final int EDITION_STATUS_NO_EDITION = 0; |
30 | 27 |
public static final int EDITION_STATUS_ONE_VECTORIAL_LAYER_ACTIVE_AND_EDITABLE = 1; |
31 | 28 |
public static final int EDITION_STATUS_ONE_VECTORIAL_LAYER_ACTIVE = 2; |
... | ... | |
41 | 38 |
|
42 | 39 |
if (f instanceof View) { |
43 | 40 |
View vista = (View) f; |
44 |
ProjectView model = vista.getModel(); |
|
41 |
IProjectView model = vista.getModel();
|
|
45 | 42 |
MapContext mapa = model.getMapContext(); |
46 | 43 |
|
47 | 44 |
FLayers capas = mapa.getLayers(); |
... | ... | |
64 | 61 |
return EDITION_STATUS_ONE_VECTORIAL_LAYER_ACTIVE; |
65 | 62 |
if (numActiveVectorial > 1) |
66 | 63 |
return EDITION_STATUS_MULTIPLE_VECTORIAL_LAYER_ACTIVE; |
67 |
|
|
64 |
|
|
68 | 65 |
} |
69 |
|
|
66 |
|
|
70 | 67 |
return status; |
71 | 68 |
} |
72 | 69 |
|
... | ... | |
80 | 77 |
|
81 | 78 |
if (f instanceof View) { |
82 | 79 |
View vista = (View) f; |
83 |
ProjectView model = vista.getModel(); |
|
80 |
IProjectView model = vista.getModel();
|
|
84 | 81 |
MapContext mapa = model.getMapContext(); |
85 |
|
|
82 |
|
|
86 | 83 |
ArrayList resul = new ArrayList(); |
87 | 84 |
|
88 | 85 |
FLayers capas = mapa.getLayers(); |
... | ... | |
101 | 98 |
} |
102 | 99 |
} |
103 | 100 |
return (FLayer[]) resul.toArray(new FLayer[0]); |
104 |
|
|
101 |
|
|
105 | 102 |
} |
106 |
|
|
103 |
|
|
107 | 104 |
return null; |
108 | 105 |
} |
109 | 106 |
|
... | ... | |
112 | 109 |
if (layer.getSource().getDriver() instanceof VectorialDatabaseDriver) |
113 | 110 |
{ |
114 | 111 |
VectorialDatabaseDriver dbDriver = (VectorialDatabaseDriver) layer.getSource().getDriver(); |
115 |
return dbDriver.getLyrDef();
|
|
112 |
return dbDriver.getLyrDef(); |
|
116 | 113 |
} |
117 | 114 |
else |
118 | 115 |
{ |
... | ... | |
125 | 122 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) { |
126 | 123 |
e.printStackTrace(); |
127 | 124 |
throw new DriverException(e); |
128 |
}
|
|
125 |
} |
|
129 | 126 |
} |
130 | 127 |
return lyrDef; |
131 | 128 |
} |
132 |
|
|
129 |
|
|
133 | 130 |
} |
Also available in: Unified diff