Revision 3513 branches/FMap_CAD/libraries/libFMap/src/com/iver/cit/gvsig/fmap/edition/ModifyGeometryCommand.java
ModifyGeometryCommand.java | ||
---|---|---|
1 |
/* Generated by Together */ |
|
1 |
|
|
2 | 2 |
package com.iver.cit.gvsig.fmap.edition; |
3 | 3 |
|
4 |
import java.io.IOException; |
|
5 |
|
|
6 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
|
7 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
|
8 |
|
|
4 | 9 |
/** |
5 |
* Modifica una geometr?a del EditableFeatureSource |
|
10 |
* Modifica una geometr?a del EditableFeatureSource
|
|
6 | 11 |
*/ |
7 | 12 |
public class ModifyGeometryCommand implements Command { |
13 |
private DefaultEditableFeatureSource efs; |
|
14 |
private IGeometry geomAnt; |
|
15 |
private IGeometry geomNext; |
|
16 |
private int indexAnt; |
|
17 |
private int previousIndex; |
|
18 |
public ModifyGeometryCommand(DefaultEditableFeatureSource ef,int i,int p,IGeometry newg) throws IOException, DriverIOException{ |
|
19 |
efs=ef; |
|
20 |
indexAnt=i; |
|
21 |
geomNext=newg; |
|
22 |
previousIndex=p; |
|
23 |
geomAnt=efs.getGeometry(indexAnt); |
|
24 |
} |
|
8 | 25 |
/** |
9 |
* @see com.iver.cit.gvsig.fmap.edition.Command#execute() |
|
26 |
* @throws DriverIOException |
|
27 |
* @throws IOException |
|
28 |
* @see com.iver.cit.gvsig.fmap.edition.Command#undo() |
|
10 | 29 |
*/ |
11 |
public void execute() { |
|
30 |
public void undo() throws IOException, DriverIOException { |
|
31 |
efs.undoModifyGeometry(indexAnt,previousIndex); |
|
12 | 32 |
} |
33 |
/** |
|
34 |
* @throws DriverIOException |
|
35 |
* @throws IOException |
|
36 |
* @see com.iver.cit.gvsig.fmap.edition.Command#redo() |
|
37 |
*/ |
|
38 |
public void redo() throws IOException, DriverIOException { |
|
39 |
((DefaultEditableFeatureSource)efs).doModifyGeometry(indexAnt,geomNext); |
|
40 |
} |
|
13 | 41 |
} |
Also available in: Unified diff