gvsig-vectorediting / org.gvsig.vectorediting / trunk / org.gvsig.vectorediting / org.gvsig.vectorediting.lib / org.gvsig.vectorediting.lib.impl / src / main / java / org / gvsig / vectorediting / lib / impl / DefaultEditingService.java @ 2608
History | View | Annotate | Download (3.53 KB)
1 | 159 | llmarques | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | 55 | fdiaz | *
|
4 | 159 | llmarques | * Copyright ? 2007-2014 gvSIG Association
|
5 | *
|
||
6 | * This program is free software; you can redistribute it and/or
|
||
7 | * modify it under the terms of the GNU General Public License
|
||
8 | * as published by the Free Software Foundation; either version 2
|
||
9 | * of the License, or (at your option) any later version.
|
||
10 | *
|
||
11 | * This program is distributed in the hope that it will be useful,
|
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
14 | * GNU General Public License for more details.
|
||
15 | *
|
||
16 | * You should have received a copy of the GNU General Public License
|
||
17 | * along with this program; if not, write to the Free Software
|
||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||
19 | * MA 02110-1301, USA.
|
||
20 | *
|
||
21 | * For any additional information, do not hesitate to contact us
|
||
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | 16 | llmarques | */
|
24 | 159 | llmarques | |
25 | 16 | llmarques | package org.gvsig.vectorediting.lib.impl; |
26 | |||
27 | 28 | llmarques | import java.util.List; |
28 | 16 | llmarques | |
29 | 80 | llmarques | import org.gvsig.fmap.geom.Geometry; |
30 | 37 | llmarques | import org.gvsig.fmap.geom.primitive.Point; |
31 | 16 | llmarques | import org.gvsig.tools.service.Manager; |
32 | 56 | llmarques | import org.gvsig.vectorediting.lib.api.DrawingStatus; |
33 | 16 | llmarques | import org.gvsig.vectorediting.lib.api.EditingService; |
34 | import org.gvsig.vectorediting.lib.api.EditingServiceParameter; |
||
35 | 61 | llmarques | import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException; |
36 | import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException; |
||
37 | 62 | llmarques | import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException; |
38 | 63 | fdiaz | import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException; |
39 | 71 | fdiaz | import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException; |
40 | 17 | llmarques | import org.gvsig.vectorediting.lib.spi.EditingProvider; |
41 | 16 | llmarques | |
42 | public class DefaultEditingService implements EditingService { |
||
43 | 55 | fdiaz | |
44 | 159 | llmarques | EditingProvider provider; |
45 | 16 | llmarques | |
46 | 159 | llmarques | public DefaultEditingService(EditingProvider provider) {
|
47 | 227 | llmarques | this.provider = provider;
|
48 | 159 | llmarques | } |
49 | 17 | llmarques | |
50 | 2125 | fdiaz | @Override
|
51 | 159 | llmarques | public Manager getManager() {
|
52 | return null; |
||
53 | } |
||
54 | 16 | llmarques | |
55 | 2125 | fdiaz | @Override
|
56 | 159 | llmarques | public DrawingStatus getDrawingStatus(Point mousePosition) |
57 | throws DrawServiceException {
|
||
58 | return provider.getDrawingStatus(mousePosition);
|
||
59 | } |
||
60 | 16 | llmarques | |
61 | 2125 | fdiaz | @Override
|
62 | 159 | llmarques | public List<EditingServiceParameter> getParameters() { |
63 | return provider.getParameters();
|
||
64 | } |
||
65 | 16 | llmarques | |
66 | 2125 | fdiaz | @Override
|
67 | 159 | llmarques | public EditingServiceParameter next() {
|
68 | return provider.next();
|
||
69 | } |
||
70 | 16 | llmarques | |
71 | 2125 | fdiaz | @Override
|
72 | 159 | llmarques | public void setValue(Object value) throws InvalidEntryException { |
73 | provider.setValue(value); |
||
74 | } |
||
75 | 16 | llmarques | |
76 | 2125 | fdiaz | @Override
|
77 | 159 | llmarques | public void stop() throws StopServiceException { |
78 | provider.stop(); |
||
79 | } |
||
80 | 16 | llmarques | |
81 | 2125 | fdiaz | @Override
|
82 | 159 | llmarques | public void finishAndStore() throws FinishServiceException { |
83 | provider.finishAndStore(); |
||
84 | } |
||
85 | 16 | llmarques | |
86 | 2125 | fdiaz | @Override
|
87 | 159 | llmarques | public Geometry finish() throws FinishServiceException { |
88 | return provider.finish();
|
||
89 | } |
||
90 | 35 | llmarques | |
91 | 2125 | fdiaz | @Override
|
92 | 251 | llmarques | public void start() throws StartServiceException, InvalidEntryException { |
93 | 159 | llmarques | this.provider.start();
|
94 | } |
||
95 | |||
96 | 2125 | fdiaz | @Override
|
97 | 159 | llmarques | public String getName() { |
98 | return provider.getName();
|
||
99 | } |
||
100 | 2125 | fdiaz | |
101 | @Override
|
||
102 | public void setValue(EditingServiceParameter parameter, Object value) throws InvalidEntryException { |
||
103 | provider.setValue(parameter, value); |
||
104 | } |
||
105 | |||
106 | @Override
|
||
107 | public boolean isEnabled(EditingServiceParameter parameter) { |
||
108 | return provider.isEnabled(parameter);
|
||
109 | } |
||
110 | 2444 | fdiaz | |
111 | @Override
|
||
112 | public void activate() { |
||
113 | provider.activate(); |
||
114 | } |
||
115 | |||
116 | @Override
|
||
117 | public Object getValue(EditingServiceParameter parameter) { |
||
118 | return provider.getValue(parameter);
|
||
119 | } |
||
120 | |||
121 | |||
122 | 159 | llmarques | } |