gvsig-vectorediting / org.gvsig.vectorediting / trunk / org.gvsig.vectorediting / org.gvsig.vectorediting.lib / org.gvsig.vectorediting.lib.prov / org.gvsig.vectorediting.lib.prov.scale / src / main / java / org / gvsig / vectorediting / lib / prov / scale / ScaleEditingProviderFactory.java @ 322
History | View | Annotate | Download (2.96 KB)
1 |
package org.gvsig.vectorediting.lib.prov.scale; |
---|---|
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.service.spi.AbstractProviderFactory; |
32 |
import org.gvsig.tools.service.spi.Provider; |
33 |
import org.gvsig.tools.service.spi.ProviderServices; |
34 |
import org.gvsig.vectorediting.lib.api.EditingServiceInfo; |
35 |
import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo; |
36 |
import org.gvsig.vectorediting.lib.spi.EditingProviderFactory; |
37 |
|
38 |
public class ScaleEditingProviderFactory extends AbstractProviderFactory |
39 |
implements EditingProviderFactory {
|
40 |
|
41 |
public static final String PROVIDER_NAME = "modify-scale"; |
42 |
|
43 |
private final static String PROVIDER_DESCRIPTION = |
44 |
"Scale selected geometries";
|
45 |
|
46 |
public void initialize() { |
47 |
|
48 |
} |
49 |
|
50 |
public EditingServiceInfo getServiceInfo() {
|
51 |
EditingServiceInfo serviceInfo = |
52 |
new DefaultEditingServiceinfo(PROVIDER_NAME, "", false, null, |
53 |
new int[] { Geometry.TYPES.POINT, Geometry.TYPES.MULTIPOINT, |
54 |
Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE, |
55 |
Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE }); |
56 |
|
57 |
return serviceInfo;
|
58 |
} |
59 |
|
60 |
@Override
|
61 |
protected Provider doCreate(DynObject parameters, ProviderServices services) { |
62 |
return new ScaleEditingProvider(services, parameters); |
63 |
} |
64 |
|
65 |
@Override
|
66 |
public DynObject createParameters() {
|
67 |
DynObject dynobject = super.createParameters();
|
68 |
dynobject.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME); |
69 |
return dynobject;
|
70 |
} |
71 |
|
72 |
@Override
|
73 |
protected DynClass createParametersDynClass() {
|
74 |
DynClass dynclass = |
75 |
ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME, |
76 |
PROVIDER_DESCRIPTION); |
77 |
|
78 |
dynclass.addDynFieldString(PROVIDER_NAME_FIELD); |
79 |
dynclass.addDynFieldObject(FEATURE_STORE_FIELD); |
80 |
dynclass.addDynFieldObject(MAPCONTEXT_FIELD); |
81 |
|
82 |
return dynclass;
|
83 |
} |
84 |
|
85 |
} |