Revision 2123
org.gvsig.vectorediting.offset/tags/org.gvsig.vectorediting.offset-1.0.79/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.desktop</artifactId> |
|
6 |
<version>2.0.290</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.vectorediting.offset</artifactId> |
|
9 |
<version>1.0.79</version> |
|
10 |
<packaging>pom</packaging> |
|
11 |
<name>org.gvsig.vectorediting.offset</name> |
|
12 |
<description>Project that provides the offset vector editing tool</description> |
|
13 |
|
|
14 |
<repositories> |
|
15 |
<repository> |
|
16 |
<id>gvsig-public-http-repository</id> |
|
17 |
<name>gvSIG maven public HTTP repository</name> |
|
18 |
<url>http://devel.gvsig.org/m2repo/j2se</url> |
|
19 |
<releases> |
|
20 |
<enabled>true</enabled> |
|
21 |
<updatePolicy>daily</updatePolicy> |
|
22 |
<checksumPolicy>warn</checksumPolicy> |
|
23 |
</releases> |
|
24 |
<snapshots> |
|
25 |
<enabled>true</enabled> |
|
26 |
<updatePolicy>daily</updatePolicy> |
|
27 |
<checksumPolicy>warn</checksumPolicy> |
|
28 |
</snapshots> |
|
29 |
</repository> |
|
30 |
</repositories> |
|
31 |
|
|
32 |
<url>dav:https://devel.gvsig.org/sites/${project.artifactId}/${project.version}</url> |
|
33 |
<scm> |
|
34 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-vectorediting/org.gvsig.vectorediting.offset/tags/org.gvsig.vectorediting.offset-1.0.79</connection> |
|
35 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-vectorediting/org.gvsig.vectorediting.offset/tags/org.gvsig.vectorediting.offset-1.0.79</developerConnection> |
|
36 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-vector-editing/repository/show/org.gvsig.vectorediting.offset/tags/org.gvsig.vectorediting.offset-1.0.79</url> |
|
37 |
</scm> |
|
38 |
|
|
39 |
<distributionManagement> |
|
40 |
<site> |
|
41 |
<id>gvsig-repository</id> |
|
42 |
<url>dav:https://devel.gvsig.org/download/projects/gvsig-vectorediting/pool/${project.artifactId}/${project.version}</url> |
|
43 |
</site> |
|
44 |
</distributionManagement> |
|
45 |
|
|
46 |
<build> |
|
47 |
<plugins> |
|
48 |
<plugin> |
|
49 |
<groupId>org.apache.maven.plugins</groupId> |
|
50 |
<artifactId>maven-release-plugin</artifactId> |
|
51 |
<configuration> |
|
52 |
<tagBase>https://devel.gvsig.org/svn/gvsig-vectorediting/${project.artifactId}/tags</tagBase> |
|
53 |
</configuration> |
|
54 |
</plugin> |
|
55 |
</plugins> |
|
56 |
</build> |
|
57 |
|
|
58 |
<dependencyManagement> |
|
59 |
<dependencies> |
|
60 |
<dependency> |
|
61 |
<groupId>org.gvsig</groupId> |
|
62 |
<artifactId> org.gvsig.vectorediting </artifactId> |
|
63 |
<version>${org.gvsig.vectorediting.version}</version> |
|
64 |
<scope>import</scope> |
|
65 |
<type>pom</type> |
|
66 |
</dependency> |
|
67 |
<dependency> |
|
68 |
<groupId>org.gvsig</groupId> |
|
69 |
<artifactId>org.gvsig.vectorediting.offset.lib.prov.offset</artifactId> |
|
70 |
<version>1.0.79</version> |
|
71 |
</dependency> |
|
72 |
</dependencies> |
|
73 |
</dependencyManagement> |
|
74 |
|
|
75 |
<modules> |
|
76 |
<module>org.gvsig.vectorediting.offset.lib</module> |
|
77 |
<module>org.gvsig.vectorediting.offset.app</module> |
|
78 |
</modules> |
|
79 |
|
|
80 |
<properties> |
|
81 |
<org.gvsig.vectorediting.version>1.0.121</org.gvsig.vectorediting.version> |
|
82 |
</properties> |
|
83 |
</project> |
org.gvsig.vectorediting.offset/tags/org.gvsig.vectorediting.offset-1.0.79/org.gvsig.vectorediting.offset.app/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.vectorediting.offset</artifactId> |
|
6 |
<version>1.0.79</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.vectorediting.offset.app</artifactId> |
|
9 |
<packaging>pom</packaging> |
|
10 |
<name>org.gvsig.vectorediting.offset.app</name> |
|
11 |
<modules> |
|
12 |
<module>org.gvsig.vectorediting.offset.app.mainplugin</module> |
|
13 |
</modules> |
|
14 |
</project> |
org.gvsig.vectorediting.offset/tags/org.gvsig.vectorediting.offset-1.0.79/org.gvsig.vectorediting.offset.app/org.gvsig.vectorediting.offset.app.mainplugin/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.vectorediting.offset.app</artifactId> |
|
6 |
<version>1.0.79</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.vectorediting.offset.app.mainplugin</artifactId> |
|
9 |
<name>org.gvsig.vectorediting.offset.app.mainplugin</name> |
|
10 |
|
|
11 |
<properties> |
|
12 |
<!-- Package info property values --> |
|
13 |
<gvsig.package.info.state>testing</gvsig.package.info.state> |
|
14 |
<gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin -ge 2.1.0-A, required: org.gvsig.vectorediting.app.mainplugin -ge 1.0.0, conflict: org.gvsig.editing.app.mainplugin -ge 1</gvsig.package.info.dependencies> |
|
15 |
<gvsig.package.info.official>true</gvsig.package.info.official> |
|
16 |
<gvsig.package.info.name>Tools: Vector editing offset provider</gvsig.package.info.name> |
|
17 |
<gvsig.package.info.description>Symmetry provider: provides offset geometries.</gvsig.package.info.description> |
|
18 |
<gvsig.package.info.categories>Vector</gvsig.package.info.categories> |
|
19 |
<gvsig.package.info.javaVM>j1_6</gvsig.package.info.javaVM> |
|
20 |
<gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-vectorediting/pool</gvsig.package.info.poolURL> |
|
21 |
</properties> |
|
22 |
|
|
23 |
<dependencies> |
|
24 |
<dependency> |
|
25 |
<groupId>org.gvsig</groupId> |
|
26 |
<artifactId>org.gvsig.vectorediting.app.mainplugin</artifactId> |
|
27 |
<scope>compile</scope> |
|
28 |
</dependency> |
|
29 |
<dependency> |
|
30 |
<groupId>org.gvsig</groupId> |
|
31 |
<artifactId>org.gvsig.vectorediting.lib.api</artifactId> |
|
32 |
</dependency> |
|
33 |
<dependency> |
|
34 |
<groupId>org.gvsig</groupId> |
|
35 |
<artifactId>org.gvsig.vectorediting.lib.impl</artifactId> |
|
36 |
</dependency> |
|
37 |
<dependency> |
|
38 |
<groupId>org.gvsig</groupId> |
|
39 |
<artifactId>org.gvsig.vectorediting.lib.spi</artifactId> |
|
40 |
</dependency> |
|
41 |
<dependency> |
|
42 |
<groupId>org.gvsig</groupId> |
|
43 |
<artifactId>org.gvsig.vectorediting.offset.lib.prov.offset</artifactId> |
|
44 |
</dependency> |
|
45 |
</dependencies> |
|
46 |
</project> |
org.gvsig.vectorediting.offset/tags/org.gvsig.vectorediting.offset-1.0.79/org.gvsig.vectorediting.offset.app/org.gvsig.vectorediting.offset.app.mainplugin/buildNumber.properties | ||
---|---|---|
1 |
#Mon Aug 24 05:59:35 CEST 2020 |
|
2 |
buildNumber=85 |
org.gvsig.vectorediting.offset/tags/org.gvsig.vectorediting.offset-1.0.79/org.gvsig.vectorediting.offset.app/org.gvsig.vectorediting.offset.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
1 |
<!-- |
|
2 |
|
|
3 |
gvSIG. Desktop Geographic Information System. |
|
4 |
|
|
5 |
Copyright (C) 2007-2013 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 3 |
|
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 |
<assembly> |
|
27 |
<id>gvsig-plugin-package</id> |
|
28 |
<formats> |
|
29 |
<format>zip</format> |
|
30 |
</formats> |
|
31 |
<baseDirectory>${project.artifactId}</baseDirectory> |
|
32 |
<includeBaseDirectory>true</includeBaseDirectory> |
|
33 |
<files> |
|
34 |
<file> |
|
35 |
<source>target/${project.artifactId}-${project.version}.jar</source> |
|
36 |
<outputDirectory>lib</outputDirectory> |
|
37 |
</file> |
|
38 |
<file> |
|
39 |
<source>target/package.info</source> |
|
40 |
</file> |
|
41 |
</files> |
|
42 |
|
|
43 |
<fileSets> |
|
44 |
<fileSet> |
|
45 |
<directory>src/main/resources-plugin</directory> |
|
46 |
<outputDirectory>.</outputDirectory> |
|
47 |
</fileSet> |
|
48 |
</fileSets> |
|
49 |
|
|
50 |
|
|
51 |
<dependencySets> |
|
52 |
<dependencySet> |
|
53 |
<useProjectArtifact>false</useProjectArtifact> |
|
54 |
<useTransitiveDependencies>false</useTransitiveDependencies> |
|
55 |
<outputDirectory>lib</outputDirectory> |
|
56 |
<includes> |
|
57 |
<include>org.gvsig:org.gvsig.vectorediting.offset.lib.prov.offset</include> |
|
58 |
</includes> |
|
59 |
</dependencySet> |
|
60 |
</dependencySets> |
|
61 |
|
|
62 |
</assembly> |
|
63 |
|
org.gvsig.vectorediting.offset/tags/org.gvsig.vectorediting.offset-1.0.79/org.gvsig.vectorediting.offset.app/org.gvsig.vectorediting.offset.app.mainplugin/src/main/resources-plugin/config.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<!-- gvSIG. Desktop Geographic Information System. Copyright (C) 2007-2013 |
|
3 |
gvSIG Association. This program is free software; you can redistribute it |
|
4 |
and/or modify it under the terms of the GNU General Public License as published |
|
5 |
by the Free Software Foundation; either version 3 of the License, or (at |
|
6 |
your option) any later version. This program is distributed in the hope that |
|
7 |
it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
|
8 |
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
9 |
Public License for more details. You should have received a copy of the GNU |
|
10 |
General Public License along with this program; if not, write to the Free |
|
11 |
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, |
|
12 |
USA. For any additional information, do not hesitate to contact us at info |
|
13 |
AT gvsig.com, or visit our website www.gvsig.com. --> |
|
14 |
<plugin-config> |
|
15 |
<depends plugin-name="org.gvsig.vectorediting.app.mainplugin" /> |
|
16 |
<resourceBundle name="text" /> |
|
17 |
<libraries library-dir="lib" /> |
|
18 |
<extensions> |
|
19 |
<extension class-name="org.gvsig.vectorediting.app.mainplugin.ServiceExtension" |
|
20 |
description="" active="true" priority="1"> |
|
21 |
|
|
22 |
<action name="modify-offset" label="modify_offset" |
|
23 |
tooltip="modify_offset" position="601004400" action-command="modify-offset" |
|
24 |
icon="modify-offset" accelerator="" /> |
|
25 |
|
|
26 |
<menu text="Layer/Modify/modify_offset" name="modify-offset" /> |
|
27 |
|
|
28 |
<tool-bar name="vector_editing" position="4000"> |
|
29 |
<selectable-tool name="modify-offset" /> |
|
30 |
</tool-bar> |
|
31 |
|
|
32 |
</extension> |
|
33 |
</extensions> |
|
34 |
</plugin-config> |
org.gvsig.vectorediting.offset/tags/org.gvsig.vectorediting.offset-1.0.79/org.gvsig.vectorediting.offset.lib/org.gvsig.vectorediting.offset.lib.prov/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.vectorediting.offset.lib</artifactId> |
|
6 |
<version>1.0.79</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.vectorediting.offset.lib.prov</artifactId> |
|
9 |
<packaging>pom</packaging> |
|
10 |
<name>org.gvsig.vectorediting.offset.lib.prov</name> |
|
11 |
<modules> |
|
12 |
<module> |
|
13 |
org.gvsig.vectorediting.offset.lib.prov.offset |
|
14 |
</module> |
|
15 |
</modules> |
|
16 |
</project> |
org.gvsig.vectorediting.offset/tags/org.gvsig.vectorediting.offset-1.0.79/org.gvsig.vectorediting.offset.lib/org.gvsig.vectorediting.offset.lib.prov/org.gvsig.vectorediting.offset.lib.prov.offset/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.vectorediting.offset.lib.prov</artifactId> |
|
6 |
<version>1.0.79</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.vectorediting.offset.lib.prov.offset</artifactId> |
|
9 |
<name>org.gvsig.vectorediting.offset.lib.prov.offset</name> |
|
10 |
|
|
11 |
<dependencies> |
|
12 |
<dependency> |
|
13 |
<groupId>org.gvsig</groupId> |
|
14 |
<artifactId>org.gvsig.vectorediting.lib.api</artifactId> |
|
15 |
</dependency> |
|
16 |
<dependency> |
|
17 |
<groupId>org.gvsig</groupId> |
|
18 |
<artifactId>org.gvsig.vectorediting.lib.impl</artifactId> |
|
19 |
</dependency> |
|
20 |
<dependency> |
|
21 |
<groupId>org.gvsig</groupId> |
|
22 |
<artifactId>org.gvsig.vectorediting.lib.spi</artifactId> |
|
23 |
</dependency> |
|
24 |
</dependencies> |
|
25 |
</project> |
org.gvsig.vectorediting.offset/tags/org.gvsig.vectorediting.offset-1.0.79/org.gvsig.vectorediting.offset.lib/org.gvsig.vectorediting.offset.lib.prov/org.gvsig.vectorediting.offset.lib.prov.offset/src/main/java/org/gvsig/vectorediting/offset/lib/prov/offset/OffsetEditingProvider.java | ||
---|---|---|
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.offset.lib.prov.offset; |
|
26 |
|
|
27 |
import java.awt.Color; |
|
28 |
import java.util.ArrayList; |
|
29 |
import java.util.HashMap; |
|
30 |
import java.util.LinkedHashMap; |
|
31 |
import java.util.List; |
|
32 |
import java.util.Map; |
|
33 |
|
|
34 |
import org.gvsig.fmap.dal.exception.DataException; |
|
35 |
import org.gvsig.fmap.dal.feature.EditableFeature; |
|
36 |
import org.gvsig.fmap.dal.feature.Feature; |
|
37 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
|
38 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
39 |
import org.gvsig.fmap.geom.Geometry; |
|
40 |
import org.gvsig.fmap.geom.GeometryException; |
|
41 |
import org.gvsig.fmap.geom.GeometryLocator; |
|
42 |
import org.gvsig.fmap.geom.GeometryManager; |
|
43 |
import org.gvsig.fmap.geom.aggregate.Aggregate; |
|
44 |
import org.gvsig.fmap.geom.aggregate.MultiCurve; |
|
45 |
import org.gvsig.fmap.geom.aggregate.MultiPoint; |
|
46 |
import org.gvsig.fmap.geom.aggregate.MultiSurface; |
|
47 |
import org.gvsig.fmap.geom.operation.GeometryOperationException; |
|
48 |
import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException; |
|
49 |
import org.gvsig.fmap.geom.primitive.Arc; |
|
50 |
import org.gvsig.fmap.geom.primitive.Circle; |
|
51 |
import org.gvsig.fmap.geom.primitive.Circumference; |
|
52 |
import org.gvsig.fmap.geom.primitive.Curve; |
|
53 |
import org.gvsig.fmap.geom.primitive.Ellipse; |
|
54 |
import org.gvsig.fmap.geom.primitive.FilledSpline; |
|
55 |
import org.gvsig.fmap.geom.primitive.Line; |
|
56 |
import org.gvsig.fmap.geom.primitive.PeriEllipse; |
|
57 |
import org.gvsig.fmap.geom.primitive.Point; |
|
58 |
import org.gvsig.fmap.geom.primitive.Polygon; |
|
59 |
import org.gvsig.fmap.geom.primitive.Spline; |
|
60 |
import org.gvsig.fmap.geom.primitive.Surface; |
|
61 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
62 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
|
63 |
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolManager; |
|
64 |
import org.gvsig.tools.ToolsLocator; |
|
65 |
import org.gvsig.tools.dispose.DisposableIterator; |
|
66 |
import org.gvsig.tools.dynobject.DynObject; |
|
67 |
import org.gvsig.tools.i18n.I18nManager; |
|
68 |
import org.gvsig.tools.service.spi.ProviderServices; |
|
69 |
import org.gvsig.vectorediting.lib.api.DrawingStatus; |
|
70 |
import org.gvsig.vectorediting.lib.api.EditingServiceParameter; |
|
71 |
import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE; |
|
72 |
import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException; |
|
73 |
import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException; |
|
74 |
import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException; |
|
75 |
import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException; |
|
76 |
import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider; |
|
77 |
import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus; |
|
78 |
import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter; |
|
79 |
import org.gvsig.vectorediting.lib.spi.EditingProvider; |
|
80 |
import org.gvsig.vectorediting.lib.spi.EditingProviderFactory; |
|
81 |
import org.gvsig.vectorediting.lib.spi.EditingProviderLocator; |
|
82 |
import org.gvsig.vectorediting.lib.spi.EditingProviderManager; |
|
83 |
import org.gvsig.vectorediting.lib.spi.EditingProviderServices; |
|
84 |
|
|
85 |
public class OffsetEditingProvider extends AbstractEditingProvider implements |
|
86 |
EditingProvider { |
|
87 |
|
|
88 |
private final Double PRECISION = new Double(1.0e-5); |
|
89 |
|
|
90 |
private I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
91 |
|
|
92 |
private EditingServiceParameter selectionParameter; |
|
93 |
|
|
94 |
private EditingServiceParameter offsetParameter; |
|
95 |
|
|
96 |
private EditingServiceParameter deleteOriginalGeometriesParameter; |
|
97 |
|
|
98 |
private boolean deleteOriginalGeometries = false; |
|
99 |
|
|
100 |
private Map<EditingServiceParameter, Object> values; |
|
101 |
|
|
102 |
private Map<String, String> options; |
|
103 |
|
|
104 |
private FeatureStore featureStore; |
|
105 |
|
|
106 |
public OffsetEditingProvider(ProviderServices providerServices, DynObject parameters) { |
|
107 |
super(providerServices); |
|
108 |
this.featureStore = (FeatureStore) parameters.getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD); |
|
109 |
|
|
110 |
this.selectionParameter = |
|
111 |
new DefaultEditingServiceParameter("selection", |
|
112 |
i18nManager.getTranslation("selection"), TYPE.SELECTION); |
|
113 |
|
|
114 |
this.offsetParameter = |
|
115 |
new DefaultEditingServiceParameter("offset_distance", |
|
116 |
i18nManager.getTranslation("offset_distance"), |
|
117 |
TYPE.POSITION, TYPE.VALUE); |
|
118 |
|
|
119 |
this.options = new LinkedHashMap<String, String>(); |
|
120 |
options.put(i18nManager.getTranslation("short_yes"), |
|
121 |
"delete_original_geometries"); |
|
122 |
options.put(i18nManager.getTranslation("short_no"), |
|
123 |
"keep_original_geometries"); |
|
124 |
|
|
125 |
EditingProviderServices editingProviderServices = |
|
126 |
(EditingProviderServices) getProviderServices(); |
|
127 |
|
|
128 |
String consoleMsg = |
|
129 |
editingProviderServices.makeConsoleMessage( |
|
130 |
"delete_original_geometries_question", options); |
|
131 |
|
|
132 |
this.deleteOriginalGeometriesParameter = |
|
133 |
new DefaultEditingServiceParameter("Delete original geometries", |
|
134 |
consoleMsg, options, TYPE.OPTION); |
|
135 |
|
|
136 |
} |
|
137 |
|
|
138 |
public EditingServiceParameter next() { |
|
139 |
|
|
140 |
if (values.get(selectionParameter) == null) { |
|
141 |
return selectionParameter; |
|
142 |
} else if (values.get(offsetParameter) == null) { |
|
143 |
return offsetParameter; |
|
144 |
} else if (values.get(deleteOriginalGeometriesParameter) == null) { |
|
145 |
return this.deleteOriginalGeometriesParameter; |
|
146 |
} |
|
147 |
|
|
148 |
return null; |
|
149 |
} |
|
150 |
|
|
151 |
public DrawingStatus getDrawingStatus(Point mousePosition) throws DrawServiceException { |
|
152 |
DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus(); |
|
153 |
EditingProviderManager editingProviderManager = |
|
154 |
EditingProviderLocator.getProviderManager(); |
|
155 |
// ISymbol auxiliaryLineSymbolEditing = editingProviderManager.getSymbol("auxiliary-line-symbol-editing"); |
|
156 |
ISymbol auxiliaryPointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing"); |
|
157 |
ISymbol auxiliaryLineSymbolEditingDirection = editingProviderManager.getSymbol("auxiliary-line-symbol-editing-direction"); |
|
158 |
ISymbol lineSymbolEditing = editingProviderManager.getSymbol("line-symbol-editing"); |
|
159 |
ISymbol polygonSymbolEditing = editingProviderManager.getSymbol("polygon-symbol-editing"); |
|
160 |
|
|
161 |
|
|
162 |
|
|
163 |
FeatureSelection selected = |
|
164 |
(FeatureSelection) values.get(selectionParameter); |
|
165 |
try { |
|
166 |
if ((selected != null) && !selected.isEmpty()) { |
|
167 |
Point point = null; |
|
168 |
double distance = 0.0; |
|
169 |
Object offsetValue = values.get(offsetParameter); |
|
170 |
if (offsetValue != null){ |
|
171 |
if (offsetValue instanceof Point) { |
|
172 |
point = (Point) offsetValue; |
|
173 |
} else { |
|
174 |
distance = (Double) offsetValue; |
|
175 |
} |
|
176 |
} else { |
|
177 |
point = mousePosition; |
|
178 |
distance = getMinDistance(selected, point); |
|
179 |
} |
|
180 |
|
|
181 |
|
|
182 |
DisposableIterator it; |
|
183 |
it = selected.fastIterator(); |
|
184 |
|
|
185 |
while (it.hasNext()) { |
|
186 |
Feature feat = (Feature) it.next(); |
|
187 |
Geometry transformedGeometry = feat.getDefaultGeometry().offset(distance); |
|
188 |
|
|
189 |
ISymbol symbol = null; |
|
190 |
if (transformedGeometry instanceof Curve || transformedGeometry instanceof MultiCurve) { |
|
191 |
symbol = lineSymbolEditing; |
|
192 |
drawingStatus.addStatus(feat.getDefaultGeometry(), auxiliaryLineSymbolEditingDirection, "Direction"); |
|
193 |
} else if (transformedGeometry instanceof Surface || transformedGeometry instanceof MultiSurface) { |
|
194 |
symbol = polygonSymbolEditing; |
|
195 |
} else if (transformedGeometry instanceof Point || transformedGeometry instanceof MultiPoint) { |
|
196 |
symbol = auxiliaryPointSymbolEditing; |
|
197 |
} |
|
198 |
if (transformedGeometry instanceof Aggregate) { |
|
199 |
int primitivesNumber = ((Aggregate) transformedGeometry).getPrimitivesNumber(); |
|
200 |
for (int i = 0; i < primitivesNumber; i++) { |
|
201 |
drawingStatus.addStatus(((Aggregate) transformedGeometry).getPrimitiveAt(i), symbol, ""); |
|
202 |
} |
|
203 |
} else { |
|
204 |
drawingStatus.addStatus(transformedGeometry, symbol, ""); |
|
205 |
} |
|
206 |
} |
|
207 |
it.dispose(); |
|
208 |
} |
|
209 |
return drawingStatus; |
|
210 |
} catch (Exception e) { |
|
211 |
throw new DrawServiceException(e); |
|
212 |
} |
|
213 |
} |
|
214 |
|
|
215 |
/** |
|
216 |
* @param selected |
|
217 |
* @param point |
|
218 |
* @return |
|
219 |
* @throws DataException |
|
220 |
* @throws GeometryOperationException |
|
221 |
* @throws GeometryOperationNotSupportedException |
|
222 |
* @throws GeometryException |
|
223 |
*/ |
|
224 |
private double getMinDistance(FeatureSelection selected, Point point) throws DataException, GeometryOperationNotSupportedException, GeometryOperationException, GeometryException { |
|
225 |
double minorDistance=Double.POSITIVE_INFINITY; |
|
226 |
DisposableIterator it; |
|
227 |
it = selected.fastIterator(); |
|
228 |
while (it.hasNext()) { |
|
229 |
Feature feat = (Feature) it.next(); |
|
230 |
Geometry geometry = feat.getDefaultGeometry(); |
|
231 |
double distance = getDistance(geometry, point); |
|
232 |
if(distance < minorDistance){ |
|
233 |
minorDistance = distance; |
|
234 |
} |
|
235 |
} |
|
236 |
it.dispose(); |
|
237 |
return minorDistance; |
|
238 |
|
|
239 |
} |
|
240 |
|
|
241 |
/** |
|
242 |
* @param geometry |
|
243 |
* @param point |
|
244 |
* @return |
|
245 |
* @throws GeometryOperationException |
|
246 |
* @throws GeometryOperationNotSupportedException |
|
247 |
* @throws GeometryException |
|
248 |
*/ |
|
249 |
private double getDistance(Geometry geometry, Point point) throws GeometryOperationNotSupportedException, GeometryOperationException, GeometryException { |
|
250 |
GeometryManager geomManager = GeometryLocator.getGeometryManager(); |
|
251 |
if(geometry instanceof Arc){ |
|
252 |
Arc arc = (Arc)geometry; |
|
253 |
Point center = arc.getCenterPoint(); |
|
254 |
double radius = center.distance(arc.getInitPoint()); |
|
255 |
double distance = center.distance(point)-radius; |
|
256 |
return distance; |
|
257 |
} |
|
258 |
|
|
259 |
if(geometry instanceof Circle){ |
|
260 |
Circle circle = (Circle)geometry; |
|
261 |
return circle.getCenter().distance(point)-circle.getRadious(); |
|
262 |
} |
|
263 |
if(geometry instanceof Circumference){ |
|
264 |
Circumference circumference = (Circumference)geometry; |
|
265 |
return circumference.getCenter().distance(point)-circumference.getRadious(); |
|
266 |
} |
|
267 |
if(geometry instanceof PeriEllipse){ |
|
268 |
double minDistance = Double.POSITIVE_INFINITY; |
|
269 |
PeriEllipse ellipse = (PeriEllipse)geometry; |
|
270 |
Geometry[] closestPoints = point.closestPoints(ellipse); |
|
271 |
if (closestPoints!=null){ |
|
272 |
for (int i = 0; i < closestPoints.length; i++) { |
|
273 |
Geometry closestPoint = closestPoints[i]; |
|
274 |
if (!point.equals(closestPoint)) { |
|
275 |
double distance = closestPoint.distance(point); |
|
276 |
if (distance < minDistance) { |
|
277 |
minDistance = distance; |
|
278 |
} |
|
279 |
} |
|
280 |
} |
|
281 |
} |
|
282 |
Ellipse auxEllipse = (Ellipse)geomManager.create(Geometry.TYPES.ELLIPSE, geometry.getGeometryType().getSubType()); |
|
283 |
auxEllipse.setPoints(ellipse.getAxis1Start(), ellipse.getAxis1End(), ellipse.getAxis2Dist()); |
|
284 |
if(auxEllipse.contains(point)){ |
|
285 |
return -minDistance; |
|
286 |
} |
|
287 |
return minDistance; |
|
288 |
} |
|
289 |
if(geometry instanceof Ellipse){ |
|
290 |
Ellipse ellipse = (Ellipse)geometry; |
|
291 |
PeriEllipse auxPeriEllipse = (PeriEllipse)geomManager.create(Geometry.TYPES.PERIELLIPSE, geometry.getGeometryType().getSubType()); |
|
292 |
auxPeriEllipse.setPoints(ellipse.getAxis1Start(), ellipse.getAxis1End(), ellipse.getAxis2Dist()); |
|
293 |
double distance = getDistance(auxPeriEllipse, point); |
|
294 |
// if(ellipse.contains(point)){ |
|
295 |
// return -distance; |
|
296 |
// } |
|
297 |
|
|
298 |
return distance; |
|
299 |
} |
|
300 |
|
|
301 |
if(geometry instanceof Spline || geometry instanceof FilledSpline ){ |
|
302 |
return getDistance(geometry.toLines().getPrimitiveAt(0), point); |
|
303 |
} |
|
304 |
|
|
305 |
if(geometry instanceof Line){ |
|
306 |
Line line = (Line)geometry; |
|
307 |
double minDistance = Double.POSITIVE_INFINITY; |
|
308 |
Geometry[] closestPoints = point.closestPoints(line); |
|
309 |
Point closestPoint = null; |
|
310 |
if (closestPoints!=null){ |
|
311 |
for (int i=0;i<closestPoints.length;i++){ |
|
312 |
Point p=(Point)closestPoints[i]; |
|
313 |
if (!point.equals(p)) { |
|
314 |
double distance = p.distance(point); |
|
315 |
if (distance < minDistance) { |
|
316 |
minDistance = distance; |
|
317 |
closestPoint = p; |
|
318 |
} |
|
319 |
} |
|
320 |
} |
|
321 |
} |
|
322 |
if(closestPoint != null){ |
|
323 |
for(int i=0; i<line.getNumVertices()-1; i++){ |
|
324 |
Line segment = (Line) geomManager.create(Geometry.TYPES.LINE, geometry.getGeometryType().getSubType()); |
|
325 |
segment.addVertex(line.getVertex(i)); |
|
326 |
segment.addVertex(line.getVertex(i+1)); |
|
327 |
if(segment.isWithinDistance(closestPoint, PRECISION)){ |
|
328 |
if(line.getVertex(0).equals(line.getVertex(line.getNumVertices()-1))){ //isClosed |
|
329 |
if(line.toPolygons().contains(point)){ |
|
330 |
return -minDistance; |
|
331 |
}; |
|
332 |
return minDistance; |
|
333 |
} else { |
|
334 |
return getDirectedDistance(closestPoint, point, segment); |
|
335 |
} |
|
336 |
} |
|
337 |
} |
|
338 |
} |
|
339 |
} |
|
340 |
|
|
341 |
if(geometry instanceof Polygon){ |
|
342 |
Polygon polygon = (Polygon)geometry; |
|
343 |
if(!polygon.contains(point)){ |
|
344 |
double minDistance = Double.POSITIVE_INFINITY; |
|
345 |
Geometry[] closestPoints = point.closestPoints(polygon); |
|
346 |
Point closestPoint = null; |
|
347 |
if (closestPoints!=null){ |
|
348 |
for (int i=0;i<closestPoints.length;i++){ |
|
349 |
Point p=(Point)closestPoints[i]; |
|
350 |
if (!point.equals(p)) { |
|
351 |
double distance = p.distance(point); |
|
352 |
if (distance < minDistance) { |
|
353 |
minDistance = distance; |
|
354 |
closestPoint = p; |
|
355 |
} |
|
356 |
} |
|
357 |
} |
|
358 |
} |
|
359 |
if(closestPoint != null){ |
|
360 |
return closestPoint.distance(point); |
|
361 |
} |
|
362 |
} else { |
|
363 |
Line auxLine = (Line) polygon.toLines().getPrimitiveAt(0); |
|
364 |
if(auxLine!=null){ |
|
365 |
return getDistance(auxLine, point); |
|
366 |
} |
|
367 |
} |
|
368 |
} |
|
369 |
|
|
370 |
if(geometry instanceof Aggregate){ |
|
371 |
double minDistance = Double.POSITIVE_INFINITY; |
|
372 |
Aggregate aggregate2 = (Aggregate)geometry; |
|
373 |
for(int i=0; i<aggregate2.getPrimitivesNumber(); i++){ |
|
374 |
double distance = getDistance(aggregate2.getPrimitiveAt(i),point); |
|
375 |
if(distance<minDistance){ |
|
376 |
minDistance = distance; |
|
377 |
} |
|
378 |
} |
|
379 |
return minDistance; |
|
380 |
} |
|
381 |
return 0.0; |
|
382 |
} |
|
383 |
|
|
384 |
public void stop() { |
|
385 |
values.clear(); |
|
386 |
} |
|
387 |
|
|
388 |
private void validateAndInsertValue(EditingServiceParameter param, |
|
389 |
Object value) throws InvalidEntryException { |
|
390 |
if (param == selectionParameter) { |
|
391 |
if (value instanceof FeatureSelection) { |
|
392 |
values.put(param, value); |
|
393 |
return; |
|
394 |
} |
|
395 |
} else if (param == offsetParameter) { |
|
396 |
if (value instanceof Point) { |
|
397 |
try { |
|
398 |
values.put(param, getMinDistance((FeatureSelection) values.get(selectionParameter), (Point) value)); |
|
399 |
} catch (Exception e) { |
|
400 |
throw new InvalidEntryException(e); |
|
401 |
} |
|
402 |
return; |
|
403 |
} |
|
404 |
if (value instanceof Double) { |
|
405 |
values.put(param, value); |
|
406 |
} |
|
407 |
} else if (param == deleteOriginalGeometriesParameter) { |
|
408 |
if (value instanceof String) { |
|
409 |
if (((String) value).trim().equalsIgnoreCase( |
|
410 |
i18nManager.getTranslation("short_yes"))) { |
|
411 |
deleteOriginalGeometries = true; |
|
412 |
} else if (((String) value).trim().equalsIgnoreCase( |
|
413 |
i18nManager.getTranslation("short_no"))) { |
|
414 |
deleteOriginalGeometries = false; |
|
415 |
} else { |
|
416 |
throw new InvalidEntryException(null); |
|
417 |
} |
|
418 |
values.put(param, value); |
|
419 |
} |
|
420 |
} |
|
421 |
|
|
422 |
} |
|
423 |
|
|
424 |
public List<EditingServiceParameter> getParameters() { |
|
425 |
List<EditingServiceParameter> list = |
|
426 |
new ArrayList<EditingServiceParameter>(); |
|
427 |
list.add(selectionParameter); |
|
428 |
list.add(offsetParameter); |
|
429 |
return list; |
|
430 |
} |
|
431 |
|
|
432 |
public void setValue(Object value) throws InvalidEntryException { |
|
433 |
EditingServiceParameter param = next(); |
|
434 |
validateAndInsertValue(param, value); |
|
435 |
} |
|
436 |
|
|
437 |
public void finishAndStore() throws FinishServiceException { |
|
438 |
|
|
439 |
FeatureSelection selected = |
|
440 |
(FeatureSelection) values.get(selectionParameter); |
|
441 |
try { |
|
442 |
if (!selected.isEmpty()) { |
|
443 |
double distance = (Double) values.get(offsetParameter); |
|
444 |
DisposableIterator it; |
|
445 |
it = selected.fastIterator(); |
|
446 |
|
|
447 |
while (it.hasNext()) { |
|
448 |
Feature feature = (Feature) it.next(); |
|
449 |
Geometry geom; |
|
450 |
try { |
|
451 |
geom = feature.getDefaultGeometry().offset(distance); |
|
452 |
} catch (GeometryOperationNotSupportedException e) { |
|
453 |
throw new FinishServiceException(e); |
|
454 |
} catch (GeometryOperationException e) { |
|
455 |
throw new FinishServiceException(e); |
|
456 |
} |
|
457 |
|
|
458 |
if (this.deleteOriginalGeometries) { |
|
459 |
// Se sustituye la geometr?a original por la |
|
460 |
// calculada |
|
461 |
EditableFeature editableFeature = |
|
462 |
feature.getEditable(); |
|
463 |
editableFeature.setDefaultGeometry(geom); |
|
464 |
((EditingProviderServices) getProviderServices()) |
|
465 |
.updateFeatureInFeatureStore(editableFeature, |
|
466 |
featureStore); |
|
467 |
} else { |
|
468 |
// Se crea una feature nueva copiando los valores de |
|
469 |
// la feature original excepto aquellos que sean PK |
|
470 |
EditingProviderServices editingProviderServices = |
|
471 |
(EditingProviderServices) getProviderServices(); |
|
472 |
EditableFeature editableFeature = |
|
473 |
editingProviderServices |
|
474 |
.getFeatureCopyWithoutPK(featureStore, |
|
475 |
feature); |
|
476 |
editableFeature.setDefaultGeometry(geom); |
|
477 |
editingProviderServices |
|
478 |
.insertFeatureIntoFeatureStore(editableFeature, |
|
479 |
featureStore); |
|
480 |
} |
|
481 |
|
|
482 |
} |
|
483 |
it.dispose(); |
|
484 |
featureStore.getFeatureSelection().deselectAll(); |
|
485 |
} |
|
486 |
} catch (DataException e) { |
|
487 |
throw new FinishServiceException(e); |
|
488 |
} |
|
489 |
} |
|
490 |
|
|
491 |
private Double getDirectedDistance(Point pointInLine, Point distancePoint, Line line) |
|
492 |
throws GeometryOperationNotSupportedException, GeometryOperationException{ |
|
493 |
Double distance=distancePoint.distance(pointInLine); |
|
494 |
EditingProviderServices editingProviderServices = |
|
495 |
(EditingProviderServices) getProviderServices(); |
|
496 |
Double angle = editingProviderServices.getAngle(pointInLine, distancePoint); |
|
497 |
double angleLine = editingProviderServices.getAngle(line.getVertex(0), line.getVertex(1)); |
|
498 |
|
|
499 |
Double angleDifference=angle - angleLine; |
|
500 |
if ( angleDifference<0 ){ |
|
501 |
angleDifference+=2*Math.PI; |
|
502 |
} |
|
503 |
if (angleDifference > Math.PI ) { |
|
504 |
distance = -distance; |
|
505 |
} |
|
506 |
return distance; |
|
507 |
} |
|
508 |
|
|
509 |
public Geometry finish() throws FinishServiceException { |
|
510 |
return null; |
|
511 |
} |
|
512 |
|
|
513 |
public void start() throws StartServiceException { |
|
514 |
this.values = new HashMap<EditingServiceParameter, Object>(); |
|
515 |
FeatureSelection selected = null; |
|
516 |
if (featureStore != null) { |
|
517 |
try { |
|
518 |
selected = |
|
519 |
(FeatureSelection) featureStore.getFeatureSelection() |
|
520 |
.clone(); |
|
521 |
} catch (DataException e) { |
|
522 |
throw new StartServiceException(e); |
|
523 |
} catch (CloneNotSupportedException e) { |
|
524 |
// Do nothing |
|
525 |
} |
|
526 |
if ((selected != null) && (selected.getSelectedCount() > 0)) { |
|
527 |
values.put(selectionParameter, selected); |
|
528 |
} |
|
529 |
} |
|
530 |
} |
|
531 |
|
|
532 |
public String getName() { |
|
533 |
return OffsetEditingProviderFactory.PROVIDER_NAME; |
|
534 |
} |
|
535 |
} |
org.gvsig.vectorediting.offset/tags/org.gvsig.vectorediting.offset-1.0.79/org.gvsig.vectorediting.offset.lib/org.gvsig.vectorediting.offset.lib.prov/org.gvsig.vectorediting.offset.lib.prov.offset/src/main/java/org/gvsig/vectorediting/offset/lib/prov/offset/OffsetEditingProviderFactory.java | ||
---|---|---|
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.offset.lib.prov.offset; |
|
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 OffsetEditingProviderFactory extends AbstractProviderFactory |
|
39 |
implements EditingProviderFactory { |
|
40 |
|
|
41 |
public static final String PROVIDER_NAME = "modify-offset"; |
|
42 |
|
|
43 |
private final static String PROVIDER_DESCRIPTION = |
|
44 |
"Creates offset geometries from selection"; |
|
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.LINE, Geometry.TYPES.MULTILINE, |
|
56 |
Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, |
|
57 |
Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE }); |
|
58 |
|
|
59 |
return serviceInfo; |
|
60 |
} |
|
61 |
|
|
62 |
@Override |
|
63 |
protected Provider doCreate(DynObject parameters, ProviderServices services) { |
|
64 |
return new OffsetEditingProvider(services, parameters); |
|
65 |
} |
|
66 |
|
|
67 |
@Override |
|
68 |
public DynObject createParameters() { |
|
69 |
DynObject dynobject = super.createParameters(); |
|
70 |
dynobject.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME); |
|
71 |
return dynobject; |
|
72 |
} |
|
73 |
|
|
74 |
@Override |
|
75 |
protected DynClass createParametersDynClass() { |
|
76 |
DynClass dynclass = |
|
77 |
ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME, |
|
78 |
PROVIDER_DESCRIPTION); |
|
79 |
|
|
80 |
dynclass.addDynFieldString(PROVIDER_NAME_FIELD); |
|
81 |
dynclass.addDynFieldObject(FEATURE_STORE_FIELD); |
|
82 |
dynclass.addDynFieldObject(MAPCONTEXT_FIELD); |
|
83 |
|
|
84 |
return dynclass; |
|
85 |
} |
|
86 |
|
|
87 |
} |
org.gvsig.vectorediting.offset/tags/org.gvsig.vectorediting.offset-1.0.79/org.gvsig.vectorediting.offset.lib/org.gvsig.vectorediting.offset.lib.prov/org.gvsig.vectorediting.offset.lib.prov.offset/src/main/java/org/gvsig/vectorediting/offset/lib/prov/offset/OffsetEditingLibrary.java | ||
---|---|---|
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.offset.lib.prov.offset; |
|
26 |
|
|
27 |
import org.gvsig.tools.ToolsLocator; |
|
28 |
import org.gvsig.tools.i18n.I18nManager; |
|
29 |
import org.gvsig.tools.library.AbstractLibrary; |
|
30 |
import org.gvsig.tools.library.LibraryException; |
|
31 |
import org.gvsig.vectorediting.lib.api.EditingLibrary; |
|
32 |
import org.gvsig.vectorediting.lib.spi.EditingProviderLocator; |
|
33 |
import org.gvsig.vectorediting.lib.spi.EditingProviderManager; |
|
34 |
|
|
35 |
/** |
|
36 |
* Library for default implementation initialization and configuration. |
|
37 |
* |
|
38 |
* @author gvSIG team |
|
39 |
* @version $Id$ |
|
40 |
*/ |
|
41 |
public class OffsetEditingLibrary extends AbstractLibrary { |
|
42 |
|
|
43 |
@Override |
|
44 |
public void doRegistration() { |
|
45 |
registerAsServiceOf(EditingLibrary.class); |
|
46 |
} |
|
47 |
|
|
48 |
@Override |
|
49 |
protected void doInitialize() throws LibraryException { |
|
50 |
} |
|
51 |
|
|
52 |
@Override |
|
53 |
protected void doPostInitialize() throws LibraryException { |
|
54 |
EditingProviderManager manager = |
|
55 |
EditingProviderLocator.getProviderManager(); |
|
56 |
|
|
57 |
manager.addProviderFactory(new OffsetEditingProviderFactory()); |
|
58 |
|
|
59 |
manager.registerIcon("vectorediting-tools", "modify-offset", this |
|
60 |
.getClass().getClassLoader(), this.getClass().getName()); |
|
61 |
|
|
62 |
registerTranslations(); |
|
63 |
} |
|
64 |
|
|
65 |
private void registerTranslations() { |
|
66 |
I18nManager manager = ToolsLocator.getI18nManager(); |
|
67 |
manager.addResourceFamily("i18n.text", |
|
68 |
this.getClass().getClassLoader(), "offset-editing"); |
|
69 |
} |
|
70 |
|
|
71 |
} |
org.gvsig.vectorediting.offset/tags/org.gvsig.vectorediting.offset-1.0.79/org.gvsig.vectorediting.offset.lib/org.gvsig.vectorediting.offset.lib.prov/org.gvsig.vectorediting.offset.lib.prov.offset/src/main/resources/i18n/text.properties | ||
---|---|---|
1 |
modify_offset = Geometr\u00eda paralela |
|
2 |
selection=Selecci\u00f3n |
|
3 |
first_point_of_symmetry_axis=Primer punto del eje de simetr\u00eda |
|
4 |
second_point_of_symmetry_axis=Segundo punto del eje de simetr\u00eda |
|
5 |
delete_original_geometries_question=\u00bfDesea borrar las geometr\u00edas originales? |
|
6 |
short_yes=S |
|
7 |
short_no=N |
|
8 |
delete_original_geometries = Eliminar geometr\u00edas originales |
|
9 |
keep_original_geometries = Mantener geometr\u00edas originales |
|
10 |
offset_distance= Distancia |
org.gvsig.vectorediting.offset/tags/org.gvsig.vectorediting.offset-1.0.79/org.gvsig.vectorediting.offset.lib/org.gvsig.vectorediting.offset.lib.prov/org.gvsig.vectorediting.offset.lib.prov.offset/src/main/resources/i18n/text_en.properties | ||
---|---|---|
1 |
modify_offset = Parallel geometry |
|
2 |
selection = Selection |
|
3 |
first_point_of_symmetry_axis=First point of the symmetry axis |
|
4 |
second_point_of_symmetry_axis=Second point of the symmetry axis |
|
5 |
delete_original_geometries_question=Delete original geometries? |
|
6 |
short_yes=Y |
|
7 |
short_no=N |
|
8 |
delete_original_geometries = Delete original geometries |
|
9 |
keep_original_geometries = Keep original geometries |
|
10 |
offset_distance= Distance |
org.gvsig.vectorediting.offset/tags/org.gvsig.vectorediting.offset-1.0.79/org.gvsig.vectorediting.offset.lib/org.gvsig.vectorediting.offset.lib.prov/org.gvsig.vectorediting.offset.lib.prov.offset/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.vectorediting.offset.lib.prov.offset.OffsetEditingLibrary |
org.gvsig.vectorediting.offset/tags/org.gvsig.vectorediting.offset-1.0.79/org.gvsig.vectorediting.offset.lib/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.vectorediting.offset</artifactId> |
|
6 |
<version>1.0.79</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.vectorediting.offset.lib</artifactId> |
|
9 |
<packaging>pom</packaging> |
|
10 |
<name>org.gvsig.vectorediting.offset.lib</name> |
|
11 |
<modules> |
|
12 |
<module>org.gvsig.vectorediting.offset.lib.prov</module> |
|
13 |
</modules> |
|
14 |
</project> |
Also available in: Unified diff