Revision 6474 trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/tools/ComplexSelectionCADTool.java
ComplexSelectionCADTool.java | ||
---|---|---|
54 | 54 |
import com.iver.cit.gvsig.CADExtension; |
55 | 55 |
import com.iver.cit.gvsig.fmap.MapControl; |
56 | 56 |
import com.iver.cit.gvsig.fmap.ViewPort; |
57 |
import com.iver.cit.gvsig.fmap.core.FCircle2D; |
|
58 |
import com.iver.cit.gvsig.fmap.core.FShape; |
|
59 | 57 |
import com.iver.cit.gvsig.fmap.core.GeneralPathX; |
60 | 58 |
import com.iver.cit.gvsig.fmap.core.Handler; |
61 | 59 |
import com.iver.cit.gvsig.fmap.core.IFeature; |
62 | 60 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
63 | 61 |
import com.iver.cit.gvsig.fmap.core.ShapeFactory; |
64 | 62 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
63 |
import com.iver.cit.gvsig.fmap.edition.DefaultRowEdited; |
|
65 | 64 |
import com.iver.cit.gvsig.fmap.edition.IRowEdited; |
66 | 65 |
import com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter; |
66 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
|
67 |
import com.iver.cit.gvsig.gui.Table; |
|
67 | 68 |
import com.iver.cit.gvsig.gui.cad.CADTool; |
68 | 69 |
import com.iver.cit.gvsig.gui.cad.exception.CommandException; |
69 | 70 |
import com.iver.cit.gvsig.gui.cad.tools.smc.ComplexSelectionCADToolContext; |
... | ... | |
142 | 143 |
} else if (status.equals("Selection.WithFeatures")) { |
143 | 144 |
} else if (status.equals("Selection.WithHandlers")) { |
144 | 145 |
vea.startComplexRow(); |
146 |
ArrayList selectedRowsAux=new ArrayList(); |
|
145 | 147 |
for (int i = 0; i < selectedRow.size(); i++) { |
146 | 148 |
IRowEdited row = (IRowEdited) selectedRow.get(i); |
149 |
IFeature feat = (IFeature) row.getLinkedRow().cloneRow(); |
|
147 | 150 |
// Movemos los handlers que hemos seleccionado |
148 | 151 |
// previamente dentro del m?todo select() |
149 | 152 |
for (int k = 0; k < selectedHandler.size(); k++) { |
... | ... | |
151 | 154 |
h.set(x, y); |
152 | 155 |
} |
153 | 156 |
|
154 |
modifyFeature(row.getIndex(), (IFeature) row.getLinkedRow().cloneRow()); |
|
157 |
modifyFeature(row.getIndex(), feat); |
|
158 |
selectedRowsAux.add(new DefaultRowEdited(feat,IRowEdited.STATUS_MODIFIED,row.getIndex())); |
|
155 | 159 |
} |
160 |
firstPoint=new Point2D.Double(x,y); |
|
161 |
vle.setSelectionCache(selectedRowsAux); |
|
156 | 162 |
try { |
157 | 163 |
String description=PluginServices.getText(this,"move_handlers"); |
158 | 164 |
vea.endComplexRow(description); |
... | ... | |
513 | 519 |
} |
514 | 520 |
System.out.println("ESTADO ACTUAL: " + getStatus()); |
515 | 521 |
|
516 |
// ESTO LO QUITO POR AHORA, PERO PUEDE QUE LO NECESITEMOS VOLVER A PONER. |
|
517 |
// Lo he quitado porque cuando seleccionas algo con CAD, molesta que |
|
518 |
// te hagan un redibujado. |
|
519 |
/* FLyrVect lv=(FLyrVect)((VectorialLayerEdited)CADExtension.getEditionManager().getActiveLayerEdited()).getLayer(); |
|
520 |
lv.getSource().getRecordset().getSelectionSupport().fireSelectionEvents(); */ |
|
522 |
FLyrVect lv=(FLyrVect)((VectorialLayerEdited)CADExtension.getEditionManager().getActiveLayerEdited()).getLayer(); |
|
523 |
com.iver.andami.ui.mdiManager.View[] views = (com.iver.andami.ui.mdiManager.View[]) PluginServices.getMDIManager().getAllViews(); |
|
524 |
|
|
525 |
for (int i=0 ; i<views.length ; i++){ |
|
526 |
if (views[i] instanceof Table){ |
|
527 |
Table table=(Table)views[i]; |
|
528 |
if (table.getModel().getAssociatedTable()!=null && table.getModel().getAssociatedTable().equals(lv)) |
|
529 |
table.updateSelection(); |
|
530 |
} |
|
531 |
} |
|
521 | 532 |
} |
522 | 533 |
public String getStatus() { |
523 | 534 |
try { |
Also available in: Unified diff