[Opencadtools-commits] r156 - branches/extCAD_sprint/src/com/iver/cit/gvsig/gui/cad/tools

psanxiao at osor.eu psanxiao at osor.eu
Sat Aug 13 18:54:24 CEST 2011


Author: psanxiao
Date: 2011-08-13 18:54:24 +0200 (Sat, 13 Aug 2011)
New Revision: 156

Modified:
   branches/extCAD_sprint/src/com/iver/cit/gvsig/gui/cad/tools/AreaCADTool.java
Log:
Added method getRowIndex to AreaCADTool in order to get the index of the inserted geometry

Modified: branches/extCAD_sprint/src/com/iver/cit/gvsig/gui/cad/tools/AreaCADTool.java
===================================================================
--- branches/extCAD_sprint/src/com/iver/cit/gvsig/gui/cad/tools/AreaCADTool.java	2011-08-12 00:18:05 UTC (rev 155)
+++ branches/extCAD_sprint/src/com/iver/cit/gvsig/gui/cad/tools/AreaCADTool.java	2011-08-13 16:54:24 UTC (rev 156)
@@ -148,7 +148,8 @@
 	private Integer virtualIndex;
 	
 	private IGeometry insertedGeometry;
-
+	private IRowEdited rowEdited;
+	
 	/**
 	 * Método de incio, para poner el código de todo lo que se requiera de una
 	 * carga previa a la utilización de la herramienta.
@@ -244,6 +245,14 @@
 	public IGeometry getInsertedGeometry() {
 		return insertedGeometry;
 	}
+	
+	public IRowEdited getRowEdited() {
+		return rowEdited;
+	}
+	
+	public int getVirtualIndex() {
+		return virtualIndex;
+	}
 
 	/**
 	 * Acción que almacena la geometria editada en el VectorialEditableAdapter
@@ -258,6 +267,7 @@
 				if(numShapes != 0){
 					if(virtualIndex != null){
 						row = vea.getRow(virtualIndex.intValue());
+						rowEdited = row;
 						IFeature feat = (IFeature) row.getLinkedRow().cloneRow();
 						IGeometry geometry = feat.getGeometry();
 						geometry = addHoleToGeom(geometry, (Point2D[])points.toArray(new Point2D[0]));
@@ -270,6 +280,7 @@
 					insertedGeometry = createNewPolygon((Point2D[])points.toArray(new Point2D[0]));
 					addGeometry(insertedGeometry);
 					virtualIndex = new Integer(vea.getRowCount()-1);
+					rowEdited = vea.getRow(virtualIndex.intValue());
 				}
 				numShapes++;
 			}




More information about the Opencadtools-commits mailing list