Statistics
| Revision:

root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / edition / EditableFeatureSourceProxy.java @ 1881

History | View | Annotate | Download (2.93 KB)

1
package com.iver.cit.gvsig.fmap.edition;
2

    
3
import com.iver.cit.gvsig.fmap.core.IGeometry;
4
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
5

    
6
import java.io.IOException;
7

    
8

    
9
/**
10
 * Clase proxy que implementa los m?todos de EditableFeatureSource apilando los
11
 * comandos correspondientes en el fichero dietario. Estos comandos al
12
 * apilarse deber?n de ejecutarse contra el EditableFeatureSource concreto que
13
 * se est? editando
14
 */
15
public class EditableFeatureSourceProxy implements EditableFeatureSource {
16
        private DefaultEditableFeatureSource defs;
17
        private CommandRecord cr;
18

    
19
        /**
20
         * Crea un nuevo EditableFeatureSourceProxy.
21
         *
22
         * @param defs DOCUMENT ME!
23
         * @param cr DOCUMENT ME!
24
         */
25
        public EditableFeatureSourceProxy(DefaultEditableFeatureSource defs,
26
                CommandRecord cr) {
27
                this.defs = defs;
28
                this.cr = cr;
29
        }
30

    
31
        /**
32
         * DOCUMENT ME!
33
         *
34
         * @throws EditionException
35
         *
36
         * @see com.iver.cit.gvsig.fmap.edition.EditableFeatureSource#startEdition()
37
         */
38
        public void startEdition() throws EditionException {
39
                defs.getOriginalFeatureAdapter().startEdition();
40
                cr.start();
41
        }
42

    
43
        /**
44
         * DOCUMENT ME!
45
         *
46
         * @throws EditionException
47
         *
48
         * @see com.iver.cit.gvsig.fmap.edition.EditableFeatureSource#stopEdition()
49
         */
50
        public void stopEdition() throws EditionException {
51
                defs.getOriginalFeatureAdapter().stopEdition();
52
                cr.stop();
53
        }
54

    
55
        /**
56
         * DOCUMENT ME!
57
         *
58
         * @param index DOCUMENT ME!
59
         *
60
         * @return DOCUMENT ME!
61
         *
62
         * @throws IOException
63
         * @throws DriverIOException
64
         *
65
         * @see com.iver.cit.gvsig.fmap.edition.EditableFeatureSource#getGeometry(int)
66
         */
67
        public IGeometry getGeometry(int index)
68
                throws IOException, DriverIOException {
69
                return defs.getGeometry(index);
70
        }
71

    
72
        /**
73
         * @see com.iver.cit.gvsig.fmap.edition.EditableFeatureSource#getGeometryCount()
74
         */
75
        public int getGeometryCount() {
76
                return defs.getGeometryCount();
77
        }
78

    
79
        /**
80
         * DOCUMENT ME!
81
         *
82
         * @param g DOCUMENT ME!
83
         *
84
         * @throws DriverIOException
85
         * @throws IOException
86
         *
87
         * @see com.iver.cit.gvsig.fmap.edition.EditableFeatureSource#addGeometry(com.iver.cit.gvsig.fmap.core.FGeometry)
88
         */
89
        public void addGeometry(IGeometry g) throws DriverIOException, IOException {
90
                defs.addGeometry(g);
91

    
92
                //cr.addCommand(new AddGeometryCommand());
93
        }
94

    
95
        /**
96
         * @see com.iver.cit.gvsig.fmap.edition.EditableFeatureSource#removeGeometry(int)
97
         */
98
        public void removeGeometry(int index) {
99
                defs.removeGeometry(index);
100

    
101
                //cr.addCommand(new RemoveGeometryCommand());
102
        }
103

    
104
        /**
105
         * DOCUMENT ME!
106
         *
107
         * @param index DOCUMENT ME!
108
         * @param g DOCUMENT ME!
109
         *
110
         * @throws IOException
111
         *
112
         * @see com.iver.cit.gvsig.fmap.edition.EditableFeatureSource#modifyGeometry(int,
113
         *                 com.iver.cit.gvsig.fmap.core.FGeometry)
114
         */
115
        public void modifyGeometry(int index, IGeometry g)
116
                throws IOException {
117
                defs.modifyGeometry(index, g);
118

    
119
                //cr.addCommand(new ModifyGeometryCommand());
120
        }
121

    
122
        /**
123
         * @see com.iver.cit.gvsig.fmap.edition.EditableFeatureSource#compact()
124
         */
125
        public void compact() {
126
        }
127
}