Statistics
| Revision:

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

History | View | Annotate | Download (2.93 KB)

1 1241 fernando
package com.iver.cit.gvsig.fmap.edition;
2
3 1251 vcaballero
import com.iver.cit.gvsig.fmap.core.IGeometry;
4 1287 vcaballero
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
5 1241 fernando
6 1342 fernando
import java.io.IOException;
7 1287 vcaballero
8 1342 fernando
9 1241 fernando
/**
10 1287 vcaballero
 * 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 1241 fernando
 */
15
public class EditableFeatureSourceProxy implements EditableFeatureSource {
16 1287 vcaballero
        private DefaultEditableFeatureSource defs;
17
        private CommandRecord cr;
18 1342 fernando
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 1287 vcaballero
        }
30 1342 fernando
31 1241 fernando
        /**
32 1342 fernando
         * DOCUMENT ME!
33
         *
34 1287 vcaballero
         * @throws EditionException
35 1342 fernando
         *
36 1241 fernando
         * @see com.iver.cit.gvsig.fmap.edition.EditableFeatureSource#startEdition()
37
         */
38 1287 vcaballero
        public void startEdition() throws EditionException {
39
                defs.getOriginalFeatureAdapter().startEdition();
40
                cr.start();
41 1241 fernando
        }
42
43
        /**
44 1342 fernando
         * DOCUMENT ME!
45
         *
46 1287 vcaballero
         * @throws EditionException
47 1342 fernando
         *
48 1241 fernando
         * @see com.iver.cit.gvsig.fmap.edition.EditableFeatureSource#stopEdition()
49
         */
50 1287 vcaballero
        public void stopEdition() throws EditionException {
51
                defs.getOriginalFeatureAdapter().stopEdition();
52
                cr.stop();
53 1241 fernando
        }
54
55
        /**
56 1342 fernando
         * DOCUMENT ME!
57
         *
58
         * @param index DOCUMENT ME!
59
         *
60
         * @return DOCUMENT ME!
61
         *
62
         * @throws IOException
63 1287 vcaballero
         * @throws DriverIOException
64 1342 fernando
         *
65 1241 fernando
         * @see com.iver.cit.gvsig.fmap.edition.EditableFeatureSource#getGeometry(int)
66
         */
67 1342 fernando
        public IGeometry getGeometry(int index)
68
                throws IOException, DriverIOException {
69 1287 vcaballero
                return defs.getGeometry(index);
70 1241 fernando
        }
71
72
        /**
73
         * @see com.iver.cit.gvsig.fmap.edition.EditableFeatureSource#getGeometryCount()
74
         */
75
        public int getGeometryCount() {
76 1287 vcaballero
                return defs.getGeometryCount();
77 1241 fernando
        }
78
79
        /**
80 1342 fernando
         * DOCUMENT ME!
81
         *
82
         * @param g DOCUMENT ME!
83
         *
84
         * @throws DriverIOException
85 1287 vcaballero
         * @throws IOException
86 1342 fernando
         *
87 1241 fernando
         * @see com.iver.cit.gvsig.fmap.edition.EditableFeatureSource#addGeometry(com.iver.cit.gvsig.fmap.core.FGeometry)
88
         */
89 1287 vcaballero
        public void addGeometry(IGeometry g) throws DriverIOException, IOException {
90
                defs.addGeometry(g);
91 1342 fernando
92 1287 vcaballero
                //cr.addCommand(new AddGeometryCommand());
93 1241 fernando
        }
94
95
        /**
96
         * @see com.iver.cit.gvsig.fmap.edition.EditableFeatureSource#removeGeometry(int)
97
         */
98
        public void removeGeometry(int index) {
99 1287 vcaballero
                defs.removeGeometry(index);
100 1342 fernando
101 1287 vcaballero
                //cr.addCommand(new RemoveGeometryCommand());
102 1241 fernando
        }
103
104
        /**
105 1342 fernando
         * DOCUMENT ME!
106
         *
107
         * @param index DOCUMENT ME!
108
         * @param g DOCUMENT ME!
109
         *
110 1287 vcaballero
         * @throws IOException
111 1342 fernando
         *
112 1287 vcaballero
         * @see com.iver.cit.gvsig.fmap.edition.EditableFeatureSource#modifyGeometry(int,
113
         *                 com.iver.cit.gvsig.fmap.core.FGeometry)
114 1241 fernando
         */
115 1342 fernando
        public void modifyGeometry(int index, IGeometry g)
116
                throws IOException {
117
                defs.modifyGeometry(index, g);
118
119 1287 vcaballero
                //cr.addCommand(new ModifyGeometryCommand());
120 1241 fernando
        }
121 1342 fernando
122 1287 vcaballero
        /**
123
         * @see com.iver.cit.gvsig.fmap.edition.EditableFeatureSource#compact()
124
         */
125
        public void compact() {
126
        }
127 1241 fernando
}