gvsig-vectorediting / org.gvsig.vectorediting / trunk / org.gvsig.vectorediting / org.gvsig.vectorediting.lib / org.gvsig.vectorediting.lib.prov / org.gvsig.vectorediting.lib.prov.stretch / src / main / java / org / gvsig / vectorediting / lib / prov / stretch / StretchEditingLibrary.java @ 340
History | View | Annotate | Download (3.42 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* 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 |
*/
|
24 |
package org.gvsig.vectorediting.lib.prov.stretch; |
25 |
|
26 |
|
27 |
|
28 |
import org.gvsig.fmap.geom.Geometry; |
29 |
import org.gvsig.tools.ToolsLocator; |
30 |
import org.gvsig.tools.i18n.I18nManager; |
31 |
import org.gvsig.tools.library.AbstractLibrary; |
32 |
import org.gvsig.tools.library.LibraryException; |
33 |
import org.gvsig.vectorediting.lib.api.EditingLibrary; |
34 |
import org.gvsig.vectorediting.lib.prov.stretch.operation.CurveStretchOperation; |
35 |
import org.gvsig.vectorediting.lib.prov.stretch.operation.SurfaceStretchOperation; |
36 |
import org.gvsig.vectorediting.lib.prov.stretch.operation.LineStretchOperation; |
37 |
import org.gvsig.vectorediting.lib.prov.stretch.operation.PolygonStretchOperation; |
38 |
import org.gvsig.vectorediting.lib.prov.stretch.operation.StretchOperationUtils; |
39 |
import org.gvsig.vectorediting.lib.spi.EditingProviderLocator; |
40 |
import org.gvsig.vectorediting.lib.spi.EditingProviderManager; |
41 |
|
42 |
/**
|
43 |
* Library for default implementation initialization and configuration.
|
44 |
*
|
45 |
* @author gvSIG team
|
46 |
* @version $Id$
|
47 |
*/
|
48 |
public class StretchEditingLibrary extends AbstractLibrary { |
49 |
|
50 |
@Override
|
51 |
public void doRegistration() { |
52 |
registerAsServiceOf(EditingLibrary.class); |
53 |
} |
54 |
|
55 |
@Override
|
56 |
protected void doInitialize() throws LibraryException { |
57 |
} |
58 |
|
59 |
@Override
|
60 |
protected void doPostInitialize() throws LibraryException { |
61 |
EditingProviderManager manager = |
62 |
EditingProviderLocator.getProviderManager(); |
63 |
|
64 |
manager.addProviderFactory(new StretchEditingProviderFactory());
|
65 |
|
66 |
manager.registerIcon("vectorediting-tools", "modify-stretch", this |
67 |
.getClass().getClassLoader(), this.getClass().getName());
|
68 |
|
69 |
StretchOperationUtils.register(new LineStretchOperation(), Geometry.TYPES.LINE);
|
70 |
StretchOperationUtils.register(new CurveStretchOperation(), Geometry.TYPES.ARC);
|
71 |
StretchOperationUtils.register(new CurveStretchOperation(), Geometry.TYPES.SPLINE);
|
72 |
|
73 |
StretchOperationUtils.register(new PolygonStretchOperation(), Geometry.TYPES.POLYGON);
|
74 |
StretchOperationUtils.register(new SurfaceStretchOperation(), Geometry.TYPES.ELLIPSE);
|
75 |
StretchOperationUtils.register(new SurfaceStretchOperation(), Geometry.TYPES.CIRCLE);
|
76 |
StretchOperationUtils.register(new SurfaceStretchOperation(), Geometry.TYPES.ELLIPTICARC);
|
77 |
registerTranslations(); |
78 |
} |
79 |
|
80 |
private void registerTranslations() { |
81 |
I18nManager manager = ToolsLocator.getI18nManager(); |
82 |
manager.addResourceFamily("i18n.text",
|
83 |
this.getClass().getClassLoader(), "stretch-editing"); |
84 |
} |
85 |
|
86 |
} |