gvsig-vectorediting / org.gvsig.vectorediting / trunk / org.gvsig.vectorediting / org.gvsig.vectorediting.lib / org.gvsig.vectorediting.lib.prov / org.gvsig.vectorediting.lib.prov.autopolygon / src / main / java / org / gvsig / vectorediting / lib / prov / autopolygon / AutopolygonEditingProviderFactory.java @ 322
History | View | Annotate | Download (3.02 KB)
1 | 301 | fdiaz | package org.gvsig.vectorediting.lib.prov.autopolygon; |
---|---|---|---|
2 | /**
|
||
3 | * gvSIG. Desktop Geographic Information System.
|
||
4 | *
|
||
5 | * Copyright ? 2007-2014 gvSIG Association
|
||
6 | *
|
||
7 | * This program is free software; you can redistribute it and/or
|
||
8 | * modify it under the terms of the GNU General Public License
|
||
9 | * as published by the Free Software Foundation; either version 2
|
||
10 | * of the License, or (at your option) any later version.
|
||
11 | *
|
||
12 | * This program is distributed in the hope that it will be useful,
|
||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
15 | * GNU General Public License for more details.
|
||
16 | *
|
||
17 | * You should have received a copy of the GNU General Public License
|
||
18 | * along with this program; if not, write to the Free Software
|
||
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||
20 | * MA 02110-1301, USA.
|
||
21 | *
|
||
22 | * For any additional information, do not hesitate to contact us
|
||
23 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
24 | */
|
||
25 | |||
26 | |||
27 | import org.gvsig.fmap.geom.Geometry; |
||
28 | import org.gvsig.tools.ToolsLocator; |
||
29 | import org.gvsig.tools.dynobject.DynClass; |
||
30 | import org.gvsig.tools.dynobject.DynObject; |
||
31 | import org.gvsig.tools.dynobject.DynObjectManager; |
||
32 | import org.gvsig.tools.service.spi.AbstractProviderFactory; |
||
33 | import org.gvsig.tools.service.spi.Provider; |
||
34 | import org.gvsig.tools.service.spi.ProviderServices; |
||
35 | import org.gvsig.vectorediting.lib.api.EditingServiceInfo; |
||
36 | import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo; |
||
37 | import org.gvsig.vectorediting.lib.spi.EditingProviderFactory; |
||
38 | |||
39 | public class AutopolygonEditingProviderFactory extends |
||
40 | AbstractProviderFactory implements EditingProviderFactory {
|
||
41 | |||
42 | public final static String PROVIDER_NAME = "insert-autopolygon"; |
||
43 | |||
44 | public final static String PROVIDER_DESCRIPTION = |
||
45 | "Creates autopolygons";
|
||
46 | |||
47 | public void initialize() { |
||
48 | } |
||
49 | |||
50 | public EditingServiceInfo getServiceInfo() {
|
||
51 | EditingServiceInfo serviceInfo = |
||
52 | new DefaultEditingServiceinfo(
|
||
53 | PROVIDER_NAME, |
||
54 | "",
|
||
55 | false,
|
||
56 | null,
|
||
57 | new int[] { Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE }); |
||
58 | |||
59 | return serviceInfo;
|
||
60 | } |
||
61 | |||
62 | @Override
|
||
63 | protected Provider doCreate(DynObject parameters, ProviderServices services) { |
||
64 | return new AutopolygonEditingProvider(services, parameters); |
||
65 | } |
||
66 | |||
67 | @Override
|
||
68 | protected DynClass createParametersDynClass() {
|
||
69 | DynObjectManager dynObjectManager = ToolsLocator.getDynObjectManager(); |
||
70 | DynClass dynclass = |
||
71 | dynObjectManager |
||
72 | .createDynClass(PROVIDER_NAME, PROVIDER_DESCRIPTION); |
||
73 | |||
74 | dynclass.addDynFieldString(PROVIDER_NAME_FIELD); |
||
75 | dynclass.addDynFieldObject(FEATURE_STORE_FIELD); |
||
76 | 322 | llmarques | dynclass.addDynFieldObject(MAPCONTEXT_FIELD); |
77 | 301 | fdiaz | |
78 | return dynclass;
|
||
79 | } |
||
80 | |||
81 | @Override
|
||
82 | public DynObject createParameters() {
|
||
83 | DynObject parameters = super.createParameters();
|
||
84 | parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME); |
||
85 | return parameters;
|
||
86 | } |
||
87 | |||
88 | } |