Statistics
| Revision:

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 @ 354

History | View | Annotate | Download (3.59 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.PointStretchOperation;
36
import org.gvsig.vectorediting.lib.prov.stretch.operation.SurfaceStretchOperation;
37
import org.gvsig.vectorediting.lib.prov.stretch.operation.LineStretchOperation;
38
import org.gvsig.vectorediting.lib.prov.stretch.operation.PolygonStretchOperation;
39
import org.gvsig.vectorediting.lib.prov.stretch.operation.StretchOperationUtils;
40
import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
41
import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
42

    
43
/**
44
 * Library for default implementation initialization and configuration.
45
 *
46
 * @author gvSIG team
47
 * @version $Id$
48
 */
49
public class StretchEditingLibrary extends AbstractLibrary {
50

    
51
    @Override
52
    public void doRegistration() {
53
        registerAsServiceOf(EditingLibrary.class);
54
    }
55

    
56
    @Override
57
    protected void doInitialize() throws LibraryException {
58
    }
59

    
60
    @Override
61
    protected void doPostInitialize() throws LibraryException {
62
        EditingProviderManager manager =
63
            EditingProviderLocator.getProviderManager();
64

    
65
        manager.addProviderFactory(new StretchEditingProviderFactory());
66

    
67
        manager.registerIcon("vectorediting-tools", "modify-stretch", this
68
            .getClass().getClassLoader(), this.getClass().getName());
69

    
70
        StretchOperationUtils.register(new PointStretchOperation(), Geometry.TYPES.POINT);
71

    
72
        StretchOperationUtils.register(new LineStretchOperation(), Geometry.TYPES.LINE);
73
        StretchOperationUtils.register(new CurveStretchOperation(), Geometry.TYPES.ARC);
74
        StretchOperationUtils.register(new CurveStretchOperation(), Geometry.TYPES.SPLINE);
75

    
76
        StretchOperationUtils.register(new PolygonStretchOperation(), Geometry.TYPES.POLYGON);
77
        StretchOperationUtils.register(new SurfaceStretchOperation(), Geometry.TYPES.ELLIPSE);
78
        StretchOperationUtils.register(new SurfaceStretchOperation(), Geometry.TYPES.CIRCLE);
79
        StretchOperationUtils.register(new SurfaceStretchOperation(), Geometry.TYPES.ELLIPTICARC);
80
        registerTranslations();
81
    }
82

    
83
    private void registerTranslations() {
84
        I18nManager manager = ToolsLocator.getI18nManager();
85
        manager.addResourceFamily("i18n.text",
86
            this.getClass().getClassLoader(), "stretch-editing");
87
    }
88

    
89
}