root / branches / FMap_CAD / libraries / libFMap / src / com / iver / cit / gvsig / fmap / edition / RemoveGeometryCommand.java @ 3513
History | View | Annotate | Download (2.16 KB)
1 |
/*
|
---|---|
2 |
* Created on 10-feb-2005
|
3 |
*
|
4 |
* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
5 |
*
|
6 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
7 |
*
|
8 |
* This program is free software; you can redistribute it and/or
|
9 |
* modify it under the terms of the GNU General Public License
|
10 |
* as published by the Free Software Foundation; either version 2
|
11 |
* of the License, or (at your option) any later version.
|
12 |
*
|
13 |
* This program is distributed in the hope that it will be useful,
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
* GNU General Public License for more details.
|
17 |
*
|
18 |
* You should have received a copy of the GNU General Public License
|
19 |
* along with this program; if not, write to the Free Software
|
20 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
21 |
USA.
|
22 |
*
|
23 |
* For more information, contact:
|
24 |
*
|
25 |
* Generalitat Valenciana
|
26 |
* Conselleria d'Infraestructures i Transport
|
27 |
* Av. Blasco Ib??ez, 50
|
28 |
* 46010 VALENCIA
|
29 |
* SPAIN
|
30 |
*
|
31 |
* +34 963862235
|
32 |
* gvsig@gva.es
|
33 |
* www.gvsig.gva.es
|
34 |
*
|
35 |
* or
|
36 |
*
|
37 |
* IVER T.I. S.A
|
38 |
* Salamanca 50
|
39 |
* 46005 Valencia
|
40 |
* Spain
|
41 |
*
|
42 |
* +34 963163400
|
43 |
* dac@iver.es
|
44 |
*/
|
45 |
package com.iver.cit.gvsig.fmap.edition; |
46 |
|
47 |
import java.io.IOException; |
48 |
|
49 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
50 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
51 |
|
52 |
|
53 |
public class RemoveGeometryCommand implements Command { |
54 |
private DefaultEditableFeatureSource efs;
|
55 |
private IGeometry geometry;
|
56 |
private int index; |
57 |
public RemoveGeometryCommand(DefaultEditableFeatureSource ef,int i) throws IOException, DriverIOException{ |
58 |
efs=ef; |
59 |
index=i; |
60 |
geometry=efs.getGeometry(index); |
61 |
} |
62 |
|
63 |
/**
|
64 |
* @throws DriverIOException
|
65 |
* @throws IOException
|
66 |
* @see com.iver.cit.gvsig.fmap.edition.Command#undo()
|
67 |
*/
|
68 |
public void undo() throws IOException, DriverIOException { |
69 |
efs.undoRemoveGeometry(index); |
70 |
} |
71 |
/**
|
72 |
* @throws IOException
|
73 |
* @throws DriverIOException
|
74 |
* @see com.iver.cit.gvsig.fmap.edition.Command#redo()
|
75 |
*/
|
76 |
public void redo() throws DriverIOException, IOException { |
77 |
((DefaultEditableFeatureSource)efs).doRemoveGeometry(index); |
78 |
} |
79 |
|
80 |
} |