Revision 26240
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/legend/gui/General.java | ||
---|---|---|
83 | 83 |
import com.iver.cit.gvsig.fmap.core.FShape; |
84 | 84 |
import com.iver.cit.gvsig.fmap.drivers.DBLayerDefinition; |
85 | 85 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
86 |
import com.iver.cit.gvsig.fmap.drivers.VectorialDriver; |
|
86 | 87 |
import com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter; |
87 | 88 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
88 | 89 |
import com.iver.cit.gvsig.fmap.layers.FLyrDefault; |
89 | 90 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
90 | 91 |
import com.iver.cit.gvsig.fmap.layers.ReadableVectorial; |
92 |
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
|
91 | 93 |
import com.iver.cit.gvsig.fmap.layers.VectorialAdapter; |
92 | 94 |
import com.iver.cit.gvsig.fmap.layers.VectorialDBAdapter; |
93 | 95 |
import com.iver.cit.gvsig.fmap.layers.VectorialFileAdapter; |
... | ... | |
170 | 172 |
this.add(new JBlank(5, 10), BorderLayout.EAST); |
171 | 173 |
|
172 | 174 |
} |
173 |
private String getTypeVectorLayer() throws ReadDriverException { |
|
174 |
if (layer instanceof FLyrVect){ |
|
175 |
String typeString=""; |
|
176 |
int type=((FLyrVect)layer).getShapeType(); |
|
177 |
if (FShape.POINT == type){ |
|
178 |
typeString="Point2D"; |
|
179 |
} else if (FShape.LINE == type){ |
|
180 |
typeString="Line2D"; |
|
181 |
} else if (FShape.POLYGON == type){ |
|
182 |
typeString="Polygon2D"; |
|
183 |
} else if (FShape.MULTIPOINT == type){ |
|
184 |
typeString="MultiPint2D"; |
|
185 |
} else if (FShape.MULTI == type){ |
|
186 |
typeString="2D"; |
|
187 |
} else if ((FShape.POINT | FShape.Z) == type ){ |
|
188 |
typeString="Point3D"; |
|
189 |
} else if ((FShape.LINE | FShape.Z) == type ){ |
|
190 |
typeString="Line3D"; |
|
191 |
} else if ((FShape.POLYGON | FShape.Z) == type ){ |
|
192 |
typeString="Polygon3D"; |
|
193 |
} else if ((FShape.MULTIPOINT | FShape.Z) == type ){ |
|
194 |
typeString="MultiPoint3D"; |
|
195 |
} else if ((FShape.MULTI | FShape.Z) == type ){ |
|
196 |
typeString="3D"; |
|
197 |
} else if ((FShape.POINT | FShape.M) == type ){ |
|
198 |
typeString="PointM"; |
|
199 |
} else if ((FShape.LINE | FShape.M) == type ){ |
|
200 |
typeString="LineM"; |
|
201 |
} else if ((FShape.POLYGON | FShape.M) == type ){ |
|
202 |
typeString="PolygonM"; |
|
203 |
} else if ((FShape.MULTIPOINT | FShape.M) == type ){ |
|
204 |
typeString="MultiPointM"; |
|
205 |
} else if ((FShape.MULTI | FShape.M) == type ){ |
|
206 |
typeString="M"; |
|
207 |
} |
|
208 |
return typeString; |
|
209 |
} |
|
210 |
return ""; |
|
175 |
private String getTypeVectorLayer() throws ReadDriverException { |
|
176 |
if (layer instanceof FLyrVect){ |
|
177 |
String typeString=""; |
|
178 |
int typeShape=((FLyrVect)layer).getShapeType(); |
|
179 |
if (FShape.MULTI==typeShape){ |
|
180 |
ReadableVectorial rv=((FLyrVect)layer).getSource(); |
|
181 |
if (rv.getShapeCount()>0){ |
|
182 |
if ((rv.getShape(0).getGeometryType() | FShape.Z) == FShape.MULTI){ |
|
183 |
typeString="Geometries2D"; |
|
184 |
}else{ |
|
185 |
typeString="Geometries3D"; |
|
186 |
} |
|
187 |
} |
|
188 |
}else{ |
|
189 |
ReadableVectorial rv=((FLyrVect)layer).getSource(); |
|
190 |
if (rv.getShapeCount()>0){ |
|
191 |
int type=rv.getShape(0).getGeometryType(); |
|
192 |
if (FShape.POINT == type){ |
|
193 |
typeString="Point2D"; |
|
194 |
} else if (FShape.LINE == type){ |
|
195 |
typeString="Line2D"; |
|
196 |
} else if (FShape.POLYGON == type){ |
|
197 |
typeString="Polygon2D"; |
|
198 |
} else if (FShape.MULTIPOINT == type){ |
|
199 |
typeString="MultiPint2D"; |
|
200 |
} else if ((FShape.POINT | FShape.Z) == type ){ |
|
201 |
typeString="Point3D"; |
|
202 |
} else if ((FShape.LINE | FShape.Z) == type ){ |
|
203 |
typeString="Line3D"; |
|
204 |
} else if ((FShape.POLYGON | FShape.Z) == type ){ |
|
205 |
typeString="Polygon3D"; |
|
206 |
} else if ((FShape.MULTIPOINT | FShape.Z) == type ){ |
|
207 |
typeString="MultiPoint3D"; |
|
208 |
} else if ((FShape.POINT | FShape.M) == type ){ |
|
209 |
typeString="PointM"; |
|
210 |
} else if ((FShape.LINE | FShape.M) == type ){ |
|
211 |
typeString="LineM"; |
|
212 |
} else if ((FShape.POLYGON | FShape.M) == type ){ |
|
213 |
typeString="PolygonM"; |
|
214 |
} else if ((FShape.MULTIPOINT | FShape.M) == type ){ |
|
215 |
typeString="MultiPointM"; |
|
216 |
} else if ((FShape.MULTI | FShape.M) == type ){ |
|
217 |
typeString="M"; |
|
218 |
} |
|
219 |
} |
|
220 |
} |
|
221 |
return typeString; |
|
211 | 222 |
} |
223 |
return ""; |
|
224 |
} |
|
212 | 225 |
|
213 | 226 |
/** |
214 | 227 |
* Sets the necessary properties in the panel. This properties are |
Also available in: Unified diff