gvsig-vectorediting / org.gvsig.vectorediting / trunk / org.gvsig.vectorediting / org.gvsig.vectorediting.lib / org.gvsig.vectorediting.lib.prov / org.gvsig.vectorediting.lib.prov.split / src / main / java / org / gvsig / vectorediting / lib / prov / split / SplitEditingLibrary.java @ 575
History | View | Annotate | Download (3.77 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 |
|
25 |
package org.gvsig.vectorediting.lib.prov.split; |
26 |
|
27 |
import org.gvsig.fmap.geom.Geometry; |
28 |
import org.gvsig.tools.ToolsLocator; |
29 |
import org.gvsig.tools.i18n.I18nManager; |
30 |
import org.gvsig.tools.library.AbstractLibrary; |
31 |
import org.gvsig.tools.library.Library; |
32 |
import org.gvsig.tools.library.LibraryException; |
33 |
import org.gvsig.vectorediting.lib.prov.split.operation.ArcSplitOperation; |
34 |
import org.gvsig.vectorediting.lib.prov.split.operation.CurveSplitOperation; |
35 |
import org.gvsig.vectorediting.lib.prov.split.operation.LineSplitOperation; |
36 |
import org.gvsig.vectorediting.lib.prov.split.operation.SplitOperationUtils; |
37 |
import org.gvsig.vectorediting.lib.prov.split.operation.splitsurface.SurfaceSplitOperation; |
38 |
import org.gvsig.vectorediting.lib.spi.EditingProviderLocator; |
39 |
import org.gvsig.vectorediting.lib.spi.EditingProviderManager; |
40 |
|
41 |
/**
|
42 |
* @author llmarques
|
43 |
*
|
44 |
*/
|
45 |
public class SplitEditingLibrary extends AbstractLibrary implements Library { |
46 |
|
47 |
@Override
|
48 |
protected void doInitialize() throws LibraryException { |
49 |
} |
50 |
|
51 |
@Override
|
52 |
protected void doPostInitialize() throws LibraryException { |
53 |
EditingProviderManager manager = |
54 |
EditingProviderLocator.getProviderManager(); |
55 |
|
56 |
manager.addProviderFactory(new SplitEditingProviderFactory());
|
57 |
|
58 |
SplitOperationUtils.register(new ArcSplitOperation(),
|
59 |
Geometry.TYPES.ARC); |
60 |
SplitOperationUtils.register(new CurveSplitOperation(),
|
61 |
Geometry.TYPES.CURVE); |
62 |
SplitOperationUtils.register(new LineSplitOperation(),
|
63 |
Geometry.TYPES.LINE); |
64 |
SplitOperationUtils.register(new CurveSplitOperation(),
|
65 |
Geometry.TYPES.SPLINE); |
66 |
SplitOperationUtils.register(new CurveSplitOperation(),
|
67 |
Geometry.TYPES.CIRCUMFERENCE); |
68 |
SplitOperationUtils.register(new CurveSplitOperation(),
|
69 |
Geometry.TYPES.PERIELLIPSE); |
70 |
SplitOperationUtils.register(new SurfaceSplitOperation(),
|
71 |
Geometry.TYPES.SURFACE); |
72 |
SplitOperationUtils.register(new SurfaceSplitOperation(),
|
73 |
Geometry.TYPES.POLYGON); |
74 |
SplitOperationUtils.register(new SurfaceSplitOperation(),
|
75 |
Geometry.TYPES.CIRCLE); |
76 |
SplitOperationUtils.register(new SurfaceSplitOperation(),
|
77 |
Geometry.TYPES.ELLIPSE); |
78 |
SplitOperationUtils.register(new SurfaceSplitOperation(),
|
79 |
Geometry.TYPES.FILLEDSPLINE); |
80 |
SplitOperationUtils.register(new SurfaceSplitOperation(),
|
81 |
Geometry.TYPES.ELLIPTICARC); |
82 |
|
83 |
manager.registerIcon("vectorediting-tools", "modify-split", this |
84 |
.getClass().getClassLoader(), this.getClass().getName());
|
85 |
|
86 |
registerTranslations(); |
87 |
} |
88 |
|
89 |
private void registerTranslations() { |
90 |
I18nManager manager = ToolsLocator.getI18nManager(); |
91 |
manager.addResourceFamily("i18n/text",
|
92 |
this.getClass().getClassLoader(), "split-editing"); |
93 |
} |
94 |
|
95 |
} |