Revision 5878 trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/tools/CopyCADTool.java
CopyCADTool.java | ||
---|---|---|
54 | 54 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
55 | 55 |
import com.iver.cit.gvsig.fmap.edition.DefaultRowEdited; |
56 | 56 |
import com.iver.cit.gvsig.fmap.edition.EditionEvent; |
57 |
import com.iver.cit.gvsig.fmap.edition.IRowEdited; |
|
57 | 58 |
import com.iver.cit.gvsig.fmap.edition.UtilFunctions; |
58 | 59 |
import com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter; |
59 | 60 |
import com.iver.cit.gvsig.gui.cad.DefaultCADTool; |
... | ... | |
135 | 136 |
VectorialLayerEdited vle=getVLE(); |
136 | 137 |
VectorialEditableAdapter vea = vle.getVEA(); |
137 | 138 |
ArrayList selectedRow=getSelectedRows(); |
138 |
|
|
139 |
ArrayList selectedRowAux=new ArrayList(); |
|
139 | 140 |
if (status.equals("Copy.FirstPointToMove")) { |
140 | 141 |
firstPoint = new Point2D.Double(x, y); |
141 | 142 |
} else if (status.equals("Copy.SecondPointToMove")) { |
... | ... | |
144 | 145 |
vea.startComplexRow(); |
145 | 146 |
|
146 | 147 |
try { |
147 |
///ArrayList selectedRowAux=new ArrayList(); |
|
148 |
|
|
149 | 148 |
for (int i = 0; i < selectedRow.size(); i++) { |
150 | 149 |
DefaultFeature fea = (DefaultFeature) ((DefaultRowEdited)selectedRow.get(i)) |
151 | 150 |
.getLinkedRow() |
... | ... | |
154 | 153 |
UtilFunctions.moveGeom(fea.getGeometry(), lastPoint.getX() - |
155 | 154 |
firstPoint.getX(), lastPoint.getY() - firstPoint.getY()); |
156 | 155 |
|
157 |
vea.addRow(fea,getName(),EditionEvent.GRAPHIC); |
|
158 |
/// selectedRowAux.add(new DefaultRowEdited(fea,IRowEdited.STATUS_ADDED,index));
|
|
156 |
int index=vea.addRow(fea,getName(),EditionEvent.GRAPHIC);
|
|
157 |
selectedRowAux.add(new DefaultRowEdited(fea,IRowEdited.STATUS_ADDED,index)); |
|
159 | 158 |
} |
160 | 159 |
vea.endComplexRow(); |
161 | 160 |
clearSelection(); |
162 |
/// selectedRow=selectedRowAux;
|
|
161 |
selectedRow.addAll(selectedRowAux);
|
|
163 | 162 |
} catch (DriverIOException e) { |
164 | 163 |
e.printStackTrace(); |
165 | 164 |
} catch (IOException e) { |
Also available in: Unified diff