Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/pom.xml	(revision 1663)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="ISO-8859-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">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.gvsig</groupId>
+	<artifactId>org.gvsig.vectorediting.app</artifactId>
+	<packaging>pom</packaging>
+	<version>1.0.92</version>
+	<name>${project.artifactId}</name>
+	<description>This plugin add to gvSIG a tool to show Vectorediting messages</description>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.vectorediting</artifactId>
+		<version>1.0.92</version>
+	</parent>
+	<dependencyManagement>
+		<dependencies>
+		
+		</dependencies>
+	</dependencyManagement>
+
+	<modules>
+		<module>org.gvsig.vectorediting.app.mainplugin</module>
+	</modules>
+
+</project>
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/maven-howto.rst
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/maven-howto.rst	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/maven-howto.rst	(revision 1663)
@@ -0,0 +1,321 @@
+
+==================================
+Usefull maven "howtos" and FAQs
+==================================
+
+.. contents::
+
+How to reduce the process of "install" to run as fast as possible.
+-------------------------------------------------------------------
+
+Can reduce install execution skiping test execution and compilation,
+javadoc generation, test signature checking, license checking, and 
+attach sources in jar.
+
+  mvn  -Danimal.sniffer.skip=true -Dmaven.test.skip=true -Dsource.skip=true -DskipTests -Dmaven.javadoc.skip=true install
+
+How to increment the build number of gvSIG plugins
+----------------------------------------------------
+
+To increase the build number of gvSIG plugins, yo can do:
+
+  mvn -Dincrease-build-number process-sources
+  
+How to deploy a package of a gvSIG plugin
+--------------------------------------------
+
+Yo can deploy the package of a gvSIG plugin with:
+
+  mvn -Ddeploy-package -Duser=USER -Dpassword=PASSWORD install
+
+Notes:
+- Require that the gvsig.package.info.poolURL property that this set to the correct value.
+- The process uses WEBDAV to upload the packages, gvspkg and gvspki, and require 
+  access to write in the location specified by gvsig.package.info.poolURL
+- If "user" or "password" is not present, the process ask its each time it need.
+- If folder specified in  gvsig.package.info.poolURL does not exist, the process try to create it.
+- The process create a file "addon-request.txt" in the target with the information to 
+  add to the ticket to request the update of the package in the main repository of
+  packages of gvSIG.
+
+How to skip attach sources in jar from command line
+------------------------------------------------------
+
+If in the project is enabled by default the generation of jar whith 
+the sources of the project, you can disable this setting the property
+"source.skip" to true in the command line::
+
+    mvn -Dsource.skip=true  install
+
+How to skip test compile from command line
+--------------------------------------------
+
+You can skip the compilation of test setting the propety "maven.test.skip" 
+to true in the command line::
+
+    mvn -Dmaven.test.skip=true  install
+
+
+How to skip test execution from command line
+----------------------------------------------
+
+You can skip the tests execution setting the propety "skipTests" to true
+in the command line::
+
+    mvn -DskipTests install
+
+How to skip javadoc generation from command line
+--------------------------------------------------
+
+You can skip the javadoc generation setting the property
+"maven.javadoc.skip" to true in the command line::
+
+    mvn -Dmaven.javadoc.skip=true  install
+
+How to skip test signature cheks from command line
+---------------------------------------------------
+
+You can skip the signature check setting the property
+"animal.sniffer.skip" to true in the command line::
+
+    mvn -Danimal.sniffer.skip=true install
+
+How to install a project without install submodules
+----------------------------------------------------------
+
+To install a project with submodules and only install the
+parent project without submodules use the option "--non-recursive" ::
+
+    mvn --non-recursive install
+
+  
+How to skip test compilation
+--------------------------------
+
+To configure a project to don't run the compilation
+of test you can add to this pom the next configuration of
+the plugin "maven-compiler-plugin"::
+
+  <build>
+    <plugins>
+      ...
+      <plugin>
+        <!-- Skip compilation tests -->
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>default-testCompile</id>
+            <phase>process-test-sources</phase>
+            <goals>
+              <goal>testCompile</goal>
+            </goals>
+            <configuration>
+              <skip>true</skip>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      ...
+    </plugins>
+  </build>
+
+Skip test execution
+----------------------
+
+To configure a project to don't run the execution
+of test you can add to this pom the next configuration of
+the plugin "maven-surefire-plugin"::
+
+
+  <build>
+    <plugins>
+      ...
+      <plugin>
+        <!-- Skip test execution -->
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <skipTests>true</skipTests>
+        </configuration>
+      </plugin>
+      ...
+    </plugins>
+  </build>
+
+Continue on test failure
+-----------------------------
+
+You can configure a project to continue on test execution 
+failure. To do this add to the pom of the project the next 
+configuration of plugin "maven-surefire-plugin" ::
+
+  <build>
+    <plugins>
+      ...
+      <plugin>
+        <!-- Continue on test failure -->
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <testFailureIgnore>true</testFailureIgnore>
+        </configuration>
+      </plugin>
+      ...
+    </plugins>
+  </build>
+
+
+Set java compatibility
+--------------------------
+
+To set the compatibility with a java version  add to the 
+pom of the project the next configuration of plugin 
+"maven-compiler-plugin" ::
+
+  <build>
+    <plugins>
+      ...
+      <plugin>
+          <!-- Set java compatibility -->
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <configuration>
+              <source>1.5</source>
+              <target>1.5</target>
+              <encoding>ISO-8859-1</encoding>
+          </configuration>
+      </plugin>
+      ...
+    </plugins>
+  </build>
+
+Packaging tests in jar
+------------------------
+
+Test classes do not packaging in jar by default.
+To packing add to pom::
+
+  <build>
+    <plugins>
+      ...
+      <plugin>
+        <!-- Packaging tests in jar -->
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <executions>
+          <!-- Generates a jar file only with the test classes -->
+          <execution>
+            <goals>
+              <goal>test-jar</goal>
+            </goals>
+            <configuration>
+              <includes>
+                <include>**/**</include>
+              </includes>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin> 
+      ...
+    </plugins>
+  </build>
+
+How to set a dependency with tests jar
+-----------------------------------------
+
+You can set a dependency with a test jar adding to
+the declaration of the dependency the scope of
+test and the type of "test-jar"::
+
+  <dependency>
+      <groupId>...</groupId>
+      <artifactId>...</artifactId>
+      <type>test-jar</type>
+      <scope>test</scope>
+  </dependency>
+
+How use ant in maven
+-------------------------
+
+You can use ant embed in the pom of you project.
+To do this use::
+
+  <plugin>
+    <artifactId>maven-antrun-plugin</artifactId>
+    <version>1.7</version>
+    <executions>
+      <execution>
+        <phase>generate-sources</phase>
+        <configuration>
+          <target>
+            <echo>Hello world!</echo>
+          </target>
+        </configuration>
+        <goals>
+          <goal>run</goal>
+        </goals>
+      </execution>
+    </executions>
+  </plugin>
+
+Fail when execute "mvn deploy" with "No connector available"
+-------------------------------------------------------------
+
+When execute a "mvn deploy" fail with the error::
+
+  [INFO] ------------------------------------------------------------------------
+  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy 
+    (default-deploy) on project org.gvsig.desktop: Failed to deploy artifacts/metadata: 
+    No connector available to access repository gvsig-repository (dav:https://devel.gvsig.org/m2repo/j2se) 
+    of type default using the available factories WagonRepositoryConnectorFactory -> [Help 1]
+  [ERROR] 
+  
+This happens to be configured the webdav wagon as an extension in the section "build"::
+
+  ...
+  <build>
+    <extensions>
+        <extension>
+            <groupId>org.apache.maven.wagon</groupId>
+            <artifactId>wagon-webdav-jackrabbit</artifactId>
+            <version>1.0-beta-7</version>
+        </extension>
+    </extensions>
+  ...
+
+Fail when execute "mvn release: prepare" with "svn command failed... Could not authenticate"
+------------------------------------------------------------------------------------------------
+
+When running "mvn release: prepare" updates poms, compiles, and then
+fails with the following error ::
+
+  [INFO] ------------------------------------------------------------------------
+  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.1:prepare 
+    (default-cli) on project org.gvsig.desktop: Unable to commit files
+  [ERROR] Provider message:
+  [ERROR] The svn command failed.
+  [ERROR] Command output:
+  [ERROR] svn: Commit failed (details follow):
+  [ERROR] svn: MKACTIVITY of '/svn/gvsig-desktop/!svn/act/931a27bc-57e8-45d9-adcd-5a2cf54a7045': 
+    authorization failed: Could not authenticate to server: rejected Basic challenge (https://devel.gvsig.org)
+  [ERROR] -> [Help 1]
+  [ERROR] 
+  [ERROR]
+
+Apparently maven in linux system use the svn of system and if you're not
+authenticated when trying to access to the repository, svn fails.
+
+This is solved by executing a commit from the command line on
+some file of the project (only if you have not enabled the option 
+"store-passwords = no" in $ HOME / .subversion / config). For example, you 
+can add or remove at the end of "pom.xml" a blank line and then run 
+from the command line ::
+
+  svn ci -m "" pom.xml
+  
+Another option that works on Windows in declaring the user and password in the command:
+
+mvn release:prepare -Dusername=[username] -Dpassword=[password]
+
+
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/pom.xml	(revision 1663)
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="ISO-8859-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/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.vectorediting.app.mainplugin</artifactId>
+	<packaging>jar</packaging>
+	<name>org.gvsig.vectorediting.app.mainplugin</name>
+	<description>This plugin add to gvSIG a tool that show Vectorediting messages</description>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.vectorediting.app</artifactId>
+		<version>1.0.92</version>
+	</parent>
+
+	<properties>
+		<!-- Package info property values -->
+		<gvsig.package.info.state>testing</gvsig.package.info.state>
+		<gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin
+			-ge 2.1.0-A,conflict: org.gvsig.editing.app.mainplugin -ge 1</gvsig.package.info.dependencies>
+		<gvsig.package.info.official>true</gvsig.package.info.official>
+		<gvsig.package.info.name>Tools: Vector editing</gvsig.package.info.name>
+		<gvsig.package.info.description>Vector editing: provides tools to edit
+			vectorial layers.</gvsig.package.info.description>
+		<gvsig.package.info.categories>Vector</gvsig.package.info.categories>
+		<gvsig.package.info.javaVM>j1_6</gvsig.package.info.javaVM>
+		<gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-vectorediting/pool</gvsig.package.info.poolURL>
+	</properties>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.vectorediting.lib.api</artifactId>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.vectorediting.lib.impl</artifactId>
+			<scope>runtime</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.control</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.point
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.vectorediting.lib.spi</artifactId>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.app.mainplugin</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.vectorediting.swing.api</artifactId>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.vectorediting.swing.impl</artifactId>
+			<scope>runtime</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.circlecr
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.polyline
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.internalpolygon
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.line
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.arc
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.ellipse
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.regularpolygon
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.rectangle
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.spline
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.circle3p
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.explode
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.move
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.rotate
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.duplicate
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.scale
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.splitline
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.simplify
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.multipoint
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+                org.gvsig.vectorediting.lib.prov.autopolygon
+            </artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.join
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+                org.gvsig.vectorediting.lib.prov.stretch
+            </artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+                org.gvsig.vectorediting.lib.prov.extendline
+    	   </artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.split
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+        		org.gvsig.vectorediting.lib.prov.smoothline
+      		</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.trimline
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.rectangularmatrix
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.vectorediting.lib.prov.polarmatrix
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.vectorediting.lib.prov.editvertex</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.vectorediting.lib.prov.remove</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.vectorediting.lib.prov.converttopolyline</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.vectorediting.lib.prov.reversedirection</artifactId>
+		</dependency>
+	</dependencies>
+</project>
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/buildNumber.properties
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/buildNumber.properties	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/buildNumber.properties	(revision 1663)
@@ -0,0 +1,2 @@
+#Mon Oct 07 10:41:04 CEST 2019
+buildNumber=99
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/test/resources/README.txt
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/test/resources/README.txt	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/test/resources/README.txt	(revision 1663)
@@ -0,0 +1,34 @@
+====
+
+    gvSIG. Desktop Geographic Information System.
+
+    Copyright (C) 2007-2013 gvSIG Association.
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 3
+    of the License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA  02110-1301, USA.
+
+    For any additional information, do not hesitate to contact us
+    at info AT gvsig.com, or visit our website www.gvsig.com.
+
+====
+
+Put into this folder the resources needed by your test classes.
+
+This folder is added to the Tests classpath, so you can load any resources 
+through the ClassLoader.
+
+By default, in this folder you can find an example of log4j configuration,
+prepared to log messages through the console, so logging works when you
+run your tests classes.
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/test/resources/log4j.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/test/resources/log4j.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/test/resources/log4j.xml	(revision 1663)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+
+    gvSIG. Desktop Geographic Information System.
+
+    Copyright (C) 2007-2012 gvSIG Association.
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA  02110-1301, USA.
+
+    For any additional information, do not hesitate to contact us
+    at info AT gvsig.com, or visit our website www.gvsig.com.
+
+-->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- 
+Log4J configuration file for unit tests execution.
+ -->
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+	<!-- Appender configuration to show logging messages through the console -->
+	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+		<layout class="org.apache.log4j.PatternLayout">
+			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
+		</layout>
+	</appender>
+
+	<!-- 
+	Activate logging messages of DEBUG level of higher only for the
+	org.gvsig.tools packages.
+	You can put full classes names or packages instead, to configure
+	logging for all the classes and subpackages of the package.
+	-->
+	<category name="org.gvsig.tools">
+		<priority value="DEBUG" />
+	</category>
+	<category name="org.gvsig.vectorediting">
+		<priority value="DEBUG" />
+	</category>
+
+	<!-- 
+	By default, show only logging messages of INFO level or higher, 
+	through the previously configured CONSOLE appender. 
+	-->
+	<root>
+		<priority value="INFO" />
+		<appender-ref ref="CONSOLE" />
+	</root>
+</log4j:configuration>
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml	(revision 1663)
@@ -0,0 +1,85 @@
+<!-- gvSIG. Desktop Geographic Information System. Copyright (C) 2007-2013 gvSIG
+  Association. This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by the Free Software
+  Foundation; either version 3 of the License, or (at your option) any later version.
+  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+  PURPOSE. See the GNU General Public License for more details. You should have received
+  a copy of the GNU General Public License along with this program; if not, write to
+  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+  USA. For any additional information, do not hesitate to contact us at info AT gvsig.com,
+  or visit our website www.gvsig.com. -->
+<assembly>
+  <id>gvsig-plugin-package</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <baseDirectory>${project.artifactId}</baseDirectory>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <files>
+    <file>
+      <source>target/${project.artifactId}-${project.version}.jar</source>
+      <outputDirectory>lib</outputDirectory>
+    </file>
+    <file>
+      <source>target/package.info</source>
+    </file>
+  </files>
+
+  <fileSets>
+    <fileSet>
+      <directory>src/main/resources-plugin</directory>
+      <outputDirectory>.</outputDirectory>
+    </fileSet>
+  </fileSets>
+
+
+  <dependencySets>
+    <dependencySet>
+      <useProjectArtifact>false</useProjectArtifact>
+      <useTransitiveDependencies>false</useTransitiveDependencies>
+      <outputDirectory>lib</outputDirectory>
+      <includes>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.api</include>
+        <include>org.gvsig:org.gvsig.vectorediting.swing.api</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.impl</include>
+        <include>org.gvsig:org.gvsig.vectorediting.swing.impl</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.spi</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.point</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.circlecr</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.circle3p</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.polyline</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.internalpolygon</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.line</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.arc</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.ellipse</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.regularpolygon</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.rectangle</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.spline</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.explode</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.move</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.rotate</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.duplicate</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.scale</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.splitline</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.simplify</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.multipoint</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.autopolygon</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.join</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.stretch</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.extendline</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.split</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.smoothline</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.trimline</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.rectangularmatrix</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.polarmatrix</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.editvertex</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.remove</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.converttopolyline</include>
+        <include>org.gvsig:org.gvsig.vectorediting.lib.prov.reversedirection</include>
+      </includes>
+    </dependencySet>
+  </dependencySets>
+
+</assembly>
+
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/vectorediting/app/mainplugin/ServiceExtension.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/vectorediting/app/mainplugin/ServiceExtension.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/vectorediting/app/mainplugin/ServiceExtension.java	(revision 1663)
@@ -0,0 +1,110 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.app.mainplugin;
+
+import org.gvsig.andami.plugins.Extension;
+import org.gvsig.app.ApplicationLocator;
+import org.gvsig.app.ApplicationManager;
+import org.gvsig.app.project.documents.view.ViewDocument;
+import org.gvsig.app.project.documents.view.gui.IView;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.vectorediting.swing.api.EditingContext;
+import org.gvsig.vectorediting.swing.api.EditingSwingLocator;
+import org.gvsig.vectorediting.swing.api.EditingSwingManager;
+
+public class ServiceExtension extends Extension {
+
+    public void initialize() {
+    }
+
+    public void execute(String actionCommand) {
+        IView view = getActiveView();
+        EditingSwingManager swingManager =
+            EditingSwingLocator.getSwingManager();
+
+        if (view != null) {
+            EditingContext editingContext =
+                swingManager.getEditingContext(view.getMapControl());
+            editingContext.activateService(actionCommand);
+        }
+
+    }
+
+    public boolean isEnabled() {
+        return this.isVisible();
+    }
+
+    @Override
+    public boolean isEnabled(String action) {
+        IView view = getActiveView();
+        FLyrVect activeLayer = getActiveLayer(view);
+
+        if ((view != null) && (activeLayer != null) && activeLayer.isEditing() && action!=null) {
+            EditingSwingManager swingManager =
+                EditingSwingLocator.getSwingManager();
+            EditingContext editingContext =
+                swingManager.getEditingContext(view.getMapControl());
+            return editingContext.isServiceCompatible(action);
+        }
+        return false;
+    }
+
+    public boolean isVisible() {
+        IView view = getActiveView();
+        FLyrVect activeLayer = getActiveLayer(view);
+        return ((view != null) && (activeLayer != null) && activeLayer
+            .isEditing());
+    }
+
+    @Override
+    public boolean isVisible(String action) {
+        return this.isVisible();
+    }
+
+    @Override
+    public boolean canQueryByAction() {
+        return true;
+    }
+
+    private IView getActiveView() {
+
+        ApplicationManager application = ApplicationLocator.getManager();
+        IView view = (IView) application.getActiveComponent(ViewDocument.class);
+        return view;
+    }
+
+    private FLyrVect getActiveLayer(IView view) {
+        if (view != null) {
+            ViewDocument viewDocument = view.getViewDocument();
+            FLayer[] actives =
+                viewDocument.getMapContext().getLayers().getActives();
+
+            if ((actives.length == 1) && (actives[0] instanceof FLyrVect)) {
+                return (FLyrVect) actives[0];
+            }
+        }
+        return null;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/vectorediting/app/mainplugin/EditingExtension.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/vectorediting/app/mainplugin/EditingExtension.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/vectorediting/app/mainplugin/EditingExtension.java	(revision 1663)
@@ -0,0 +1,432 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.app.mainplugin;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import javax.swing.JOptionPane;
+import org.apache.commons.io.FileUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.PluginsLocator;
+import org.gvsig.andami.actioninfo.ActionInfo;
+import org.gvsig.andami.plugins.Extension;
+import org.gvsig.andami.plugins.IExtension;
+import org.gvsig.andami.plugins.status.IExtensionStatus;
+import org.gvsig.andami.plugins.status.IUnsavedData;
+import org.gvsig.andami.plugins.status.UnsavedData;
+import org.gvsig.app.ApplicationLocator;
+import org.gvsig.app.ApplicationManager;
+import org.gvsig.app.project.Project;
+import org.gvsig.app.project.documents.Document;
+import org.gvsig.app.project.documents.view.ViewDocument;
+import org.gvsig.app.project.documents.view.ViewManager;
+import org.gvsig.app.project.documents.view.gui.DefaultViewPanel;
+import org.gvsig.app.project.documents.view.gui.IView;
+import org.gvsig.app.project.documents.view.toc.actions.EndEditingTocMenuEntry;
+import org.gvsig.app.project.documents.view.toc.actions.StartEditingTocMenuEntry;
+import org.gvsig.app.project.documents.view.toolListeners.StatusBarListener;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.MapContextLocator;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolException;
+import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolManager;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.MapControlCreationListener;
+import org.gvsig.fmap.mapcontrol.MapControlLocator;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseMovementBehavior;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.observer.Notification;
+import org.gvsig.tools.observer.Observable;
+import org.gvsig.tools.observer.Observer;
+import org.gvsig.tools.swing.api.windowmanager.WindowManager.MODE;
+import org.gvsig.utils.swing.threads.IMonitorableTask;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.swing.api.EditingContext;
+import org.gvsig.vectorediting.swing.api.EditingSwingLocator;
+import org.gvsig.vectorediting.swing.api.EditingSwingManager;
+
+public class EditingExtension extends Extension implements Observer {
+
+    private static final Logger logger = LoggerFactory.getLogger(EditingExtension.class);
+
+    @Override
+    public void execute(String actionCommand) {
+
+        ApplicationManager application = ApplicationLocator.getManager();
+        IView view = getActiveView();
+        EditingSwingManager swingManager = EditingSwingLocator.getSwingManager();
+
+        if (view != null) {
+
+            FLyrVect layer = getActiveLayer(view);
+            MapControl mapControl = view.getMapControl();
+            EditingContext editingContext = swingManager.getEditingContext(mapControl);
+
+            if ("start-editing".equals(actionCommand)) {
+
+                if (canBeEdited(layer)) {
+                    if( !mapControl.getProjection().equals(layer.getProjection()) ) {
+                        String msg = "_The_layer_is_reproyected_on_the_fly"
+                                + "_Not_all_editing_tools_work_properly"
+                                + "_When_you_finish_editing"
+                                + "_will_only_export_the_changes_to_another_layer";
+                        application.messageDialog(msg, "_Warning", JOptionPane.WARNING_MESSAGE);
+                    } else if (!isWritable(layer)){
+                        String msg = "_The_layer_can_not_be_written"
+                            + "_When_you_finish_editing"
+                            + "_will_only_export_the_changes_to_another_layer";
+                        application.messageDialog(msg, "_Warning", JOptionPane.WARNING_MESSAGE);
+                    }
+                    editingContext.beginEdition(layer);
+                    editingContext.addObserver(this);
+                    ApplicationLocator.getManager().refreshMenusAndToolBars();
+                }
+
+            } else if ("end-editing".equals(actionCommand)) {
+
+                if ((layer != null) && layer.isEditing()) {
+                    editingContext.endEdition(layer);
+                    ApplicationLocator.getManager().refreshMenusAndToolBars();
+                }
+
+            }
+        }
+    }
+
+    @Override
+    public void initialize() {
+        registerIcons();
+
+        // Disable default view panel console. Uses editing context console.
+        DefaultViewPanel.setDisableConsole(true);
+
+        // Adding TOC menu entry
+        ExtensionPoint exPoint = ToolsLocator.getExtensionPointManager().add(
+                "View_TocActions", "");
+        exPoint.append(
+            StartEditingTocMenuEntry.EXTENSION_POINT_NAME,
+                "TOC popup menu to start vector layer's editing",
+                new StartEditingTocMenuEntry());
+        exPoint.append(
+            EndEditingTocMenuEntry.EXTENSION_POINT_NAME,
+                "TOC popup menu to end vector layer's editing",
+                new EndEditingTocMenuEntry());
+    }
+
+
+    private void registerIcons() {
+        IconThemeHelper.registerIcon("vectorediting", "vector-editing", this);
+    }
+
+    @Override
+    public void postInitialize() {
+        super.postInitialize();
+        registerSymbols();
+
+        MapControlLocator.getMapControlManager().addMapControlCreationListener(new MapControlCreationListener() {
+
+            @Override
+            public MapControl mapControlCreated(MapControl mapControl) {
+                EditingContext editingContext = EditingSwingLocator.getSwingManager().getEditingContext(mapControl);
+                StatusBarListener sbl = new StatusBarListener(mapControl);
+                editingContext.setDefaultBehaviors(new Behavior[] { new MouseMovementBehavior(sbl) });
+                editingContext.addObserver(EditingExtension.this);
+                ApplicationLocator.getManager().refreshMenusAndToolBars();
+                return mapControl;
+            }
+        });
+    }
+
+    /**
+     * Register all symbols in the plugin symbols folder in the providerManager.
+     * The description of the symbols must be unique because the key used for registration is the proper description of the symbol.
+     *
+     */
+    private void registerSymbols() {
+
+        EditingProviderManager providerManager = EditingProviderLocator.getProviderManager();
+
+        SymbolManager symbolManager = MapContextLocator.getSymbolManager();
+        File symbolsFolder = FileUtils.getFile(getPlugin().getPluginDirectory(), "symbols","editing");
+        ISymbol[] symbols = null;
+        try {
+            symbols = symbolManager.loadSymbols(symbolsFolder);
+        } catch (SymbolException e) {
+            logger.warn("No symbols loaded from "+symbolsFolder.getAbsolutePath(), e);
+        }
+
+        if (symbols != null) {
+            for (ISymbol symbol : symbols) {
+                String description = symbol.getDescription();
+                providerManager.registerSymbol(description, symbol);
+            }
+        }
+    }
+
+    @Override
+    public boolean isEnabled() {
+        return true;
+    }
+
+    @Override
+    public boolean isVisible() {
+        return true;
+    }
+
+    @Override
+    public boolean isVisible(String action) {
+        IView view = getActiveView();
+        FLyrVect activeLayer = getActiveLayer(view);
+
+        if ("start-editing".equals(action)) {
+            return ((view != null) && (activeLayer != null) && !activeLayer
+                .isEditing());
+
+        } else {
+            return ((view != null) && (activeLayer != null) && activeLayer
+                .isEditing());
+
+        }
+    }
+
+    @Override
+    public boolean isEnabled(String action) {
+
+        IView vista = getActiveView();
+        FLyrVect activeLayer = getActiveLayer(vista);
+
+        if ("start-editing".equals(action)) {
+            return (canBeEdited(activeLayer));
+
+        } else if ("end-editing".equals(action)) {
+            return activeLayer.isEditing();
+
+        }
+
+        return false;
+
+    }
+
+    @Override
+    public boolean canQueryByAction() {
+        return true;
+    }
+
+    private IView getActiveView() {
+        ApplicationManager application = ApplicationLocator.getManager();
+        IView view = (IView) application.getActiveComponent(ViewDocument.class);
+        return view;
+    }
+
+    private boolean isWritable(FLyrVect layer) {
+        if (layer != null && layer.isAvailable()) {
+            return layer.getFeatureStore().allowWrite();
+        }
+        return false;
+    }
+
+    private boolean canBeEdited(FLyrVect layer) {
+        if (layer != null && layer.isAvailable()) {
+
+            boolean isNotTransformed =
+                layer.getFeatureStore().getTransforms().isEmpty();
+
+            return isNotTransformed && !layer.isEditing();
+        }
+
+        return false;
+    }
+
+    private FLyrVect getActiveLayer(IView vista) {
+        if (vista != null) {
+            ViewDocument viewDocument = vista.getViewDocument();
+            FLayer[] actives =
+                viewDocument.getMapContext().getLayers().getActives();
+
+            if ((actives.length == 1) && (actives[0] instanceof FLyrVect)) {
+                return (FLyrVect) actives[0];
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public void update(Observable observable, Object notification) {
+
+        if (notification instanceof Notification){
+            ApplicationManager appManager = ApplicationLocator.getManager();
+            Notification n = (Notification)notification;
+            if (n.isOfType(EditingContext.CHANGE_SELECTED_TOOL_NOTIFICATION)){
+                String name = (String)n.getValue();
+                logger.trace("Changed selected tool to '{}'", name);
+                PluginServices.getMainFrame().setSelectedTool(name);
+                appManager.refreshMenusAndToolBars();
+
+            } else if (n.isOfType(EditingContext.EXPORT_LAYER_NOTIFICATION)){
+                exportLayer((FLyrVect)(n.getValue()));
+
+            } else if (n.isOfType(EditingContext.REFRESH_TOOLS_NOTIFICATION)){
+                appManager.refreshMenusAndToolBars();
+            }
+        }
+    }
+
+    private void exportLayer(FLyrVect layer)  {
+        ApplicationManager appManager = ApplicationLocator.getManager();
+        I18nManager i18nManager = ToolsLocator.getI18nManager();
+        ActionInfo action = PluginsLocator.getActionInfoManager().getAction("layer-exportto");
+        action.execute(new Object[] { layer, MODE.toInteger(MODE.DIALOG) });
+        String msg = "_Do_you_want_to_finish_editing_If_not_exported_the_data_the_changes_will_be_lost";
+        if( appManager.confirmDialog(
+                i18nManager.getTranslation(msg),
+                i18nManager.getTranslation("end_editing"),
+                JOptionPane.YES_NO_OPTION,
+                JOptionPane.QUESTION_MESSAGE)==JOptionPane.YES_OPTION ) {
+            try {
+                layer.getFeatureStore().cancelEditing();
+            } catch (Exception e) {
+                logger.warn("Can't abort editing of layer '"+layer.getName()+"'.",e);
+                msg = "_Cant_finish_editing_See_the_error_log_for_more_information";
+                appManager.messageDialog(msg, "_Warning", JOptionPane.WARNING_MESSAGE);
+            }
+        }
+    }
+
+    private List<FLyrVect> getEditedLayers(){
+        ApplicationManager application = ApplicationLocator.getManager();
+        List<FLyrVect> editedLayers = new ArrayList<>();
+
+        Project project = application.getCurrentProject();
+        for( Document document : project.getDocuments(ViewManager.TYPENAME) ) {
+            ViewDocument view = (ViewDocument) document;
+            MapContext mapContext = view.getMapContext();
+            if (mapContext != null) {
+                FLayers layers = mapContext.getLayers();
+                for (int j = 0; j < layers.getLayersCount(); j++) {
+                    FLayer lyr = layers.getLayer(j);
+                    if (lyr instanceof FLyrVect) {
+                        FLyrVect layerVect = (FLyrVect) lyr;
+                        if (layerVect.isEditing()) {
+                            editedLayers.add(layerVect);
+                        }
+                    }
+                }
+            }
+        }
+        return editedLayers;
+    }
+
+    private List<IUnsavedData> getUnsavedData(List<FLyrVect> editedLayers){
+        List<IUnsavedData> unsavedData = new ArrayList<>();
+        for (FLyrVect editedLayer : editedLayers) {
+            IUnsavedData unsavedDataLayer = new UnsavedLayer(this, editedLayer);
+            unsavedData.add(unsavedDataLayer);
+        }
+        return unsavedData;
+
+    }
+
+    private static class UnsavedLayer extends UnsavedData {
+        private final FLyrVect layer;
+
+        public UnsavedLayer(IExtension extension, FLyrVect layer) {
+            super(extension);
+            this.layer = layer;
+        }
+
+        @Override
+        public String getDescription() {
+            return layer.getName();
+        }
+
+        @Override
+        public String getResourceName() {
+            return layer.getFeatureStore().getFullName();
+        }
+
+        @Override
+        public boolean saveData() {
+            FeatureStore featureStore = layer.getFeatureStore();
+            if(featureStore.isEditing()){
+                try {
+                    featureStore.finishEditing();
+                    return true;
+                } catch (DataException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+            return true;
+        }
+    }
+
+    @Override
+    public IExtensionStatus getStatus() {
+        List<FLyrVect> editedLayers = getEditedLayers();
+        final List<IUnsavedData> unsavedData = getUnsavedData(editedLayers);
+
+        return new IExtensionStatus() {
+
+            @Override
+            public boolean hasUnsavedData() {
+                if(unsavedData == null){
+                    return false;
+                }
+                return !unsavedData.isEmpty();
+            }
+
+            @Override
+            public boolean hasRunningProcesses() {
+                return false;
+            }
+
+            @Override
+            public IUnsavedData[] getUnsavedData() {
+                if(unsavedData == null){
+                    return null;
+                }
+                return unsavedData.toArray(new IUnsavedData[0]);
+            }
+
+            @Override
+            public IMonitorableTask[] getRunningProcesses() {
+                return null;
+            }
+        };
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/toc/actions/StartEditingTocMenuEntry.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/toc/actions/StartEditingTocMenuEntry.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/toc/actions/StartEditingTocMenuEntry.java	(revision 1663)
@@ -0,0 +1,83 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.app.project.documents.view.toc.actions;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.plugins.IExtension;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.vectorediting.app.mainplugin.EditingExtension;
+
+
+public class StartEditingTocMenuEntry extends AbstractTocContextMenuAction {
+
+    public static final String EXTENSION_POINT_NAME = "StartEditing";
+
+    private IExtension ext = null;
+
+    private static Logger logger =
+        LoggerFactory.getLogger(StartEditingTocMenuEntry.class);
+
+	public String getGroup() {
+		return "vectorEditing";
+	}
+
+	public int getGroupOrder() {
+		return 0;
+	}
+
+	public int getOrder() {
+		return 0;
+	}
+
+	public String getText() {
+		return PluginServices.getText(this, "start_editing");
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+	    return ((EditingExtension)getExtension()).isEnabled("start-editing");
+	}
+
+   public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+       return ((EditingExtension)getExtension()).isVisible("start-editing");
+    }
+
+
+	public void execute(ITocItem item, FLayer[] selItems) {
+	       getExtension().execute("start-editing");
+	}
+
+    private IExtension getExtension() {
+
+        if (ext == null) {
+            ext = PluginServices.getExtension(EditingExtension.class);
+        }
+        return ext;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/toc/actions/EndEditingTocMenuEntry.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/toc/actions/EndEditingTocMenuEntry.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/toc/actions/EndEditingTocMenuEntry.java	(revision 1663)
@@ -0,0 +1,83 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.app.project.documents.view.toc.actions;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.plugins.IExtension;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.vectorediting.app.mainplugin.EditingExtension;
+
+
+public class EndEditingTocMenuEntry extends AbstractTocContextMenuAction {
+
+    public static final String EXTENSION_POINT_NAME = "EndEditing";
+
+    private IExtension ext = null;
+
+    private static Logger logger =
+        LoggerFactory.getLogger(EndEditingTocMenuEntry.class);
+
+	public String getGroup() {
+		return "vectorEditing";
+	}
+
+	public int getGroupOrder() {
+		return 0;
+	}
+
+	public int getOrder() {
+		return 1;
+	}
+
+	public String getText() {
+		return PluginServices.getText(this, "end_editing");
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+	    return ((EditingExtension)getExtension()).isEnabled("end-editing");
+	}
+
+   public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+        return ((EditingExtension)getExtension()).isVisible("end-editing");
+    }
+
+
+	public void execute(ITocItem item, FLayer[] selItems) {
+	       getExtension().execute("end-editing");
+	}
+
+    private IExtension getExtension() {
+
+        if (ext == null) {
+            ext = PluginServices.getExtension(EditingExtension.class);
+        }
+        return ext;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/i18n/text.properties
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/i18n/text.properties	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/i18n/text.properties	(revision 1663)
@@ -0,0 +1,139 @@
+start_editing = Comenzar edici\u00f3n
+end_editing = Terminar edici\u00f3n
+insert_point = Insertar punto
+insert_multipoint = Insertar MultiPunto
+insert_line = Insertar l\u00ednea
+insert_arc = Insertar arco
+insert_circle_cr = Insertar c\u00edrculo (centro y radio)
+insert_circumference_cr = Insertar circunferencia (centro y radio)
+insert_circle_3p = Insertar c\u00edrculo (tres puntos)
+insert_circumference_3p = Insertar circunferencia (tres puntos)
+insert_ellipse = Insertar elipse
+insert_filled_ellipse = Insertar elipse rellena
+insert_polyline = Insertar polil\u00ednea
+insert_polygon = Insertar pol\u00edgono
+insert_regular_polygon = Insertar pol\u00edgono regular
+insert_filled_regular_polygon = Insertar pol\u00edgono regular relleno
+insert_rectangle = Insertar rect\u00e1ngulo
+insert_filled_rectangle =  Insertar rect\u00e1ngulo relleno
+insert_spline= Insertar curva spline
+insert_filled_spline = Insertar curva spline rellena
+insert_rectangular_matrix = Matriz rectangular de geometr\u00edas
+insert_polar_matrix = Matriz polar de geometr\u00edas
+modify_internal_polygon = Pol\u00edgono interno
+modify_explode_geometry = Descomponer geometr\u00eda
+modify_move = Mover geometr\u00eda
+modify_rotate = Rotar geometr\u00eda
+modify_duplicate = Duplicar geometr\u00eda
+modify_split_line = Partir linea por un punto
+modify_split = Partir geometr\u00eda
+modify_scale = Escalar geometr\u00eda
+modify_simplify = Simplificar geometr\u00eda
+modify_join = Unir geometr\u00edas
+insert_autopolygon = Insertar autopol\u00edgono
+modify_stretch = Estirar geometr\u00eda
+modify_extend_line = Alargar l\u00ednea hasta objeto
+modify_trim_line = Recortar l\u00ednea por un objeto
+modify_edit_vertex = Editar v\u00e9rtice
+modify_convert_to_polyline= Convertir a polil\u00ednea
+modify_reverse_direction=Invertir direcci\u00f3n
+uniqueselection = Seleccione una \u00fanica geometr\u00eda
+selectvertex = Seleccione un v\u00e9rtice
+new_position = Nueva posici\u00f3n
+new_position_or_z_value = Nueva posici\u00f3n o valor Z
+insert_vertex = Insertar v\u00e9rtice
+remove_vertex = Eliminar v\u00e9rtice
+selection=Selecci\u00f3n
+invalid_option=Opci\u00f3n no v\u00e1lida
+center=Centro
+radius=Radio
+save_changes_performed=Guardar cambios realizados
+discard= Descartar
+discard_and_loose_changes= Descartar cambios y perder los cambios
+continue= Continuar
+do_not_save_yet_stay_in_editing_mode= No guardar los cambios y seguir en modo edici\u00f3n
+indicate_new_point= Indique un nuevo punto
+arc_mode = Modo arco
+line_mode = Modo l\u00ednea
+select_new_tool= Seleccione una nueva herramienta
+draw_geometry_to_internal_polygon= Seleccione una herramienta para dibujar un pol\u00edgono interno
+draw_geometry_to_autopolygon = Seleccione una herramienta para dibujar un autopol\u00edgono
+draw_geometry_to_split = Seleccione una herramienta para partir las geometr\u00edas
+draw_geometry_to_select_vertex = Seleccione una herramienta poligonal para seleccionar v\u00e9rtices
+save = Guardar
+discard = Descartar
+continue = Continuar
+export = Exportar
+ask_save_layer = \u00bfDesea guardar la capa
+can_not_write_layer =  No existe writer para este formato de capa o no tiene permisos de escritura.\n\u00bfQu\u00e9 desea hacer?
+save_changes_performed = Guardar cambios realizados
+discard_and_loose_changes = Descartar y perder los cambios
+export_to_another_format = Exportar a otro formato
+do_not_save_yet_stay_in_editing_mode = No guardar los cambios y seguir editando
+first_point= Primer punto
+second_point= Segundo punto
+third_point= Tercer punto
+start_point= Punto de inicio
+middle_point= Punto medio
+end_point= Punto final
+first_point_A_axis = Primer punto del eje A
+second_point_A_axis = Segundo punto del eje A
+length_of_B_axis= Longitud del eje B
+inscribed = Inscrito
+circumscribed = Circunscrito
+sides_of_regular_polygon = Indique los lados del poligono regular
+center_of_regular_polygon = Centro del pol\u00edguno regular
+point_of_circle = Punto del c\u00edrculo del pol\u00edgono
+sides = Lados
+key_arc_mode = A
+key_line_mode = L
+key_close = C
+key_finish = F
+key_inscribed = I
+key_circumscribed = C
+key_remove_last_point = Q
+remove_last_point = Quitar \u00faltimo punto
+close_polyline = Cerrar polil\u00ednea
+close_spline = Cerrar curva spline
+new_point = Nuevo punto
+new_value = Nuevo valor
+finished = finalizada
+center_of_rotation = Centro de rotaci\u00f3n
+angle_of_rotation = \u00c1ngulo de rotaci\u00f3n (grados)
+origin_point = Origen
+scale_factor_or_reference_point = Factor de escala o punto de referencia
+second_scale_point = Segundo punto para la escala
+tolerance = Tolerancia
+line_to_extend = Seleccione l\u00ednea para alargar
+line_to_trim = Seleccione l\u00ednea para partir
+modify_smooth_line = Suavizar l\u00ednea
+intermediate_steps_1_9 = Pasos intermedios [1,9]
+algorithm = algoritmo
+natural_cubic_splines = Splines c\u00fabicos naturales
+bezier_curves = Curvas B\u00e9zier
+b_splines = B-splines
+key_natural_cubic_splines = 1
+key_bezier_curves = 2
+key_b_splines = 3
+columns_number = N\u00famero de columnas
+rows_number = N\u00famero de filas
+distance_between_columns = Distancia entre columnas
+distance_between_rows = Distancia entre filas
+key_yes= S
+key_no = N
+yes = Si
+no = No
+number_of_total_elements = N\u00famero de elementos totales
+rotate_elements = Rotar elementos?
+angle_between_elements = Angulo entre elementos
+modify = modificar
+insert = insertar
+Modify = Modificar
+Insert = Insertar
+_The_layer_is_reproyected_on_the_fly_Not_all_editing_tools_work_properly_When_you_finish_editing_will_only_export_the_changes_to_another_layer=La capa esta reproyectada el vuelo.\nNo todas las herramientas de edici\u00f3n funcionar\u00e1n correctamente.\nCuando termine edici\u00f3n solo podra exportar los cambios a otra capa.
+_Do_you_want_to_finish_editing_If_not_exported_the_data_the_changes_will_be_lost=\u00bf Desea terminar la edici\u00f3n ?\nSi no ha exportado los datos y termina edici\u00f3n, los cambios realizados se perder\u00e1n.
+_Cant_finish_editing_See_the_error_log_for_more_information=No se puede terminar la edici\u00f3n.\nConsulte el registro de errores para mas informaci\u00f3n.
+_The_layer_can_not_be_written_When_you_finish_editing_will_only_export_the_changes_to_another_layer=No puede escribirse en la capa.\nCuando termine edici\u00f3n solo podra exportar los cambios a otra capa.
+remove_selected_geometries=Eliminar geometr\u00edas seleccionadas
+_Use_a_point_previously_captured=Usar un punto capturado previamente.
+_Enter_the_coordinates_manually=Introducir las coordenadas manualmente.
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties	(revision 1663)
@@ -0,0 +1,139 @@
+start_editing = Start editing
+end_editing = End editing
+insert_point = Insert point
+insert_multipoint = Insert MultiPoint
+insert_line = Insert line
+insert_arc = Insert arc
+insert_circle_cr=Insert circle (center & radius)
+insert_circumference_cr=Insert circumference (center & radius)
+insert_circle_3p = Insert circle (three point)
+insert_circumference_3p = Insert circumference (three points)
+insert_ellipse = Insert ellipse
+insert_filled_ellipse = Insert filled ellipse
+insert_polyline = Insert polyline
+insert_polygon = Insert polygon
+insert_regular_polygon = Insert regular polygon
+insert_filled_regular_polygon = Insert filled regular polygon
+insert_rectangle = Insert rectangle
+insert_filled_rectangle = Insert filled rectangle
+insert_spline= Insert spline curve
+insert_filled_spline = Insert filled spline
+insert_rectangular_matrix = Rectangular matrix of geometries
+insert_polar_matrix = Polar matrix of geometries
+modify_internal_polygon = Internal polygon
+modify_explode_geometry = Explode geometry
+modify_move = Move geometry
+modify_rotate = Rotate geometry
+modify_duplicate = Duplicate geometry
+modify_split_line = Split line open by a point
+modify_split = Split geometry
+modify_scale = Scale geometry
+modify_simplify = Simplify geometry
+insert_autopolygon = Insert autopolygon
+modify_join = Join geometries
+modify_stretch = Stretch geometry
+modify_extend_line = Extend line to object
+modify_trim_line = Trim line by object
+modify_edit_vertex = Edit vertex
+modify_convert_to_polyline= Convert to polyline
+modify_reverse_direction=Reverse direction
+uniqueselection = Select only one geometry
+selectvertex = Select a vertex
+new_position = New position
+new_position_or_z_value = New position or Z value
+insert_vertex = Insertr vertex
+remove_vertex = Remove vertex
+selection=Selection
+invalid_option=Invalid option
+center=Center
+radius=Radius
+save_changes_performed=Save changed performed
+discard= Discard
+discard_and_loose_changes= Discard changes and loose changes
+continue= Continue
+do_not_save_yet_stay_in_editing_mode= Don't save changes and continue editing
+indicate_new_point= Indicate new point
+arc_mode = Arc mode
+line_mode = Line mode
+select_new_tool= Select a new tool
+draw_geometry_to_interal_polygon= Select tool to draw a internal polygon
+draw_geometry_to_autopolygon = Select tool to draw an autopolygon
+draw_geometry_to_split = Select tool to split selected geometries
+draw_geometry_to_select_vertex = Select a polygonal tool to select vertex
+save = Save
+discard = Discard
+continue = Continue
+export = Export
+ask_save_layer = Would you really like to save the layer
+can_not_write_layer =  There are not writer for this layer format or you don't have write permissions.\nWhat do you want to do?
+save_changes_performed = Save changed performed
+discard_and_loose_changes = Discard and loose changes
+export_to_another_format = Export to another format
+do_not_save_yet_stay_in_editing_mode = Do not save changes and continue editing
+first_point= First point
+second_point= Second point
+start_point= Start point
+middle_point= Middle point
+third_point= Third point
+end_point= End point
+first_point_A_axis = First point of A axis
+second_point_A_axis = Second point of A axis
+length_of_B_axis= Length of B axis
+inscribed = Inscribed
+circumscribed = Circumscribed
+sides_of_regular_polygon = Indicate sides of regular polygon
+center_of_regular_polygon = Center of regular polygon
+point_of_circle = Point of circle of  polygon
+sides = Sides
+key_arc_mode = A
+key_line_mode = L
+key_close = C
+key_finish = F
+key_inscribed = I
+key_circumscribed = C
+key_remove_last_point = R
+remove_last_point = Remove last point
+close_polyline = Close polyline
+close_spline = Close spline curve
+new_point = New point
+new_value = New value
+finished = finished
+center_of_rotation=Center of rotation
+angle_of_rotation=Angle of rotation (degree)
+origin_point = Origin
+scale_factor_or_reference_point = Scale factor or reference point
+second_scale_point = Second scale point
+tolerance = Tolerance
+line_to_extend = Select line to extend
+line_to_trim = Select line to trim
+modify_smooth_line = Smooth line
+intermediate_steps_1_9 = Intermediate steps [1,9]
+algorithm = algorithm
+natural_cubic_splines = Natural cubic splines
+bezier_curves = Bezier curves
+b_splines = B-splines
+key_natural_cubic_splines = 1
+key_bezier_curves = 2
+key_b_splines = 3
+columns_number = Number of columns
+rows_number = Number of rows
+distance_between_columns = Distance between columns
+distance_between_rows = Distance between rows
+key_yes= Y
+key_no = N
+yes = Yes
+no = No
+number_of_total_elements = Number of total elements
+rotate_elements = Rotate elements?
+angle_between_elements = Angle between elements
+modify = modify
+insert = insert
+Modify = Modify
+Insert = Insert
+_The_layer_is_reproyected_on_the_fly_Not_all_editing_tools_work_properly_When_you_finish_editing_will_only_export_the_changes_to_another_layer=The layer is reproyected on the fly.\nNot all editing tools work properly.\nWhen you finish editing will only export the changes to another layer will be allowed.
+_Do_you_want_to_finish_editing_If_not_exported_the_data_the_changes_will_be_lost=Do you want to finish editing?\nIf not exported the data and finish editing, the changes will be lost.
+_Cant_finish_editing_See_the_error_log_for_more_information=Unable to finish editing.\nSee the error log for more information
+_The_layer_can_not_be_written_When_you_finish_editing_will_only_export_the_changes_to_another_layer=The layer can not be written.\nWhen you finish editing will only export the changes to another layer will be allowed.
+remove_selected_geometries=Remove selected geometries
+_Use_a_point_previously_captured=Use a point previously captured.
+_Enter_the_coordinates_manually=Enter the coordinates manually.
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/config.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/config.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/config.xml	(revision 1663)
@@ -0,0 +1,284 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!-- gvSIG. Desktop Geographic Information System. Copyright (C) 2007-2013 gvSIG
+  Association. This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by the Free Software
+  Foundation; either version 3 of the License, or (at your option) any later version.
+  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+  PURPOSE. See the GNU General Public License for more details. You should have received
+  a copy of the GNU General Public License along with this program; if not, write to
+  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+  USA. For any additional information, do not hesitate to contact us at info AT gvsig.com,
+  or visit our website www.gvsig.com. -->
+<plugin-config>
+  <depends plugin-name="org.gvsig.app.mainplugin" />
+  <resourceBundle name="text" />
+  <libraries library-dir="lib" />
+  <extensions>
+    <extension class-name="org.gvsig.vectorediting.app.mainplugin.EditingExtension"
+      description="" active="true" priority="1">
+
+      <action name="start-editing" label="start_editing" tooltip="start_editing"
+        position="600800000" action-command="start-editing" icon="vector-editing"
+        accelerator="" />
+
+      <action name="end-editing" label="end_editing" tooltip="end_editing"
+        position="600800000" action-command="end-editing" icon="vector-editing"
+        accelerator="" />
+
+      <menu text="Layer/start_editing" name="start-editing" />
+      <menu text="Layer/end_editing" name="end-editing" />
+
+      <tool-bar name="vector_editing" position="4000">
+        <action-tool name="start-editing" />
+        <action-tool name="end-editing" />
+      </tool-bar>
+
+    </extension>
+
+    <extension class-name="org.gvsig.vectorediting.app.mainplugin.ServiceExtension"
+      description="" active="true" priority="1">
+
+      <action name="remove" label="remove_selected_geometries" tooltip="remove_selected_geometries"
+        action-command="remove" icon="remove" position="601002000"
+        accelerator="delete" />
+        <!-- accelerator="" /> -->
+
+      <action name="insert-point" label="insert_point" tooltip="insert_point"
+        action-command="insert-point" icon="insert-point" position="601002010"
+        accelerator="" />
+
+      <action name="insert-multipoint" label="insert_multipoint" tooltip="insert_multipoint"
+        action-command="insert-multipoint" icon="insert-multipoint" position="601002025"
+        accelerator="" />
+
+      <action name="insert-line" label="insert_line" tooltip="insert_line"
+        position="601002050" action-command="insert-line" icon="insert-line"
+        accelerator="" />
+
+      <action name="insert-arc" label="insert_arc" tooltip="insert_arc"
+        position="601002060" action-command="insert-arc" icon="insert-arc"
+        accelerator="" />
+
+      <action name="insert-circle-cr" label="insert_circle_cr" tooltip="insert_circle_cr"
+        position="601002100" action-command="insert-circle-cr" icon="insert-circle-cr"
+        accelerator="" />
+
+      <action name="insert-circumference-cr" label="insert_circumference_cr"
+        tooltip="insert_circumference_cr" position="601002101" action-command="insert-circumference-cr"
+        icon="insert-circumference-cr" accelerator="" />
+
+      <action name="insert-circle-3p" label="insert_circle_3p" tooltip="insert_circle_3p"
+        position="601002125" action-command="insert-circle-3p" icon="insert-circle-3p"
+        accelerator="" />
+
+      <action name="insert-circumference-3p" label="insert_circumference_3p"
+        tooltip="insert_circumference_3p" position="601002126" action-command="insert-circumference-3p"
+        icon="insert-circumference-3p" accelerator="" />
+
+      <action name="insert-ellipse" label="insert_ellipse" tooltip="insert_ellipse"
+        position="601002150" action-command="insert-ellipse" icon="insert-ellipse"
+        accelerator="" />
+
+      <action name="insert-filled-ellipse" label="insert_filled_ellipse"
+        tooltip="insert_filled_ellipse" position="601002160" action-command="insert-filled-ellipse"
+        icon="insert-filled-ellipse" accelerator="" />
+
+      <action name="insert-polygon" label="insert_polygon" tooltip="insert_polygon"
+        position="601002200" action-command="insert-polygon" icon="insert-polygon"
+        accelerator="" />
+
+      <action name="insert-polyline" label="insert_polyline" tooltip="insert_polyline"
+        position="601002201" action-command="insert-polyline" icon="insert-polyline"
+        accelerator="" />
+
+      <action name="insert-filled-regular-polygon" label="insert_filled_regular_polygon"
+        tooltip="insert_filled_regular_polygon" position="601002300"
+        action-command="insert-filled-regular-polygon" icon="insert-filled-regular-polygon"
+        accelerator="" />
+
+      <action name="insert-regular-polygon" label="insert_regular_polygon"
+        tooltip="insert_regular_polygon" position="601002301" action-command="insert-regular-polygon"
+        icon="insert-regular-polygon" accelerator="" />
+
+      <action name="insert-filled-rectangle" label="insert_filled_rectangle"
+        tooltip="insert_filled_rectangle" position="601002350" action-command="insert-filled-rectangle"
+        icon="insert-filled-rectangle" accelerator="" />
+
+      <action name="insert-rectangle" label="insert_rectangle" tooltip="insert_rectangle"
+        position="601002351" action-command="insert-rectangle" icon="insert-rectangle"
+        accelerator="" />
+
+      <action name="insert-filled-spline" label="insert_filled_spline"
+        tooltip="insert_filled_spline" position="601002370" action-command="insert-filled-spline"
+        icon="insert-filled-spline" accelerator="" />
+
+      <action name="insert-spline" label="insert_spline" tooltip="insert_spline"
+        position="601002371" action-command="insert-spline" icon="insert-spline"
+        accelerator="" />
+
+      <action name="modify-internal-polygon" label="modify_internal_polygon"
+        tooltip="modify_internal_polygon" position="601002500" action-command="modify-internal-polygon"
+        icon="modify-internal-polygon" accelerator="" />
+
+      <action name="modify-explode-geometry" label="modify_explode_geometry"
+        tooltip="modify_explode_geometry" position="601002600" action-command="modify-explode-geometry"
+        icon="modify-explode-geometry" accelerator="" />
+
+      <action name="modify-move" label="modify_move" tooltip="modify_move"
+        position="601002700" action-command="modify-move" icon="modify-move"
+        accelerator="" />
+
+      <action name="modify-rotate" label="modify_rotate" tooltip="modify_rotate"
+        position="601002800" action-command="modify-rotate" icon="modify-rotate"
+        accelerator="" />
+
+      <action name="modify-duplicate" label="modify_duplicate" tooltip="modify_duplicate"
+        position="601002900" action-command="modify-duplicate" icon="modify-duplicate"
+        accelerator="" />
+
+      <action name="modify-split" label="modify_split" tooltip="modify_split"
+        position="601003000" action-command="modify-split" icon="modify-split"
+        accelerator="" />
+
+      <action name="modify-split-line" label="modify_split_line" tooltip="modify_split_line"
+        position="601003050" action-command="modify-split-line" icon="modify-split-line"
+        accelerator="" />
+
+      <action name="modify-scale" label="modify_scale" tooltip="modify_scale"
+        position="601003100" action-command="modify-scale" icon="modify-scale"
+        accelerator="" />
+
+      <action name="modify-simplify" label="modify_simplify" tooltip="modify_simplify"
+        position="601003200" action-command="modify-simplify" icon="modify-simplify"
+        accelerator="" />
+
+      <action name="modify-join" label="modify_join" tooltip="modify_join"
+        position="601003300" action-command="modify-join" icon="modify-join"
+        accelerator="" />
+
+      <action name="insert-autopolygon" label="insert_autopolygon"
+        tooltip="insert_autopolygon" position="601003400" action-command="insert-autopolygon"
+        icon="insert-autopolygon" accelerator="" />
+
+      <action name="modify-stretch" label="modify_stretch" tooltip="modify_stretch"
+        position="601003500" action-command="modify-stretch" icon="modify-stretch"
+        accelerator="" />
+
+      <action name="modify-extend-line" label="modify_extend_line"
+        tooltip="modify_extend_line" position="601003600" action-command="modify-extend-line"
+        icon="modify-extend-line" accelerator="" />
+
+      <action name="modify-trim-line" label="modify_trim_line" tooltip="modify_trim_line"
+        position="601003700" action-command="modify-trim-line" icon="modify-trim-line"
+        accelerator="" />
+
+      <action name="modify-smooth-line" label="modify_smooth_line"
+        tooltip="modify_smooth_line" position="601003800" action-command="modify-smooth-line"
+        icon="modify-smooth-line" accelerator="" />
+
+      <action name="modify-edit-vertex" label="modify_edit_vertex"
+        tooltip="modify_edit_vertex" position="601003900" action-command="modify-edit-vertex"
+        icon="modify-edit-vertex" accelerator="" />
+
+      <action name="insert-rectangular-matrix" label="insert_rectangular_matrix"
+        tooltip="insert_rectangular_matrix" position="601004000" action-command="insert-rectangular-matrix"
+        icon="insert-rectangular-matrix" accelerator="" />
+
+      <action name="insert-polar-matrix" label="insert_polar_matrix"
+        tooltip="insert_polar_matrix" position="601004100" action-command="insert-polar-matrix"
+        icon="insert-polar-matrix" accelerator="" />
+
+      <action name="modify-convert-to-polyline" label="modify_convert_to_polyline"
+        tooltip="modify_convert_to_polyline" position="601004200" action-command="modify-convert-to-polyline"
+        icon="modify-convert-to-polyline" accelerator="" />
+
+      <action name="modify-reverse-direction" label="modify_reverse_direction"
+        tooltip="modify_reverse_direction" position="601004300" action-command="modify-reverse-direction"
+        icon="modify-reverse-direction" accelerator="" />
+
+      <menu text="Layer/Remove/remove_selected_geometries" name="remove" />
+      <menu text="Layer/Insert/insert_point" name="insert-point" />
+      <menu text="Layer/Insert/insert_multipoint" name="insert-multipoint" />
+      <menu text="Layer/Insert/insert_line" name="insert-line" />
+      <menu text="Layer/Insert/insert_arc" name="insert-arc" />
+      <menu text="Layer/Insert/insert_circle_cr" name="insert-circle-cr" />
+      <menu text="Layer/Insert/insert_circumference_cr" name="insert-circumference-cr" />
+      <menu text="Layer/Insert/insert_circle_3p" name="insert-circle-3p" />
+      <menu text="Layer/Insert/insert_circumference_3p" name="insert-circumference-3p" />
+      <menu text="Layer/Insert/insert_ellipse" name="insert-ellipse" />
+      <menu text="Layer/Insert/insert_filled_ellipse" name="insert-filled-ellipse" />
+      <menu text="Layer/Insert/insert_polyline" name="insert-polyline" />
+      <menu text="Layer/Insert/insert_polygon" name="insert-polygon" />
+      <menu text="Layer/Insert/insert_regular_polygon" name="insert-regular-polygon" />
+      <menu text="Layer/Insert/insert_filled_regular_polygon" name="insert-filled-regular-polygon" />
+      <menu text="Layer/Insert/insert_rectangle" name="insert-rectangle" />
+      <menu text="Layer/Insert/insert_filled_rectangle" name="insert-filled-rectangle" />
+      <menu text="Layer/Insert/insert_spline" name="insert-spline" />
+      <menu text="Layer/Insert/insert_filled_spline" name="insert-filled-spline" />
+      <menu text="Layer/Insert/insert_rectangular_matrix" name="insert-rectangular-matrix" />
+      <menu text="Layer/Insert/insert_polar_matrix" name="insert-polar-matrix" />
+      <menu text="Layer/Insert/insert_autopolygon" name="insert-autopolygon" />
+      <menu text="Layer/Modify/modify_internal_polygon" name="modify-internal-polygon" />
+      <menu text="Layer/Modify/modify_explode_geometry" name="modify-explode-geometry" />
+      <menu text="Layer/Modify/modify_move" name="modify-move" />
+      <menu text="Layer/Modify/modify_rotate" name="modify-rotate" />
+      <menu text="Layer/Modify/modify_duplicate" name="modify-duplicate" />
+      <menu text="Layer/Modify/modify_split_line" name="modify-split-line" />
+      <menu text="Layer/Modify/modify_split" name="modify-split" />
+      <menu text="Layer/Modify/modify_scale" name="modify-scale" />
+      <menu text="Layer/Modify/modify_simplify" name="modify-simplify" />
+      <menu text="Layer/Modify/modify_join" name="modify-join" />
+      <menu text="Layer/Modify/modify_stretch" name="modify-stretch" />
+      <menu text="Layer/Modify/modify_extend_line" name="modify-extend-line" />
+      <menu text="Layer/Modify/modify_trim_line" name="modify-extend-line" />
+      <menu text="Layer/Modify/modify_smooth_line" name="modify-smooth-line" />
+      <menu text="Layer/Modify/modify_edit_vertex" name="modify-edit-vertex" />
+      <menu text="Layer/Modify/modify_convert_to_polyline" name="modify-convert-to-polyline" />
+      <menu text="Layer/Modify/modify_reverse_direction" name="modify-reverse-direction" />
+
+      <tool-bar name="vector_editing" position="4000">
+        <selectable-tool name="remove" />
+        <selectable-tool name="insert-point" />
+        <selectable-tool name="insert-multipoint" />
+        <selectable-tool name="insert-line" />
+        <selectable-tool name="insert-arc" />
+        <selectable-tool name="insert-circumference-cr" dropdowngroup="circle" />
+        <selectable-tool name="insert-circle-cr" dropdowngroup="circle" />
+        <selectable-tool name="insert-circumference-3p" dropdowngroup="circle" />
+        <selectable-tool name="insert-circle-3p" dropdowngroup="circle" />
+        <selectable-tool name="insert-ellipse" dropdowngroup="ellipse" />
+        <selectable-tool name="insert-filled-ellipse" dropdowngroup="ellipse" />
+        <selectable-tool name="insert-polyline" dropdowngroup="polygon"/>
+        <selectable-tool name="insert-polygon" dropdowngroup="polygon"/>
+        <selectable-tool name="insert-regular-polygon" dropdowngroup="regularpolygon"/>
+        <selectable-tool name="insert-filled-regular-polygon" dropdowngroup="regularpolygon"/>
+        <selectable-tool name="insert-rectangle" dropdowngroup="rectangle"/>
+        <selectable-tool name="insert-filled-rectangle" dropdowngroup="rectangle"/>
+        <selectable-tool name="insert-filled-spline" dropdowngroup="spline"/>
+        <selectable-tool name="insert-spline" dropdowngroup="spline"/>
+        <selectable-tool name="modify-internal-polygon" />
+        <selectable-tool name="modify-explode-geometry" />
+        <selectable-tool name="modify-move" />
+        <selectable-tool name="modify-rotate" />
+        <selectable-tool name="modify-duplicate" />
+        <selectable-tool name="modify-split" />
+        <selectable-tool name="modify-split-line" />
+        <selectable-tool name="modify-scale" />
+        <selectable-tool name="modify-simplify" />
+        <selectable-tool name="insert-autopolygon" />
+        <selectable-tool name="modify-join" />
+        <selectable-tool name="modify-stretch" />
+        <selectable-tool name="modify-extend-line" />
+        <selectable-tool name="modify-trim-line" />
+        <selectable-tool name="modify-smooth-line" />
+        <selectable-tool name="insert-rectangular-matrix" dropdowngroup="matrix" />
+        <selectable-tool name="insert-polar-matrix" dropdowngroup="matrix" />
+        <selectable-tool name="modify-edit-vertex" />
+        <selectable-tool name="modify-convert-to-polyline" />
+        <selectable-tool name="modify-reverse-direction" />
+      </tool-bar>
+
+    </extension>
+  </extensions>
+</plugin-config>
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/images/vectorediting/vector-editing.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/images/vectorediting/vector-editing.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/line-symbol-editing.gvssym
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/line-symbol-editing.gvssym
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/polygon-symbol-editing.gvssym
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/polygon-symbol-editing.gvssym
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/rule-axis-symbol.gvssym
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/rule-axis-symbol.gvssym
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/edited-vertex-symbol-editing.gvssym
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/edited-vertex-symbol-editing.gvssym
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/auxiliary-line-symbol-editing-direction.gvssym
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/auxiliary-line-symbol-editing-direction.gvssym
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/auxiliary-line-symbol-editing.gvssym
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/auxiliary-line-symbol-editing.gvssym
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/rule-unity-symbol.gvssym
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/rule-unity-symbol.gvssym
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/auxiliary-point-symbol-editing.gvssym
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/auxiliary-point-symbol-editing.gvssym
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/rule-decimal-symbol.gvssym
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/rule-decimal-symbol.gvssym
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/selected-vertex-symbol-editing.gvssym
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/selected-vertex-symbol-editing.gvssym
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/rule-marker-symbol.gvssym
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources-plugin/symbols/editing/rule-marker-symbol.gvssym
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources/README.txt
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources/README.txt	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/resources/README.txt	(revision 1663)
@@ -0,0 +1,27 @@
+====
+
+    gvSIG. Desktop Geographic Information System.
+
+    Copyright (C) 2007-2013 gvSIG Association.
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 3
+    of the License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA  02110-1301, USA.
+
+    For any additional information, do not hesitate to contact us
+    at info AT gvsig.com, or visit our website www.gvsig.com.
+====
+
+Put into this folder the resources to be included in the plugin jar.
+

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/pom.xml	(revision 1663)
@@ -0,0 +1,335 @@
+<?xml version="1.0" encoding="ISO-8859-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">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.gvsig</groupId>
+  <artifactId>org.gvsig.vectorediting</artifactId>
+  <packaging>pom</packaging>
+  <version>1.0.92</version>
+  <name>${project.artifactId}</name>
+  <description>Vectorediting project</description>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.desktop</artifactId>
+    <version>2.0.248</version>
+  </parent>
+  <url>https://devel.gvsig.org/sites/org.gvsig.vectorediting/${project.version}</url>
+  <scm>
+    <connection>scm:svn:https://devel.gvsig.org/svn/gvsig-vectorediting/org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92</connection>
+    <developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-vectorediting/org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92</developerConnection>
+    <url>https://devel.gvsig.org/redmine/projects/gvsig-vector-editing/repository/show/org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92</url>
+  </scm>
+  <repositories>
+    <repository>
+      <id>gvsig-public-http-repository</id>
+      <name>gvSIG maven public HTTP repository</name>
+      <url>http://devel.gvsig.org/m2repo/j2se</url>
+      <releases>
+        <enabled>true</enabled>
+        <updatePolicy>daily</updatePolicy>
+        <checksumPolicy>warn</checksumPolicy>
+      </releases>
+      <snapshots>
+        <enabled>true</enabled>
+        <updatePolicy>daily</updatePolicy>
+        <checksumPolicy>warn</checksumPolicy>
+      </snapshots>
+    </repository>
+  </repositories>
+
+  <distributionManagement>
+    <site>
+      <id>gvsig-repository</id>
+      <url>dav:https://devel.gvsig.org/download/projects/gvsig-vectorediting/pool/${project.artifactId}/${project.version}</url>
+    </site>
+  </distributionManagement>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-release-plugin</artifactId>
+        <configuration>
+          <tagBase>https://devel.gvsig.org/svn/gvsig-vectorediting/org.gvsig.vectorediting/tags</tagBase>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <modules>
+    <module>org.gvsig.vectorediting.lib</module>
+    <module>org.gvsig.vectorediting.swing</module>
+    <module>org.gvsig.vectorediting.main</module>
+    <module>org.gvsig.vectorediting.app</module>
+  </modules>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>org.gvsig.vectorediting.lib.api</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.impl
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>org.gvsig.vectorediting.lib.spi</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.swing.api
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.swing.impl
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.point
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.circlecr
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.polyline
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.symmetry
+				</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.internalpolygon
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+                    org.gvsig.vectorediting.lib.prov.line
+                </artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+                    org.gvsig.vectorediting.lib.prov.arc
+                </artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.app.mainplugin
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.ellipse
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.regularpolygon
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.rectangle
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.spline
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.circle3p
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.explode
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.move
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.rotate
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.duplicate
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.splitline
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.scale
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.simplify
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.multipoint
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+                    org.gvsig.vectorediting.lib.prov.autopolygon
+                </artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.join
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+                    org.gvsig.vectorediting.lib.prov.stretch
+                </artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+      		        org.gvsig.vectorediting.lib.prov.extendline
+      	        </artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.split
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+          			org.gvsig.vectorediting.lib.prov.smoothline
+        		</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.trimline
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.rectangularmatrix
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+					org.gvsig.vectorediting.lib.prov.polarmatrix
+				</artifactId>
+        <version>1.0.92</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+          org.gvsig.vectorediting.lib.prov.editvertex
+        </artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>
+          org.gvsig.vectorediting.lib.prov.remove
+        </artifactId>
+        <version>1.0.92</version>
+      </dependency>
+      <dependency>
+      	<groupId>org.gvsig</groupId>
+      	<artifactId>org.gvsig.vectorediting.lib.prov.converttopolyline</artifactId>
+      	<version>1.0.92</version>
+      </dependency>
+      <dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.vectorediting.lib.prov.reversedirection</artifactId>
+			<version>1.0.92</version>
+		</dependency>
+    </dependencies>
+  </dependencyManagement>
+</project>
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main/src/main/resources/README.txt
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main/src/main/resources/README.txt	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main/src/main/resources/README.txt	(revision 1663)
@@ -0,0 +1,32 @@
+====
+    gvSIG. Desktop Geographic Information System.
+
+    Copyright (C) 2007-2012 gvSIG Association.
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA  02110-1301, USA.
+
+    For any additional information, do not hesitate to contact us
+    at info AT gvsig.com, or visit our website www.gvsig.com.
+====
+
+Put into this folder the resources needed by your classes.
+
+This folder is added to the classpath, so you can load any resources 
+through the ClassLoader.
+
+By default, in this folder you can find an example of log4j configuration,
+prepared to log messages through the console, so logging works when you
+run your classes.
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main/src/main/resources/log4j.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main/src/main/resources/log4j.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main/src/main/resources/log4j.xml	(revision 1663)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+
+    gvSIG. Desktop Geographic Information System.
+
+    Copyright (C) 2007-2012 gvSIG Association.
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA  02110-1301, USA.
+
+    For any additional information, do not hesitate to contact us
+    at info AT gvsig.com, or visit our website www.gvsig.com.
+
+-->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- 
+Log4J configuration file for unit tests execution.
+ -->
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+	<!-- Appender configuration to show logging messages through the console -->
+	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+		<layout class="org.apache.log4j.PatternLayout">
+			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
+		</layout>
+	</appender>
+
+	<!-- 
+	Activate logging messages of DEBUG level of higher only for the
+	org.gvsig.tools packages.
+	You can put full classes names or packages instead, to configure
+	logging for all the classes and subpackages of the package.
+	-->
+	<category name="org.gvsig.tools">
+		<priority value="DEBUG" />
+	</category>
+	<category name="org.gvsig.vectorediting">
+		<priority value="DEBUG" />
+	</category>
+
+	<!-- 
+	By default, show only logging messages of INFO level or higher, 
+	through the previously configured CONSOLE appender. 
+	-->
+	<root>
+		<priority value="INFO" />
+		<appender-ref ref="CONSOLE" />
+	</root>
+</log4j:configuration>
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main/src/main/java/org/gvsig/vectorediting/main/DummieLayerOrderManager.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main/src/main/java/org/gvsig/vectorediting/main/DummieLayerOrderManager.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main/src/main/java/org/gvsig/vectorediting/main/DummieLayerOrderManager.java	(revision 1663)
@@ -0,0 +1,63 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.main;
+
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontext.layers.order.LayerOrderManager;
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+
+public class DummieLayerOrderManager implements LayerOrderManager {
+
+    public void saveToState(PersistentState state) throws PersistenceException {
+    }
+
+    public void loadFromState(PersistentState state)
+        throws PersistenceException {
+    }
+
+    public int getPosition(FLayers target, FLayer newLayer) {
+        return 0;
+    }
+
+    public String getName() {
+        return null;
+    }
+
+    public String getDescription() {
+        return null;
+    }
+
+    public String getCode() {
+        return null;
+    }
+
+    @Override
+    public Object clone() throws CloneNotSupportedException {
+        return new DummieLayerOrderManager();
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main/src/main/java/org/gvsig/vectorediting/main/Main.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main/src/main/java/org/gvsig/vectorediting/main/Main.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main/src/main/java/org/gvsig/vectorediting/main/Main.java	(revision 1663)
@@ -0,0 +1,1215 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.main;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JToolBar;
+import javax.swing.SwingUtilities;
+import javax.swing.WindowConstants;
+
+import org.cresques.cts.IProjection;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.fmap.crs.CRSFactory;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
+import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.MapContextLocator;
+import org.gvsig.fmap.mapcontext.MapContextManager;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.MapControlCreationException;
+import org.gvsig.fmap.mapcontrol.MapControlLocator;
+import org.gvsig.fmap.mapcontrol.MapControlManager;
+import org.gvsig.fmap.mapcontrol.tools.PanListenerImpl;
+import org.gvsig.fmap.mapcontrol.tools.PointSelectionListener;
+import org.gvsig.fmap.mapcontrol.tools.ZoomInListenerImpl;
+import org.gvsig.fmap.mapcontrol.tools.ZoomOutListenerImpl;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.MoveBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.PointBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.RectangleBehavior;
+import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
+import org.gvsig.tools.observer.Observable;
+import org.gvsig.tools.observer.Observer;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
+import org.gvsig.utils.GenericFileFilter;
+import org.gvsig.vectorediting.lib.api.EditingLocator;
+import org.gvsig.vectorediting.lib.api.EditingManager;
+import org.gvsig.vectorediting.lib.prov.arc.ArcEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.autopolygon.AutopolygonEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.circle3p.Circle3PEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.circle3p.Circumference3PEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.circlecr.CircleCREditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.circlecr.CircumferenceCREditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.duplicate.DuplicateEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.editvertex.EditVertexEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.ellipse.EllipseEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.ellipse.FilledEllipseEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.explode.ExplodeEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.extendline.ExtendLineEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.internalpolygon.InternalPolygonEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.join.JoinEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.line.LineEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.move.MoveEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.multipoint.MultipointEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.point.PointEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.polarmatrix.PolarMatrixEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.polyline.PolygonEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.polyline.PolylineEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.rectangle.FilledRectangleEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.rectangle.RectangleEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.rectangularmatrix.RectangularMatrixEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.regularpolygon.FilledRegularPolygonEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.regularpolygon.RegularPolygonEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.rotate.RotateEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.scale.ScaleEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.simplify.SimplifyEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.smoothline.SmoothLineEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.spline.FilledSplineEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.spline.SplineEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.split.SplitEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.splitline.SplitLineEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.stretch.StretchEditingProviderFactory;
+import org.gvsig.vectorediting.lib.prov.trimline.TrimLineEditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.swing.api.EditingContext;
+import org.gvsig.vectorediting.swing.api.EditingSwingLocator;
+import org.gvsig.vectorediting.swing.api.EditingSwingManager;
+import org.gvsig.vectorediting.swing.impl.DefaultEditingBehavior;
+
+/**
+ * Main executable class for testing the VectorEditing library.
+ *
+ * @author gvSIG Team
+ * @version $Id$
+ */
+public class Main implements Observer {
+
+    public static void main(String args[]) {
+        new DefaultLibrariesInitializer().fullInitialize();
+        Main main = new Main();
+        main.doMain();
+    }
+
+    private static final Logger logger = LoggerFactory.getLogger(Main.class);
+
+    final EditingManager manager;
+
+    final EditingSwingManager swingManager;
+
+    final EditingProviderManager providerManager;
+
+    final MapControlManager mapControlManager;
+
+    final DataManager dataManager;
+
+    final MapContextManager mapContextManager;
+
+    DefaultEditingBehavior editingBehavior;
+
+    MapControl mapControl;
+
+    EditingContext editingContext;
+
+    FeatureStore store;
+
+    FLyrVect currentLayer;
+
+    final String DEFAULT_CRS_CODE = "EPSG:23030";
+
+    IProjection defaultProjection;
+
+    JFrame mainFrame;
+
+    JFrame paletteTools;
+
+    JButton openPaletteToolsButtons;
+
+    JButton editingExtensionButtons;
+
+    JButton endEditingExtensionButtons;
+
+    JButton cleanMapButton;
+
+    List<JButton> buttons;
+
+    public Main() {
+        manager = EditingLocator.getManager();
+        swingManager = EditingSwingLocator.getSwingManager();
+        providerManager = EditingProviderLocator.getProviderManager();
+        mapControlManager = MapControlLocator.getMapControlManager();
+        dataManager = DALLocator.getDataManager();
+        mapContextManager = MapContextLocator.getMapContextManager();
+        defaultProjection = CRSFactory.getCRS(DEFAULT_CRS_CODE);
+
+        MapContextLocator
+            .registerDefaultOrderManager(DummieLayerOrderManager.class);
+    }
+
+    public void addLayer(String shpPath) throws InitializeException,
+        ProviderNotRegisteredException, ValidateDataParametersException,
+        LoadLayerException {
+        DataStoreParameters params;
+        params = dataManager.createStoreParameters("Shape");
+
+        String dbfPath =
+            shpPath.substring(0, shpPath.length() - 3).concat("dbf");
+        String shxPath =
+            shpPath.substring(0, shpPath.length() - 3).concat("shx");
+
+        File shpFile = new File(shpPath);
+        File dbFile = new File(dbfPath);
+        File shxFile = new File(shxPath);
+
+        params.setDynValue("shpFile", shpFile.getPath());
+        params.setDynValue("dbfFile", dbFile.getPath());
+        params.setDynValue("shxFile", shxFile.getPath());
+        params.setDynValue("CRS", defaultProjection);
+
+        store = (FeatureStore) dataManager.openStore("Shape", params);
+
+        FLayer layer = mapContextManager.createLayer(store.getName(), store);
+        mapControl.getMapContext().getLayers().addLayer(layer);
+        layer.setActive(true);
+        try {
+            currentLayer = (FLyrVect) layer;
+        } catch (Exception e) {
+            logger.error("Can't load layer " + e.getMessage());
+        }
+        refreshButtons();
+    }
+
+    private void createActionButtons() {
+
+        buttons = new ArrayList<JButton>();
+
+        buttons.add(new JButton(getPointAction()));
+        buttons.add(new JButton(getMultiPointAction()));
+        buttons.add(new JButton(getLineAction()));
+        buttons.add(new JButton(getArcAction()));
+        buttons.add(new JButton(getCircumferenceCrAction()));
+        buttons.add(new JButton(getCircleCrAction()));
+        buttons.add(new JButton(getCircumference3PAction()));
+        buttons.add(new JButton(getCircle3PAction()));
+        buttons.add(new JButton(getPolylineAction()));
+        buttons.add(new JButton(getPolygonAction()));
+        buttons.add(new JButton(getEclipseAction()));
+        buttons.add(new JButton(getFilledEclipseAction()));
+        buttons.add(new JButton(getRegularPolygonAction()));
+        buttons.add(new JButton(getFilledRegularPolygonAction()));
+        buttons.add(new JButton(getRectangleAction()));
+        buttons.add(new JButton(getFilledRectangleAction()));
+        buttons.add(new JButton(getSplineAction()));
+        buttons.add(new JButton(getFilledSplineAction()));
+        buttons.add(new JButton(getAutopolygonAction()));
+        buttons.add(new JButton(getInternalPolygonAction()));
+        buttons.add(new JButton(getExplodeGeometryAction()));
+        buttons.add(new JButton(getMoveAction()));
+        buttons.add(new JButton(getDuplicateAction()));
+        buttons.add(new JButton(getStretchAction()));
+        buttons.add(new JButton(getRotateAction()));
+        buttons.add(new JButton(getSplitLineAction()));
+        buttons.add(new JButton(getSplitAction()));
+        buttons.add(new JButton(getExtendLineAction()));
+        buttons.add(new JButton(getTrimLineAction()));
+        buttons.add(new JButton(getSimplifyAction()));
+        buttons.add(new JButton(getScaleAction()));
+        buttons.add(new JButton(getJoinAction()));
+        buttons.add(new JButton(getSmoothLineAction()));
+        buttons.add(new JButton(getRectangularMatrixAction()));
+        buttons.add(new JButton(getPolarMatrixAction()));
+        buttons.add(new JButton(getEditVertexAction()));
+
+    }
+
+    private JButton getOpenPaletteToolsButton() {
+
+        if (openPaletteToolsButtons == null) {
+            openPaletteToolsButtons = new JButton(getOpenPaletteToolsAction());
+            openPaletteToolsButtons.setEnabled(false);
+        }
+        return openPaletteToolsButtons;
+    }
+
+    private JButton getEditingExtensionButton() {
+
+        if (editingExtensionButtons == null) {
+            editingExtensionButtons = new JButton(getEditingExtensionAction());
+        }
+        return editingExtensionButtons;
+    }
+
+    private JButton getEndEditingExtensionButton() {
+
+        if (endEditingExtensionButtons == null) {
+            endEditingExtensionButtons =
+                new JButton(getEndEditingExtensionAction());
+            endEditingExtensionButtons.setEnabled(false);
+        }
+        return endEditingExtensionButtons;
+    }
+
+    private JButton getCleanMapButton() {
+        if (cleanMapButton == null) {
+            cleanMapButton = new JButton(getCleanMapAction());
+            cleanMapButton.setEnabled(false);
+        }
+        return cleanMapButton;
+    }
+
+    private AbstractAction getInternalPolygonAction() {
+        return new AbstractAction(
+            InternalPolygonEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -5366590032240258186L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(InternalPolygonEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getExplodeGeometryAction() {
+        return new AbstractAction(ExplodeEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -5366590032240258186L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(ExplodeEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getMoveAction() {
+        return new AbstractAction(MoveEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -5366590032240258186L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(MoveEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getDuplicateAction() {
+        return new AbstractAction(DuplicateEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -5366590032240258186L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(DuplicateEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getSimplifyAction() {
+        return new AbstractAction(SimplifyEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -5366590032240258186L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(SimplifyEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getFilledSplineAction() {
+        return new AbstractAction(
+            FilledSplineEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = 357716596419507221L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(FilledSplineEditingProviderFactory.PROVIDER_NAME);
+
+            }
+        };
+    }
+
+    private AbstractAction getSplineAction() {
+        return new AbstractAction(SplineEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -2308770572409304622L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(SplineEditingProviderFactory.PROVIDER_NAME);
+
+            }
+        };
+    }
+
+    private AbstractAction getFilledRectangleAction() {
+        return new AbstractAction(
+            FilledRectangleEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = 2293196006002423664L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(FilledRectangleEditingProviderFactory.PROVIDER_NAME);
+
+            }
+        };
+    }
+
+    private AbstractAction getRectangleAction() {
+        return new AbstractAction(RectangleEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -6429005619655148416L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(RectangleEditingProviderFactory.PROVIDER_NAME);
+
+            }
+        };
+    }
+
+    private AbstractAction getFilledRegularPolygonAction() {
+        return new AbstractAction(
+            FilledRegularPolygonEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = 7944728685657584703L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(FilledRegularPolygonEditingProviderFactory.PROVIDER_NAME);
+
+            }
+        };
+    }
+
+    private AbstractAction getRegularPolygonAction() {
+        return new AbstractAction(
+            RegularPolygonEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = 1465569443777907186L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(RegularPolygonEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getPolygonAction() {
+        return new AbstractAction(PolygonEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = 966582628310445218L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(PolygonEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getPolylineAction() {
+        return new AbstractAction(PolylineEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = 2859732316623830924L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(PolylineEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getEclipseAction() {
+        return new AbstractAction(EllipseEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -4698275458250358502L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(EllipseEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getFilledEclipseAction() {
+        return new AbstractAction(
+            FilledEllipseEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -4698275458250358502L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(FilledEllipseEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getCircumferenceCrAction() {
+        return new AbstractAction(
+            CircumferenceCREditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -4422429984929119239L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(CircumferenceCREditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getCircleCrAction() {
+        return new AbstractAction(CircleCREditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = 1564163738941995373L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(CircleCREditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getCircumference3PAction() {
+        return new AbstractAction(
+            Circumference3PEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -4422429984929119239L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(Circumference3PEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getCircle3PAction() {
+        return new AbstractAction(Circle3PEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = 1564163738941995373L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(Circle3PEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getArcAction() {
+        return new AbstractAction(ArcEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = 5529987067864211418L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(ArcEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getLineAction() {
+        return new AbstractAction(LineEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = 7464822491323014704L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(LineEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getPointAction() {
+        return new AbstractAction(PointEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -9147590153911397886L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(PointEditingProviderFactory.PROVIDER_NAME);
+            }
+
+        };
+    }
+
+    private AbstractAction getMultiPointAction() {
+        return new AbstractAction(
+            MultipointEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -9147590153911397886L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(MultipointEditingProviderFactory.PROVIDER_NAME);
+            }
+
+        };
+    }
+
+    private AbstractAction getSplitLineAction() {
+        return new AbstractAction(SplitLineEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -5366590032240258186L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(SplitLineEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getSplitAction() {
+        return new AbstractAction(SplitEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -5366590032240258186L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(SplitEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getExtendLineAction() {
+        return new AbstractAction(
+            ExtendLineEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -5366590032240258186L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(ExtendLineEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getTrimLineAction() {
+        return new AbstractAction(TrimLineEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -5366590032240258186L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(TrimLineEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getEndEditingExtensionAction() {
+        return new AbstractAction("end-editing") {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -1026680183527522379L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext.endEdition(currentLayer);
+
+                if (currentLayer != null && !currentLayer.isEditing()) {
+                    getPaletteTools().setVisible(false);
+                }
+
+                refreshButtons();
+            }
+        };
+    }
+
+    private AbstractAction getRotateAction() {
+        return new AbstractAction(RotateEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+            *
+            */
+            private static final long serialVersionUID = -1026680183527522379L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(RotateEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getEditingExtensionAction() {
+        return new AbstractAction("start-editing") {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = 5524271695550380473L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                registerObserver(editingContext);
+                editingContext.beginEdition(currentLayer);
+                refreshButtons();
+
+                // XXX Forces component repaint.
+                SwingUtilities.updateComponentTreeUI(mainFrame);
+            }
+        };
+    }
+
+    private AbstractAction getExitAction() {
+        return new AbstractAction("Exit") {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = 7506436995278783992L;
+
+            public void actionPerformed(ActionEvent e) {
+                System.exit(0);
+            }
+        };
+    }
+
+    private AbstractAction getOpenPaletteToolsAction() {
+        return new AbstractAction("Show palette tools") {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -2643193186380529723L;
+
+            public void actionPerformed(ActionEvent e) {
+                getPaletteTools().setVisible(true);
+            }
+        };
+    }
+
+    private AbstractAction getAddLayerAction() {
+        return new AbstractAction("Add layer") {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -7527908235576117027L;
+
+            public void actionPerformed(ActionEvent e) {
+                ThreadSafeDialogsManager dlgManager =
+                    ToolsSwingLocator.getThreadSafeDialogsManager();
+
+                File[] file =
+                    dlgManager.showChooserDialog("Seleccione archivo SHP",
+                        JFileChooser.OPEN_DIALOG, JFileChooser.FILES_ONLY,
+                        false, new File(System.getProperty("user.home")),
+                        new GenericFileFilter(new String[] { ".shp" },
+                            "(*.shp)"), true);
+
+                if (file != null) {
+                    try {
+                        addLayer(file[0].getAbsolutePath());
+                    } catch (Exception ex) {
+                        logger.warn("Problems adding layer", ex);
+                    }
+                }
+            }
+        };
+    }
+
+    private AbstractAction getCleanMapAction() {
+        return new AbstractAction("Clean Map") {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = 5059847015866672405L;
+
+            public void actionPerformed(ActionEvent e) {
+                MapContext mapContext = mapControl.getMapContext();
+                mapContext.beginAtomicEvent();
+                while (mapContext.getLayers().getLayersCount() > 0) {
+                    mapContext.getLayers().removeLayer(0);
+                }
+                mapContext.endAtomicEvent();
+                currentLayer = null;
+                refreshButtons();
+            }
+        };
+    }
+
+    private AbstractAction getZoomAllAction() {
+        return new AbstractAction("Zoom all") {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -1338436395515982258L;
+
+            public void actionPerformed(ActionEvent e) {
+                zoomAll();
+            }
+        };
+    }
+
+    private AbstractAction getZoomAction() {
+        return new AbstractAction("Zoom") {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -7231543178928614445L;
+
+            public void actionPerformed(ActionEvent e) {
+                mapControl.setTool("zoom");
+            }
+        };
+    }
+
+    private AbstractAction getPanAction() {
+        return new AbstractAction("Pan") {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -6520053841602571307L;
+
+            public void actionPerformed(ActionEvent e) {
+                mapControl.setTool("pan");
+            }
+        };
+    }
+
+    private AbstractAction getAutopolygonAction() {
+        return new AbstractAction(
+            AutopolygonEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -6520053841602571307L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(AutopolygonEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getJoinAction() {
+        return new AbstractAction(JoinEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -6520053841602571307L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(JoinEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getSmoothLineAction() {
+        return new AbstractAction(
+            SmoothLineEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = 4659561526143686702L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(SmoothLineEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getScaleAction() {
+        return new AbstractAction(ScaleEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -6520053841602571307L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(ScaleEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getRectangularMatrixAction() {
+        return new AbstractAction(
+            RectangularMatrixEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -6520053841602571307L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(RectangularMatrixEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getPolarMatrixAction() {
+        return new AbstractAction(
+            PolarMatrixEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = -6520053841602571307L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(PolarMatrixEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getEditVertexAction() {
+        return new AbstractAction(
+            EditVertexEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = 6445235261647995856L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(EditVertexEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private AbstractAction getStretchAction() {
+        return new AbstractAction(StretchEditingProviderFactory.PROVIDER_NAME) {
+
+            /**
+             *
+             */
+            private static final long serialVersionUID = 6445235261647995856L;
+
+            public void actionPerformed(ActionEvent e) {
+                editingContext = swingManager.getEditingContext(mapControl);
+                editingContext
+                    .activateService(StretchEditingProviderFactory.PROVIDER_NAME);
+            }
+        };
+    }
+
+    private void createMenu() {
+        // Create the menu bar.
+        JMenuBar menuBar = new JMenuBar();
+
+        // Build the menu.
+        JMenu menuFile = new JMenu("File");
+        menuFile.add(new JMenuItem(getExitAction()));
+
+        menuBar.add(menuFile);
+
+        mainFrame.setJMenuBar(menuBar);
+    }
+
+    private JFrame getPaletteTools() {
+        if (paletteTools == null) {
+            paletteTools = new JFrame("Palette tools");
+            paletteTools.setLayout(new GridLayout(0, 2, 1, 5));
+            paletteTools.setLocation(0, 0);
+            paletteTools
+                .setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
+
+            for (JButton button : buttons) {
+                paletteTools.add(button);
+            }
+
+            paletteTools.pack();
+        }
+        return paletteTools;
+    }
+
+    private void createToolBar() {
+        JToolBar toolBar = new JToolBar();
+
+        toolBar.add(new JButton(getAddLayerAction()));
+        toolBar.add(getEditingExtensionButton());
+        toolBar.add(getEndEditingExtensionButton());
+        toolBar.add(new JButton(getPanAction()));
+        toolBar.add(new JButton(getZoomAction()));
+        toolBar.add(new JButton(getZoomAllAction()));
+        toolBar.add(getCleanMapButton());
+        toolBar.add(getOpenPaletteToolsButton());
+
+        mainFrame.add(toolBar, BorderLayout.PAGE_START);
+    }
+
+    public void doMain() {
+
+        try {
+            MapContext mapContext =
+                new MapContext(new ViewPort(defaultProjection));
+            mapControl = mapControlManager.createJMapControlPanel(mapContext);
+
+            mapControl.addBehavior("zoom", new Behavior[] {
+                new RectangleBehavior(new ZoomInListenerImpl(mapControl)),
+                new PointBehavior(new ZoomOutListenerImpl(mapControl),
+                    Behavior.BUTTON_RIGHT) });
+            mapControl.addBehavior("pan", new MoveBehavior(new PanListenerImpl(
+                mapControl)));
+
+            mapControl.addBehavior("pointSelection",
+                new Behavior[] { new PointBehavior(new PointSelectionListener(
+                    mapControl)) });
+
+            IProjection defaultProjection = CRSFactory.getCRS(DEFAULT_CRS_CODE);
+            mapControl.getViewPort().setProjection(defaultProjection);
+
+            mapControl.setTool("pan");
+
+            swingManager.registerEditingContext(mapControl);
+
+            // Create buttons
+            createActionButtons();
+
+        } catch (MapControlCreationException e) {
+            logger.error("Can't create mapControl", e);
+        }
+
+        // Create JFrame to show data
+        mainFrame = new JFrame("Editing test app");
+        mainFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+        mainFrame.setPreferredSize(new Dimension(800, 680));
+        mainFrame.add(mapControl, BorderLayout.CENTER);
+
+        // Create menu bar
+        createMenu();
+
+        // Create tools bar
+        createToolBar();
+
+        // Display the window.
+        mainFrame.pack();
+        mainFrame.setLocation(500, 0);
+        mainFrame.setVisible(true);
+    }
+
+    private void registerObserver(EditingContext editingContext) {
+        editingContext.addObserver(this);
+    }
+
+    private void refreshButtons() {
+
+        // Refresh palette tool buttons
+        for (JButton button : buttons) {
+            String acctionCommand = button.getActionCommand();
+            editingContext = swingManager.getEditingContext(mapControl);
+            boolean enable = editingContext.isServiceCompatible(acctionCommand);
+            button.setEnabled(enable);
+        }
+
+        // Refresh toolbar buttons
+
+        if (currentLayer != null) {
+
+            if (currentLayer.isEditing()) {
+                getOpenPaletteToolsButton().setEnabled(true);
+                getEditingExtensionButton().setEnabled(false);
+                getEndEditingExtensionButton().setEnabled(true);
+                getCleanMapButton().setEnabled(false);
+            } else {
+                getOpenPaletteToolsButton().setEnabled(false);
+                getEditingExtensionButton().setEnabled(true);
+                getEndEditingExtensionButton().setEnabled(false);
+                getCleanMapButton().setEnabled(true);
+            }
+        } else {
+            getOpenPaletteToolsButton().setEnabled(false);
+            getEditingExtensionButton().setEnabled(false);
+            getEndEditingExtensionButton().setEnabled(false);
+            getCleanMapButton().setEnabled(false);
+        }
+    }
+
+    private void zoomAll() {
+        MapContext mapContext = mapControl.getMapContext();
+        Envelope all = mapContext.getLayers().getFullEnvelope();
+        logger.info("Full extdents " + all.toString());
+        mapContext.getViewPort().setEnvelope(all);
+        mapContext.invalidate();
+    }
+
+    public void update(Observable observable, Object notification) {
+
+        if (observable instanceof EditingContext) {
+            refreshButtons();
+        }
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main/src/main/java/org/gvsig/vectorediting/main/package.html
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main/src/main/java/org/gvsig/vectorediting/main/package.html	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main/src/main/java/org/gvsig/vectorediting/main/package.html	(revision 1663)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+
+    gvSIG. Desktop Geographic Information System.
+
+    Copyright (C) 2007-2012 gvSIG Association.
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA  02110-1301, USA.
+
+    For any additional information, do not hesitate to contact us
+    at info AT gvsig.com, or visit our website www.gvsig.com.
+
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>org.gvsig.vectorediting package documentation</title>
+</head>
+<body>
+
+	<p>Vectorediting library testing and demo application.</p>
+
+</body>
+</html>
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main/pom.xml	(revision 1663)
@@ -0,0 +1,338 @@
+<?xml version="1.0" encoding="ISO-8859-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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>org.gvsig.vectorediting.main</artifactId>
+  <packaging>jar</packaging>
+  <name>org.gvsig.vectorediting.main</name>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <dependencies>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.vectorediting.lib.api</artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.vectorediting.swing.api</artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.vectorediting.swing.impl</artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.vectorediting.lib.spi</artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.point
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.circlecr
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.internalpolygon
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.polyline
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.tools.swing.api</artifactId>
+      <type>jar</type>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.fmap.control</artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.fmap.dal.api</artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.fmap.geometry.api</artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.arc
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.line
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.ellipse
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.regularpolygon
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.rectangle
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.spline
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.circle3p
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.explode
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.move
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.split
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.extendline
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.splitline
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.duplicate
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.rotate
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.simplify
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.multipoint
+            </artifactId>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.autopolygon
+            </artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.join
+            </artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.scale
+            </artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.smoothline
+            </artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.trimline
+            </artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.rectangularmatrix
+            </artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.polarmatrix
+            </artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>
+                org.gvsig.vectorediting.lib.prov.editvertex
+            </artifactId>
+    </dependency>
+
+    <!-- runtime dependencies -->
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.vectorediting.lib.impl</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.metadata.lib.basic.impl</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <!--
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.fmap.geometry.generalpath</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.fmap.geometry.operation</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    -->
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.fmap.mapcontext.impl</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.symbology.lib.impl</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.fmap.dal.impl</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.fmap.dal.spi</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.fmap.dal.file.shp</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.fmap.dal.file.dbf</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.fmap.dal.file.lib</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.timesupport.lib.api</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.timesupport.lib.impl</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.tools.evaluator.sqljep</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.proj.lib.proj4j</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+    	<groupId>org.gvsig</groupId>
+    	<artifactId>
+    		org.gvsig.vectorediting.lib.prov.stretch
+    	</artifactId>
+    </dependency>
+  </dependencies>
+</project>

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.main
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1,2 @@
+org.gvsig.vectorediting.lib.impl.DefaultEditingLibrary
+org.gvsig.vectorediting.lib.impl.DefaultEditingProviderLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/java/org/gvsig/vectorediting/lib/impl/DefaultEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/java/org/gvsig/vectorediting/lib/impl/DefaultEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/java/org/gvsig/vectorediting/lib/impl/DefaultEditingLibrary.java	(revision 1663)
@@ -0,0 +1,58 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.impl;
+
+import org.gvsig.fmap.dal.DALLibrary;
+import org.gvsig.fmap.geom.GeometryLibrary;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.api.EditingLocator;
+
+/**
+ * Library for default implementation initialization and configuration.
+ *
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class DefaultEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsImplementationOf(EditingLibrary.class);
+        require(DALLibrary.class);
+        require(GeometryLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+        EditingLocator.registerManager(DefaultEditingManager.class);
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        // Do nothing
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/java/org/gvsig/vectorediting/lib/impl/DefaultEditingProviderManager.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/java/org/gvsig/vectorediting/lib/impl/DefaultEditingProviderManager.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/java/org/gvsig/vectorediting/lib/impl/DefaultEditingProviderManager.java	(revision 1663)
@@ -0,0 +1,169 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.impl;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.Service;
+import org.gvsig.tools.service.ServiceException;
+import org.gvsig.tools.service.spi.AbstractProviderManager;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderFactory;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+import org.gvsig.tools.swing.icontheme.IconTheme;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.api.exceptions.ServiceInformationException;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+public class DefaultEditingProviderManager extends AbstractProviderManager
+implements EditingProviderManager {
+
+    private static final Logger logger = LoggerFactory
+        .getLogger(DefaultEditingProviderManager.class);
+
+    Map<String, ISymbol> symbols =
+        new HashMap<String, ISymbol>();
+
+    Map<String, Map<String, String>> defaultValues =
+        new HashMap<String, Map<String, String>>();
+
+    public ProviderServices createProviderServices(Service service) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    protected String getRegistryKey() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    protected String getRegistryDescription() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Provider createProvider(DynObject serviceParameters,
+        ProviderServices providerServices) throws ServiceException {
+        String providerName =
+            (String) serviceParameters
+            .getDynValue(EditingProviderFactory.PROVIDER_NAME_FIELD);
+        ProviderFactory factory = getProviderFactory(providerName);
+        return factory == null ? null : factory.create(serviceParameters,
+            providerServices);
+    }
+
+    public EditingServiceInfo getServiceInfo(String name)
+        throws ServiceInformationException {
+        EditingProviderFactory factory;
+        try {
+            factory = (EditingProviderFactory) getProviderFactory(name);
+            return (factory == null ? null : factory.getServiceInfo());
+        } catch (Exception e) {
+            throw new ServiceInformationException("Can't get service info of "
+                + name, e);
+        }
+    }
+
+    public void registerIcon(String group, String name, ClassLoader loader,
+        String provider) {
+        String resourceName;
+        IconTheme iconTheme =
+            ToolsSwingLocator.getIconThemeManager().getCurrent();
+        if ((group == null) || (group.trim().length() == 0)) {
+            resourceName = "images/" + name + ".png";
+        } else {
+            resourceName = "images/" + group + "/" + name + ".png";
+        }
+
+        URL resource = null;
+        try {
+            resource = loader.getResource(resourceName);
+            iconTheme.registerDefault(provider, group, name, null, resource);
+        } catch (Throwable e) {
+            logger.info("Can't register icon '" + name + "'.", e);
+        }
+
+    }
+
+
+    public void registerSymbol(String name, ISymbol symbol) {
+        symbols.put(name, symbol);
+    }
+
+    public ISymbol getSymbol(String name) {
+        return symbols.get(name);
+    }
+
+    public void registerDefaultValues(String provider, Map values) {
+        if (!this.defaultValues.containsKey(provider)) {
+            this.defaultValues.put(provider, values);
+        }
+    }
+
+    public void registerDefaultValues(String provider, ClassLoader loader) {
+        if (!this.defaultValues.containsKey(provider)) {
+            String resourceName =
+                "defaultvalues/" + provider + "/defaultvalues.properties";
+            HashMap<String, String> providerDefaultValues =
+                new HashMap<String, String>();
+
+            URL resource = null;
+            try {
+                resource = loader.getResource(resourceName);
+
+                Properties properties = new Properties();
+                properties.load(resource.openStream());
+
+                for (Iterator it = properties.keySet().iterator(); it.hasNext();) {
+                    String key = (String) it.next();
+                    providerDefaultValues.put(key, (String) properties.get(key));
+                }
+                this.defaultValues.put(provider, providerDefaultValues);
+            } catch (Throwable e) {
+                logger.info("Can't register default values from '" + provider
+                    + "'.", e);
+            }
+        }
+    }
+
+    public Map<String, String> getDefaultValues(String name) {
+        return this.defaultValues.get(name);
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/java/org/gvsig/vectorediting/lib/impl/DefaultEditingManager.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/java/org/gvsig/vectorediting/lib/impl/DefaultEditingManager.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/java/org/gvsig/vectorediting/lib/impl/DefaultEditingManager.java	(revision 1663)
@@ -0,0 +1,87 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.impl;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.AbstractManager;
+import org.gvsig.tools.service.Service;
+import org.gvsig.tools.service.ServiceException;
+import org.gvsig.vectorediting.lib.api.EditingManager;
+import org.gvsig.vectorediting.lib.api.EditingService;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.api.exceptions.ServiceInformationException;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+
+public class DefaultEditingManager extends AbstractManager implements
+EditingManager {
+
+    private static final Logger logger = LoggerFactory
+        .getLogger(DefaultEditingManager.class);
+
+    public DefaultEditingManager() {
+        super(new DefaultEditingProviderManager());
+    }
+
+    public Service getService(DynObject arg0) throws ServiceException {
+        EditingProvider provider =
+            (EditingProvider) EditingProviderLocator.getProviderManager()
+            .createProvider(arg0, new DefaultEditingProviderServices());
+        return new DefaultEditingService(provider);
+    }
+
+    public EditingServiceInfo getServiceInfo(String serviceName)
+        throws ServiceInformationException {
+        return EditingProviderLocator.getProviderManager().getServiceInfo(
+            serviceName);
+    }
+
+    public EditingService getEditingService(String name,
+        FeatureStore featureStore, MapContext mapContext) {
+        try {
+            DynObject params = this.createServiceParameters(name);
+            params.setDynValue(EditingProviderFactory.FEATURE_STORE_FIELD,
+                featureStore);
+            params.setDynValue(EditingProviderFactory.MAPCONTEXT_FIELD, mapContext);
+            return (EditingService) this.getService(params);
+        } catch (ServiceException e) {
+            String msg =
+                String
+                .format(
+                    "Some problem getting %1$s editing service. Seems to name is not correct or there is not factory registered with that name. ",
+                    name);
+            logger.info(msg, e);
+        }
+
+        return null;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/java/org/gvsig/vectorediting/lib/impl/DefaultEditingProviderServices.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/java/org/gvsig/vectorediting/lib/impl/DefaultEditingProviderServices.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/java/org/gvsig/vectorediting/lib/impl/DefaultEditingProviderServices.java	(revision 1663)
@@ -0,0 +1,633 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.impl;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.EditingNotification;
+import org.gvsig.fmap.dal.EditingNotificationManager;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
+import org.gvsig.fmap.dal.feature.FeatureSet;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
+import org.gvsig.fmap.dal.swing.DALSwingLocator;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.Geometry.TYPES;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Circle;
+import org.gvsig.fmap.geom.primitive.Ellipse;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Spline;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.layers.CancelationException;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.service.spi.AbstractProviderServices;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DefaultEditingProviderServices extends AbstractProviderServices
+    implements EditingProviderServices {
+
+    private static final Logger logger = LoggerFactory
+        .getLogger(DefaultEditingProviderServices.class);
+
+    protected GeometryManager geomManager = GeometryLocator
+        .getGeometryManager();
+
+    public void insertFeatureIntoFeatureStore(Feature feature,
+        FeatureStore featureStore) {
+        EditableFeature eFeature = null;
+        try {
+
+            if (feature instanceof EditableFeature) {
+                eFeature = (EditableFeature) feature;
+            } else {
+                eFeature = feature.getEditable();
+            }
+
+            EditingNotificationManager editingNotificationManager =
+                DALSwingLocator.getEditingNotificationManager();
+
+            EditingNotification notification =
+                editingNotificationManager.notifyObservers(this, // source
+                    EditingNotification.BEFORE_INSERT_FEATURE, // type
+                    null,// document
+                    null,// layer
+                    featureStore,// store
+                    eFeature// feature
+                    );
+
+            if (notification.isCanceled()) {
+                String msg =
+                    String
+                        .format(
+                            "Can't insert feature into %1$s, canceled by some observer.",
+                            featureStore.getName());
+                throw new CancelationException(msg, null);
+            }
+
+            if (notification.shouldValidateTheFeature()) {
+                if (!editingNotificationManager.validateFeature(eFeature)) {
+                    String msg =
+                        String.format("%1$s is not valid", eFeature.toString());
+                    throw new Exception(msg);
+                }
+            }
+
+            featureStore.insert(eFeature);
+
+            editingNotificationManager.notifyObservers(this,
+                EditingNotification.AFTER_INSERT_FEATURE, null, null,
+                featureStore, eFeature);
+
+        } catch (Exception e) {
+            String msg =
+                String.format("Can't insert %1$s into %2$s",
+                    eFeature.toString(), featureStore.getName());
+            logger.info(msg, e);
+        }
+    }
+
+    public void insertGeometryIntoFeatureStore(Geometry geometry,
+        FeatureStore featureStore) {
+        EditableFeature eFeature = null;
+
+        try {
+            eFeature = featureStore.createNewFeature(true);
+
+            eFeature.setGeometry(featureStore.getDefaultFeatureType()
+                .getDefaultGeometryAttributeName(), geometry);
+
+            EditingNotificationManager editingNotificationManager =
+                DALSwingLocator.getEditingNotificationManager();
+
+            EditingNotification notification =
+                editingNotificationManager.notifyObservers(this, // source
+                    EditingNotification.BEFORE_INSERT_FEATURE, // type
+                    null,// document
+                    null,// layer
+                    featureStore,// store
+                    eFeature// feature
+                    );
+
+            if (notification.isCanceled()) {
+                String msg =
+                    String
+                        .format(
+                            "Can't insert geometry into %1$s, canceled by some observer.",
+                            featureStore.getName());
+                throw new CancelationException(msg, null);
+            }
+
+            if (notification.shouldValidateTheFeature()) {
+                if (!editingNotificationManager.validateFeature(eFeature)) {
+                    String msg =
+                        String.format("%1$s is not valid", eFeature.toString());
+                    throw new Exception(msg);
+                }
+            }
+
+            featureStore.insert(eFeature);
+
+            editingNotificationManager.notifyObservers(this,
+                EditingNotification.AFTER_INSERT_FEATURE, null, null,
+                featureStore, eFeature);
+
+        } catch (Exception e) {
+            String msg =
+                String.format("Can't insert %1$s into %2$s",
+                    eFeature.toString(), featureStore.getName());
+            logger.info(msg, e);
+        }
+    }
+
+    public void deleteFeatureFromFeatureSet(Feature feature,
+        FeatureStore featureStore, FeatureSet set) {
+
+        try {
+            EditingNotificationManager editingNotificationManager =
+                DALSwingLocator.getEditingNotificationManager();
+
+            EditingNotification notification =
+                editingNotificationManager.notifyObservers(this, // source
+                    EditingNotification.BEFORE_REMOVE_FEATURE, // type
+                    null,// document
+                    null,// layer
+                    featureStore,// store
+                    feature// feature
+                    );
+
+            if (notification.isCanceled()) {
+                String msg =
+                    String
+                        .format(
+                            "Can't delete feature from %1$s, canceled by some observer.",
+                            featureStore.getName());
+                throw new CancelationException(msg, null);
+            }
+
+            set.delete(feature);
+
+            editingNotificationManager.notifyObservers(this,
+                EditingNotification.AFTER_REMOVE_FEATURE, null, null,
+                featureStore, feature);
+
+        } catch (Exception e) {
+            logger.warn(e.getMessage(), e);
+        }
+    }
+
+        public void deleteFeatureFromFeatureStore(Feature feature,
+        FeatureStore featureStore) {
+
+        try {
+            EditingNotificationManager editingNotificationManager =
+                DALSwingLocator.getEditingNotificationManager();
+
+            EditingNotification notification =
+                editingNotificationManager.notifyObservers(this, // source
+                    EditingNotification.BEFORE_REMOVE_FEATURE, // type
+                    null,// document
+                    null,// layer
+                    featureStore,// store
+                    feature// feature
+                    );
+
+            if (notification.isCanceled()) {
+                String msg =
+                    String
+                        .format(
+                            "Can't delete feature from %1$s, canceled by some observer.",
+                            featureStore.getName());
+                throw new CancelationException(msg, null);
+            }
+
+            featureStore.delete(feature);
+
+            editingNotificationManager.notifyObservers(this,
+                EditingNotification.AFTER_REMOVE_FEATURE, null, null,
+                featureStore, feature);
+
+        } catch (Exception e) {
+            logger.warn(e.getMessage(), e);
+        }
+    }
+
+    public void updateFeatureInFeatureStore(Feature feature,
+        FeatureStore featureStore) {
+        EditableFeature eFeature = null;
+
+        try {
+
+            if (feature instanceof EditableFeature) {
+                eFeature = (EditableFeature) feature;
+            } else {
+                eFeature = feature.getEditable();
+            }
+
+            EditingNotificationManager editingNotificationManager =
+                DALSwingLocator.getEditingNotificationManager();
+
+            EditingNotification notification =
+                editingNotificationManager.notifyObservers(this, // source
+                    EditingNotification.BEFORE_UPDATE_FEATURE, // type
+                    null,// document
+                    null,// layer
+                    featureStore,// store
+                    eFeature// feature
+                    );
+
+            if (notification.isCanceled()) {
+                String msg =
+                    String
+                        .format(
+                            "Can't update feature in %1$s, canceled by some observer.",
+                            featureStore.getName());
+                throw new CancelationException(msg, null);
+            }
+
+            if (notification.shouldValidateTheFeature()) {
+                if (!editingNotificationManager.validateFeature(eFeature)) {
+                    String msg =
+                        String.format("%1$s is not valid", eFeature.toString());
+                    throw new Exception(msg);
+                }
+            }
+
+            featureStore.update(eFeature);
+            editingNotificationManager.notifyObservers(this,
+                EditingNotification.AFTER_UPDATE_FEATURE, null, null,
+                featureStore, eFeature);
+
+        } catch (Exception e) {
+            String msg =
+                String.format("Can't update %1$s in %2$s", eFeature.toString(),
+                    featureStore.getName());
+            logger.info(msg, e);
+        }
+    }
+
+    public Circle createCircle(Point center, double radius, int subtype)
+        throws CreateGeometryException {
+        Circle circle = null;
+        circle = (Circle) geomManager.create(TYPES.CIRCLE, subtype);
+        circle.setPoints(center, radius);
+
+        return circle;
+    }
+
+    public Circle createCircle(Point firstPoint, Point secondPoint,
+        Point thridPoint, int subtype) throws CreateGeometryException {
+        Circle circle = null;
+        circle = (Circle) geomManager.create(TYPES.CIRCLE, subtype);
+        circle.setPoints(firstPoint, secondPoint, thridPoint);
+
+        return circle;
+    }
+
+    public Arc createArc(Point center, double radius, double startAngle,
+        double angleExt, int subtype) throws CreateGeometryException {
+        Arc arc = null;
+        arc = (Arc) geomManager.create(TYPES.ARC, subtype);
+        arc.setPoints(center, radius, startAngle, angleExt);
+        return arc;
+    }
+
+    public Ellipse createFilledEllipse(Point firstPointAxisA,
+        Point secondPointAxisA, double halfLengthAxisB, int subtype)
+        throws CreateGeometryException {
+        Ellipse ellipse = (Ellipse) geomManager.create(TYPES.ELLIPSE, subtype);
+        ellipse.setPoints(firstPointAxisA, secondPointAxisA, halfLengthAxisB);
+        return ellipse;
+    }
+
+    public Arc createArc(Point start, Point middle, Point end, int subtype)
+        throws BaseException {
+
+        Arc arc = (Arc)GeometryLocator.getGeometryManager().create(Geometry.TYPES.ARC, subtype);
+        arc.setPoints(start, middle, end);
+        return arc;
+
+    }
+
+    public Point createPoint(double x, double y, int subtype)
+        throws CreateGeometryException {
+        Point point = null;
+        point = (Point) geomManager.create(TYPES.POINT, subtype);
+        point.setX(x);
+        point.setY(y);
+        return point;
+    }
+
+    public Line createLine(double x1, double y1, double x2, double y2,
+        int subtype) throws CreateGeometryException {
+        Line line = null;
+        line = (Line) geomManager.create(TYPES.CURVE, subtype);
+        line.addVertex(x1, y1);
+        line.addVertex(x2, y2);
+        return line;
+    }
+
+    public int getSubType(FeatureStore featureStore) throws DataException {
+
+        GeometryType geomType = getGeomType(featureStore);
+        if (geomType != null) {
+            return geomType.getSubType();
+        }
+        return SUBTYPES.UNKNOWN;
+    }
+
+    public GeometryType getGeomType(FeatureStore featureStore)
+        throws DataException {
+        return featureStore.getDefaultFeatureType()
+            .getDefaultGeometryAttribute().getGeomType();
+    }
+
+    public EditableFeature getFeatureCopyWithoutPK(FeatureStore featureStore,
+        Feature feature) throws DataException {
+        EditableFeature editableFeature =
+            featureStore.createNewFeature(feature.getType(), true);
+
+        FeatureType type_src = feature.getType();
+        @SuppressWarnings("rawtypes")
+        Iterator iterator = type_src.iterator();
+        FeatureType type_dest = editableFeature.getType();
+
+        while (iterator.hasNext()) {
+            FeatureAttributeDescriptor attribute_src =
+                (FeatureAttributeDescriptor) iterator.next();
+
+            FeatureAttributeDescriptor attribute_dest =
+                type_dest.getAttributeDescriptor(attribute_src.getName());
+            if (attribute_dest != null) {
+                if (!attribute_dest.isPrimaryKey()) {
+                    editableFeature.set(attribute_dest.getIndex(),
+                        feature.get(attribute_src.getIndex()));
+                }
+            }
+        }
+        return editableFeature;
+    }
+
+    public Point getCenter(Point a, Point b, Point c, int subtype)
+        throws CreateGeometryException {
+
+        Point midPointAC = getMidPoint(a, c, subtype);
+        Double[] lineParamsAC = getLineParams(a, c);
+        Point[] bisectorAC =
+            getPerpendicular(lineParamsAC[0], lineParamsAC[1], midPointAC,
+                subtype);
+
+        Point midPointBC = getMidPoint(b, c, subtype);
+        Double[] lineParamsBC = getLineParams(c, b);
+        Point[] bisectorBC =
+            getPerpendicular(lineParamsBC[0], lineParamsBC[1], midPointBC,
+                subtype);
+
+        return getIntersection(bisectorAC, bisectorBC, subtype);
+    }
+
+    public Point getMidPoint(Point a, Point b, int subtype)
+        throws CreateGeometryException {
+        double x = (a.getX() + b.getX()) / 2;
+        double y = (a.getY() + b.getY()) / 2;
+        return createPoint(x, y, subtype);
+    }
+
+    public Double[] getLineParams(Point point, Point nextPoint) {
+        Double[] lineParams = new Double[2];
+        double denom = nextPoint.getX() - point.getX();
+        if (denom != 0) {
+            lineParams[0] = (nextPoint.getY() - point.getY()) / denom;
+            lineParams[1] = point.getY() - (lineParams[0] * point.getX());
+        } else {
+            if (nextPoint.getY() >= point.getY()) {
+                lineParams[0] = Double.POSITIVE_INFINITY;
+                lineParams[1] = Double.NEGATIVE_INFINITY;
+                if (point.getX() == 0) {
+                    lineParams[1] = 0.0;
+                }
+            } else {
+                lineParams[0] = Double.NEGATIVE_INFINITY;
+                lineParams[1] = Double.POSITIVE_INFINITY;
+                if (point.getX() == 0) {
+                    lineParams[1] = 0.0;
+                }
+            }
+        }
+        return lineParams;
+    }
+
+    public Point[] getPerpendicular(Double m, Double b, Point perp, int subtype)
+        throws CreateGeometryException {
+        if (m == Double.POSITIVE_INFINITY) {
+            Point[] res = new Point[2];
+            res[0] = createPoint(0, perp.getY(), subtype);
+            res[1] = createPoint(1, perp.getY(), subtype);
+            return res;
+        } else if (m == Double.NEGATIVE_INFINITY) {
+            Point[] res = new Point[2];
+            res[0] = createPoint(1, perp.getY(), subtype);
+            res[1] = createPoint(0, perp.getY(), subtype);
+            return res;
+        } else {
+            // Pendiente de la recta perpendicular
+            Double m1 = -1 / m;
+
+            // b de la funcion de la recta perpendicular
+            Double b1 = perp.getY() - (m1 * perp.getX());
+
+            // Obtenemos un par de puntos
+            Point[] res = new Point[2];
+
+            if (Double.isInfinite(m1)) {
+                res[0] = createPoint(perp.getX(), 0.0, subtype);
+                res[1] = createPoint(perp.getX(), perp.getY(), subtype);
+            } else {
+                res[0] = createPoint(0, 0.0 + b1, subtype);
+                res[1] =
+                    createPoint(perp.getX(), (m1 * perp.getX()) + b1, subtype);
+            }
+
+            return res;
+        }
+    }
+
+    public Point getIntersection(Point[] lineA, Point[] lineB, int subtype)
+        throws CreateGeometryException {
+        Point p1 = lineA[0];
+        Point p2 = lineA[1];
+        Point p3 = lineB[0];
+        Point p4 = lineB[1];
+
+        double m1 = Double.POSITIVE_INFINITY;
+
+        if ((p2.getX() - p1.getX()) != 0) {
+            m1 = (p2.getY() - p1.getY()) / (p2.getX() - p1.getX());
+        }
+
+        double m2 = Double.POSITIVE_INFINITY;
+
+        if ((p4.getX() - p3.getX()) != 0) {
+            m2 = (p4.getY() - p3.getY()) / (p4.getX() - p3.getX());
+        }
+
+        if ((m1 == Double.POSITIVE_INFINITY)
+            && (m2 == Double.POSITIVE_INFINITY)) {
+            return null;
+        }
+
+        double b1 = p2.getY() - (m1 * p2.getX());
+
+        double b2 = p4.getY() - (m2 * p4.getX());
+
+        if ((m1 != Double.POSITIVE_INFINITY)
+            && (m2 != Double.POSITIVE_INFINITY)) {
+            if (m1 == m2) {
+                return null;
+            }
+
+            double x = (b2 - b1) / (m1 - m2);
+
+            return createPoint(x, (m1 * x) + b1, subtype);
+        } else if (m1 == Double.POSITIVE_INFINITY) {
+            double x = p1.getX();
+
+            return createPoint(x, (m2 * x) + b2, subtype);
+        } else if (m2 == Double.POSITIVE_INFINITY) {
+            double x = p3.getX();
+
+            return createPoint(x, (m1 * x) + b1, subtype);
+        }
+
+        return null;
+    }
+
+    public double getAngle(Point start, Point end)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+        double angle =
+            Math.acos((end.getX() - start.getX()) / start.distance(end));
+
+        if (start.getY() > end.getY()) {
+            angle = -angle;
+        }
+
+        if (angle < 0) {
+            angle += (2 * Math.PI);
+        }
+
+        return angle;
+    }
+
+    public double angleDistance(double angle1, double angle2) {
+        double result = angle2-angle1;
+        if(result<0){
+            result = (Math.PI *2)+result;
+        }
+        return result;
+    }
+
+    public Line createLine(Point p1, Point p2, int subtype)
+        throws CreateGeometryException {
+        return this.createLine(p1.getX(), p1.getY(), p2.getX(), p2.getY(),
+            subtype);
+    }
+
+    public Spline createSpline(List<Point> points, int subtype)
+        throws CreateGeometryException {
+        Spline spline = null;
+        spline = (Spline) geomManager.create(TYPES.SPLINE, subtype);
+
+        for (Point point : points) {
+
+            spline.addVertex(point);
+        }
+
+        return spline;
+    }
+
+    public String makeConsoleMessage(String preText, Map<String, String> options) {
+
+        I18nManager i18nManager = ToolsLocator.getI18nManager();
+
+        StringBuilder stb = new StringBuilder();
+
+        if (preText != null) {
+            stb.append(i18nManager.getTranslation(preText));
+            stb.append(" ");
+        }
+
+        for (String option : options.keySet()) {
+            stb.append("[");
+            stb.append(option);
+            stb.append("]");
+            stb.append(i18nManager.getTranslation(options.get(option)));
+            stb.append(" ");
+        }
+
+        return stb.toString();
+    }
+
+    public Arc createEllipse(Point firstPointAxisA, Point secondPointAxisA,
+        double halfLengthAxisB, int subtype) throws CreateGeometryException {
+        try {
+            double lengthAxisA = secondPointAxisA.distance(firstPointAxisA);
+
+            Point origen = this.createPoint(0, 0, subtype);
+        Arc ellipse = this.createArc(
+            origen,
+            lengthAxisA/2,
+            0,
+            2*Math.PI,
+            subtype);
+
+            ellipse.scale(origen, 1, halfLengthAxisB*2/lengthAxisA);
+            ellipse.rotate(this.getAngle(firstPointAxisA, secondPointAxisA), 0, 0);
+            Point centerOfEllipse = this.getMidPoint(firstPointAxisA, secondPointAxisA, subtype);
+            ellipse.move(centerOfEllipse.getX(), centerOfEllipse.getY());
+            return ellipse;
+        } catch (GeometryOperationNotSupportedException e) {
+            throw new CreateGeometryException(Geometry.TYPES.ARC, subtype, e);
+        } catch (GeometryOperationException e) {
+            throw new CreateGeometryException(Geometry.TYPES.ARC, subtype, e);
+        }
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/java/org/gvsig/vectorediting/lib/impl/DefaultEditingProviderLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/java/org/gvsig/vectorediting/lib/impl/DefaultEditingProviderLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/java/org/gvsig/vectorediting/lib/impl/DefaultEditingProviderLibrary.java	(revision 1663)
@@ -0,0 +1,52 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.impl;
+
+import org.gvsig.fmap.dal.DALLibrary;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+
+public class DefaultEditingProviderLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsImplementationOf(EditingProviderLibrary.class);
+        require(DALLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+        EditingProviderLocator
+        .registerEditingProviderManager(DefaultEditingProviderManager.class);
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/java/org/gvsig/vectorediting/lib/impl/DefaultEditingService.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/java/org/gvsig/vectorediting/lib/impl/DefaultEditingService.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/main/java/org/gvsig/vectorediting/lib/impl/DefaultEditingService.java	(revision 1663)
@@ -0,0 +1,90 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.impl;
+
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.tools.service.Manager;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingService;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+
+public class DefaultEditingService implements EditingService {
+
+    EditingProvider provider;
+
+    public DefaultEditingService(EditingProvider provider) {
+        this.provider = provider;
+    }
+
+    public Manager getManager() {
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        return provider.getDrawingStatus(mousePosition);
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        return provider.getParameters();
+    }
+
+    public EditingServiceParameter next() {
+        return provider.next();
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        provider.setValue(value);
+    }
+
+    public void stop() throws StopServiceException {
+        provider.stop();
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+        provider.finishAndStore();
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return provider.finish();
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        this.provider.start();
+    }
+
+    public String getName() {
+        return provider.getName();
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/test/resources/README.txt
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/test/resources/README.txt	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/test/resources/README.txt	(revision 1663)
@@ -0,0 +1,32 @@
+====
+    gvSIG. Desktop Geographic Information System.
+
+    Copyright (C) 2007-2012 gvSIG Association.
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA  02110-1301, USA.
+
+    For any additional information, do not hesitate to contact us
+    at info AT gvsig.com, or visit our website www.gvsig.com.
+====
+
+Put into this folder the resources needed by your test classes.
+
+This folder is added to the Tests classpath, so you can load any resources 
+through the ClassLoader.
+
+By default, in this folder you can find an example of log4j configuration,
+prepared to log messages through the console, so logging works when you
+run your tests classes.
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/test/resources/log4j.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/test/resources/log4j.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/src/test/resources/log4j.xml	(revision 1663)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+
+    gvSIG. Desktop Geographic Information System.
+
+    Copyright (C) 2007-2012 gvSIG Association.
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA  02110-1301, USA.
+
+    For any additional information, do not hesitate to contact us
+    at info AT gvsig.com, or visit our website www.gvsig.com.
+
+-->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- 
+Log4J configuration file for unit tests execution.
+ -->
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+	<!-- Appender configuration to show logging messages through the console -->
+	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+		<layout class="org.apache.log4j.PatternLayout">
+			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
+		</layout>
+	</appender>
+
+	<!-- 
+	Activate logging messages of DEBUG level of higher only for the
+	org.gvsig.tools packages.
+	You can put full classes names or packages instead, to configure
+	logging for all the classes and subpackages of the package.
+	-->
+	<category name="org.gvsig.tools">
+		<priority value="DEBUG" />
+	</category>
+	<category name="org.gvsig.vectorediting">
+		<priority value="DEBUG" />
+	</category>
+
+	<!-- 
+	By default, show only logging messages of INFO level or higher, 
+	through the previously configured CONSOLE appender. 
+	-->
+	<root>
+		<priority value="INFO" />
+		<appender-ref ref="CONSOLE" />
+	</root>
+</log4j:configuration>
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl/pom.xml	(revision 1663)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-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/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.vectorediting.lib.impl</artifactId>
+	<packaging>jar</packaging>
+	<name>org.gvsig.vectorediting.lib.impl</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.vectorediting.lib</artifactId>
+		<version>1.0.92</version>
+	</parent>
+	<dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.vectorediting.lib.api</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.vectorediting.lib.spi</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.dal.swing.api</artifactId>
+		</dependency>
+		
+	</dependencies>
+</project>

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.impl
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move/src/main/java/org/gvsig/vectorediting/lib/prov/move/MoveEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move/src/main/java/org/gvsig/vectorediting/lib/prov/move/MoveEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move/src/main/java/org/gvsig/vectorediting/lib/prov/move/MoveEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,89 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.move;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author llmarques
+ *
+ */
+public class MoveEditingProviderFactory extends AbstractProviderFactory
+    implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "modify-move";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Move selected geometries";
+
+    public void initialize() {
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", false, null,
+                new int[] { Geometry.TYPES.POINT, Geometry.TYPES.MULTIPOINT,
+                    Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE,
+                    Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                    Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, 
+                    Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new MoveEditingProvider(services, parameters);
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move/src/main/java/org/gvsig/vectorediting/lib/prov/move/MoveEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move/src/main/java/org/gvsig/vectorediting/lib/prov/move/MoveEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move/src/main/java/org/gvsig/vectorediting/lib/prov/move/MoveEditingLibrary.java	(revision 1663)
@@ -0,0 +1,70 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.move;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+
+/**
+ * @author llmarques
+ *
+ */
+public class MoveEditingLibrary extends AbstractLibrary {
+    
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new MoveEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "modify-move", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+    
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "modify-move");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move/src/main/java/org/gvsig/vectorediting/lib/prov/move/MoveEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move/src/main/java/org/gvsig/vectorediting/lib/prov/move/MoveEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move/src/main/java/org/gvsig/vectorediting/lib/prov/move/MoveEditingProvider.java	(revision 1663)
@@ -0,0 +1,328 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.move;
+
+import java.awt.geom.AffineTransform;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.Aggregate;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.aggregate.MultiPoint;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Surface;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.tools.visitor.VisitCanceledException;
+import org.gvsig.tools.visitor.Visitor;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author llmarques
+ *
+ */
+public class MoveEditingProvider extends AbstractEditingProvider implements
+    EditingProvider {
+
+    private EditingServiceParameter selection;
+
+    private EditingServiceParameter firstPoint;
+
+    private EditingServiceParameter secondPoint;
+
+    private FeatureStore featureStore;
+
+    private Map<EditingServiceParameter, Object> values;
+
+    /**
+     * Default constructor.
+     *
+     * @param providerServices
+     *            available services for this provider
+     * @param parameters
+     *            of this provider
+     */
+    public MoveEditingProvider(ProviderServices providerServices,
+        DynObject parameters) {
+        super(providerServices);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.selection =
+            new DefaultEditingServiceParameter("selection", "selection",
+                TYPE.SELECTION);
+
+        this.firstPoint =
+            new DefaultEditingServiceParameter("first_point", "first_point",
+                TYPE.POSITION);
+
+        this.secondPoint =
+            new DefaultEditingServiceParameter("second_point", "second_point",
+                TYPE.POSITION);
+    }
+
+    public EditingServiceParameter next() {
+        if (values.get(selection) == null) {
+            return selection;
+        } else if (values.get(firstPoint) == null) {
+            return firstPoint;
+        } else if (values.get(secondPoint) == null) {
+            return secondPoint;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+        int subtype;
+        try {
+            subtype = editingProviderServices.getSubType(featureStore);
+        } catch (DataException e2) {
+            throw new DrawServiceException(e2);
+        }
+        ISymbol lineSymbolEditing = editingProviderManager.getSymbol("line-symbol-editing");
+        ISymbol auxiliarylineSymbolEditing = editingProviderManager.getSymbol("auxiliary-line-symbol-editing");
+        ISymbol polygonSymbolEditing = editingProviderManager.getSymbol("polygon-symbol-editing");
+        ISymbol auxiliaryPointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+
+        DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+
+        if (values != null) {
+
+            FeatureSelection featureSelection =
+                (FeatureSelection) values.get(selection);
+            ToolsLocator.getDisposableManager().bind(featureSelection);
+
+            Point firstPointValue = (Point) values.get(firstPoint);
+
+            if (featureSelection != null && firstPointValue != null) {
+                drawingStatus.addStatus(firstPointValue, auxiliaryPointSymbolEditing, "");
+                Line auxLine;
+                try {
+                    auxLine = geometryManager.createLine(subtype);
+                } catch (CreateGeometryException e1) {
+                    throw new DrawServiceException(e1);
+                }
+                auxLine.setPoints(firstPointValue, mousePosition);
+                drawingStatus.addStatus(auxLine, auxiliarylineSymbolEditing, "");
+
+                DisposableIterator it = null;
+                try {
+                    it = featureSelection.fastIterator();
+                    while (it.hasNext()) {
+                        Feature feature = (Feature) it.next();
+
+                        Geometry geometry =
+                            feature.getDefaultGeometry().cloneGeometry();
+
+                        AffineTransform at =
+                            getMoveAffineTransform(firstPointValue,
+                                mousePosition);
+                        geometry.transform(at);
+                        ISymbol symbol=null;
+                        if(geometry instanceof Curve || geometry instanceof MultiCurve){
+                            symbol = lineSymbolEditing;
+                        } else if(geometry instanceof Surface || geometry instanceof MultiSurface){
+                            symbol = polygonSymbolEditing;
+                        } else if(geometry instanceof Point || geometry instanceof MultiPoint){
+                            symbol = auxiliaryPointSymbolEditing;
+                        }
+                        if(geometry instanceof Aggregate){
+                            int primitivesNumber = ((Aggregate)geometry).getPrimitivesNumber();
+                            for (int i = 0; i < primitivesNumber; i++) {
+                                drawingStatus.addStatus(((Aggregate)geometry).getPrimitiveAt(i), symbol, "");
+                            }
+                        } else {
+                            drawingStatus.addStatus(geometry, symbol, "");
+                        }
+
+                    }
+                } catch (BaseException e) {
+                    throw new DrawServiceException(e);
+                } finally {
+                    it.dispose();
+                }
+            }
+        }
+        return drawingStatus;
+    }
+
+    private AffineTransform getMoveAffineTransform(Point p1, Point p2)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+
+        AffineTransform translate =
+            AffineTransform.getTranslateInstance(p2.getX() - p1.getX(),
+                p2.getY() - p1.getY());
+
+        return translate;
+    }
+
+    public void stop() throws StopServiceException {
+        if (values != null) {
+            values.clear();
+        }
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(selection);
+        parameters.add(firstPoint);
+        parameters.add(secondPoint);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter parameter,
+        Object value) {
+
+        if (parameter == selection) {
+            if (value instanceof FeatureSelection) {
+                if (((FeatureSelection) value).getSelectedCount() > 0) {
+                    values.put(selection, value);
+                }
+            }
+        } else if (parameter == firstPoint || parameter == secondPoint) {
+            if (value instanceof Point) {
+                values.put(parameter, value);
+                return;
+            }
+        }
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+
+        if (values != null) {
+
+            final Point p1 = (Point) values.get(firstPoint);
+            final Point p2 = (Point) values.get(secondPoint);
+
+            FeatureSelection featureSelection =
+                (FeatureSelection) values.get(selection);
+            ToolsLocator.getDisposableManager().bind(featureSelection);
+
+
+            try {
+                featureSelection.accept(new Visitor() {
+
+                    public void visit(Object obj)
+                        throws VisitCanceledException, BaseException {
+                        Feature feature = (Feature) obj;
+
+                        EditableFeature editable = feature.getEditable();
+
+                        Geometry geometry =
+                            feature.getDefaultGeometry().cloneGeometry();
+                        geometry.transform(getMoveAffineTransform(p1, p2));
+
+                        editable.setDefaultGeometry(geometry);
+                        ((EditingProviderServices) getProviderServices())
+                            .updateFeatureInFeatureStore(editable, featureStore);
+                    }
+                });
+
+                featureStore.getFeatureSelection().deselectAll();
+                featureSelection.dispose();
+
+            } catch (BaseException e) {
+                throw new FinishServiceException(e);
+            }
+        }
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        values = new HashMap<EditingServiceParameter, Object>();
+        FeatureSelection selected = null;
+        if (featureStore != null) {
+            try {
+                selected = featureStore.getFeatureSelection();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            }
+            try {
+                setValue(selected);
+            } catch (InvalidEntryException e) {
+                throw new InvalidEntryException(e);
+            }
+        }
+    }
+
+    public String getName() {
+        return MoveEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.move.MoveEditingLibrary
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move/src/main/resources/images/vectorediting-tools/modify-move.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move/src/main/resources/images/vectorediting-tools/modify-move.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.move</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.move</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.duplicate.DuplicateEditingLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate/src/main/resources/images/vectorediting-tools/modify-duplicate.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate/src/main/resources/images/vectorediting-tools/modify-duplicate.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate/src/main/java/org/gvsig/vectorediting/lib/prov/duplicate/DuplicateEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate/src/main/java/org/gvsig/vectorediting/lib/prov/duplicate/DuplicateEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate/src/main/java/org/gvsig/vectorediting/lib/prov/duplicate/DuplicateEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,88 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.duplicate;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author llmarques
+ *
+ */
+public class DuplicateEditingProviderFactory extends AbstractProviderFactory
+    implements EditingProviderFactory {
+
+    public static final String PROVIDER_NAME = "modify-duplicate";
+
+    private final static String PROVIDER_DESCRIPTION = "Duplicates geometries";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", false, null,
+                new int[] { Geometry.TYPES.POINT, Geometry.TYPES.MULTIPOINT,
+                    Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE,
+                    Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                    Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, 
+                    Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new DuplicateEditingProvider(parameters, services);
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate/src/main/java/org/gvsig/vectorediting/lib/prov/duplicate/DuplicateEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate/src/main/java/org/gvsig/vectorediting/lib/prov/duplicate/DuplicateEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate/src/main/java/org/gvsig/vectorediting/lib/prov/duplicate/DuplicateEditingLibrary.java	(revision 1663)
@@ -0,0 +1,72 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.duplicate;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.Library;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+
+/**
+ * @author llmarques
+ *
+ */
+public class DuplicateEditingLibrary extends AbstractLibrary implements Library {
+    
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new DuplicateEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "modify-duplicate", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "modify-duplicate");
+    }
+
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate/src/main/java/org/gvsig/vectorediting/lib/prov/duplicate/DuplicateEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate/src/main/java/org/gvsig/vectorediting/lib/prov/duplicate/DuplicateEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate/src/main/java/org/gvsig/vectorediting/lib/prov/duplicate/DuplicateEditingProvider.java	(revision 1663)
@@ -0,0 +1,328 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.duplicate;
+
+import java.awt.geom.AffineTransform;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.Aggregate;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.aggregate.MultiPoint;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Surface;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.tools.visitor.VisitCanceledException;
+import org.gvsig.tools.visitor.Visitor;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author llmarques
+ *
+ */
+public class DuplicateEditingProvider extends AbstractEditingProvider implements
+    EditingProvider {
+
+    private EditingServiceParameter selection;
+
+    private EditingServiceParameter firstPoint;
+
+    private EditingServiceParameter secondPoint;
+
+    private FeatureStore featureStore;
+
+    private Map<EditingServiceParameter, Object> values;
+
+    /**
+     * Default constructor.
+     *
+     * @param providerServices
+     *            available services for this provider
+     * @param parameters
+     *            of this provider
+     */
+    public DuplicateEditingProvider(DynObject parameters,
+        ProviderServices services) {
+        super(services);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.selection =
+            new DefaultEditingServiceParameter("selection", "selection",
+                TYPE.SELECTION);
+
+        this.firstPoint =
+            new DefaultEditingServiceParameter("first_point", "first_point",
+                TYPE.POSITION);
+
+        this.secondPoint =
+            new DefaultEditingServiceParameter("second_point", "second_point",
+                TYPE.POSITION);
+    }
+
+    public EditingServiceParameter next() {
+        if (values.get(selection) == null) {
+            return selection;
+        } else if (values.get(firstPoint) == null) {
+            return firstPoint;
+        } else if (values.get(secondPoint) == null) {
+            return secondPoint;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+        int subtype;
+        try {
+            subtype = editingProviderServices.getSubType(featureStore);
+        } catch (DataException e2) {
+            throw new DrawServiceException(e2);
+        }
+        ISymbol lineSymbolEditing = editingProviderManager.getSymbol("line-symbol-editing");
+        ISymbol auxiliarylineSymbolEditing = editingProviderManager.getSymbol("auxiliary-line-symbol-editing");
+        ISymbol polygonSymbolEditing = editingProviderManager.getSymbol("polygon-symbol-editing");
+        ISymbol auxiliaryPointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+
+        if (values != null) {
+
+            FeatureSelection featureSelection =
+                (FeatureSelection) values.get(selection);
+            Point firstPointValue = (Point) values.get(firstPoint);
+
+            if (featureSelection != null && firstPointValue != null) {
+                drawingStatus.addStatus(firstPointValue, auxiliaryPointSymbolEditing, "");
+                Line auxLine;
+                try {
+                    auxLine = geometryManager.createLine(subtype);
+                } catch (CreateGeometryException e1) {
+                    throw new DrawServiceException(e1);
+                }
+                auxLine.setPoints(firstPointValue, mousePosition);
+                drawingStatus.addStatus(auxLine, auxiliarylineSymbolEditing, "");
+
+                DisposableIterator it = null;
+                try {
+                    it = featureSelection.fastIterator();
+                    while (it.hasNext()) {
+                        Feature feature = (Feature) it.next();
+
+                        Geometry geometry =
+                            feature.getDefaultGeometry().cloneGeometry();
+
+                        AffineTransform at =
+                            getMoveAffineTransform(firstPointValue,
+                                mousePosition);
+                        geometry.transform(at);
+                        ISymbol symbol=null;
+                        if(geometry instanceof Curve || geometry instanceof MultiCurve){
+                            symbol = lineSymbolEditing;
+                        } else if(geometry instanceof Surface || geometry instanceof MultiSurface){
+                            symbol = polygonSymbolEditing;
+                        } else if(geometry instanceof Point || geometry instanceof MultiPoint){
+                            symbol = auxiliaryPointSymbolEditing;
+                        }
+                        if(geometry instanceof Aggregate){
+                            int primitivesNumber = ((Aggregate)geometry).getPrimitivesNumber();
+                            for (int i = 0; i < primitivesNumber; i++) {
+                                drawingStatus.addStatus(((Aggregate)geometry).getPrimitiveAt(i), symbol, "");
+                            }
+                        } else {
+                            drawingStatus.addStatus(geometry, symbol, "");
+                        }
+//                        drawingStatus.addGeometry(geometry);
+                    }
+                } catch (BaseException e) {
+                    throw new DrawServiceException(e);
+                } finally {
+                    it.dispose();
+                }
+            }
+        }
+        return drawingStatus;
+    }
+
+    private AffineTransform getMoveAffineTransform(Point p1, Point p2)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+
+        AffineTransform translate =
+            AffineTransform.getTranslateInstance(p2.getX() - p1.getX(),
+                p2.getY() - p1.getY());
+
+        return translate;
+    }
+
+    public void stop() throws StopServiceException {
+        if (values != null) {
+            values.clear();
+        }
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(selection);
+        parameters.add(firstPoint);
+        parameters.add(secondPoint);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter parameter,
+        Object value) {
+
+        if (parameter == selection) {
+            if (value instanceof FeatureSelection) {
+                if (((FeatureSelection) value).getSelectedCount() > 0) {
+                    values.put(selection, value);
+                }
+            }
+        } else if (parameter == firstPoint || parameter == secondPoint) {
+            if (value instanceof Point) {
+                values.put(parameter, value);
+                return;
+            }
+        }
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+        if (values != null) {
+
+            final Point p1 = (Point) values.get(firstPoint);
+            final Point p2 = (Point) values.get(secondPoint);
+
+            FeatureSelection featureSelection =
+                (FeatureSelection) values.get(selection);
+            ToolsLocator.getDisposableManager().bind(featureSelection);
+
+            try {
+                featureSelection.accept(new Visitor() {
+
+                    public void visit(Object obj)
+                        throws VisitCanceledException, BaseException {
+                        Feature feature = (Feature) obj;
+
+                        EditingProviderServices editingProviderServices =
+                            (EditingProviderServices) getProviderServices();
+
+                        EditableFeature editable =
+                            editingProviderServices.getFeatureCopyWithoutPK(
+                                featureStore, feature);
+
+                        Geometry geometry =
+                            feature.getDefaultGeometry().cloneGeometry();
+                        geometry.transform(getMoveAffineTransform(p1, p2));
+
+                        editable.setDefaultGeometry(geometry);
+                        editingProviderServices.insertFeatureIntoFeatureStore(
+                            editable, featureStore);
+                    }
+                });
+
+                featureStore.getFeatureSelection().deselectAll();
+                featureSelection.dispose();
+
+            } catch (BaseException e) {
+                throw new FinishServiceException(e);
+            }
+        }
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        values = new HashMap<EditingServiceParameter, Object>();
+        FeatureSelection selected = null;
+        if (featureStore != null) {
+            try {
+                selected = featureStore.getFeatureSelection();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            }
+            try {
+                setValue(selected);
+            } catch (InvalidEntryException e) {
+                throw new InvalidEntryException(e);
+            }
+        }
+    }
+
+    public String getName() {
+        return DuplicateEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.duplicate</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.duplicate</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/StretchEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/StretchEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/StretchEditingProvider.java	(revision 1663)
@@ -0,0 +1,435 @@
+package org.gvsig.vectorediting.lib.prov.stretch;
+
+
+
+
+import java.awt.geom.AffineTransform;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.Aggregate;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.aggregate.MultiPoint;
+import org.gvsig.fmap.geom.aggregate.MultiPrimitive;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.geom.primitive.Surface;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.prov.stretch.operation.StretchOperation;
+import org.gvsig.vectorediting.lib.prov.stretch.operation.StretchOperationUtils;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+public class StretchEditingProvider extends AbstractEditingProvider implements
+    EditingProvider {
+
+    private static Logger logger = LoggerFactory.getLogger(StretchEditingProvider.class);
+
+    private I18nManager i18nManager = ToolsLocator.getI18nManager();
+
+    private EditingServiceParameter selectionParameter;
+
+    private EditingServiceParameter geometryParameter;
+
+    private EditingServiceParameter firstPointParameter;
+
+    private EditingServiceParameter secondPointParameter;
+
+    private Map<EditingServiceParameter, Object> values;
+
+    private FeatureStore featureStore;
+
+    public StretchEditingProvider(ProviderServices providerServices,
+        DynObject parameters) {
+        super(providerServices);
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.selectionParameter =
+            new DefaultEditingServiceParameter("selection",
+                i18nManager.getTranslation("selection"), TYPE.SELECTION);
+
+        this.geometryParameter =
+            new DefaultEditingServiceParameter("Draw geometry",
+                "draw_geometry_to_select_vertex", Geometry.TYPES.MULTISURFACE, TYPE.GEOMETRY);
+
+        this.firstPointParameter =
+            new DefaultEditingServiceParameter("first_point",
+                i18nManager.getTranslation("first_point"), TYPE.VALUE, TYPE.POSITION);
+
+        this.secondPointParameter =
+            new DefaultEditingServiceParameter("second_point",
+                i18nManager.getTranslation("second_point"), TYPE.VALUE, TYPE.POSITION);
+
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> list =
+            new ArrayList<EditingServiceParameter>();
+        list.add(selectionParameter);
+        list.add(geometryParameter);
+        list.add(firstPointParameter);
+        list.add(secondPointParameter);
+        return list;
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter param,
+        Object value) throws InvalidEntryException {
+        if (param == selectionParameter) {
+            if (value instanceof FeatureSelection) {
+                values.put(param, value);
+                return;
+            }
+        } else if (param == firstPointParameter) {
+            if (value instanceof Point) {
+                values.put(param, value);
+                return;
+            }
+        } else if (param == secondPointParameter) {
+            if (value instanceof Point) {
+                values.put(param, value);
+                return;
+            }
+        } else if (param == geometryParameter) {
+            if (value instanceof Geometry) {
+
+                // Before set value checks if some geometry intersects the
+                // geometry received as parameter.
+                Geometry geometry = (Geometry) value;
+                FeatureSelection selection =
+                    (FeatureSelection) values.get(selectionParameter);
+                DisposableIterator it = null;
+
+                try {
+                    it = selection.fastIterator();
+
+                    while (it.hasNext()) {
+                        Feature feature = (Feature) it.next();
+
+                        Geometry defaultGeometry = feature.getDefaultGeometry();
+                        if (defaultGeometry.intersects(geometry) || defaultGeometry.contains(geometry)) {
+                            values.put(param, value);
+                            return;
+                        }
+                    }
+                    throw new InvalidEntryException(null);
+                } catch (BaseException e) {
+                    throw new InvalidEntryException(e);
+                } finally {
+                    it.dispose();
+                }
+            }
+        }
+    }
+
+    public EditingServiceParameter next() {
+        if (values.get(selectionParameter) == null) {
+            return this.selectionParameter;
+        } else if (values.get(geometryParameter) == null) {
+            return this.geometryParameter;
+        } else if (values.get(firstPointParameter) == null) {
+            return this.firstPointParameter;
+        } else if (values.get(secondPointParameter) == null) {
+            return this.secondPointParameter;
+        }
+        return null;
+    }
+
+    public static Geometry applyTransform(Geometry geometry, AffineTransform at,
+        Geometry roi) throws CreateGeometryException,
+        GeometryOperationNotSupportedException, GeometryOperationException {
+        if (geometry instanceof MultiPrimitive) {
+            GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+            MultiPrimitive aggregate = (MultiPrimitive)geometry;
+            GeometryType geometryType = aggregate.getGeometryType();
+            MultiPrimitive newAggregate = (MultiPrimitive) geometryManager.create(geometryType.getType(), geometryType.getSubType());
+            for (int i = 0; i < aggregate.getPrimitivesNumber(); i++) {
+                Primitive primitive = aggregate.getPrimitiveAt(i);
+                StretchOperation operation = StretchOperationUtils.getOperation(primitive);
+                if (operation != null) {
+                    Geometry element = operation.transform(at, primitive, roi);
+                    if (element instanceof MultiPrimitive) {
+                        for (int j = 0; j < ((MultiPrimitive)element).getPrimitivesNumber(); j++) {
+                            newAggregate.addPrimitive(((MultiPrimitive)element).getPrimitiveAt(j));
+                        }
+                    } else if(element instanceof Primitive){
+                        newAggregate.addPrimitive((Primitive)element);
+                    } else {
+                        logger.warn("StretchOperation has returned a not-supported geometry type. "+operation.toString()+" "+element.getClass().getName());
+                    }
+                } else {
+                    newAggregate.addPrimitive(primitive);
+                }
+            }
+            return newAggregate;
+        } else if (geometry instanceof Primitive) {
+            StretchOperation operation = StretchOperationUtils.getOperation((Primitive)geometry);
+            if (operation != null) {
+                return operation.transform(at, (Primitive)geometry, roi);
+            }
+        }
+        return geometry;
+    }
+
+
+    public static List<Point> getSelectedVertex(Geometry geometry,
+        Geometry roi) throws CreateGeometryException,
+        GeometryOperationNotSupportedException, GeometryOperationException {
+        List<Point> selectedVertex = new ArrayList<Point>();
+        if (geometry instanceof MultiPrimitive) {
+            MultiPrimitive aggregate = (MultiPrimitive)geometry;
+            for (int i = 0; i < aggregate.getPrimitivesNumber(); i++) {
+                Primitive primitive = aggregate.getPrimitiveAt(i);
+                StretchOperation operation = StretchOperationUtils.getOperation(primitive);
+                if (operation != null) {
+                    selectedVertex.addAll(operation.getSelectedVertex(primitive, roi));
+                }
+            }
+        } else if (geometry instanceof Primitive) {
+            Primitive primitive = (Primitive)geometry;
+            StretchOperation operation = StretchOperationUtils.getOperation(primitive);
+            if (operation != null) {
+                selectedVertex.addAll(operation.getSelectedVertex(primitive, roi));
+            }
+        }
+        return selectedVertex;
+    }
+
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol selectedVertexEditingSymbol = editingProviderManager.getSymbol("selected-vertex-symbol-editing");
+        ISymbol lineSymbolEditing = editingProviderManager.getSymbol("line-symbol-editing");
+        ISymbol polygonSymbolEditing = editingProviderManager.getSymbol("polygon-symbol-editing");
+        ISymbol auxiliaryPointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+
+        FeatureSelection selection =
+            (FeatureSelection) values.get(this.selectionParameter);
+        try {
+            if ((selection != null) && !selection.isEmpty()) {
+                Geometry geometry = (Geometry) values.get(this.geometryParameter);
+                if (geometry != null) {
+                    //
+                    List<Point> selectedVertex = new ArrayList<Point>();
+                    DisposableIterator it = null;
+
+                    try {
+                        it = selection.fastIterator();
+
+                        while (it.hasNext()) {
+                            Feature feature = (Feature) it.next();
+                            Geometry featureGeometry = feature.getDefaultGeometry();
+                            List<Point> vertex = getSelectedVertex(featureGeometry, geometry);
+                            if(vertex != null){
+                                selectedVertex.addAll(vertex);
+                            }
+                        }
+                    } catch (BaseException e) {
+                        throw new InvalidEntryException(e);
+                    } finally {
+                        it.dispose();
+                    }
+
+                    if(!selectedVertex.isEmpty()){
+                        for (Iterator<Point> iterator = selectedVertex.iterator(); iterator.hasNext();) {
+                            Point point = (Point) iterator.next();
+                            drawingStatus.addStatus(point, selectedVertexEditingSymbol, "");
+                        }
+                    }
+
+                    Point firstPoint = (Point) values.get(this.firstPointParameter);
+                    if (firstPoint != null){
+                        AffineTransform at = getMoveAffineTransform(firstPoint, mousePosition);
+
+                        if(!selectedVertex.isEmpty()){
+                            for (Iterator<Point> iterator = selectedVertex.iterator(); iterator.hasNext();) {
+                                Point point = (Point) ((Point) iterator.next()).cloneGeometry();
+                                point.transform(at);
+                                drawingStatus.addStatus(point, selectedVertexEditingSymbol, "");
+                            }
+                        }
+
+                        it = null;
+                        try {
+                            it = selection.fastIterator();
+
+                            while (it.hasNext()) {
+                                Feature feature = (Feature) it.next();
+                                Geometry featureGeometry = feature.getDefaultGeometry();
+                                Geometry transformedGeometry = applyTransform(featureGeometry, at, geometry);
+                                ISymbol symbol=null;
+                                if(transformedGeometry instanceof Curve || transformedGeometry instanceof MultiCurve){
+                                    symbol = lineSymbolEditing;
+                                } else if(transformedGeometry instanceof Surface || transformedGeometry instanceof MultiSurface){
+                                    symbol = polygonSymbolEditing;
+                                } else if(transformedGeometry instanceof Point || transformedGeometry instanceof MultiPoint){
+                                    symbol = auxiliaryPointSymbolEditing;
+                                }
+                                if(transformedGeometry instanceof Aggregate){
+                                    int primitivesNumber = ((Aggregate)transformedGeometry).getPrimitivesNumber();
+                                    for (int i = 0; i < primitivesNumber; i++) {
+                                        drawingStatus.addStatus(((Aggregate)transformedGeometry).getPrimitiveAt(i), symbol, "");
+                                    }
+                                } else {
+                                    drawingStatus.addStatus(transformedGeometry, symbol, "");
+                                }
+                            }
+                        } catch (BaseException e) {
+                            throw new InvalidEntryException(e);
+                        } finally {
+                            it.dispose();
+                        }
+                    }
+                }
+                return drawingStatus;
+            }
+        } catch (Exception e) {
+            throw new DrawServiceException(e);
+        }
+        return null;
+    }
+
+    private AffineTransform getMoveAffineTransform(Point p1, Point p2) {
+
+        AffineTransform translate =
+            AffineTransform.getTranslateInstance(p2.getX() - p1.getX(),
+                p2.getY() - p1.getY());
+
+        return translate;
+    }
+
+    public void stop() {
+        values.clear();
+    }
+
+
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter param = next();
+        validateAndInsertValue(param, value);
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+
+        FeatureSelection selection =
+            (FeatureSelection) values.get(selectionParameter);
+
+        try {
+            if ((selection != null) && !selection.isEmpty()) {
+                Geometry geometry = (Geometry) values.get(this.geometryParameter);
+                if (geometry != null) {
+                    Point firstPoint =
+                        (Point) values.get(this.firstPointParameter);
+                    if (firstPoint != null) {
+                        Point secondPoint =
+                            (Point) values.get(this.secondPointParameter);
+                        if (secondPoint != null) {
+                            AffineTransform at =
+                                getMoveAffineTransform(firstPoint, secondPoint);
+
+                            DisposableIterator it = null;
+
+                            try {
+                                it = selection.fastIterator();
+
+                                while (it.hasNext()) {
+                                    Feature feature = (Feature) it.next();
+                                    Geometry featureGeometry =
+                                        feature.getDefaultGeometry();
+
+                                    Geometry geom =
+                                        applyTransform(featureGeometry, at,
+                                            geometry);
+
+                                    EditableFeature editableFeature =
+                                        feature.getEditable();
+                                    editableFeature.setDefaultGeometry(geom);
+                                    ((EditingProviderServices) getProviderServices())
+                                        .updateFeatureInFeatureStore(
+                                            editableFeature, featureStore);
+                                }
+                            } catch (BaseException e) {
+                                throw new FinishServiceException(e);
+                            } finally {
+                                it.dispose();
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (DataException e) {
+            throw new FinishServiceException(e);
+        }
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void start() throws StartServiceException {
+        this.values = new HashMap<EditingServiceParameter, Object>();
+        FeatureSelection selected = null;
+        if (featureStore != null) {
+            try {
+                selected =
+                    (FeatureSelection) featureStore.getFeatureSelection()
+                        .clone();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            } catch (CloneNotSupportedException e) {
+                // Do nothing
+            }
+            if ((selected != null) && (selected.getSelectedCount() > 0)) {
+                values.put(selectionParameter, selected);
+            }
+        }
+    }
+
+    public String getName() {
+        return StretchEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/CurveStretchOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/CurveStretchOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/CurveStretchOperation.java	(revision 1663)
@@ -0,0 +1,54 @@
+package org.gvsig.vectorediting.lib.prov.stretch.operation;
+
+import java.awt.geom.AffineTransform;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.GeneralPathX;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+
+
+public class CurveStretchOperation implements StretchOperation{
+
+    public CurveStretchOperation() {
+        // TODO Auto-generated constructor stub
+    }
+
+    public Geometry transform(AffineTransform at, Primitive geom, Geometry roi)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, CreateGeometryException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        Line line = geometryManager.createLine(geom.getGeometryType().getSubType());
+        line.setGeneralPath((GeneralPathX) geom.getGeneralPath().clone());
+        for (int j = 0; j < line.getNumVertices(); j++) {
+            Point point = line.getVertex(j);
+          if (roi.intersects(point) || roi.contains(point)) {
+            point.transform(at);
+            StretchOperationUtils.setVertex(line, j, point);
+          }
+        }
+        return line;
+    }
+
+    public List<Point> getSelectedVertex(Primitive geom, Geometry roi) throws GeometryOperationNotSupportedException, GeometryOperationException, CreateGeometryException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        List<Point> vertexList = new ArrayList<Point>();
+        Line line = geometryManager.createLine(geom.getGeometryType().getSubType());
+        line.setGeneralPath(geom.getGeneralPath());
+        for (int j = 0; j < line.getNumVertices(); j++) {
+            Point point = line.getVertex(j);
+          if (roi.intersects(point) || roi.contains(point)) {
+              vertexList.add(point);
+          }
+        }
+        return vertexList;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/LineStretchOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/LineStretchOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/LineStretchOperation.java	(revision 1663)
@@ -0,0 +1,53 @@
+package org.gvsig.vectorediting.lib.prov.stretch.operation;
+
+import java.awt.geom.AffineTransform;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.OrientablePrimitive;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+
+
+public class LineStretchOperation implements StretchOperation{
+
+    public LineStretchOperation() {
+        // TODO Auto-generated constructor stub
+    }
+
+    public Geometry transform(AffineTransform at, Primitive geom, Geometry roi)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+        OrientablePrimitive primitive = (OrientablePrimitive)(geom.cloneGeometry());
+        for (int j = 0; j < primitive.getNumVertices(); j++) {
+            Point point = primitive.getVertex(j);
+          if (roi.intersects(point) || roi.contains(point)) {
+            point.transform(at);
+            StretchOperationUtils.setVertex(primitive, j, point);
+
+          }
+        }
+        return primitive;
+    }
+
+    public List<Point> getSelectedVertex(Primitive geom, Geometry roi)
+        throws  GeometryOperationNotSupportedException, GeometryOperationException, CreateGeometryException {
+        OrientablePrimitive primitive = (OrientablePrimitive)(geom.cloneGeometry());
+        List<Point> vertexList = new ArrayList<Point>();
+        for (int j = 0; j < primitive.getNumVertices(); j++) {
+            Point point = primitive.getVertex(j);
+          if (roi.intersects(point) || roi.contains(point)) {
+              vertexList.add(point);
+          }
+        }
+        return vertexList;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/PolygonStretchOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/PolygonStretchOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/PolygonStretchOperation.java	(revision 1663)
@@ -0,0 +1,56 @@
+package org.gvsig.vectorediting.lib.prov.stretch.operation;
+
+import java.awt.geom.AffineTransform;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.OrientablePrimitive;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Polygon;
+import org.gvsig.fmap.geom.primitive.Primitive;
+
+
+public class PolygonStretchOperation implements StretchOperation{
+
+    public PolygonStretchOperation() {
+        // TODO Auto-generated constructor stub
+    }
+
+    public Geometry transform(AffineTransform at, Primitive geom, Geometry roi)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+        OrientablePrimitive primitive = (OrientablePrimitive)(geom.cloneGeometry());
+        for (int j = 0; j < primitive.getNumVertices(); j++) {
+            Point point = primitive.getVertex(j);
+          if (roi.intersects(point) || roi.contains(point)) {
+            point.transform(at);
+            StretchOperationUtils.setVertex(primitive, j, point);
+          }
+        }
+        return primitive;
+    }
+
+    public List<Point> getSelectedVertex(Primitive geom, Geometry roi)
+        throws  GeometryOperationNotSupportedException, GeometryOperationException, CreateGeometryException {
+        OrientablePrimitive primitive = (OrientablePrimitive)(geom.cloneGeometry());
+        List<Point> vertexList = new ArrayList<Point>();
+        for (int j = 0; j < primitive.getNumVertices(); j++) {
+            Point point = primitive.getVertex(j);
+          if (roi.intersects(point) || roi.contains(point)) {
+              vertexList.add(point);
+          }
+        }
+        return vertexList;
+    }
+
+
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/SurfaceStretchOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/SurfaceStretchOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/SurfaceStretchOperation.java	(revision 1663)
@@ -0,0 +1,58 @@
+package org.gvsig.vectorediting.lib.prov.stretch.operation;
+
+import java.awt.geom.AffineTransform;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.GeneralPathX;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Polygon;
+import org.gvsig.fmap.geom.primitive.Primitive;
+
+
+public class SurfaceStretchOperation implements StretchOperation{
+
+    public SurfaceStretchOperation() {
+        // TODO Auto-generated constructor stub
+    }
+
+    public Geometry transform(AffineTransform at, Primitive geom, Geometry roi)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, CreateGeometryException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        Polygon polygon = geometryManager.createPolygon(geom.getGeometryType().getSubType());
+        polygon.setGeneralPath((GeneralPathX) geom.getGeneralPath().clone());
+
+        for (int j = 0; j < polygon.getNumVertices(); j++) {
+            Point point = polygon.getVertex(j);
+          if (roi.intersects(point) || roi.contains(point)) {
+            point.transform(at);
+            StretchOperationUtils.setVertex(polygon, j, point);
+          }
+        }
+
+        return polygon;
+    }
+
+    public List<Point> getSelectedVertex(Primitive geom, Geometry roi) throws GeometryOperationNotSupportedException, GeometryOperationException, CreateGeometryException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        List<Point> vertexList = new ArrayList<Point>();
+
+        Polygon polygon = geometryManager.createPolygon(geom.getGeometryType().getSubType());
+        polygon.setGeneralPath(geom.getGeneralPath());
+
+        for (int j = 0; j < polygon.getNumVertices(); j++) {
+            Point point = polygon.getVertex(j);
+          if (roi.intersects(point) || roi.contains(point)) {
+              vertexList.add(point);
+          }
+        }
+        return vertexList;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/PointStretchOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/PointStretchOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/PointStretchOperation.java	(revision 1663)
@@ -0,0 +1,49 @@
+package org.gvsig.vectorediting.lib.prov.stretch.operation;
+
+import java.awt.geom.AffineTransform;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.OrientablePrimitive;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Polygon;
+import org.gvsig.fmap.geom.primitive.Primitive;
+
+
+public class PointStretchOperation implements StretchOperation{
+
+    public PointStretchOperation() {
+        // TODO Auto-generated constructor stub
+    }
+
+    public Geometry transform(AffineTransform at, Primitive geom, Geometry roi)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+        Point point = (Point) (geom.cloneGeometry());
+        if (roi.intersects(point) || roi.contains(point)) {
+            point.transform(at);
+        }
+        return point;
+    }
+
+    public List<Point> getSelectedVertex(Primitive geom, Geometry roi)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, CreateGeometryException {
+        Point point = (Point) (geom.cloneGeometry());
+        List<Point> vertexList = new ArrayList<Point>();
+        if (roi.intersects(point) || roi.contains(point)) {
+            vertexList.add(point);
+        }
+        return vertexList;
+    }
+
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/StretchOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/StretchOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/StretchOperation.java	(revision 1663)
@@ -0,0 +1,22 @@
+package org.gvsig.vectorediting.lib.prov.stretch.operation;
+
+import java.awt.geom.AffineTransform;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+
+
+public interface StretchOperation {
+
+    Geometry transform(AffineTransform at,
+        Primitive geom, Geometry roi) throws GeometryOperationNotSupportedException, GeometryOperationException, CreateGeometryException ;
+
+    public List<Point> getSelectedVertex(Primitive geom, Geometry roi) throws GeometryOperationNotSupportedException, GeometryOperationException, CreateGeometryException;
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/StretchOperationUtils.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/StretchOperationUtils.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/operation/StretchOperationUtils.java	(revision 1663)
@@ -0,0 +1,88 @@
+package org.gvsig.vectorediting.lib.prov.stretch.operation;
+
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Circle;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Ellipse;
+import org.gvsig.fmap.geom.primitive.EllipticArc;
+import org.gvsig.fmap.geom.primitive.OrientablePrimitive;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.geom.primitive.Spline;
+import org.gvsig.fmap.geom.primitive.Surface;
+
+
+public class StretchOperationUtils {
+
+    private static Logger logger = LoggerFactory.getLogger(StretchOperationUtils.class);
+
+    private static Map<Integer, StretchOperation> operations = new HashMap<Integer, StretchOperation>();
+
+    private StretchOperationUtils() {
+    }
+
+    public static void register(StretchOperation operation, int geometryType){
+        operations.put(geometryType, operation);
+    }
+
+    public static StretchOperation getOperation(Primitive geom) {
+        Integer type = geom.getGeometryType().getType();
+
+        if(isPolygon(geom)){
+            type = Geometry.TYPES.POLYGON;
+        } else if(isLine(geom)){
+            type = Geometry.TYPES.LINE;
+        }
+        StretchOperation operation = operations.get(type);
+
+        return operation;
+    }
+
+    private static boolean isPolygon(Geometry geometry) {
+
+        if(!(geometry instanceof Surface)){
+            return false;
+        }
+        if (geometry instanceof Ellipse) {
+            return false;
+        }
+        if (geometry instanceof EllipticArc) {
+            return false;
+        }
+        if (geometry instanceof Circle) {
+            return false;
+        }
+        return true;
+    }
+
+    private static boolean isLine(Geometry geometry) {
+
+        if(!(geometry instanceof Curve)){
+            return false;
+        }
+        if (geometry instanceof Arc) {
+            return false;
+        }
+        if (geometry instanceof Spline) {
+            return false;
+        }
+        return true;
+    }
+
+    public static void setVertex(OrientablePrimitive geom, int index, Point p) {
+        Point point = geom.getVertex(index);
+        int min = p.getDimension() < point.getDimension()?p.getDimension():point.getDimension();
+        for(int i=0; i<min; i++){
+            point.setCoordinateAt(i, p.getCoordinateAt(i));
+        }
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/StretchEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/StretchEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/java/org/gvsig/vectorediting/lib/prov/stretch/StretchEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,65 @@
+package org.gvsig.vectorediting.lib.prov.stretch;
+
+
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+public class StretchEditingProviderFactory extends AbstractProviderFactory
+implements EditingProviderFactory {
+
+    public static final String PROVIDER_NAME = "modify-stretch";
+
+    private final static String PROVIDER_DESCRIPTION =
+        "Stretch selected geometries";
+
+    public void initialize() {
+
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", false, null,
+                new int[] { Geometry.TYPES.POINT, Geometry.TYPES.MULTIPOINT,
+                Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE,
+                Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, 
+                Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new StretchEditingProvider(services, parameters);
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject dynobject = super.createParameters();
+        dynobject.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return dynobject;
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/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
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/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	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/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	(revision 1663)
@@ -0,0 +1,89 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.stretch;
+
+
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.prov.stretch.operation.CurveStretchOperation;
+import org.gvsig.vectorediting.lib.prov.stretch.operation.PointStretchOperation;
+import org.gvsig.vectorediting.lib.prov.stretch.operation.SurfaceStretchOperation;
+import org.gvsig.vectorediting.lib.prov.stretch.operation.LineStretchOperation;
+import org.gvsig.vectorediting.lib.prov.stretch.operation.PolygonStretchOperation;
+import org.gvsig.vectorediting.lib.prov.stretch.operation.StretchOperationUtils;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * Library for default implementation initialization and configuration.
+ *
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class StretchEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new StretchEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "modify-stretch", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        StretchOperationUtils.register(new PointStretchOperation(), Geometry.TYPES.POINT);
+
+        StretchOperationUtils.register(new LineStretchOperation(), Geometry.TYPES.LINE);
+        StretchOperationUtils.register(new CurveStretchOperation(), Geometry.TYPES.ARC);
+        StretchOperationUtils.register(new CurveStretchOperation(), Geometry.TYPES.SPLINE);
+
+        StretchOperationUtils.register(new PolygonStretchOperation(), Geometry.TYPES.POLYGON);
+        StretchOperationUtils.register(new SurfaceStretchOperation(), Geometry.TYPES.ELLIPSE);
+        StretchOperationUtils.register(new SurfaceStretchOperation(), Geometry.TYPES.CIRCLE);
+        StretchOperationUtils.register(new SurfaceStretchOperation(), Geometry.TYPES.ELLIPTICARC);
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n.text",
+            this.getClass().getClassLoader(), "stretch-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.stretch.StretchEditingLibrary
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/resources/images/vectorediting-tools/modify-stretch.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/src/main/resources/images/vectorediting-tools/modify-stretch.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.stretch</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.stretch</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.stretch
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/EditVertexEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/EditVertexEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/EditVertexEditingProvider.java	(revision 1663)
@@ -0,0 +1,885 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.editvertex;
+
+
+import java.awt.Color;
+import java.awt.geom.AffineTransform;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.cresques.cts.IProjection;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureQuery;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureSet;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiPrimitive;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.OrientablePrimitive;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.layers.vectorial.SpatialEvaluatorsFactory;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.symbology.SymbologyLocator;
+import org.gvsig.symbology.SymbologyManager;
+import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.ISimpleTextSymbol;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.dispose.DisposeUtils;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.evaluator.Evaluator;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.prov.editvertex.operation.EditVertexOperation;
+import org.gvsig.vectorediting.lib.prov.editvertex.operation.EditVertexOperationUtils;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author fdiaz
+ *
+ */
+public class EditVertexEditingProvider extends AbstractEditingProvider implements
+    EditingProvider {
+    private static final Logger LOGGER = LoggerFactory
+        .getLogger(EditVertexEditingProvider.class);
+
+    private final int TOLERANCE_PIXELS = 3;
+
+    private final EditingServiceParameter selectionParameter;
+
+    private final EditingServiceParameter vertexSelectionPointParameter;
+
+    private final EditingServiceParameter actionParameter;
+
+    private FeatureSelection selection;
+
+    private Point selectedVertex;
+    private int selectedIndex;
+
+    private Point pointToMove;
+
+    private String action;
+
+    private final FeatureStore featureStore;
+
+    private final MapContext mapContext;
+
+    /**
+     * Default constructor.
+     * @param services
+     *            available services for this provider
+     * @param parameters
+     *            of this provider
+     */
+    public EditVertexEditingProvider(ProviderServices services, DynObject parameters) {
+        super(services);
+
+        selectedIndex = -1;
+
+        this.featureStore = (FeatureStore) parameters.getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.mapContext = (MapContext) parameters.getDynValue(EditingProviderFactory.MAPCONTEXT_FIELD);
+
+        this.selectionParameter = new DefaultEditingServiceParameter("selection", "uniqueselection", TYPE.SELECTION);
+
+        this.vertexSelectionPointParameter =
+            new DefaultEditingServiceParameter("selectvertex", "selectvertex", TYPE.POSITION, TYPE.VALUE);
+
+        LinkedHashMap<String, String> options = new LinkedHashMap<>();
+        options.put("+", "insert_vertex");
+        options.put("-", "remove_vertex");
+        this.actionParameter =
+            new DefaultEditingServiceParameter("new_position",
+                ((EditingProviderServices) getProviderServices()).makeConsoleMessage("new_position", options), options,
+                TYPE.POSITION, TYPE.OPTION);
+    }
+
+    public EditingServiceParameter next() {
+        if (selection == null) {
+            return selectionParameter;
+        } else if (selectedVertex == null) {
+            return vertexSelectionPointParameter;
+        } else if (action == null && pointToMove == null) {
+            this.actionParameter.setDefaultValue(selectedVertex);
+            return actionParameter;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol selectedVertexSymbolEditing =
+            editingProviderManager.getSymbol("selected-vertex-symbol-editing");
+        ISymbol editedVertexSymbolEditing =
+            editingProviderManager.getSymbol("edited-vertex-symbol-editing");
+        Color colorToTextSymbol = Color.BLACK;
+        if (selectedVertexSymbolEditing != null) {
+            colorToTextSymbol = selectedVertexSymbolEditing
+                .getColor();
+        }
+
+        double translationForTextSymbol =
+            mapContext.getViewPort().toMapDistance(8);
+        double tolerance =
+            mapContext.getViewPort().toMapDistance(TOLERANCE_PIXELS);
+        try {
+            if (this.selection == null) {
+                Geometry geometry;
+                geometry = getNearestGeometry(mousePosition);
+                if (geometry != null) {
+                    List<Point> vertexesList = getVertexesList(geometry);
+                    if (vertexesList != null) {
+                        int i = 0;
+                        for (Point point : vertexesList) {
+                            drawingStatus.addStatus(point,
+                                    selectedVertexSymbolEditing, "");
+                            Point pointToText = (Point) point.cloneGeometry();
+                            pointToText.transform(new AffineTransform(1, 0, 0,
+                                    1, translationForTextSymbol, 0));
+                            drawingStatus.addStatus(pointToText,
+                                    getTextSymbol(colorToTextSymbol), String.valueOf(i++));
+                        }
+                    }
+                }
+            } else {
+                Geometry selectedGeometry = getSelectedGeometry();
+                if (selectedVertex == null) {
+                    List<Point> vertexesList =
+                        getVertexesList(selectedGeometry);
+                    Point vertex =
+                        getVertex(selectedGeometry, mousePosition, tolerance);
+                    if (vertexesList != null) {
+                        int i = 0;
+                        int selectedIndex = -1;
+                        for (Point point : vertexesList) {
+                            Point pointToText = (Point) point.cloneGeometry();
+                            pointToText.transform(new AffineTransform(1, 0, 0,
+                                    1, translationForTextSymbol, 0));
+                            if (vertex != null && vertex.equals(point)) {
+                                if(selectedIndex<0){
+                                    selectedIndex = i++;
+                                } else {
+                                    i++;
+                                }
+                            } else {
+                                drawingStatus.addStatus(point,
+                                        selectedVertexSymbolEditing, "");
+                                drawingStatus
+                                        .addStatus(
+                                                pointToText,
+                                                getTextSymbol(colorToTextSymbol),
+                                                String.valueOf(i++));
+                            }
+                        }
+                        if (selectedIndex >= 0) {
+                            Point pointToText = (Point) vertex.cloneGeometry();
+                            pointToText.transform(new AffineTransform(1, 0, 0, 1, translationForTextSymbol, 0));
+                            drawingStatus.addStatus(vertex,
+                                editedVertexSymbolEditing, "");
+                            drawingStatus
+                                .addStatus(pointToText,
+                                    getTextSymbol(colorToTextSymbol),
+                                    createInfoPointMessage(vertex, selectedIndex)
+                                    );
+
+                        }
+                    }
+                } else {
+                    List<Point> vertexesList =
+                        getVertexesList(selectedGeometry);
+                    if (vertexesList != null) {
+                        int i = 0;
+                        if (selectedIndex < 0) {
+                            for (Point point : vertexesList) {
+                                Point pointToText = (Point) point.cloneGeometry();
+                                pointToText.transform(new AffineTransform(1, 0, 0, 1, translationForTextSymbol, 0));
+                                if (selectedVertex.equals(point)) {
+                                    if (selectedIndex < 0) {
+                                        selectedIndex = i++;
+                                    } else {
+                                        i++;
+                                    }
+                                } else {
+                                    drawingStatus.addStatus(point, selectedVertexSymbolEditing, "");
+                                    drawingStatus.addStatus(pointToText, getTextSymbol(colorToTextSymbol),
+                                            String.valueOf(i++));
+                                }
+                            }
+                        }
+                        if (selectedIndex >= 0) {
+                            Point pointToText =
+                                (Point) selectedVertex.cloneGeometry();
+                            pointToText.transform(new AffineTransform(1, 0, 0, 1, translationForTextSymbol, 0));
+                            drawingStatus.addStatus(selectedVertex,
+                                editedVertexSymbolEditing, "");
+                            drawingStatus
+                            .addStatus(pointToText,
+                                getTextSymbol(colorToTextSymbol), createInfoPointMessage(pointToText, selectedIndex));
+                            Point newPosition = (Point) selectedVertex.cloneGeometry();
+                            newPosition.setX(mousePosition.getX());
+                            newPosition.setY(mousePosition.getY());
+                            Geometry modifiedGeometry = this.getModifiedGeometry(selectedGeometry, selectedIndex, newPosition);
+                            addToDrawingStatus(drawingStatus, modifiedGeometry);
+
+                            drawingStatus.addStatus(mousePosition,
+                                selectedVertexSymbolEditing, "");
+                            pointToText =(Point) selectedVertex.cloneGeometry();
+                            pointToText.setX(mousePosition.getX());
+                            pointToText.setY(mousePosition.getY());
+                            pointToText.transform(new AffineTransform(1, 0, 0, 1, translationForTextSymbol, 0));
+                            drawingStatus.addStatus(pointToText,
+                                getTextSymbol(colorToTextSymbol), createInfoPointMessage(pointToText, selectedIndex));
+                        }
+                    }
+                }
+            }
+        } catch (BaseException e) {
+            throw new DrawServiceException(e);
+        }
+        return drawingStatus;
+    }
+
+    private String createInfoPointMessage(Point point, int index) throws GeometryOperationNotSupportedException, GeometryOperationException{
+        StringBuilder builder = new StringBuilder();
+        builder.append(index);
+        builder.append(" ");
+
+        builder.append("(");
+        for( int i=0; i<point.getDimension()-1; i++) {
+            builder.append(point.getCoordinateAt(i));
+            builder.append(" , ");
+        }
+        builder.append(point.getCoordinateAt(point.getDimension()-1));
+        builder.append(")");
+
+        return builder.toString();
+    }
+
+    private void addToDrawingStatus(DefaultDrawingStatus drawingStatus,
+        Geometry geometry) throws CreateGeometryException, GeometryOperationNotSupportedException, GeometryOperationException {
+
+        if (geometry instanceof MultiPrimitive) {
+            MultiPrimitive aggregate = (MultiPrimitive) geometry;
+            for (int i = 0; i < aggregate.getPrimitivesNumber(); i++) {
+                Primitive primitive = aggregate.getPrimitiveAt(i);
+
+                EditVertexOperation operation =
+                    EditVertexOperationUtils.getOperation(primitive);
+                if (operation != null) {
+                    operation.addToDrawingStatus(drawingStatus, primitive);
+                }
+            }
+        } else if (geometry instanceof Primitive) {
+            Primitive primitive = (Primitive) geometry;
+            EditVertexOperation operation =
+                EditVertexOperationUtils.getOperation(primitive);
+            if (operation != null) {
+                operation.addToDrawingStatus(drawingStatus, primitive);
+            }
+        }
+    }
+
+    private Geometry getModifiedGeometry(Geometry geometry, int index,
+        Point newPosition) throws CreateGeometryException,
+        GeometryOperationNotSupportedException, GeometryOperationException {
+
+        if (geometry instanceof MultiPrimitive) {
+            GeometryManager geometryManager =
+                GeometryLocator.getGeometryManager();
+            MultiPrimitive aggregate = (MultiPrimitive) geometry;
+            GeometryType geometryType = aggregate.getGeometryType();
+            MultiPrimitive newAggregate =
+                (MultiPrimitive) geometryManager.create(geometryType.getType(),
+                    geometryType.getSubType());
+            for (int i = 0; i < aggregate.getPrimitivesNumber(); i++) {
+                Primitive primitive = aggregate.getPrimitiveAt(i);
+                EditVertexOperation operation =
+                    EditVertexOperationUtils.getOperation(primitive);
+                if (operation != null) {
+                    int numVertexes = operation.getNumVertex(primitive);
+                    if (index > -1 && index < numVertexes) {
+                        Geometry modifiedPrimitive =
+                            operation.moveVertex(primitive, index,
+                                newPosition);
+                        newAggregate
+                            .addPrimitive((Primitive) modifiedPrimitive);
+                        index = -1;
+                    } else {
+                        index -= numVertexes;
+                        newAggregate.addPrimitive((Primitive) primitive
+                            .cloneGeometry());
+                    }
+                }
+            }
+            return newAggregate;
+        } else if (geometry instanceof Primitive) {
+            Primitive primitive = (Primitive) geometry;
+            EditVertexOperation operation =
+                EditVertexOperationUtils.getOperation(primitive);
+            if (operation != null) {
+                return operation.moveVertex(primitive, index, newPosition);
+            }
+        }
+        return null;
+    }
+
+    private Geometry getInsertVertexGeometry(Geometry geometry, int index)
+        throws CreateGeometryException {
+        if (geometry instanceof MultiPrimitive) {
+            GeometryManager geometryManager =
+                GeometryLocator.getGeometryManager();
+            MultiPrimitive aggregate = (MultiPrimitive) geometry;
+            GeometryType geometryType = aggregate.getGeometryType();
+            MultiPrimitive newAggregate =
+                (MultiPrimitive) geometryManager.create(geometryType.getType(),
+                    geometryType.getSubType());
+            for (int i = 0; i < aggregate.getPrimitivesNumber(); i++) {
+                Primitive primitive = aggregate.getPrimitiveAt(i);
+                EditVertexOperation operation =
+                    EditVertexOperationUtils.getOperation(primitive);
+                if (operation != null) {
+                    int numVertexes = operation.getNumVertex(primitive);
+                    if (operation.canInsertVertex(primitive, index) && index > -1 && index < numVertexes) {
+                        Geometry modifiedPrimitive =
+                            operation.insertVertex(primitive, index);
+                        newAggregate
+                            .addPrimitive((Primitive) modifiedPrimitive);
+                        index = -1;
+                    } else {
+                        index -= numVertexes;
+                        newAggregate.addPrimitive((Primitive) primitive
+                            .cloneGeometry());
+                    }
+                }
+            }
+            return newAggregate;
+        } else if (geometry instanceof Primitive) {
+            Primitive primitive = (Primitive) geometry;
+            EditVertexOperation operation =
+                EditVertexOperationUtils.getOperation(primitive);
+            if (operation != null) {
+                return operation.insertVertex(primitive, index);
+            }
+        }
+        return null;
+    }
+
+    private Geometry getRemovedVertexGeometry(Geometry geometry, int index)
+        throws CreateGeometryException {
+        if (geometry instanceof MultiPrimitive) {
+            GeometryManager geometryManager =
+                GeometryLocator.getGeometryManager();
+            MultiPrimitive aggregate = (MultiPrimitive) geometry;
+            GeometryType geometryType = aggregate.getGeometryType();
+            MultiPrimitive newAggregate =
+                (MultiPrimitive) geometryManager.create(geometryType.getType(),
+                    geometryType.getSubType());
+            for (int i = 0; i < aggregate.getPrimitivesNumber(); i++) {
+                Primitive primitive = aggregate.getPrimitiveAt(i);
+                EditVertexOperation operation =
+                    EditVertexOperationUtils.getOperation(primitive);
+                if (operation != null) {
+                    int numVertexes = operation.getNumVertex(primitive);
+                    if (index > -1 && index < numVertexes) {
+                        Geometry modifiedPrimitive =
+                            operation.removeVertex(primitive, index);
+                        newAggregate
+                            .addPrimitive((Primitive) modifiedPrimitive);
+                        index = -1;
+                    } else {
+                        index -= numVertexes;
+                        newAggregate.addPrimitive((Primitive) primitive
+                            .cloneGeometry());
+                    }
+                }
+            }
+            return newAggregate;
+        } else if (geometry instanceof Primitive) {
+            Primitive primitive = (Primitive) geometry;
+            EditVertexOperation operation =
+                EditVertexOperationUtils.getOperation(primitive);
+            if (operation != null) {
+                return operation.removeVertex(primitive, index);
+            }
+        }
+        return null;
+    }
+
+    private ISimpleTextSymbol getTextSymbol(Color color){
+        SymbologyManager symbologyManager = SymbologyLocator.getSymbologyManager();
+        ISimpleTextSymbol textSymbol = symbologyManager.createSimpleTextSymbol();
+        textSymbol.setFontSize(12);
+        textSymbol.setColor(color);
+        return textSymbol;
+    }
+
+    public void stop() throws StopServiceException {
+        this.selection = null;
+        this.selectedVertex = null;
+        this.pointToMove = null;
+        this.action = null;
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters = new ArrayList<>();
+        parameters.add(selectionParameter);
+        parameters.add(vertexSelectionPointParameter);
+        parameters.add(actionParameter);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+    }
+
+    private void validateAndInsertValue(
+        final EditingServiceParameter parameter, Object value)
+        throws InvalidEntryException {
+
+        if (parameter == selectionParameter) {
+            if (value instanceof FeatureSelection) {
+                FeatureSelection featureSelection = (FeatureSelection) value;
+                if (featureSelection.getSelectedCount() == 1) {
+                    this.selection = featureSelection;
+                } else {
+                    throw new InvalidEntryException(null);
+                }
+            }
+        } else {
+            Geometry selectedGeometry;
+            try {
+                selectedGeometry = getSelectedGeometry();
+            } catch (DataException e1) {
+                throw new InvalidEntryException(e1);
+            }
+            if (parameter == vertexSelectionPointParameter) {
+                if (value instanceof Point) {
+                    Point point = (Point) value;
+                    double tolerance = mapContext.getViewPort().toMapDistance(TOLERANCE_PIXELS);
+                    try {
+                        this.selectedVertex = getVertex(selectedGeometry, point, tolerance);
+                        selectedIndex = getSelectedIndex(getVertexesList(selectedGeometry));
+                    } catch (BaseException e) {
+                        throw new InvalidEntryException(e);
+                    }
+                    return;
+                } else if (value instanceof Double) {
+                    Double index = (Double) value;
+                    if (index != Math.round(index)) {
+                        throw new InvalidEntryException(null);
+                    } else {
+                        List<Point> vertexesList;
+                        try {
+                            vertexesList = getVertexesList(selectedGeometry);
+                        } catch (BaseException e) {
+                            throw new InvalidEntryException(e);
+                        }
+                        if(index >= vertexesList.size()){
+                            throw new InvalidEntryException(null);
+                        }
+                        this.selectedIndex = index.intValue();
+                        this.selectedVertex = vertexesList.get(this.selectedIndex);
+                    }
+                }
+
+            } else if (parameter == actionParameter) {
+                if (value instanceof Point) {
+                    Point valuePoint = (Point) value;
+                    this.pointToMove = (Point) selectedVertex.cloneGeometry();
+                    for(int i=0; i<valuePoint.getDimension(); i++){
+                        this.pointToMove.setCoordinateAt(i, valuePoint.getCoordinateAt(i));
+                    }
+                } else if (value instanceof String) {
+
+                    List<Point> vertexesList;
+                    try {
+                        vertexesList = getVertexesList(selectedGeometry);
+                    } catch (BaseException e) {
+                        throw new InvalidEntryException(e);
+                    }
+                    EditVertexOperation operation = null;
+                    if (vertexesList != null) {
+                        Primitive primitive;
+                        if (selectedGeometry instanceof MultiPrimitive) {
+                            if (selectedIndex < 0) {
+                                MultiPrimitive aggregate = (MultiPrimitive) selectedGeometry;
+                                boolean found = false;
+                                for (int i = 0; i < aggregate.getPrimitivesNumber(); i++) {
+                                    // selectedIndex = -1;
+                                    primitive = aggregate.getPrimitiveAt(i);
+                                    operation = EditVertexOperationUtils.getOperation(primitive);
+                                    if (operation != null) {
+                                        int numVertexes = operation.getNumVertex(primitive);
+                                        if (primitive instanceof OrientablePrimitive) {
+                                            OrientablePrimitive orientable = (OrientablePrimitive) primitive;
+                                            for (int j = 0; j < numVertexes; j++) {
+                                                if (selectedVertex.equals(orientable.getVertex(j))) {
+                                                    selectedIndex = j;
+                                                    found = true;
+                                                    break;
+                                                }
+                                            }
+                                        }
+                                    }
+                                    if (found) {
+                                        break;
+                                    }
+                                }
+                            }
+                        } else if (selectedGeometry instanceof Primitive) {
+                            primitive = (Primitive) selectedGeometry;
+                            operation = EditVertexOperationUtils.getOperation(primitive);
+                            if (selectedIndex < 0) {
+                                if (operation != null) {
+                                    int numVertexes = operation.getNumVertex(primitive);
+                                    if (primitive instanceof OrientablePrimitive) {
+                                        OrientablePrimitive orientable = (OrientablePrimitive) primitive;
+                                        for (int j = 0; j < numVertexes; j++) {
+                                            if (selectedVertex.equals(orientable.getVertex(j))) {
+                                                selectedIndex = j;
+                                                break;
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                        int auxSelectedIndex = selectedIndex;
+
+                        String str = (String) value;
+                        if (str.equalsIgnoreCase("+") || str.equalsIgnoreCase("-")) {
+                            if (selectedGeometry instanceof MultiPrimitive) {
+
+                                MultiPrimitive aggregate = (MultiPrimitive) selectedGeometry;
+                                for (int i = 0; i < aggregate.getPrimitivesNumber(); i++) {
+                                    int primitiveSelectedIndex = -1;
+                                    primitive = aggregate.getPrimitiveAt(i);
+                                    operation = EditVertexOperationUtils.getOperation(primitive);
+                                    if (operation != null) {
+                                        int numVertexes = operation.getNumVertex(primitive);
+                                        if (auxSelectedIndex >= numVertexes) {
+                                            auxSelectedIndex -= numVertexes;
+                                            continue;
+                                        }
+                                        primitiveSelectedIndex = auxSelectedIndex;
+
+                                        if (primitive instanceof OrientablePrimitive) {
+                                            OrientablePrimitive orientable = (OrientablePrimitive) primitive;
+                                            if (str.equalsIgnoreCase("+")) {
+                                                if (!operation.canInsertVertex(orientable, primitiveSelectedIndex)) {
+                                                    throw new InvalidEntryException(null);
+                                                }
+                                                try {
+                                                    operation.insertVertex(orientable, primitiveSelectedIndex);
+                                                } catch (CreateGeometryException e) {
+                                                    throw new InvalidEntryException(e);
+                                                }
+                                            }
+                                            if (str.equalsIgnoreCase("-")) {
+                                                if (!operation.canRemoveVertex(orientable, primitiveSelectedIndex)) {
+                                                    throw new InvalidEntryException(null);
+                                                }
+                                                try {
+                                                    operation.removeVertex(orientable, primitiveSelectedIndex);
+                                                } catch (CreateGeometryException e) {
+                                                    throw new InvalidEntryException(e);
+                                                }
+                                            }
+                                        }
+                                    }
+                                    break;
+                                }
+                            } else if (selectedGeometry instanceof Primitive) {
+                                primitive = (Primitive)selectedGeometry;
+                                if (str.equalsIgnoreCase("+")) {
+                                    if (!operation.canInsertVertex(primitive, selectedIndex)) {
+                                        throw new InvalidEntryException(null);
+                                    }
+                                    try {
+                                        operation.insertVertex(primitive, selectedIndex);
+                                    } catch (CreateGeometryException e) {
+                                        throw new InvalidEntryException(e);
+                                    }
+                                }
+                                if (str.equalsIgnoreCase("-")) {
+                                    if (!operation.canRemoveVertex(primitive, selectedIndex)) {
+                                        throw new InvalidEntryException(null);
+                                    }
+                                    try {
+                                        operation.removeVertex(primitive, selectedIndex);
+                                    } catch (CreateGeometryException e) {
+                                        throw new InvalidEntryException(e);
+                                    }
+                                }
+                            }
+                            this.action = str;
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    private Point getVertex(Geometry geometry, Point point, double tolerance)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, CreateGeometryException {
+        List<Point> vertexesList = getVertexesList(geometry);
+        double min = Double.POSITIVE_INFINITY;
+        Point vertex = null;
+        if (vertexesList != null) {
+            for (Point point2 : vertexesList) {
+                double distance = getDistance(point, point2);
+                if (distance <= tolerance) {
+                    if (distance < min) {
+                        vertex = point2;
+                        min = distance;
+                    }
+                }
+            }
+        }
+        return vertex;
+    }
+
+    private double getDistance(Point p1, Point p2) throws GeometryOperationNotSupportedException, GeometryOperationException, CreateGeometryException{
+        GeometryManager geomManager = GeometryLocator.getGeometryManager();
+        if(p1.getDimension()==p2.getDimension()){
+            return p1.distance(p2);
+        } else {
+            Point auxP1 = geomManager.createPoint(p1.getX(), p1.getY(), Geometry.SUBTYPES.GEOM2D);
+            Point auxP2 = geomManager.createPoint(p2.getX(), p2.getY(), Geometry.SUBTYPES.GEOM2D);
+            return auxP1.distance(auxP2);
+        }
+    }
+
+    private List<Point> getVertexesList(Geometry geometry) throws CreateGeometryException, GeometryOperationNotSupportedException, GeometryOperationException {
+        if (geometry instanceof MultiPrimitive) {
+            MultiPrimitive aggregate = (MultiPrimitive) geometry;
+            List<Point> vertexesList = new ArrayList<>();
+            for (int i = 0; i < aggregate.getPrimitivesNumber(); i++) {
+                Primitive primitive = aggregate.getPrimitiveAt(i);
+                EditVertexOperation operation =
+                    EditVertexOperationUtils.getOperation(primitive);
+                if (operation != null) {
+                    vertexesList.addAll(operation.getVertexesList(primitive));
+                }
+            }
+            return vertexesList;
+        } else if (geometry instanceof Primitive) {
+            Primitive primitive = (Primitive) geometry;
+            EditVertexOperation operation =
+                EditVertexOperationUtils.getOperation(primitive);
+            if (operation != null) {
+                List<Point> vertexesList = operation.getVertexesList(primitive);
+                return vertexesList;
+            }
+        }
+        return null;
+    }
+
+
+
+    private FeatureSet getGeometryByBuffer(Geometry buffer)
+        throws DataException {
+        FeatureQuery queryByGeometry = featureStore.createFeatureQuery();
+
+        // Get default SRS of default feature type
+        IProjection defaultSRS =
+            this.featureStore.getDefaultFeatureType().getDefaultSRS();
+
+        Evaluator iee = SpatialEvaluatorsFactory.getInstance().intersects(
+                buffer, 
+                defaultSRS, 
+                featureStore
+        );
+        queryByGeometry.setFilter(iee);
+        queryByGeometry.setAttributeNames(null);
+        return this.featureStore.getFeatureSet(queryByGeometry);
+    }
+
+    private Geometry getNearestGeometry(final Point point) throws GeometryOperationNotSupportedException, GeometryOperationException, DataException{
+        double tolerance =
+            mapContext.getViewPort().toMapDistance(TOLERANCE_PIXELS);
+        Geometry buffer = point.buffer(tolerance);
+        FeatureSet featureSet = getGeometryByBuffer(buffer);
+        double min = Double.POSITIVE_INFINITY;
+        Geometry geometry = null;
+
+        DisposableIterator iterator = featureSet.fastIterator();
+        while (iterator.hasNext()) {
+            Feature feat = (Feature) iterator.next();
+            double distance = point.distance(feat.getDefaultGeometry());
+            if (distance < min){
+                geometry = feat.getDefaultGeometry();
+                min = distance;
+            }
+        }
+        iterator.dispose();
+        return geometry;
+    }
+
+    private Geometry getSelectedGeometry() throws DataException {
+
+        Geometry selectedGeometry = null;
+            if (this.selection != null && this.selection.getSelectedCount() == 1) {
+                DisposableIterator it = this.selection.fastIterator();
+                while (it.hasNext()) {
+                    Feature feature = (Feature) it.next();
+                    selectedGeometry = feature.getDefaultGeometry();
+                }
+                it.dispose();
+            }
+        return selectedGeometry;
+    }
+
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+        if (this.selection != null) {
+            try {
+                Geometry selectedGeometry = getSelectedGeometry();
+                List<Point> vertexesList;
+                vertexesList = getVertexesList(selectedGeometry);
+                if(vertexesList != null){
+                    if(selectedIndex<0){
+                        selectedIndex = getSelectedIndex(vertexesList);
+                    }
+                    Geometry modifiedGeometry = null;
+                    if (pointToMove != null) {
+                        if (selectedIndex >= 0) {
+                            modifiedGeometry =
+                                this.getModifiedGeometry(selectedGeometry,
+                                    selectedIndex, pointToMove);
+                        }
+                    } else if (action != null){
+                        if(action.equalsIgnoreCase("+")){
+                            modifiedGeometry =
+                                this.getInsertVertexGeometry(selectedGeometry, selectedIndex);
+
+                        } else if(action.equalsIgnoreCase("-")){
+                            modifiedGeometry = this.getRemovedVertexGeometry(selectedGeometry, selectedIndex);
+
+                        }
+                    }
+                    DisposableIterator it = null;
+
+                    try {
+                        it = selection.fastIterator();
+
+                        while (it.hasNext()) {
+                            Feature feature = (Feature) it.next();
+                            EditableFeature editableFeature =
+                                feature.getEditable();
+                            editableFeature.setDefaultGeometry(modifiedGeometry);
+                            ((EditingProviderServices) getProviderServices())
+                                .updateFeatureInFeatureStore(
+                                    editableFeature, featureStore);
+                        }
+                    } catch (BaseException e) {
+                        throw new FinishServiceException(e);
+                    } finally {
+                        DisposeUtils.disposeQuietly(it);
+                    }
+
+                }
+            } catch (BaseException e) {
+                throw new FinishServiceException(e);
+            }
+        }
+
+    }
+
+    private int getSelectedIndex(List<Point> vertexesList) {
+        int theSelectedIndex = -1;
+        if (vertexesList != null) {
+            int i = 0;
+            if (selectedVertex != null) {
+                for (Point point : vertexesList) {
+                    if (selectedVertex.equals(point)) {
+                        theSelectedIndex = i;
+                        break;
+                    }
+                    i++;
+                }
+            }
+        }
+        return theSelectedIndex;
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        FeatureSelection selected;
+        if (featureStore != null) {
+            try {
+                selected = featureStore.getFeatureSelection();
+                long selectedCount = selected.getSelectedCount();
+                if(selectedCount==1){
+                    this.selection = selected;
+                } else {
+                    selected.deselectAll();
+                }
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            }
+        }
+    }
+
+    public String getName() {
+        return EditVertexEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/EditVertexEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/EditVertexEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/EditVertexEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,91 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.editvertex;
+
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author fdiaz
+ *
+ */
+public class EditVertexEditingProviderFactory extends AbstractProviderFactory
+    implements EditingProviderFactory {
+
+    public static final String PROVIDER_NAME = "modify-edit-vertex";
+
+    private final static String PROVIDER_DESCRIPTION =
+        "Edit vertex";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, PROVIDER_DESCRIPTION,
+                false, null, new int[] { 
+                    Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE,
+                    Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                    Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, 
+                    Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE, 
+                    Geometry.TYPES.POINT, Geometry.TYPES.MULTIPOINT });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new EditVertexEditingProvider(services, parameters);
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject dynobject = super.createParameters();
+        dynobject.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return dynobject;
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/EditVertexEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/EditVertexEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/EditVertexEditingLibrary.java	(revision 1663)
@@ -0,0 +1,95 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.editvertex;
+
+
+//import org.gvsig.fmap.geom.Geometry.TYPES;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.Library;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.prov.editvertex.operation.ArcEditVertexOperation;
+import org.gvsig.vectorediting.lib.prov.editvertex.operation.CircleEditVertexOperation;
+import org.gvsig.vectorediting.lib.prov.editvertex.operation.CircumferenceEditVertexOperation;
+import org.gvsig.vectorediting.lib.prov.editvertex.operation.EditVertexOperationUtils;
+import org.gvsig.vectorediting.lib.prov.editvertex.operation.EllipseEditVertexOperation;
+import org.gvsig.vectorediting.lib.prov.editvertex.operation.FilledEllipseEditVertexOperation;
+import org.gvsig.vectorediting.lib.prov.editvertex.operation.FilledSplineEditVertexOperation;
+import org.gvsig.vectorediting.lib.prov.editvertex.operation.LineEditVertexOperation;
+import org.gvsig.vectorediting.lib.prov.editvertex.operation.PointEditVertexOperation;
+import org.gvsig.vectorediting.lib.prov.editvertex.operation.PolygonEditVertexOperation;
+import org.gvsig.vectorediting.lib.prov.editvertex.operation.SplineEditVertexOperation;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * @author fdiaz
+ *
+ */
+public class EditVertexEditingLibrary extends AbstractLibrary implements Library {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+    
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new EditVertexEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "modify-edit-vertex", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        EditVertexOperationUtils.register(new LineEditVertexOperation(), Geometry.TYPES.LINE);
+        EditVertexOperationUtils.register(new SplineEditVertexOperation(), Geometry.TYPES.SPLINE);
+        EditVertexOperationUtils.register(new ArcEditVertexOperation(), Geometry.TYPES.ARC);
+        EditVertexOperationUtils.register(new PolygonEditVertexOperation(), Geometry.TYPES.POLYGON);
+        EditVertexOperationUtils.register(new CircleEditVertexOperation(), Geometry.TYPES.CIRCLE);
+        EditVertexOperationUtils.register(new CircumferenceEditVertexOperation(), Geometry.TYPES.CIRCUMFERENCE);
+        EditVertexOperationUtils.register(new EllipseEditVertexOperation(), Geometry.TYPES.PERIELLIPSE);
+        EditVertexOperationUtils.register(new FilledSplineEditVertexOperation(), Geometry.TYPES.FILLEDSPLINE);
+        EditVertexOperationUtils.register(new FilledEllipseEditVertexOperation(), Geometry.TYPES.ELLIPSE);
+
+        EditVertexOperationUtils.register(new PointEditVertexOperation(), Geometry.TYPES.POINT);
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "modify-edit-vertex");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/CircleEditVertexOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/CircleEditVertexOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/CircleEditVertexOperation.java	(revision 1663)
@@ -0,0 +1,85 @@
+package org.gvsig.vectorediting.lib.prov.editvertex.operation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.primitive.Circle;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+public class CircleEditVertexOperation implements EditVertexOperation {
+
+    public CircleEditVertexOperation() {
+        // TODO Auto-generated constructor stub
+    }
+
+    public Geometry insertVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        return null;
+    }
+
+    public Geometry removeVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        return null;
+    }
+
+    public Geometry moveVertex(Primitive geom, int index, Point point) {
+        Circle result = (Circle) geom.cloneGeometry();
+        if(index == 0){
+            result.setPoints(point, ((Circle)geom).getRadious());
+        } else if (index == 1){
+            result.setPoints(((Circle)geom).getCenter(), point);
+        }
+        return result;
+    }
+
+    public List<Point> getVertexesList(Primitive geom) throws CreateGeometryException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        ArrayList<Point> vertexList = new ArrayList<Point>();
+        Circle circle = (Circle) geom;
+        Point center = circle.getCenter();
+        vertexList.add(center);
+        vertexList.add(geometryManager.createPoint(center.getX()
+            + circle.getRadious(), center.getY(), geom
+            .getGeometryType().getSubType()));
+
+        return vertexList;
+    }
+
+    public int getNumVertex(Primitive geom) {
+        return 2;
+    }
+
+    public boolean canInsertVertex(Primitive geom, int index) {
+        return false;
+    }
+
+    public boolean canRemoveVertex(Primitive geom, int index) {
+        return false;
+    }
+
+    public boolean canMoveVertex(int index, Point point) {
+        return true;
+    }
+
+    public void addToDrawingStatus(DefaultDrawingStatus drawingStatus,
+        Primitive primitive) {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol polygonSymbolEditing =
+            editingProviderManager.getSymbol("polygon-symbol-editing");
+        drawingStatus.addStatus(primitive, polygonSymbolEditing, "");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/CurveEditVertexOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/CurveEditVertexOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/CurveEditVertexOperation.java	(revision 1663)
@@ -0,0 +1,129 @@
+package org.gvsig.vectorediting.lib.prov.editvertex.operation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.primitive.GeneralPathX;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.OrientablePrimitive;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+public class CurveEditVertexOperation implements EditVertexOperation {
+
+    /**
+     *
+     */
+    public CurveEditVertexOperation() {
+        // TODO Auto-generated constructor stub
+    }
+
+    public Geometry insertVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        GeometryType geomType = geom.getGeometryType();
+        Line line = geometryManager.createLine(geomType.getSubType());
+        line.setGeneralPath((GeneralPathX) geom.getGeneralPath().clone());
+
+        if (index == 0) {
+            return line;
+        }
+
+        int numVertices = line.getNumVertices();
+        Line result = geometryManager.createLine(geomType.getSubType());
+
+        Point antPoint = null;
+        for (int i = 0; i < numVertices; i++) {
+            Point point = line.getVertex(i);
+            if (i == index) {
+                Point newPoint = geometryManager.createPoint(
+                    (point.getX() + antPoint.getX()) / 2,
+                    (point.getY() + antPoint.getY()) / 2, geomType.getSubType());
+                for(int j=2; j<geom.getDimension(); j++){
+                    newPoint.setCoordinateAt(i, (point.getCoordinateAt(i) + antPoint.getCoordinateAt(i)) / 2);
+                }
+
+                result.addVertex(newPoint);
+
+            }
+            result.addVertex(point);
+            antPoint = point;
+        }
+        return result;
+    }
+
+    public Geometry removeVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        Line result = geometryManager.createLine(geom.getGeometryType().getSubType());
+        result.setGeneralPath((GeneralPathX) geom.getGeneralPath().clone());
+        if (index < 0 || index>=result.getNumVertices()) {
+            return result;
+        }
+
+        result.removeVertex(index);
+        return result;
+    }
+
+    public Geometry moveVertex(Primitive geom, int index, Point point) throws CreateGeometryException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        Line result = geometryManager.createLine(geom.getGeometryType().getSubType());
+        result.setGeneralPath((GeneralPathX) geom.getGeneralPath().clone());
+        EditVertexOperationUtils.setVertex(result, index, point);
+        return result;
+    }
+
+    public List<Point> getVertexesList(Primitive geom) {
+        ArrayList<Point> vertexList = new ArrayList<Point>();
+        if (geom instanceof OrientablePrimitive) {
+            OrientablePrimitive orientable = (OrientablePrimitive) geom;
+            orientable.getNumVertices();
+            for (int i = 0; i < orientable.getNumVertices(); i++) {
+                vertexList.add(orientable.getVertex(i));
+            }
+        }
+        return vertexList;
+    }
+
+    public int getNumVertex(Primitive geom) {
+        if (geom instanceof OrientablePrimitive) {
+            OrientablePrimitive orientable = (OrientablePrimitive) geom;
+            return orientable.getNumVertices();
+        }
+        return 0;
+    }
+
+    public boolean canInsertVertex(Primitive geom, int index) {
+        if (index == 0) {
+            return false;
+        }
+        return true;
+    }
+
+    public boolean canRemoveVertex(Primitive geom, int index) {
+        return true;
+    }
+
+    public boolean canMoveVertex(int index, Point point) {
+        return true;
+    }
+
+    public void addToDrawingStatus(DefaultDrawingStatus drawingStatus,
+        Primitive primitive) {
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol lineSymbolEditing =
+            editingProviderManager.getSymbol("line-symbol-editing");
+        drawingStatus.addStatus(primitive, lineSymbolEditing, "");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/ArcEditVertexOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/ArcEditVertexOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/ArcEditVertexOperation.java	(revision 1663)
@@ -0,0 +1,185 @@
+package org.gvsig.vectorediting.lib.prov.editvertex.operation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+public class ArcEditVertexOperation implements EditVertexOperation {
+
+    public ArcEditVertexOperation() {
+        // TODO Auto-generated constructor stub
+    }
+
+    public Geometry insertVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        return null;
+    }
+
+    public Geometry removeVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        return null;
+    }
+
+    public Geometry moveVertex(Primitive geom, int index, Point point)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, CreateGeometryException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+
+        Arc arc = (Arc) geom;
+        Arc result = (Arc) arc.cloneGeometry();
+
+        Point center = result.getCenterPoint();
+        if(center == null){
+            Envelope envelope = arc.getEnvelope();
+            center = geometryManager.createPoint(envelope.getCenter(0), envelope.getCenter(1), geom.getGeometryType().getSubType());
+        }
+
+        Point initPoint = result.getInitPoint();
+        Point middlePoint = result.getMiddlePoint();
+        Point endPoint = result.getEndPoint();
+
+        double radius = center.distance(initPoint);
+
+        double angle = getAngle(center, point);
+
+        switch (index) {
+        case 0:
+            double dx = point.getX()-center.getX();
+            double dy = point.getY()-center.getY();
+            initPoint.setX(initPoint.getX()+dx);
+            initPoint.setY(initPoint.getY()+dy);
+            middlePoint.setX(middlePoint.getX()+dx);
+            middlePoint.setY(middlePoint.getY()+dy);
+            endPoint.setX(endPoint.getX()+dx);
+            endPoint.setY(endPoint.getY()+dy);
+            result.setPoints(initPoint, middlePoint, endPoint);
+
+            break;
+        case 1:
+            initPoint.setX(center.getX()+Math.cos(angle)*radius);
+            initPoint.setY(center.getY()+Math.sin(angle)*radius);
+            result.setPoints(initPoint, middlePoint, endPoint);
+
+            break;
+        case 2:
+            endPoint.setX(center.getX()+Math.cos(angle)*radius);
+            endPoint.setY(center.getY()+Math.sin(angle)*radius);
+            result.setPoints(initPoint, middlePoint, endPoint);
+            break;
+
+        case 3:
+            middlePoint.setX(center.getX()+Math.cos(angle)*radius);
+            middlePoint.setY(center.getY()+Math.sin(angle)*radius);
+            result.setPoints(initPoint, middlePoint, endPoint);
+            break;
+        default:
+            break;
+        }
+
+        return result;
+    }
+
+    public List<Point> getVertexesList(Primitive geom) throws CreateGeometryException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        ArrayList<Point> vertexList = new ArrayList<Point>();
+        Arc arc = (Arc) geom;
+
+        Point center = arc.getCenterPoint();
+        if(center == null){
+            Envelope envelope = arc.getEnvelope();
+            center = geometryManager.createPoint(envelope.getCenter(0), envelope.getCenter(1), geom.getGeometryType().getSubType());
+        }
+        vertexList.add(center);
+
+        vertexList.add(arc.getInitPoint());
+        vertexList.add(arc.getEndPoint());
+        vertexList.add(arc.getMiddlePoint());
+        return vertexList;
+    }
+
+    public int getNumVertex(Primitive geom) {
+        return 4;
+    }
+
+    public boolean canInsertVertex(Primitive geom, int index) {
+        return false;
+    }
+
+    public boolean canRemoveVertex(Primitive geom, int index) {
+        return false;
+    }
+
+    public boolean canMoveVertex(int index, Point point) {
+        return true;
+    }
+
+    public double getAngle(Point start, Point end)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+        double angle =
+            Math.acos((end.getX() - start.getX()) / start.distance(end));
+
+        if (start.getY() > end.getY()) {
+            angle = -angle;
+        }
+
+        if (angle < 0) {
+            angle += (2 * Math.PI);
+        }
+
+        return angle;
+    }
+
+    public void addToDrawingStatus(DefaultDrawingStatus drawingStatus,
+        Primitive primitive) throws CreateGeometryException,
+        GeometryOperationNotSupportedException, GeometryOperationException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol auxiliaryLineSymbolEditing =
+            editingProviderManager.getSymbol("auxiliary-line-symbol-editing");
+        ISymbol lineSymbolEditing =
+            editingProviderManager.getSymbol("line-symbol-editing");
+        ISymbol pointSymbolEditing =
+            editingProviderManager.getSymbol("point-symbol-editing");
+        Arc arc = (Arc)primitive;
+
+        Point center = arc.getCenterPoint();
+        if(center == null){
+            Envelope envelope = arc.getEnvelope();
+            center = geometryManager.createPoint(envelope.getCenter(0), envelope.getCenter(1), primitive.getGeometryType().getSubType());
+        }
+
+        Line auxLine = geometryManager.createLine(primitive.getGeometryType().getSubType());
+        auxLine.setPoints(center,arc.getInitPoint());
+        drawingStatus.addStatus(auxLine, auxiliaryLineSymbolEditing, "");
+
+        Line auxLine2 = geometryManager.createLine(primitive.getGeometryType().getSubType());
+        auxLine2.setPoints(center,arc.getEndPoint());
+        drawingStatus.addStatus(auxLine2, auxiliaryLineSymbolEditing, "");
+        Line auxLine3 = geometryManager.createLine(primitive.getGeometryType().getSubType());
+        auxLine3.setPoints(center,arc.getMiddlePoint());
+        drawingStatus.addStatus(auxLine3, auxiliaryLineSymbolEditing, "");
+        drawingStatus.addStatus(arc.getInitPoint(), pointSymbolEditing, "");
+        drawingStatus.addStatus(arc.getEndPoint(), pointSymbolEditing, "");
+        drawingStatus.addStatus(arc.getMiddlePoint(), pointSymbolEditing, "");
+
+        drawingStatus.addStatus(primitive, lineSymbolEditing, "");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/LineEditVertexOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/LineEditVertexOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/LineEditVertexOperation.java	(revision 1663)
@@ -0,0 +1,137 @@
+package org.gvsig.vectorediting.lib.prov.editvertex.operation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.OrientablePrimitive;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * @author fdiaz
+ *
+ */
+public class LineEditVertexOperation implements EditVertexOperation {
+
+    /**
+     *
+     */
+    public LineEditVertexOperation() {
+        // TODO Auto-generated constructor stub
+    }
+
+    public Geometry insertVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        if (index == 0) {
+            return geom;
+        }
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        GeometryType geomType = geom.getGeometryType();
+        Line result =
+            geometryManager.createLine(geomType.getSubType());
+
+        Line line = (Line) geom;
+        int numVertices = line.getNumVertices();
+
+        Point antPoint = null;
+        for (int i = 0; i < numVertices; i++) {
+            Point point = line.getVertex(i);
+            if (i == index) {
+                Point newPoint = geometryManager.createPoint(
+                    (point.getX() + antPoint.getX()) / 2,
+                    (point.getY() + antPoint.getY()) / 2, geomType.getSubType());
+                for(int j=2; j<geom.getDimension(); j++){
+                    newPoint.setCoordinateAt(j, (point.getCoordinateAt(j) + antPoint.getCoordinateAt(j)) / 2);
+                }
+                result.addVertex(newPoint);
+
+            }
+            result.addVertex(point);
+            antPoint = point;
+        }
+        return result;
+    }
+
+    public Geometry removeVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        if (index < 0) {
+            return geom;
+        }
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        Line result =
+            geometryManager.createLine(geom.getGeometryType().getSubType());
+
+        Line line = (Line) geom;
+        int numVertices = line.getNumVertices();
+
+        for (int i = 0; i < numVertices; i++) {
+            Point point = line.getVertex(i);
+            if (i == index) {
+                continue;
+            }
+            result.addVertex(point);
+        }
+        return result;
+    }
+
+    public Geometry moveVertex(Primitive geom, int index, Point point) {
+        Line result = (Line) geom.cloneGeometry();
+        EditVertexOperationUtils.setVertex(result, index, point);
+        return result;
+    }
+
+    public List<Point> getVertexesList(Primitive geom) {
+        ArrayList<Point> vertexList = new ArrayList<Point>();
+        if (geom instanceof OrientablePrimitive) {
+            OrientablePrimitive orientable = (OrientablePrimitive) geom;
+            orientable.getNumVertices();
+            for (int i = 0; i < orientable.getNumVertices(); i++) {
+                vertexList.add(orientable.getVertex(i));
+            }
+        }
+        return vertexList;
+    }
+
+    public int getNumVertex(Primitive geom) {
+        if (geom instanceof OrientablePrimitive) {
+            OrientablePrimitive orientable = (OrientablePrimitive) geom;
+            return orientable.getNumVertices();
+        }
+        return 0;
+    }
+
+    public boolean canInsertVertex(Primitive geom, int index) {
+        if (index == 0) {
+            return false;
+        }
+        return true;
+    }
+
+    public boolean canRemoveVertex(Primitive geom, int index) {
+        return true;
+    }
+
+    public boolean canMoveVertex(int index, Point point) {
+        return true;
+    }
+
+    public void addToDrawingStatus(DefaultDrawingStatus drawingStatus,
+        Primitive primitive) {
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol lineSymbolEditing =
+            editingProviderManager.getSymbol("line-symbol-editing");
+        drawingStatus.addStatus(primitive, lineSymbolEditing, "");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/PolygonEditVertexOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/PolygonEditVertexOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/PolygonEditVertexOperation.java	(revision 1663)
@@ -0,0 +1,295 @@
+package org.gvsig.vectorediting.lib.prov.editvertex.operation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.primitive.OrientablePrimitive;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Polygon;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.geom.primitive.Ring;
+import org.gvsig.fmap.geom.primitive.Surface;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * @author fdiaz
+ *
+ */
+public class PolygonEditVertexOperation implements EditVertexOperation {
+
+    /**
+     *
+     */
+    public PolygonEditVertexOperation() {
+        // TODO Auto-generated constructor stub
+    }
+
+    @Override
+    public Geometry insertVertex(Primitive geom, int index) throws CreateGeometryException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+
+        Polygon polygon = (Polygon) geom.cloneGeometry();
+        int numVertices = polygon.getNumVertices();
+        if (index < 0) {
+            return polygon;
+        }
+        if (index >= numVertices) {
+            if (geom instanceof Surface) {
+                Surface sgeom = (Surface) geom.cloneGeometry();
+                int count = 0; // id incremental from rings
+                int dif = index - sgeom.getNumVertices(); // id inside rings
+                for (int i = 0; i < sgeom.getNumInteriorRings(); i++) {
+                    Ring ring = sgeom.getInteriorRing(i);
+                    if ((count + ring.getNumVertices()) > dif) {
+                        int positionIndexRing = dif - count;
+                        numVertices = ring.getNumVertices();
+                        int indexToInsert = positionIndexRing;
+                        Point antVertex = ring.getVertex(numVertices - 1);
+                        if (positionIndexRing == 0 && ring.getVertex(0).equals(antVertex)) {
+                            indexToInsert = numVertices - 1;
+                        }
+
+                        if (indexToInsert != 0) {
+                            antVertex = ring.getVertex(indexToInsert - 1);
+                        }
+                        Point point = ring.getVertex(indexToInsert);
+                        GeometryType geomType = ring.getGeometryType();
+                        Point newPoint = geometryManager.createPoint((point.getX() + antVertex.getX()) / 2,
+                                (point.getY() + antVertex.getY()) / 2, geomType.getSubType());
+
+                        for (int ri = 2; ri < ring.getDimension(); ri++) {
+                            newPoint.setCoordinateAt(ri, (point.getCoordinateAt(ri) + antVertex.getCoordinateAt(ri)) / 2);
+                        }
+
+                        ring.insertVertex(indexToInsert, newPoint);
+                        return sgeom;
+
+                    } else {
+                        count = count + ring.getNumVertices();
+                    }
+                }
+            }
+        
+        }
+        int indexToInsert = index;
+        Point antVertex = polygon.getVertex(numVertices - 1);
+        if (index == 0 && polygon.getVertex(0).equals(antVertex)) {
+            indexToInsert = numVertices - 1;
+        }
+
+        if (indexToInsert!=0){
+            antVertex = polygon.getVertex(indexToInsert - 1);
+        }
+        Point point = polygon.getVertex(indexToInsert);
+        GeometryType geomType = geom.getGeometryType();
+        Point newPoint = geometryManager.createPoint((point.getX() + antVertex.getX()) / 2,
+            (point.getY() + antVertex.getY()) / 2, geomType.getSubType());
+
+        for(int i=2; i<geom.getDimension(); i++){
+            newPoint.setCoordinateAt(i, (point.getCoordinateAt(i) + antVertex.getCoordinateAt(i)) / 2);
+        }
+
+        polygon.insertVertex(indexToInsert, newPoint);
+        return polygon;
+    }
+
+    @Override
+    public Geometry removeVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        Polygon polygon = (Polygon) geom.cloneGeometry();
+        int numVertices = polygon.getNumVertices();
+        if (index < 0) { 
+            return polygon;
+        }
+        if (index >= numVertices) {
+            if (geom instanceof Surface) {
+                Surface sgeom = (Surface) geom.cloneGeometry();
+                int count = 0; // id incremental from rings
+                int dif = index - sgeom.getNumVertices(); // id inside rings
+                for (int i = 0; i < sgeom.getNumInteriorRings(); i++) {
+                    Ring ring = sgeom.getInteriorRing(i);
+                    if ((count + ring.getNumVertices()) > dif) {
+                        if (ring.getNumVertices() <= 4) {
+                            sgeom.removeInteriorRing(i);
+                            return sgeom;
+                        } else {
+                            int positionIndexRing = dif-count;
+                            ring.removeVertex(positionIndexRing);
+                            if (count == dif) {
+                                ring.removeVertex(ring.getNumVertices() - 1);
+                            } else if (count + ring.getNumVertices() == dif) {
+                                ring.removeVertex(0);
+                            }
+                        }
+
+                        return sgeom;
+                    } else {
+                        count = count + ring.getNumVertices();
+                    }
+                }
+            }
+        }
+
+        if (polygon.getVertex(0).equals(polygon.getVertex(numVertices - 1))) {
+            if (numVertices <= 4) {
+                return polygon;
+            }
+            if(index == 0 || index == numVertices - 1){
+                polygon.removeVertex(numVertices - 1);
+                polygon.removeVertex(0);
+                polygon.addVertex(polygon.getVertex(0));
+                numVertices --;
+
+                return polygon;
+            }
+            numVertices--;
+        } else {
+            if (numVertices <= 3) {
+                return polygon;
+            }
+        }
+        polygon.removeVertex(index);
+
+        return polygon;
+    }
+
+    @Override
+    public Geometry moveVertex(Primitive geom, int index, Point point) {
+        Polygon result = (Polygon) geom.cloneGeometry();
+        int numVertices = result.getNumVertices();
+        if (index < result.getNumVertices()) {
+            if (result.getVertex(0).equals(result.getVertex(numVertices - 1))) {
+                if (index == 0 || index == (result.getNumVertices() - 1)) {
+                    EditVertexOperationUtils.setVertex(result, 0, point);
+                    EditVertexOperationUtils.setVertex(result,
+                            result.getNumVertices() - 1, (Point) point.cloneGeometry());
+                    return result;
+                }
+            }
+            EditVertexOperationUtils.setVertex(result, index, point);
+            return result;
+        }
+        if (geom instanceof Surface) {
+            Surface sgeom = (Surface) geom;
+            int count = 0;
+            int dif = index - sgeom.getNumVertices();
+            for (int i = 0; i < sgeom.getNumInteriorRings(); i++) {
+                Ring ring = sgeom.getInteriorRing(i);
+                if ((count + ring.getNumVertices()) > dif) {
+                    EditVertexOperationUtils.setVertex(sgeom, index, point);
+                    int positionIndexRing = sgeom.getNumVertices() + count;
+                    if (count == dif) {
+                        EditVertexOperationUtils.setVertex(sgeom, positionIndexRing + ring.getNumVertices() - 1, (Point) point.cloneGeometry());
+                    } else if (count + ring.getNumVertices() == dif) {
+                        {
+                            EditVertexOperationUtils.setVertex(sgeom, positionIndexRing - ring.getNumVertices() - 1, (Point) point.cloneGeometry());
+                        }
+                    }
+                    return sgeom;
+                } else {
+                    count = count + ring.getNumVertices();
+                }
+            }
+        }
+        return result;
+    }
+
+    @Override
+    public List<Point> getVertexesList(Primitive geom) {
+        ArrayList<Point> vertexList = new ArrayList<Point>();
+        if (geom instanceof OrientablePrimitive) {
+            OrientablePrimitive orientable = (OrientablePrimitive) geom;
+            orientable.getNumVertices();
+            for (int i = 0; i < orientable.getNumVertices(); i++) {
+                vertexList.add(orientable.getVertex(i));
+            }
+            if  (geom instanceof Surface) {
+                Surface surface = (Surface) geom;
+                if (surface.getNumInteriorRings()>0) {
+                    for (int i = 0; i < surface.getNumInteriorRings(); i++) {
+                        Ring iRing = surface.getInteriorRing(i);
+                        for (int ri = 0; ri < iRing.getNumVertices();ri++){
+                            vertexList.add(iRing.getVertex(ri));
+                        }
+                    }
+
+                    
+                }
+            }
+            
+        }
+        return vertexList;
+    }
+
+    @Override
+    public int getNumVertex(Primitive geom) {
+        if (geom instanceof OrientablePrimitive) {
+            OrientablePrimitive orientable = (OrientablePrimitive) geom;
+            int totalVertices = orientable.getNumVertices();
+            if  (geom instanceof Surface) {
+                Surface surface = (Surface) geom;
+                if (surface.getNumInteriorRings()>0) {
+                    for (int i = 0; i < surface.getNumInteriorRings(); i++) {
+                        Ring iRing = surface.getInteriorRing(i);
+                        totalVertices = totalVertices + iRing.getNumVertices();
+                    }
+                }
+            }
+            return totalVertices;
+            
+        }
+        return 0;
+    }
+
+    @Override
+    public boolean canInsertVertex(Primitive geom, int index) {
+        return true;
+    }
+
+    @Override
+    public boolean canRemoveVertex(Primitive geom, int index) {
+
+            Polygon polygon = (Polygon) geom;
+            int numVertices = polygon.getNumVertices();
+            if (index < 0) {
+                return false;
+            } else if (index >= numVertices) {
+                return true; // asumimos que tiene anillos
+            }
+            if (polygon.getVertex(0).equals(polygon.getVertex(numVertices - 1))) {
+                if (numVertices <= 4) {
+                    return false;
+                }
+            } else {
+                if (numVertices <= 3) {
+                    return false;
+                }
+            }
+            return true;
+        
+    }
+
+    @Override
+    public boolean canMoveVertex(int index, Point point) {
+        return true;
+    }
+
+    @Override
+    public void addToDrawingStatus(DefaultDrawingStatus drawingStatus,
+        Primitive primitive) {
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol polygonSymbolEditing =
+            editingProviderManager.getSymbol("polygon-symbol-editing");
+        drawingStatus.addStatus(primitive, polygonSymbolEditing, "");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/PointEditVertexOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/PointEditVertexOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/PointEditVertexOperation.java	(revision 1663)
@@ -0,0 +1,82 @@
+package org.gvsig.vectorediting.lib.prov.editvertex.operation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * @author fdiaz
+ *
+ */
+public class PointEditVertexOperation implements EditVertexOperation {
+
+    /**
+     *
+     */
+    public PointEditVertexOperation() {
+        // TODO Auto-generated constructor stub
+    }
+
+    public Geometry insertVertex(Primitive geom, int index) throws CreateGeometryException {
+        return geom;
+    }
+
+    public Geometry removeVertex(Primitive geom, int index) throws CreateGeometryException {
+        return geom;
+    }
+
+    public Geometry moveVertex(Primitive geom, int index, Point point) {
+        if(index!=0) {
+            return geom;
+        }
+        Point p = ((Point)geom);
+        int min = point.getDimension() < p.getDimension() ? point.getDimension() : p.getDimension();
+        for (int i = 0; i < min; i++) {
+            p.setCoordinateAt(i, point.getCoordinateAt(i));
+        }
+        return p;
+    }
+
+    public List<Point> getVertexesList(Primitive geom) {
+        ArrayList<Point> vertexList = new ArrayList<Point>();
+        if (geom instanceof Point) {
+            Point point = (Point) geom;
+            vertexList.add(point);
+        }
+        return vertexList;
+    }
+
+    public int getNumVertex(Primitive geom) {
+        return 1;
+    }
+
+    public boolean canInsertVertex(Primitive geom, int index) {
+        return false;
+    }
+
+    public boolean canRemoveVertex(Primitive geom, int index) {
+        return false;
+    }
+
+    public boolean canMoveVertex(int index, Point point) {
+        return true;
+    }
+
+    public void addToDrawingStatus(DefaultDrawingStatus drawingStatus,
+        Primitive primitive) {
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol pointSymbolEditing =
+            editingProviderManager.getSymbol("point-symbol-editing");
+        drawingStatus.addStatus(primitive, pointSymbolEditing, "");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/CircumferenceEditVertexOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/CircumferenceEditVertexOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/CircumferenceEditVertexOperation.java	(revision 1663)
@@ -0,0 +1,82 @@
+package org.gvsig.vectorediting.lib.prov.editvertex.operation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.primitive.Circumference;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+public class CircumferenceEditVertexOperation implements EditVertexOperation {
+
+    public CircumferenceEditVertexOperation() {
+        // TODO Auto-generated constructor stub
+    }
+
+    public Geometry insertVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        return null;
+    }
+
+    public Geometry removeVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        return null;
+    }
+
+    public Geometry moveVertex(Primitive geom, int index, Point point) {
+        Circumference result = (Circumference) geom.cloneGeometry();
+        if(index == 0){
+            result.setPoints(point, ((Circumference)geom).getRadious());
+        } else if (index == 1){
+            result.setPoints(((Circumference)geom).getCenter(), point);
+        }
+        return result;
+    }
+
+    public List<Point> getVertexesList(Primitive geom) throws CreateGeometryException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        ArrayList<Point> vertexList = new ArrayList<Point>();
+        Circumference circumference = (Circumference) geom;
+        Point center = circumference.getCenter();
+        vertexList.add(center);
+        vertexList.add(geometryManager.createPoint(center.getX()
+            + circumference.getRadious(), center.getY(), geom
+            .getGeometryType().getSubType()));
+
+        return vertexList;
+    }
+
+    public int getNumVertex(Primitive geom) {
+        return 2;
+    }
+
+    public boolean canInsertVertex(Primitive geom, int index) {
+        return false;
+    }
+
+    public boolean canRemoveVertex(Primitive geom, int index) {
+        return false;
+    }
+
+    public boolean canMoveVertex(int index, Point point) {
+        return true;
+    }
+
+    public void addToDrawingStatus(DefaultDrawingStatus drawingStatus,
+        Primitive primitive) {
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol lineSymbolEditing =
+            editingProviderManager.getSymbol("line-symbol-editing");
+        drawingStatus.addStatus(primitive, lineSymbolEditing, "");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/FilledSplineEditVertexOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/FilledSplineEditVertexOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/FilledSplineEditVertexOperation.java	(revision 1663)
@@ -0,0 +1,174 @@
+package org.gvsig.vectorediting.lib.prov.editvertex.operation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.primitive.FilledSpline;
+import org.gvsig.fmap.geom.primitive.OrientablePrimitive;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.geom.type.GeometryTypeNotSupportedException;
+import org.gvsig.fmap.geom.type.GeometryTypeNotValidException;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * @author fdiaz
+ *
+ */
+public class FilledSplineEditVertexOperation implements EditVertexOperation {
+
+    /**
+     *
+     */
+    public FilledSplineEditVertexOperation() {
+        // TODO Auto-generated constructor stub
+    }
+
+    public Geometry insertVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        GeometryType geomType = geom.getGeometryType();
+        FilledSpline result =
+            (FilledSpline) geometryManager.create(Geometry.TYPES.FILLEDSPLINE,geomType.getSubType());
+
+        FilledSpline filledSpline = (FilledSpline) geom;
+        int numVertices = filledSpline.getNumVertices();
+
+
+        double[][] values = new double[geom.getDimension()][numVertices];
+        for (int v = 0; v < numVertices; v++) {
+            for (int d = 0; d < filledSpline.getDimension(); d++) {
+                values[d][v] = filledSpline.getCoordinateAt(v, d);
+            }
+        }
+        int auxIndex = index;
+        if(index==0) {
+            auxIndex = numVertices-1;
+        }
+
+        for (int i = 0; i < numVertices; i++) {
+            Point point = filledSpline.getVertex(i);
+            if (i > 0 && i == auxIndex) {
+                Point newPoint;
+                try {
+                    newPoint = (Point) geometryManager.create(geometryManager.getGeometryType(Geometry.TYPES.POINT, geomType.getSubType()));
+                } catch (GeometryTypeNotSupportedException | GeometryTypeNotValidException e) {
+                    throw new CreateGeometryException(Geometry.TYPES.POINT, geomType.getSubType(), e);
+                }
+
+                SplineCalculator splineDim;
+                for(int d=0; d<geom.getDimension(); d++){
+
+                    splineDim = new SplineCalculator(values[d]);
+                    newPoint.setCoordinateAt(d, splineDim.fn(i-1, 0.5));
+
+                }
+
+                result.addVertex(newPoint);
+            }
+            result.addVertex(point);
+        }
+        return result;
+    }
+
+    public Geometry removeVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        org.gvsig.fmap.geom.primitive.FilledSpline filledSpline = (org.gvsig.fmap.geom.primitive.FilledSpline) geom.cloneGeometry();
+
+        if (index < 0) {
+            return filledSpline;
+        }
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+
+        int numVertices = filledSpline.getNumVertices();
+        if (index >= numVertices){
+            return filledSpline;
+        }
+
+        if (filledSpline.getVertex(0).equals(filledSpline.getVertex(numVertices - 1))) {
+            if (numVertices <= 4) {
+                return filledSpline;
+            }
+            if(index == 0 || index == numVertices - 1){
+                filledSpline.removeVertex(numVertices - 1);
+                filledSpline.removeVertex(0);
+                filledSpline.addVertex(filledSpline.getVertex(0));
+                numVertices --;
+
+                return filledSpline;
+            }
+            numVertices--;
+        } else {
+            if (numVertices <= 3) {
+                return filledSpline;
+            }
+        }
+        filledSpline.removeVertex(index);
+        return filledSpline;
+    }
+
+    public Geometry moveVertex(Primitive geom, int index, Point point) {
+        FilledSpline result = (FilledSpline) geom.cloneGeometry();
+        int numVertices = result.getNumVertices();
+        if (result.getVertex(0).equals(result.getVertex(numVertices - 1))) {
+            if (index == 0 || index == (result.getNumVertices() - 1)) {
+                EditVertexOperationUtils.setVertex(result, 0, point);
+                EditVertexOperationUtils.setVertex(result,
+                    result.getNumVertices() - 1, (Point)point.cloneGeometry());
+                return result;
+            }
+        }
+        EditVertexOperationUtils.setVertex(result, index, point);
+        return result;
+    }
+
+    public List<Point> getVertexesList(Primitive geom) {
+        ArrayList<Point> vertexList = new ArrayList<Point>();
+        if (geom instanceof OrientablePrimitive) {
+            OrientablePrimitive orientable = (OrientablePrimitive) geom;
+            orientable.getNumVertices();
+            for (int i = 0; i < orientable.getNumVertices(); i++) {
+                vertexList.add(orientable.getVertex(i));
+            }
+        }
+        return vertexList;
+    }
+
+    public int getNumVertex(Primitive geom) {
+        if (geom instanceof OrientablePrimitive) {
+            OrientablePrimitive orientable = (OrientablePrimitive) geom;
+            return orientable.getNumVertices();
+        }
+        return 0;
+    }
+
+    public boolean canInsertVertex(Primitive geom, int index) {
+        return true;
+    }
+
+    public boolean canRemoveVertex(Primitive geom, int index) {
+        return true;
+    }
+
+    public boolean canMoveVertex(int index, Point point) {
+        return true;
+    }
+
+    public void addToDrawingStatus(DefaultDrawingStatus drawingStatus,
+        Primitive primitive) {
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol lineSymbolEditing =
+            editingProviderManager.getSymbol("polygon-symbol-editing");
+        drawingStatus.addStatus(primitive, lineSymbolEditing, "");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/SplineEditVertexOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/SplineEditVertexOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/SplineEditVertexOperation.java	(revision 1663)
@@ -0,0 +1,150 @@
+package org.gvsig.vectorediting.lib.prov.editvertex.operation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.primitive.OrientablePrimitive;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.geom.type.GeometryTypeNotSupportedException;
+import org.gvsig.fmap.geom.type.GeometryTypeNotValidException;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * @author fdiaz
+ *
+ */
+public class SplineEditVertexOperation implements EditVertexOperation {
+
+    /**
+     *
+     */
+    public SplineEditVertexOperation() {
+        // TODO Auto-generated constructor stub
+    }
+
+    public Geometry insertVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        if (index == 0) {
+            return geom;
+        }
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        GeometryType geomType = geom.getGeometryType();
+        org.gvsig.fmap.geom.primitive.Spline result =
+            (org.gvsig.fmap.geom.primitive.Spline) geometryManager.create(Geometry.TYPES.SPLINE,geomType.getSubType());
+
+        org.gvsig.fmap.geom.primitive.Spline spline = (org.gvsig.fmap.geom.primitive.Spline) geom;
+        int numVertices = spline.getNumVertices();
+
+        double[][] values = new double[geom.getDimension()][numVertices];
+        for (int v = 0; v < numVertices; v++) {
+            for (int d = 0; d < spline.getDimension(); d++) {
+                values[d][v] = spline.getCoordinateAt(v, d);
+            }
+        }
+
+        for (int i = 0; i < numVertices; i++) {
+            Point point = spline.getVertex(i);
+            if (i>0 && i == index) {
+                Point newPoint;
+                try {
+                    newPoint = (Point) geometryManager.create(geometryManager.getGeometryType(Geometry.TYPES.POINT, geomType.getSubType()));
+                } catch (GeometryTypeNotSupportedException | GeometryTypeNotValidException e) {
+                    throw new CreateGeometryException(Geometry.TYPES.POINT, geomType.getSubType(), e);
+                }
+
+                SplineCalculator splineDim;
+                for(int d=0; d<geom.getDimension(); d++){
+
+                    splineDim = new SplineCalculator(values[d]);
+                    newPoint.setCoordinateAt(d, splineDim.fn(i-1, 0.5));
+
+                }
+
+                result.addVertex(newPoint);
+            }
+            result.addVertex(point);
+        }
+        return result;
+    }
+
+    public Geometry removeVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        if (index < 0) {
+            return geom;
+        }
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        org.gvsig.fmap.geom.primitive.Spline result =
+            (org.gvsig.fmap.geom.primitive.Spline) geometryManager.create(Geometry.TYPES.SPLINE,geom.getGeometryType().getSubType());
+
+        org.gvsig.fmap.geom.primitive.Spline spline = (org.gvsig.fmap.geom.primitive.Spline) geom;
+        int numVertices = spline.getNumVertices();
+
+        for (int i = 0; i < numVertices; i++) {
+            Point point = spline.getVertex(i);
+            if (i == index) {
+                continue;
+            }
+            result.addVertex(point);
+        }
+        return result;
+    }
+
+    public Geometry moveVertex(Primitive geom, int index, Point point) {
+        org.gvsig.fmap.geom.primitive.Spline result = (org.gvsig.fmap.geom.primitive.Spline) geom.cloneGeometry();
+        EditVertexOperationUtils.setVertex(result, index, point);
+        return result;
+    }
+
+    public List<Point> getVertexesList(Primitive geom) {
+        ArrayList<Point> vertexList = new ArrayList<Point>();
+        if (geom instanceof OrientablePrimitive) {
+            OrientablePrimitive orientable = (OrientablePrimitive) geom;
+            orientable.getNumVertices();
+            for (int i = 0; i < orientable.getNumVertices(); i++) {
+                vertexList.add(orientable.getVertex(i));
+            }
+        }
+        return vertexList;
+    }
+
+    public int getNumVertex(Primitive geom) {
+        if (geom instanceof OrientablePrimitive) {
+            OrientablePrimitive orientable = (OrientablePrimitive) geom;
+            return orientable.getNumVertices();
+        }
+        return 0;
+    }
+
+    public boolean canInsertVertex(Primitive geom, int index) {
+        if (index == 0) {
+            return false;
+        }
+        return true;
+    }
+
+    public boolean canRemoveVertex(Primitive geom, int index) {
+        return true;
+    }
+
+    public boolean canMoveVertex(int index, Point point) {
+        return true;
+    }
+
+    public void addToDrawingStatus(DefaultDrawingStatus drawingStatus,
+        Primitive primitive) {
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol lineSymbolEditing =
+            editingProviderManager.getSymbol("line-symbol-editing");
+        drawingStatus.addStatus(primitive, lineSymbolEditing, "");
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/EllipseEditVertexOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/EllipseEditVertexOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/EllipseEditVertexOperation.java	(revision 1663)
@@ -0,0 +1,155 @@
+package org.gvsig.vectorediting.lib.prov.editvertex.operation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.PeriEllipse;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+public class EllipseEditVertexOperation implements EditVertexOperation {
+
+    public EllipseEditVertexOperation() {
+        // TODO Auto-generated constructor stub
+    }
+
+    public Geometry insertVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        return null;
+    }
+
+    public Geometry removeVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        return null;
+    }
+
+    public Geometry moveVertex(Primitive geom, int index, Point point) throws CreateGeometryException, GeometryOperationNotSupportedException, GeometryOperationException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        PeriEllipse original = (PeriEllipse)geom;
+        PeriEllipse result = (PeriEllipse) original.cloneGeometry();
+        if(index == 0){
+            result.setPoints(point, original.getAxis1End(), original.getAxis2Dist());
+        } else if (index == 1){
+            result.setPoints(original.getAxis1Start(), point, original.getAxis2Dist());
+        } else if (index == 2){
+            Point axis1Start = original.getAxis1Start();
+            Point axis1End = original.getAxis1End();
+            Point center = geometryManager.createPoint(
+                (axis1Start.getX()+axis1End.getX())/2,
+                (axis1Start.getY()+axis1End.getY())/2,
+                geom.getGeometryType().getSubType());
+            result.setPoints(original.getAxis1Start(), original.getAxis1End(), center.distance(point));
+        }
+        return result;
+    }
+
+    public List<Point> getVertexesList(Primitive geom) throws CreateGeometryException, GeometryOperationNotSupportedException, GeometryOperationException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        ArrayList<Point> vertexList = new ArrayList<Point>();
+        PeriEllipse ellipse = (PeriEllipse) geom;
+        Point axis1Start = ellipse.getAxis1Start();
+        vertexList.add(axis1Start);
+        Point axis1End = ellipse.getAxis1End();
+        vertexList.add(axis1End);
+        Point center = geometryManager.createPoint(
+            (axis1Start.getX()+axis1End.getX())/2,
+            (axis1Start.getY()+axis1End.getY())/2,
+            geom.getGeometryType().getSubType());
+
+        double angle = getAngle(axis1Start, axis1End);
+
+        vertexList.add(geometryManager.createPoint(
+            center.getX() + ellipse.getAxis2Dist()*Math.cos(angle+Math.PI/2),
+            center.getY() + ellipse.getAxis2Dist()*Math.sin(angle+Math.PI/2),
+            geom.getGeometryType().getSubType()));
+
+        return vertexList;
+    }
+
+    public int getNumVertex(Primitive geom) {
+        return 3;
+    }
+
+    public boolean canInsertVertex(Primitive geom, int index) {
+        return false;
+    }
+
+    public boolean canRemoveVertex(Primitive geom, int index) {
+        return false;
+    }
+
+    public boolean canMoveVertex(int index, Point point) {
+        return true;
+    }
+
+    public double getAngle(Point start, Point end)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+        double angle =
+            Math.acos((end.getX() - start.getX()) / start.distance(end));
+
+        if (start.getY() > end.getY()) {
+            angle = -angle;
+        }
+
+        if (angle < 0) {
+            angle += (2 * Math.PI);
+        }
+
+        return angle;
+    }
+
+    public void addToDrawingStatus(DefaultDrawingStatus drawingStatus,
+        Primitive primitive) throws CreateGeometryException, GeometryOperationNotSupportedException, GeometryOperationException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol auxiliaryLineSymbolEditing =
+            editingProviderManager.getSymbol("auxiliary-line-symbol-editing");
+        ISymbol lineSymbolEditing =
+            editingProviderManager.getSymbol("line-symbol-editing");
+        PeriEllipse ellipse = (PeriEllipse)primitive;
+        Point axis1Start = ellipse.getAxis1Start();
+        Point axis1End = ellipse.getAxis1End();
+        Line axis1Line = geometryManager.createLine(primitive.getGeometryType().getSubType());
+        axis1Line.setPoints(axis1Start,axis1End);
+        drawingStatus.addStatus(axis1Line, auxiliaryLineSymbolEditing, "");
+
+        Line axis2Line = geometryManager.createLine(primitive.getGeometryType().getSubType());
+
+        Point center = geometryManager.createPoint(
+            (axis1Start.getX()+axis1End.getX())/2,
+            (axis1Start.getY()+axis1End.getY())/2,
+            primitive.getGeometryType().getSubType());
+
+        double angle = getAngle(axis1Start, axis1End);
+
+        Point axis2Point1 = geometryManager.createPoint(
+        center.getX() + ellipse.getAxis2Dist()*Math.cos(angle+Math.PI/2),
+        center.getY() + ellipse.getAxis2Dist()*Math.sin(angle+Math.PI/2),
+        primitive.getGeometryType().getSubType());
+
+        Point axis2Point2 = geometryManager.createPoint(
+        center.getX() - ellipse.getAxis2Dist()*Math.cos(angle+Math.PI/2),
+        center.getY() - ellipse.getAxis2Dist()*Math.sin(angle+Math.PI/2),
+        primitive.getGeometryType().getSubType());
+
+        axis2Line.setPoints(axis2Point1,
+            axis2Point2);
+        drawingStatus.addStatus(axis2Line, auxiliaryLineSymbolEditing, "");
+
+        drawingStatus.addStatus(primitive, lineSymbolEditing, "");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/FilledEllipseEditVertexOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/FilledEllipseEditVertexOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/FilledEllipseEditVertexOperation.java	(revision 1663)
@@ -0,0 +1,154 @@
+package org.gvsig.vectorediting.lib.prov.editvertex.operation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Ellipse;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+public class FilledEllipseEditVertexOperation implements EditVertexOperation {
+
+    public FilledEllipseEditVertexOperation() {
+        // TODO Auto-generated constructor stub
+    }
+
+    public Geometry insertVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        return null;
+    }
+
+    public Geometry removeVertex(Primitive geom, int index)
+        throws CreateGeometryException {
+        return null;
+    }
+
+    public Geometry moveVertex(Primitive geom, int index, Point point) throws CreateGeometryException, GeometryOperationNotSupportedException, GeometryOperationException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        Ellipse result = (Ellipse) geom.cloneGeometry();
+        if(index == 0){
+            result.setPoints(point, ((Ellipse)geom).getAxis1End(), ((Ellipse)geom).getAxis2Dist());
+        } else if (index == 1){
+            result.setPoints(((Ellipse)geom).getAxis1Start(), point, ((Ellipse)geom).getAxis2Dist());
+        } else if (index == 2){
+            Point axis1Start = ((Ellipse)geom).getAxis1Start();
+            Point axis1End = ((Ellipse)geom).getAxis1End();
+            Point center = geometryManager.createPoint(
+                (axis1Start.getX()+axis1End.getX())/2,
+                (axis1Start.getY()+axis1End.getY())/2,
+                geom.getGeometryType().getSubType());
+            result.setPoints(((Ellipse)geom).getAxis1Start(), ((Ellipse)geom).getAxis1End(), center.distance(point));
+        }
+        return result;
+    }
+
+    public List<Point> getVertexesList(Primitive geom) throws CreateGeometryException, GeometryOperationNotSupportedException, GeometryOperationException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        ArrayList<Point> vertexList = new ArrayList<Point>();
+        Ellipse ellipse = (Ellipse) geom;
+        Point axis1Start = ellipse.getAxis1Start();
+        vertexList.add(axis1Start);
+        Point axis1End = ellipse.getAxis1End();
+        vertexList.add(axis1End);
+        Point center = geometryManager.createPoint(
+            (axis1Start.getX()+axis1End.getX())/2,
+            (axis1Start.getY()+axis1End.getY())/2,
+            geom.getGeometryType().getSubType());
+
+        double angle = getAngle(axis1Start, axis1End);
+
+        vertexList.add(geometryManager.createPoint(
+            center.getX() + ellipse.getAxis2Dist()*Math.cos(angle+Math.PI/2),
+            center.getY() + ellipse.getAxis2Dist()*Math.sin(angle+Math.PI/2),
+            geom.getGeometryType().getSubType()));
+
+        return vertexList;
+    }
+
+    public int getNumVertex(Primitive geom) {
+        return 3;
+    }
+
+    public boolean canInsertVertex(Primitive geom, int index) {
+        return false;
+    }
+
+    public boolean canRemoveVertex(Primitive geom, int index) {
+        return false;
+    }
+
+    public boolean canMoveVertex(int index, Point point) {
+        return true;
+    }
+
+    public double getAngle(Point start, Point end)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+        double angle =
+            Math.acos((end.getX() - start.getX()) / start.distance(end));
+
+        if (start.getY() > end.getY()) {
+            angle = -angle;
+        }
+
+        if (angle < 0) {
+            angle += (2 * Math.PI);
+        }
+
+        return angle;
+    }
+
+    public void addToDrawingStatus(DefaultDrawingStatus drawingStatus,
+        Primitive primitive) throws CreateGeometryException, GeometryOperationNotSupportedException, GeometryOperationException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol auxiliaryLineSymbolEditing =
+            editingProviderManager.getSymbol("auxiliary-line-symbol-editing");
+        ISymbol polygonSymbolEditing =
+            editingProviderManager.getSymbol("polygon-symbol-editing");
+        Ellipse ellipse = (Ellipse)primitive;
+        Point axis1Start = ellipse.getAxis1Start();
+        Point axis1End = ellipse.getAxis1End();
+        Line axis1Line = geometryManager.createLine(primitive.getGeometryType().getSubType());
+        axis1Line.setPoints(axis1Start,axis1End);
+        drawingStatus.addStatus(axis1Line, auxiliaryLineSymbolEditing, "");
+
+        Line axis2Line = geometryManager.createLine(primitive.getGeometryType().getSubType());
+
+        Point center = geometryManager.createPoint(
+            (axis1Start.getX()+axis1End.getX())/2,
+            (axis1Start.getY()+axis1End.getY())/2,
+            primitive.getGeometryType().getSubType());
+
+        double angle = getAngle(axis1Start, axis1End);
+
+        Point axis2Point1 = geometryManager.createPoint(
+        center.getX() + ellipse.getAxis2Dist()*Math.cos(angle+Math.PI/2),
+        center.getY() + ellipse.getAxis2Dist()*Math.sin(angle+Math.PI/2),
+        primitive.getGeometryType().getSubType());
+
+        Point axis2Point2 = geometryManager.createPoint(
+        center.getX() - ellipse.getAxis2Dist()*Math.cos(angle+Math.PI/2),
+        center.getY() - ellipse.getAxis2Dist()*Math.sin(angle+Math.PI/2),
+        primitive.getGeometryType().getSubType());
+
+        axis2Line.setPoints(axis2Point1,
+            axis2Point2);
+        drawingStatus.addStatus(axis2Line, auxiliaryLineSymbolEditing, "");
+
+        drawingStatus.addStatus(primitive, polygonSymbolEditing, "");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/EditVertexOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/EditVertexOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/EditVertexOperation.java	(revision 1663)
@@ -0,0 +1,93 @@
+package org.gvsig.vectorediting.lib.prov.editvertex.operation;
+
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+
+
+/**
+ * @author fdiaz
+ *
+ */
+public interface EditVertexOperation {
+
+    /**
+     * @param geom
+     * @param index
+     * @return The geometry with the inserted vertex
+     * @throws CreateGeometryException
+     */
+    public Geometry insertVertex(Primitive geom, int index) throws CreateGeometryException;
+
+    /**
+     * @param geom
+     * @param index
+     * @return true if can insert vertex
+     */
+    public boolean canInsertVertex(Primitive geom, int index);
+
+    /**
+     * @param geom
+     * @param index
+     * @return The geometry without the removed vertex
+     * @throws CreateGeometryException
+     */
+    public Geometry removeVertex(Primitive geom, int index) throws CreateGeometryException;
+
+    /**
+     * @param geom
+     * @param index
+     * @return true if can remove vertex
+     */
+    public boolean canRemoveVertex(Primitive geom, int index);
+
+    /**
+     * @param geom
+     * @param index
+     * @param point
+     * @return the geometry with the moved vertex
+     * @throws CreateGeometryException
+     * @throws GeometryOperationNotSupportedException
+     * @throws GeometryOperationException
+     */
+    public Geometry moveVertex(Primitive geom, int index, Point point) throws CreateGeometryException, GeometryOperationNotSupportedException, GeometryOperationException;
+
+    /**
+     * @param index
+     * @param point
+     * @return true if can move vertex
+     */
+    public boolean canMoveVertex(int index, Point point);
+
+    /**
+     * @param geom
+     * @return a list of vertices
+     * @throws CreateGeometryException
+     * @throws GeometryOperationNotSupportedException
+     * @throws GeometryOperationException
+     */
+    public List<Point> getVertexesList(Primitive geom) throws CreateGeometryException, GeometryOperationNotSupportedException, GeometryOperationException;
+
+    /**
+     * @param geom
+     * @return the number of vertices
+     */
+    public int getNumVertex(Primitive geom);
+
+    /**
+     * @param drawingStatus
+     * @param primitive
+     * @throws CreateGeometryException
+     * @throws GeometryOperationNotSupportedException
+     * @throws GeometryOperationException
+     */
+    public void addToDrawingStatus(DefaultDrawingStatus drawingStatus,
+        Primitive primitive) throws CreateGeometryException, GeometryOperationNotSupportedException, GeometryOperationException;
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/SplineCalculator.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/SplineCalculator.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/SplineCalculator.java	(revision 1663)
@@ -0,0 +1,66 @@
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2016 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.editvertex.operation;
+
+
+/**
+ * @author fdiaz
+ *
+ */
+public class SplineCalculator {
+    private double y[];
+    private double y2[];
+
+    /**
+     * The constructor calculates the second derivatives of the interpolating function
+     * at the tabulated points xi, with xi = (i, y[i]).
+     * Based on numerical recipes in C, http://www.library.cornell.edu/nr/bookcpdf/c3-3.pdf .
+     * @param y Array of y coordinates for cubic-spline interpolation.
+     */
+    public SplineCalculator(double y[]) {
+        this.y = y;
+        int n = y.length;
+        y2 = new double[n];
+        double u[] = new double[n];
+        for (int i = 1; i < n - 1; i++) {
+            y2[i] = -1.0 / (4.0 + y2[i - 1]);
+            u[i] = (6.0 * (y[i + 1] - 2.0 * y[i] + y[i - 1]) - u[i - 1]) / (4.0 + y2[i - 1]);
+        }
+        for (int i = n - 2; i >= 0; i--) {
+            y2[i] = y2[i] * y2[i + 1] + u[i];
+        }
+    }
+
+    /**
+     * Returns a cubic-spline interpolated value y for the point between
+     * point (n, y[n]) and (n+1, y[n+1), with t ranging from 0 for (n, y[n])
+     * to 1 for (n+1, y[n+1]).
+     * @param n The start point.
+     * @param t The distance to the next point (0..1).
+     * @return A cubic-spline interpolated value.
+     */
+    public double fn(int n, double t) {
+        return t * y[n + 1] - ((t - 1.0) * t * ((t - 2.0) * y2[n] - (t + 1.0) * y2[n + 1])) / 6.0 + y[n] - t * y[n];
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/EditVertexOperationUtils.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/EditVertexOperationUtils.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/java/org/gvsig/vectorediting/lib/prov/editvertex/operation/EditVertexOperationUtils.java	(revision 1663)
@@ -0,0 +1,137 @@
+package org.gvsig.vectorediting.lib.prov.editvertex.operation;
+
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Circle;
+import org.gvsig.fmap.geom.primitive.Circumference;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Ellipse;
+import org.gvsig.fmap.geom.primitive.EllipticArc;
+import org.gvsig.fmap.geom.primitive.FilledSpline;
+import org.gvsig.fmap.geom.primitive.OrientablePrimitive;
+import org.gvsig.fmap.geom.primitive.PeriEllipse;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.geom.primitive.Ring;
+import org.gvsig.fmap.geom.primitive.Spline;
+import org.gvsig.fmap.geom.primitive.Surface;
+
+
+public class EditVertexOperationUtils {
+
+    private static Logger logger = LoggerFactory.getLogger(EditVertexOperationUtils.class);
+
+    private static Map<Integer, EditVertexOperation> operations = new HashMap<Integer, EditVertexOperation>();
+
+    private EditVertexOperationUtils() {
+    }
+
+    public static void register(EditVertexOperation operation, int geometryType){
+        operations.put(geometryType, operation);
+    }
+
+    public static EditVertexOperation getOperation(Primitive geom) {
+        Integer type = geom.getGeometryType().getType();
+
+        if(isPolygon(geom)){
+            type = Geometry.TYPES.POLYGON;
+        } else if(isLine(geom)){
+            type = Geometry.TYPES.LINE;
+        }
+        EditVertexOperation operation = operations.get(type);
+
+        return operation;
+    }
+
+    private static boolean isPolygon(Geometry geometry) {
+
+        if(!(geometry instanceof Surface)){
+            return false;
+        }
+        if(!isLineOrPolygon(geometry)){
+            return false;
+        };
+        return true;
+    }
+
+    private static boolean isLine(Geometry geometry) {
+
+        if(!(geometry instanceof Curve)){
+            return false;
+        }
+        if(!isLineOrPolygon(geometry)){
+            return false;
+        };
+        return true;
+    }
+
+    private static boolean isLineOrPolygon(Geometry geometry) {
+        if (geometry instanceof Ellipse) {
+            return false;
+        }
+        if (geometry instanceof EllipticArc) {
+            return false;
+        }
+        if (geometry instanceof Circle) {
+            return false;
+        }
+        if (geometry instanceof FilledSpline) {
+            return false;
+        }
+        if (geometry instanceof Arc) {
+            return false;
+        }
+        if (geometry instanceof Spline) {
+            return false;
+        }
+        if (geometry instanceof Circumference) {
+            return false;
+        }
+        if (geometry instanceof PeriEllipse) {
+            return false;
+        }
+        return true;
+    }
+
+    public static void setVertex(OrientablePrimitive geom, int index, Point p) {
+        if (index < geom.getNumVertices()) {
+            Point point = geom.getVertex(index);
+            int min = p.getDimension() < point.getDimension() ? p.getDimension() : point.getDimension();
+            for (int i = 0; i < min; i++) {
+                point.setCoordinateAt(i, p.getCoordinateAt(i));
+            }
+        } else {
+            if (geom instanceof Surface) {
+                Surface sgeom = (Surface) geom;
+                int count = 0;
+                int dif = index - geom.getNumVertices();
+                for (int i = 0; i < sgeom.getNumInteriorRings(); i++) {
+                    Ring ring = sgeom.getInteriorRing(i);
+                    for (int ri = 0; ri < ring.getNumVertices(); ri++) {
+                        if (count == dif) {
+                            Point point = ring.getVertex(ri);
+                            int min = p.getDimension() < point.getDimension() ? p.getDimension() : point.getDimension();
+                            for (int vri = 0; vri < min; vri++) {
+                                point.setCoordinateAt(vri, p.getCoordinateAt(vri));
+                            }
+                            return;
+                        } else {
+                            count = count + 1;
+                        }
+
+                    }
+
+                }
+
+            }
+        }
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.editvertex.EditVertexEditingLibrary
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/resources/images/vectorediting-tools/modify-edit-vertex.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/src/main/resources/images/vectorediting-tools/modify-edit-vertex.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex/pom.xml	(revision 1663)
@@ -0,0 +1,11 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.editvertex</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.editvertex</name>
+  <description>Edit Vertex Tool</description>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.editvertex
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.line/src/main/resources/images/vectorediting-tools/insert-line.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.line/src/main/resources/images/vectorediting-tools/insert-line.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.line/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.line/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.line/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.line.LineEditingLibrary
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.line/src/main/java/org/gvsig/vectorediting/lib/prov/line/LineEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.line/src/main/java/org/gvsig/vectorediting/lib/prov/line/LineEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.line/src/main/java/org/gvsig/vectorediting/lib/prov/line/LineEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,110 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.line;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author llmarques
+ *
+ */
+public class LineEditingProviderFactory extends AbstractProviderFactory
+implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "insert-line";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Inserts lines on the view";
+
+    public void initialize() {
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", true, null,
+                new int[] { 
+                    Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                    Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new LineEditingProvider(services, parameters);
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.line/src/main/java/org/gvsig/vectorediting/lib/prov/line/LineEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.line/src/main/java/org/gvsig/vectorediting/lib/prov/line/LineEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.line/src/main/java/org/gvsig/vectorediting/lib/prov/line/LineEditingLibrary.java	(revision 1663)
@@ -0,0 +1,91 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.line;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * @author llmarques
+ *
+ */
+public class LineEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new LineEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "insert-line", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "insert-line-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.line/src/main/java/org/gvsig/vectorediting/lib/prov/line/LineEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.line/src/main/java/org/gvsig/vectorediting/lib/prov/line/LineEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.line/src/main/java/org/gvsig/vectorediting/lib/prov/line/LineEditingProvider.java	(revision 1663)
@@ -0,0 +1,240 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.line;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author llmarques
+ *
+ */
+public class LineEditingProvider extends AbstractEditingProvider implements
+EditingProvider {
+
+    private EditingServiceParameter firstPoint;
+
+    private EditingServiceParameter secondPoint;
+
+    private Map<EditingServiceParameter, Object> values;
+
+    private FeatureStore featureStore;
+
+    /**
+     * Default constructor.
+     *
+     * @param providerServices
+     *            available services for this provider
+     * @param parameters
+     *            of this provider
+     */
+    public LineEditingProvider(ProviderServices providerServices,
+        DynObject parameters) {
+        super(providerServices);
+        this.featureStore =
+            (FeatureStore) parameters
+            .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.firstPoint =
+            new DefaultEditingServiceParameter("first_point", "first_point",
+                TYPE.POSITION);
+
+        this.secondPoint =
+            new DefaultEditingServiceParameter("second_point", "second_point",
+                TYPE.POSITION);
+
+    }
+
+    public EditingServiceParameter next() {
+        if (values.get(firstPoint) == null) {
+            return this.firstPoint;
+        } else if (values.get(secondPoint) == null) {
+            return this.secondPoint;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        DefaultDrawingStatus geometries = new DefaultDrawingStatus();
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol lineSymbolEditing = editingProviderManager.getSymbol("line-symbol-editing");
+        ISymbol auxiliaryPointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+
+        if ((values != null) && (values.get(firstPoint) != null)) {
+            Point point = (Point) values.get(firstPoint);
+            try {
+                EditingProviderServices editingProviderServices =
+                    (EditingProviderServices) getProviderServices();
+                int subtype = editingProviderServices.getSubType(featureStore);
+                Line line =
+                    editingProviderServices.createLine(point, mousePosition,
+                        subtype);
+                geometries.addStatus(line, lineSymbolEditing, "");
+                geometries.addStatus(point, auxiliaryPointSymbolEditing, "");
+                geometries.addStatus(mousePosition, auxiliaryPointSymbolEditing, "");
+
+            } catch (Exception e) {
+                throw new DrawServiceException(e);
+            }
+
+            return geometries;
+        }
+
+        return null;
+
+    }
+
+    public void stop() throws StopServiceException {
+        values.clear();
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(firstPoint);
+        parameters.add(secondPoint);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter param = next();
+        validateAndInsertValue(param, value);
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter param,
+        Object value) throws InvalidEntryException {
+        if (param == firstPoint) {
+            if (value instanceof Point) {
+                values.put(param, value);
+                return;
+            }
+        } else if (param == secondPoint) {
+            if (value instanceof Point) {
+                values.put(param, value);
+                return;
+            }
+        }
+        throw new InvalidEntryException(null);
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        Point secondPointValue = (Point) values.get(secondPoint);
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        try {
+
+            DrawingStatus drawingStatus = getDrawingStatus(secondPointValue);
+            Line line = (Line) drawingStatus.getGeometries().get(0);
+
+            GeometryType storeGeomType =
+                editingProviderServices.getGeomType(featureStore);
+
+            if (storeGeomType.isTypeOf(MULTICURVE)) {
+
+                MultiCurve multiCurve;
+                multiCurve =
+                    GeometryLocator.getGeometryManager().createMultiCurve(
+                        storeGeomType.getSubType());
+                multiCurve.addCurve(line);
+                return multiCurve;
+            }
+
+            return line;
+        } catch (Exception e) {
+            throw new FinishServiceException(e);
+        }
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+        Geometry geometry = this.finish();
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+        editingProviderServices.insertGeometryIntoFeatureStore(geometry,
+            featureStore);
+    }
+
+    public void start() throws StartServiceException {
+        values = new HashMap<EditingServiceParameter, Object>();
+    }
+
+    public String getName() {
+        return LineEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.line/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.line/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.line/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.line</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.line</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.line
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/pom.xml	(revision 1663)
@@ -0,0 +1,157 @@
+<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">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.vectorediting.lib</artifactId>
+		<version>1.0.92</version>
+	</parent>
+	<artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+	<packaging>pom</packaging>
+	<modules>
+		<module>org.gvsig.vectorediting.lib.prov.point</module>
+		<module>org.gvsig.vectorediting.lib.prov.circlecr</module>
+		<module>org.gvsig.vectorediting.lib.prov.polyline</module>
+		<module>org.gvsig.vectorediting.lib.prov.internalpolygon</module>
+		<module>org.gvsig.vectorediting.lib.prov.line</module>
+		<module>org.gvsig.vectorediting.lib.prov.arc</module>
+		<module>org.gvsig.vectorediting.lib.prov.ellipse</module>
+		<module>org.gvsig.vectorediting.lib.prov.regularpolygon</module>
+		<module>org.gvsig.vectorediting.lib.prov.rectangle</module>
+		<module>org.gvsig.vectorediting.lib.prov.spline</module>
+		<module>org.gvsig.vectorediting.lib.prov.circle3p</module>
+		<module>org.gvsig.vectorediting.lib.prov.explode</module>
+		<module>org.gvsig.vectorediting.lib.prov.move</module>
+		<module>org.gvsig.vectorediting.lib.prov.rotate</module>
+		<module>org.gvsig.vectorediting.lib.prov.duplicate</module>
+		<module>org.gvsig.vectorediting.lib.prov.splitline</module>
+		<module>org.gvsig.vectorediting.lib.prov.scale</module>
+		<module>org.gvsig.vectorediting.lib.prov.simplify</module>
+		<module>org.gvsig.vectorediting.lib.prov.multipoint</module>
+		<module>org.gvsig.vectorediting.lib.prov.autopolygon</module>
+		<module>org.gvsig.vectorediting.lib.prov.join</module>
+		<module>org.gvsig.vectorediting.lib.prov.stretch</module>
+		<module>org.gvsig.vectorediting.lib.prov.extendline</module>
+		<module>org.gvsig.vectorediting.lib.prov.split</module>
+		<module>org.gvsig.vectorediting.lib.prov.smoothline</module>
+		<module>org.gvsig.vectorediting.lib.prov.trimline</module>
+		<module>
+			org.gvsig.vectorediting.lib.prov.rectangularmatrix
+		</module>
+		<module>org.gvsig.vectorediting.lib.prov.polarmatrix</module>
+		<module>org.gvsig.vectorediting.lib.prov.editvertex</module>
+		<module>org.gvsig.vectorediting.lib.prov.remove</module>
+		<module>
+			org.gvsig.vectorediting.lib.prov.converttopolyline
+		</module>
+		<module>
+			org.gvsig.vectorediting.lib.prov.reversedirection
+		</module>
+	</modules>
+	<dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.vectorediting.lib.api</artifactId>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.vectorediting.lib.spi</artifactId>
+			<scope>compile</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.vectorediting.lib.impl</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.dal.api</artifactId>
+			<scope>compile</scope>
+		</dependency>
+
+
+		<!-- for test case -->
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.geometry.api</artifactId>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.tools.lib</artifactId>
+			<type>test-jar</type>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.dal.impl</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.dal.file.shp</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.dal.spi</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.dal.file.lib</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.dal.file.dbf</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.metadata.lib.basic.impl</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.timesupport.lib.api</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.timesupport.lib.impl</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.tools.evaluator.sqljep</artifactId>
+			<scope>test</scope>
+		</dependency>
+    <!--
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.geometry.generalpath</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.geometry.operation</artifactId>
+			<scope>test</scope>
+		</dependency>
+    -->
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.control</artifactId>
+		</dependency>
+		<dependency>
+		  <groupId>org.gvsig</groupId>
+		  <artifactId>org.gvsig.symbology.lib.api</artifactId>
+		</dependency>
+		<dependency>
+		  <groupId>org.gvsig</groupId>
+		  <artifactId>org.gvsig.symbology.lib.impl</artifactId>
+		  <scope>runtime</scope>
+		</dependency>
+	</dependencies>
+</project>
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/test/java/org/gvsig/vectorediting/lib/prov/point/PointTest.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/test/java/org/gvsig/vectorediting/lib/prov/point/PointTest.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/test/java/org/gvsig/vectorediting/lib/prov/point/PointTest.java	(revision 1663)
@@ -0,0 +1,350 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.point;
+
+import java.io.File;
+import java.net.URL;
+import java.util.List;
+
+import org.gvsig.fmap.crs.CRSFactory;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingManager;
+import org.gvsig.vectorediting.lib.api.EditingService;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.VectorEditingException;
+import org.gvsig.vectorediting.lib.impl.DefaultEditingManager;
+import org.gvsig.vectorediting.lib.prov.point.PointEditingProviderFactory;
+
+/**
+ *
+ * Insert point provider test.
+ *
+ * This test uses src/test/resources/cartography
+ *
+ * @author llmarques
+ *
+ */
+public class PointTest extends AbstractLibraryAutoInitTestCase {
+
+    GeometryManager geoManager;
+    DataManager dataManager;
+    EditingManager editingManager;
+    EditingService service;
+    FeatureStore featureStoreTest;
+    MapContext mapContextTest;
+
+    @Override
+    protected void doSetUp() throws Exception {
+
+        editingManager = new DefaultEditingManager();
+
+        geoManager = GeometryLocator.getGeometryManager();
+
+        try {
+            featureStoreTest = openTestFeatureStore();
+        } catch (Exception e) {
+            fail("Unexpected exception opening test feature store: "
+                + e.getMessage());
+        }
+
+        mapContextTest =
+            new MapContext(new ViewPort(featureStoreTest
+                .getDefaultFeatureType().getDefaultSRS()));
+
+        service =
+            editingManager.getEditingService(
+                PointEditingProviderFactory.PROVIDER_NAME, featureStoreTest,
+                mapContextTest);
+
+        service.start();
+    }
+
+    public void testFinish() {
+
+        // Try to finish without values.
+        try {
+
+            service.finish();
+            fail("No exception has been thrown");
+
+        } catch (NullPointerException e) {
+            // Test OK, got expected exception
+        } catch (FinishServiceException e) {
+            fail("Unexpected exception finishing service: " + e.getMessage());
+        }
+
+        // Try to finish with valid points
+        Point point;
+        try {
+
+            point = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(point);
+
+            Geometry geom = service.finish();
+
+            assertNotNull("geometry is null", geom);
+            assertTrue("geometry instanceof Point == false",
+                geom instanceof Point);
+            assertEquals("geometry type != POINT", geom.getType(),
+                Geometry.TYPES.POINT);
+            assertTrue(((Point) geom).getX() == 0);
+            assertTrue(((Point) geom).getY() == 0);
+
+        } catch (Exception e) {
+            fail("Unexpected exception finish with valid values: "
+                + e.getMessage());
+        }
+
+        // Try to finish with null featureStore
+        try {
+
+            service =
+                editingManager.getEditingService(
+                    PointEditingProviderFactory.PROVIDER_NAME, null,
+                    mapContextTest);
+
+            service.start();
+
+            point = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(point);
+
+            service.finish();
+            fail("No exception has been thrown");
+        } catch (FinishServiceException e) {
+            // Test OK, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception finishing with null feature store: "
+                + e.getMessage());
+        }
+
+    }
+
+    public void testfinishAndStore() {
+
+        // Try to finish and store without values
+        try {
+            service.finishAndStore();
+        } catch (NullPointerException e) {
+            // Test ok, got expected exception
+        } catch (FinishServiceException e) {
+            fail("Unexpected exception ending and storing service: "
+                + e.getMessage());
+        }
+
+        // Try to finish and store with values
+        Point point;
+        try {
+            point = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(point);
+
+            featureStoreTest.edit();
+            service.finishAndStore();
+            featureStoreTest.finishEditing();
+
+        } catch (Exception e) {
+            fail("Unexpected exception ending and storing service: "
+                + e.getMessage());
+        }
+
+        // Try to finish and store with null featureStore
+        try {
+
+            service =
+                editingManager.getEditingService(
+                    PointEditingProviderFactory.PROVIDER_NAME, null,
+                    mapContextTest);
+
+            point = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(point);
+
+            service.finishAndStore();
+            fail("No exception has been thrown");
+        } catch (FinishServiceException e) {
+            // Test OK, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception ending and storing service: "
+                + e.getMessage());
+        }
+
+    }
+
+    public void testgetDrawingStatus() {
+
+        Point point;
+        try {
+            point = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+            DrawingStatus ds = service.getDrawingStatus(point);
+            assertNull("drawingStatus != null", ds);
+        } catch (Exception e) {
+            fail("Unexpected exception getting drawing status: "
+                + e.getMessage());
+        }
+
+        point = null;
+        try {
+            DrawingStatus ds = service.getDrawingStatus(point);
+            assertNull("drawingStatus != null", ds);
+        } catch (Exception e) {
+            fail("Unexpected exception getting drawing status: "
+                + e.getMessage());
+        }
+
+    }
+
+    public void testgetName() {
+
+        assertEquals(PointEditingProviderFactory.PROVIDER_NAME,
+            service.getName());
+
+    }
+
+    public void testgetParameters() {
+
+        List<EditingServiceParameter> parameters = service.getParameters();
+
+        assertNotNull(parameters);
+        assertTrue(parameters.size() == 1);
+
+        EditingServiceParameter parameter = parameters.get(0);
+
+        assertTrue(parameter.getTypes().size() == 1);
+        assertTrue(parameter.getTypes().iterator().next() == EditingServiceParameter.TYPE.POSITION);
+    }
+
+    public void testNext() {
+
+        assertNotNull(service.next());
+
+        List<EditingServiceParameter> parameters = service.getParameters();
+        assertEquals(parameters.get(0), service.next());
+
+        Point point;
+        try {
+            point = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(point);
+        } catch (Exception e) {
+            fail("Unexpected exception getting next parameter: "
+                + e.getMessage());
+        }
+
+        assertNull(service.next());
+
+    }
+
+    public void testsetValue() {
+
+        // Try to set valid point
+        Point point;
+        try {
+            point = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(point);
+        } catch (Exception e) {
+            fail("Unexpected exception setting value: " + e.getMessage());
+        }
+
+        assertNull("Point has not been set.", service.next());
+
+        // Try to set invalid point
+        point = null;
+        try {
+            service.stop();
+            service.start();
+            service.setValue(point);
+        } catch (InvalidEntryException e) {
+            // Test ok, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception setting value: " + e.getMessage());
+        }
+
+        assertNotNull("Invalid point has been set", service.next());
+
+    }
+
+    public void testStart() {
+        service =
+            editingManager.getEditingService(
+                PointEditingProviderFactory.PROVIDER_NAME, featureStoreTest,
+                mapContextTest);
+
+        try {
+            service.start();
+        } catch (VectorEditingException e) {
+            fail("Unexpected exception starting service: " + e.getMessage());
+        }
+    }
+
+    public void testStop() {
+        service =
+            editingManager.getEditingService(
+                PointEditingProviderFactory.PROVIDER_NAME, featureStoreTest,
+                mapContextTest);
+
+        try {
+            service.start();
+            service.stop();
+        } catch (VectorEditingException e) {
+            fail("Unexpected exception starting or stopping service: "
+                + e.getMessage());
+        }
+    }
+
+    private FeatureStore openTestFeatureStore() throws Exception {
+
+        URL shapeURL =
+            this.getClass().getResource("/cartography/puertos_andalucia.shp");
+        if (shapeURL == null) {
+            throw new IllegalStateException("Can't locate cartography resource");
+        }
+        File shapeFile = new File(shapeURL.getFile());
+        if (!shapeFile.exists()) {
+            throw new IllegalStateException("cartography resource not exists");
+        }
+
+        dataManager = DALLocator.getDataManager();
+
+        DataStoreParameters params = dataManager.createStoreParameters("Shape");
+
+        params.setDynValue("shpfile", shapeFile);
+        params.setDynValue("CRS", CRSFactory.getCRS("EPSG:23030"));
+        params.setDynValue("useNullGeometry", false);
+        params.validate();
+
+        return (FeatureStore) dataManager.openStore("Shape", params);
+
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/test/resources/cartography/puertos_andalucia.shx
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/test/resources/cartography/puertos_andalucia.shx
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/test/resources/cartography/puertos_andalucia.shp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/test/resources/cartography/puertos_andalucia.shp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/test/resources/cartography/puertos_andalucia.dbf
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/test/resources/cartography/puertos_andalucia.dbf
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.point.PointEditingLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/main/resources/images/vectorediting-tools/insert-point.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/main/resources/images/vectorediting-tools/insert-point.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/main/java/org/gvsig/vectorediting/lib/prov/point/PointEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/main/java/org/gvsig/vectorediting/lib/prov/point/PointEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/main/java/org/gvsig/vectorediting/lib/prov/point/PointEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,83 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.point;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+public class PointEditingProviderFactory extends AbstractProviderFactory
+implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "insert-point";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Inserts points on the view";
+
+    @Override
+    public Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new PointEditingProvider(services, parameters);
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", true, null,
+                new int[] { Geometry.TYPES.POINT, Geometry.TYPES.MULTIPOINT });
+
+        return serviceInfo;
+    }
+
+    public void initialize() {
+
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/main/java/org/gvsig/vectorediting/lib/prov/point/PointEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/main/java/org/gvsig/vectorediting/lib/prov/point/PointEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/main/java/org/gvsig/vectorediting/lib/prov/point/PointEditingLibrary.java	(revision 1663)
@@ -0,0 +1,65 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.point;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+public class PointEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new PointEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "insert-point", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "insert-point-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/main/java/org/gvsig/vectorediting/lib/prov/point/PointEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/main/java/org/gvsig/vectorediting/lib/prov/point/PointEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/src/main/java/org/gvsig/vectorediting/lib/prov/point/PointEditingProvider.java	(revision 1663)
@@ -0,0 +1,155 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.point;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.aggregate.MultiPoint;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+public class PointEditingProvider extends AbstractEditingProvider
+implements EditingProvider {
+
+    private EditingProviderServices editingProviderServices =
+        (EditingProviderServices) getProviderServices();
+
+    private EditingServiceParameter point;
+
+    private Point valuePoint;
+
+    private FeatureStore featureStore;
+
+    public PointEditingProvider(ProviderServices services,
+        DynObject parameters) {
+        super(services);
+        this.featureStore =
+            (FeatureStore) parameters
+            .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.point =
+            new DefaultEditingServiceParameter("insert_point",
+                "indicate_new_point", TYPE.POSITION);
+    }
+
+    public DefaultDrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        return null;
+    }
+
+    public void stop() throws StopServiceException {
+        valuePoint = null;
+    }
+
+    private boolean isValidValue(EditingServiceParameter param, Object value) {
+        return (value instanceof Point) ? true : false;
+    }
+
+    public EditingServiceParameter next() {
+        if (valuePoint == null) {
+            return this.point;
+        }
+        return null;
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> list =
+            new ArrayList<EditingServiceParameter>();
+        list.add(point);
+        return list;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter param = next();
+        if (isValidValue(param, value)) {
+            this.valuePoint = (Point) value;
+        } else {
+            throw new InvalidEntryException(null);
+        }
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+        Geometry geometry = null;
+        try {
+            geometry = finish();
+            editingProviderServices.insertGeometryIntoFeatureStore(geometry,
+                featureStore);
+        } catch (Exception e) {
+            throw new FinishServiceException("Can't finalize " + this.getName()
+                + "with X=" + valuePoint.getX() + " Y= " + valuePoint.getY(), e);
+        }
+    }
+
+    public void start() throws StartServiceException {
+        this.valuePoint = null;
+    }
+
+    public String getName() {
+        return PointEditingProviderFactory.PROVIDER_NAME;
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        Point geometry = null;
+        try {
+            int subtype = editingProviderServices.getSubType(featureStore);
+            GeometryType geomType =
+                editingProviderServices.getGeomType(featureStore);
+            geometry =
+                editingProviderServices.createPoint(valuePoint.getX(),
+                    valuePoint.getY(), subtype);
+
+            if (geomType.isTypeOf(MULTIPOINT)) {
+                MultiPoint multiPoint;
+                multiPoint = GeometryLocator.getGeometryManager().createMultiPoint(subtype);
+                multiPoint.addPoint(geometry);
+                return multiPoint;
+            }
+
+        } catch (Exception e) {
+            throw new FinishServiceException("Can't finalize " + this.getName()
+                + "with X=" + valuePoint.getX() + " Y= " + valuePoint.getY(), e);
+        }
+        return geometry;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point/pom.xml	(revision 1663)
@@ -0,0 +1,9 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.point</artifactId>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.point
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.spline</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.spline</name>
+</project>
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.spline.SplineEditingLibrary
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/resources/images/vectorediting-tools/insert-filled-spline.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/resources/images/vectorediting-tools/insert-filled-spline.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/resources/images/vectorediting-tools/insert-spline.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/resources/images/vectorediting-tools/insert-spline.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/java/org/gvsig/vectorediting/lib/prov/spline/FilledSplineEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/java/org/gvsig/vectorediting/lib/prov/spline/FilledSplineEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/java/org/gvsig/vectorediting/lib/prov/spline/FilledSplineEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,97 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.spline;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author llmarques
+ *
+ */
+public class FilledSplineEditingProviderFactory extends AbstractProviderFactory
+implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "insert-filled-spline";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Creates filled spline providers";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(
+                PROVIDER_NAME,
+                "",
+                true,
+                null,
+                new int[] { 
+                    Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, 
+                    Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE 
+                });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new FilledSplineEditingProvider(services, parameters);
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+        return dynclass;
+    }
+
+    @Override
+    public String getName() {
+        return PROVIDER_NAME;
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/java/org/gvsig/vectorediting/lib/prov/spline/SplineEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/java/org/gvsig/vectorediting/lib/prov/spline/SplineEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/java/org/gvsig/vectorediting/lib/prov/spline/SplineEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,93 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.spline;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author llmarques
+ *
+ */
+public class SplineEditingProviderFactory extends AbstractProviderFactory
+implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "insert-spline";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Creates spline providers";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", true, null,
+                new int[] { 
+                    Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                    Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE 
+                });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new SplineEditingProvider(services, parameters);
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    @Override
+    public String getName() {
+        return PROVIDER_NAME;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/java/org/gvsig/vectorediting/lib/prov/spline/SplineEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/java/org/gvsig/vectorediting/lib/prov/spline/SplineEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/java/org/gvsig/vectorediting/lib/prov/spline/SplineEditingLibrary.java	(revision 1663)
@@ -0,0 +1,73 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.spline;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * @author llmarques
+ *
+ */
+public class SplineEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new SplineEditingProviderFactory());
+        manager.addProviderFactory(new FilledSplineEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "insert-spline", this
+            .getClass().getClassLoader(), this.getClass().getName());
+        manager.registerIcon("vectorediting-tools", "insert-filled-spline",
+            this.getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "rectangle-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/java/org/gvsig/vectorediting/lib/prov/spline/FilledSplineEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/java/org/gvsig/vectorediting/lib/prov/spline/FilledSplineEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/java/org/gvsig/vectorediting/lib/prov/spline/FilledSplineEditingProvider.java	(revision 1663)
@@ -0,0 +1,151 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.spline;
+
+import java.util.Iterator;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.primitive.FilledSpline;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author llmarques
+ *
+ */
+public class FilledSplineEditingProvider extends SplineEditingProvider
+    implements EditingProvider {
+
+    /**
+     * @param services
+     * @param parameters
+     */
+    public FilledSplineEditingProvider(ProviderServices services,
+        DynObject parameters) {
+        super(services, parameters);
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+
+        DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol polygonSymbolEditing = editingProviderManager.getSymbol("polygon-symbol-editing");
+        ISymbol auxiliaryPointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+
+        if (values != null) {
+
+            if (values.size() >= 1) {
+                for (Iterator iterator = values.iterator(); iterator.hasNext();) {
+                    Point point = (Point) iterator.next();
+                    drawingStatus.addStatus(point, auxiliaryPointSymbolEditing, "");
+                }
+
+                EditingProviderServices editingProviderServices =
+                    (EditingProviderServices) getProviderServices();
+
+                try {
+                    int subtype =
+                        editingProviderServices.getSubType(featureStore);
+
+                    FilledSpline filledSpline = (FilledSpline) geometryManager.create(Geometry.TYPES.FILLEDSPLINE, subtype);
+                    for (int i = 0; i < values.size(); i++) {
+                        filledSpline.addVertex(values.get(i));
+                    }
+                    filledSpline.addVertex(mousePosition);
+                    filledSpline.addVertex(values.get(0));
+
+                    drawingStatus.addStatus(mousePosition, auxiliaryPointSymbolEditing, "");
+                    drawingStatus.addStatus(filledSpline, polygonSymbolEditing, "");
+
+                } catch (BaseException e) {
+                    throw new DrawServiceException(e);
+                }
+            }
+        }
+        return drawingStatus;
+    }
+
+    @Override
+    public Geometry finish() throws FinishServiceException {
+        if (values != null) {
+
+            EditingProviderServices editingProviderServices =
+                (EditingProviderServices) getProviderServices();
+            GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+
+            try {
+                int subtype = editingProviderServices.getSubType(featureStore);
+
+                FilledSpline filledSpline = (FilledSpline) geometryManager.create(Geometry.TYPES.FILLEDSPLINE, subtype);
+                for (int i = 0; i < values.size(); i++) {
+                    filledSpline.addVertex(values.get(i));
+                }
+                filledSpline.addVertex(values.get(0));
+
+                GeometryType geomType = editingProviderServices.getGeomType(featureStore);
+
+                if (geomType.isTypeOf(MULTISURFACE)) {
+                    MultiSurface multisurface;
+                    multisurface =
+                        GeometryLocator.getGeometryManager().createMultiSurface(
+                            geomType.getSubType());
+                    multisurface.addSurface((FilledSpline) filledSpline);
+                    return multisurface;
+
+                } else {
+                    return filledSpline;
+                }
+
+            } catch (BaseException e) {
+                throw new FinishServiceException(e);
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public String getName() {
+        return FilledSplineEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/java/org/gvsig/vectorediting/lib/prov/spline/SplineEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/java/org/gvsig/vectorediting/lib/prov/spline/SplineEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline/src/main/java/org/gvsig/vectorediting/lib/prov/spline/SplineEditingProvider.java	(revision 1663)
@@ -0,0 +1,292 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.spline;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Spline;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author llmarques
+ *
+ */
+public class SplineEditingProvider extends AbstractEditingProvider implements
+    EditingProvider {
+
+    protected EditingServiceParameter points;
+
+    protected List<Point> values;
+
+    protected Map<String, String> options;
+
+    protected boolean closeSpline;
+
+    protected boolean finishSpline;
+
+    protected FeatureStore featureStore;
+
+    /**
+     * Default constructor.
+     *
+     * @param parameters
+     *            of service.
+     * @param providerServices
+     *            available services. See {@link EditingProviderServices}.
+     */
+    public SplineEditingProvider(ProviderServices services, DynObject parameters) {
+        super(services);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        I18nManager i18nManager = ToolsLocator.getI18nManager();
+        options = new LinkedHashMap<String, String>();
+        options.put(i18nManager.getTranslation("key_close"), "close_spline");
+        options.put(i18nManager.getTranslation("key_finish"), "finish");
+        options.put(i18nManager.getTranslation("key_remove_last_point"), "remove_last_point");
+
+
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        String consoleMsg =
+            editingProviderServices.makeConsoleMessage("indicate_new_point",
+                options);
+
+        this.points =
+            new DefaultEditingServiceParameter("insert_point", consoleMsg,
+                options, EditingServiceParameter.TYPE.LIST_POSITIONS,
+                EditingServiceParameter.TYPE.OPTION);
+
+        this.closeSpline = false;
+
+        this.finishSpline = false;
+    }
+
+    public EditingServiceParameter next() {
+        if (finishSpline) {
+            return null;
+        }
+        return points;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+
+        DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol lineSymbolEditing = editingProviderManager.getSymbol("line-symbol-editing");
+        ISymbol auxiliaryPointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+
+
+        if (values != null) {
+
+            if (values.size() >= 1) {
+                for (Iterator iterator = values.iterator(); iterator.hasNext();) {
+                    Point point = (Point) iterator.next();
+                    drawingStatus.addStatus(point, auxiliaryPointSymbolEditing, "");
+                }
+
+                EditingProviderServices editingProviderServices =
+                    (EditingProviderServices) getProviderServices();
+
+                try {
+                    int subtype =
+                        editingProviderServices.getSubType(featureStore);
+                    Spline spline =
+                        editingProviderServices.createSpline(values, subtype);
+
+                    spline.addVertex(mousePosition);
+                    drawingStatus.addStatus(mousePosition, auxiliaryPointSymbolEditing, "");
+                    drawingStatus.addStatus(spline, lineSymbolEditing, "");
+
+//                    drawingStatus.addGeometry(spline);
+                } catch (BaseException e) {
+                    throw new DrawServiceException(e);
+                }
+            }
+        }
+        return drawingStatus;
+    }
+
+    public void stop() throws StopServiceException {
+        values.clear();
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(points);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+    }
+
+    /**
+     * Checks if value is valid to parameter received as parameter.
+     *
+     * @param param
+     *            of value
+     * @param value
+     *            to e inserted
+     * @throws InvalidEntryException
+     *             If values is no valid throw an InvalidEntryException
+     */
+    private void validateAndInsertValue(EditingServiceParameter parameter,
+        Object value) throws InvalidEntryException {
+
+        if (parameter == points) {
+
+            if (value instanceof Point) {
+                values.add((Point) value);
+                return;
+
+            } else if (value instanceof String) {
+
+                String option = (String) value;
+                I18nManager i18nManager = ToolsLocator.getI18nManager();
+
+                if (values.size() > 0) {
+                    if (option.equalsIgnoreCase(i18nManager
+                        .getTranslation("key_remove_last_point"))) {
+                        values.remove(values.size() - 1);
+                        return;
+                    }
+                }
+                if (values.size() > 1) {
+                    if (option.equalsIgnoreCase(i18nManager
+                        .getTranslation("key_close"))
+                        || option.equalsIgnoreCase(i18nManager
+                            .getTranslation("key_finish"))) {
+
+                        if (option.equalsIgnoreCase(i18nManager
+                            .getTranslation("key_close"))) {
+                            this.closeSpline = true;
+                        }
+
+                        this.finishSpline = true;
+                        return;
+                    }
+                }
+            }
+        }
+        throw new InvalidEntryException(null);
+    }
+
+    public Geometry finish() throws FinishServiceException {
+
+        if (values != null) {
+
+            EditingProviderServices editingProviderServices =
+                (EditingProviderServices) getProviderServices();
+            try {
+
+                if (closeSpline) {
+                    values.add(values.get(0));
+                }
+
+                int subtype = editingProviderServices.getSubType(featureStore);
+                Spline spline =
+                    editingProviderServices.createSpline(values, subtype);
+
+                GeometryType geomType =
+                    editingProviderServices.getGeomType(featureStore);
+
+                if (geomType.isTypeOf(MULTICURVE)) {
+
+                    GeometryManager geometryManager =
+                        GeometryLocator.getGeometryManager();
+                    MultiCurve multiCurve =
+                        geometryManager.createMultiCurve(geomType.getSubType());
+                    multiCurve.addCurve(spline);
+                    return multiCurve;
+
+                } else {
+                    return spline;
+                }
+            } catch (BaseException e) {
+                throw new FinishServiceException(e);
+            }
+        }
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+        Geometry geometry = this.finish();
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+        editingProviderServices.insertGeometryIntoFeatureStore(geometry,
+            featureStore);
+    }
+
+    public void start() throws StartServiceException {
+        values = new ArrayList<Point>();
+
+        closeSpline = false;
+        finishSpline = false;
+    }
+
+    public String getName() {
+        return SplineEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.spline
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.split</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.split</name>
+</project>
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/resources/images/vectorediting-tools/modify-split.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/resources/images/vectorediting-tools/modify-split.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.split.SplitEditingLibrary
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/SplitEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/SplitEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/SplitEditingProvider.java	(revision 1663)
@@ -0,0 +1,383 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.split;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.Geometry.TYPES;
+import org.gvsig.fmap.geom.GeometryException;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.aggregate.MultiPrimitive;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.tools.visitor.VisitCanceledException;
+import org.gvsig.tools.visitor.Visitor;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.VectorEditingException;
+import org.gvsig.vectorediting.lib.prov.split.operation.SplitOperation;
+import org.gvsig.vectorediting.lib.prov.split.operation.SplitOperationUtils;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author llmarques
+ *
+ */
+public class SplitEditingProvider extends AbstractEditingProvider implements
+    EditingProvider {
+
+    private EditingServiceParameter selection;
+
+    private EditingServiceParameter splitGeometry;
+
+    private FeatureStore featureStore;
+
+    private Map<EditingServiceParameter, Object> values;
+
+    /**
+     * Default constructor.
+     *
+     * @param providerServices
+     *            available services for this provider
+     * @param parameters
+     *            of this provider
+     */
+    public SplitEditingProvider(ProviderServices services, DynObject parameters) {
+        super(services);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.selection =
+            new DefaultEditingServiceParameter("selection", "selection",
+                EditingServiceParameter.TYPE.SELECTION);
+
+        this.splitGeometry =
+            new DefaultEditingServiceParameter("draw_geometry_to_split",
+                "draw_geometry_to_split", Geometry.TYPES.CURVE,
+                EditingServiceParameter.TYPE.GEOMETRY);
+    }
+
+    public EditingServiceParameter next() {
+        if (values.get(selection) == null) {
+            return selection;
+        } else if (values.get(splitGeometry) == null) {
+            return splitGeometry;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        return null;
+    }
+
+    public void stop() throws StopServiceException {
+        if (values != null) {
+            values.clear();
+        }
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(selection);
+        parameters.add(splitGeometry);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter parameter,
+        Object value) throws InvalidEntryException {
+
+        if (values != null && value != null) {
+
+            if (value instanceof FeatureSelection) {
+
+                FeatureSelection featureSelection = (FeatureSelection) value;
+
+                try {
+                    featureSelection.accept(new Visitor() {
+
+                        public void visit(Object obj)
+                            throws VisitCanceledException, BaseException {
+                            Feature feature = (Feature) obj;
+                            Geometry geometry = feature.getDefaultGeometry();
+                            GeometryType geoType = geometry.getGeometryType();
+
+                            if (geoType.isTypeOf(POINT)
+                                || geoType.isTypeOf(MULTIPOINT)) {
+                                throw new InvalidEntryException(null);
+                            }
+                        }
+                    });
+
+                    values.put(selection, value);
+                    return;
+                } catch (BaseException e) {
+                    throw new InvalidEntryException(e);
+                }
+
+            } else if (value instanceof Geometry) {
+
+                Geometry geometry = (Geometry) value;
+
+                if (geometry instanceof MultiCurve) {
+                    MultiCurve multiCurve = (MultiCurve) geometry;
+                    for (int i = 0; i < multiCurve.getPrimitivesNumber(); i++) {
+                        if (isValid((Curve) multiCurve.getPrimitiveAt(i))) {
+                            values.put(splitGeometry, geometry);
+                            return;
+                        }
+                    }
+
+                } else if (geometry instanceof Curve) {
+                    if (isValid((Curve) geometry)) {
+                        values.put(splitGeometry, geometry);
+                        return;
+                    }
+                }
+            }
+        }
+        throw new InvalidEntryException(null);
+    }
+
+    private boolean isValid(final Curve curve) {
+        FeatureSelection featureSelection =
+            (FeatureSelection) values.get(selection);
+
+        try {
+            featureSelection.accept(new Visitor() {
+
+                public void visit(Object obj) throws VisitCanceledException,
+                    BaseException {
+                    Feature feature = (Feature) obj;
+                    Geometry geometry = feature.getDefaultGeometry();
+
+                    Geometry intersection = geometry.intersection(curve);
+
+                    if (intersection == null
+                        || (!intersection.getGeometryType().isTypeOf(POINT)
+                        && !intersection.getGeometryType().isTypeOf(MULTIPOINT)
+                        && !intersection.getGeometryType().isTypeOf(CURVE)
+                        && !intersection.getGeometryType().isTypeOf(MULTICURVE))) {
+                        throw new VectorEditingException();
+                    }
+                }
+            });
+            return true;
+        } catch (BaseException e) {
+            return false;
+        }
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+
+        if (values != null) {
+
+            EditingProviderServices editingProviderServices =
+                (EditingProviderServices) getProviderServices();
+
+            FeatureSelection featureSelection =
+                (FeatureSelection) values.get(selection);
+            Geometry splitter = (Geometry) values.get(splitGeometry);
+            ToolsLocator.getDisposableManager().bind(featureSelection);
+
+            DisposableIterator it = null;
+            try {
+                it = featureSelection.fastIterator();
+
+                while (it.hasNext()) {
+                    Feature feature = (Feature) it.next();
+                    Geometry geometryToBeSplitted =
+                        feature.getDefaultGeometry();
+                    GeometryType geoType =
+                        geometryToBeSplitted.getGeometryType();
+
+                    if (geoType.isTypeOf(TYPES.SURFACE)
+                        || geoType.isTypeOf(TYPES.CURVE)) {
+
+                        MultiPrimitive splittedGeometries =
+                            (MultiPrimitive) split(
+                                (Primitive) geometryToBeSplitted, splitter);
+
+                        for (int j = 0; j < splittedGeometries
+                            .getPrimitivesNumber(); j++) {
+                            copyAlfanumericDataAndInsert(
+                                splittedGeometries.getPrimitiveAt(j), feature);
+                        }
+
+                    } else if (geoType.isTypeOf(TYPES.MULTISURFACE)
+                        || geoType.isTypeOf(TYPES.MULTICURVE)) {
+
+                        MultiPrimitive multiPrimitive =
+                            (MultiPrimitive) geometryToBeSplitted;
+
+                        // Multigeometry composed by no splitted geometries.
+                        GeometryManager geoManager = GeometryLocator.getGeometryManager();
+                        MultiPrimitive multiNoSplitted;
+                        if(geoType.isTypeOf(TYPES.MULTISURFACE)){
+                            multiNoSplitted =
+                                geoManager.createMultiSurface(editingProviderServices
+                                    .getSubType(featureStore));
+                        } else {
+                            multiNoSplitted =
+                                geoManager.createMultiCurve(editingProviderServices
+                                    .getSubType(featureStore));
+                        }
+
+                        for (int i = 0; i < multiPrimitive
+                            .getPrimitivesNumber(); i++) {
+
+                            Geometry geoSplitted =
+                                split(multiPrimitive.getPrimitiveAt(i),
+                                    splitter);
+
+                            if (geoSplitted instanceof MultiPrimitive) {
+                                // If the result of split is a multiprimitive,
+                                // it has splitted
+                                MultiPrimitive multiSplitted = (MultiPrimitive) geoSplitted;
+                                // Splitted geometries should be saved as
+                                // primitives
+                                for (int j = 0; j < multiSplitted
+                                    .getPrimitivesNumber(); j++) {
+                                    copyAlfanumericDataAndInsert(
+                                        multiSplitted.getPrimitiveAt(j),
+                                        feature);
+                                }
+                            } else {
+                                // If the result of split is a primitive, it has
+                                // not splitted. Add it to mulriNoSplitted to save it later.
+                                multiNoSplitted
+                                    .addPrimitive((Primitive) geoSplitted);
+                            }
+                        }
+
+                        if(multiNoSplitted.getPrimitivesNumber() > 0){
+                            // Not splitted geometries should be saved as multigeometry
+                            copyAlfanumericDataAndInsert(multiNoSplitted,
+                                feature);
+                        }
+                    }
+
+                    editingProviderServices.deleteFeatureFromFeatureStore(
+                        feature, featureStore);
+                }
+
+                featureSelection.deselectAll();
+                featureStore.getFeatureSelection().deselectAll();
+
+
+            } catch (BaseException e) {
+                throw new FinishServiceException(e);
+            } finally {
+                it.dispose();
+                featureSelection.dispose();
+            }
+        }
+    }
+
+    private void copyAlfanumericDataAndInsert(Geometry geometry, Feature feature)
+        throws DataException {
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        EditableFeature eFeature =
+            editingProviderServices.getFeatureCopyWithoutPK(featureStore,
+                feature);
+        eFeature.setDefaultGeometry(geometry);
+        editingProviderServices.insertFeatureIntoFeatureStore(eFeature,
+            featureStore);
+    }
+
+    private Geometry split(Primitive geometry, Geometry splitter)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, GeometryException {
+        SplitOperation operation = SplitOperationUtils.getOperation(geometry);
+
+        if (operation != null) {
+            return operation.split(geometry, splitter);
+        }
+        return null;
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        values = new HashMap<EditingServiceParameter, Object>();
+        FeatureSelection selected = null;
+        if (featureStore != null) {
+            try {
+                selected = featureStore.getFeatureSelection();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            }
+            if (selected.getSelectedCount() > 0) {
+                setValue(selected);
+            }
+        }
+    }
+
+    public String getName() {
+        return SplitEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/SplitOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/SplitOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/SplitOperation.java	(revision 1663)
@@ -0,0 +1,55 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.split.operation;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryException;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+
+/**
+ * @author llmarques
+ *
+ */
+public interface SplitOperation {
+
+    /**
+     * Splits the geometry by a other splitter geometry. If splitter does not
+     * intersect geometry return original geometry.
+     *
+     * @param geometryToBeSplitted
+     *            to be splitted
+     * @param splitter
+     *            the geometry that splits other geometries
+     * @return If splitter does not intersect return original geometry, else
+     *         return splitted geometry.
+     * @throws GeometryException
+     */
+    public Geometry split(Geometry geometryToBeSplitted, Geometry splitter)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, CreateGeometryException, GeometryException;
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/SplitOperationUtils.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/SplitOperationUtils.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/SplitOperationUtils.java	(revision 1663)
@@ -0,0 +1,307 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.split.operation;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.Geometry.TYPES;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+
+/**
+ * @author llmarques
+ *
+ */
+public class SplitOperationUtils {
+
+    private static Map<Integer, SplitOperation> operations =
+        new HashMap<Integer, SplitOperation>();
+
+    private SplitOperationUtils() {
+    }
+
+    public static void register(SplitOperation operation, int geometryType) {
+        operations.put(geometryType, operation);
+    }
+
+    public static SplitOperation getOperation(Primitive geom) {
+        Integer type = geom.getGeometryType().getType();
+
+        SplitOperation operation = operations.get(type);
+
+        return operation;
+    }
+
+    // FIXME: Deletes method when geometry manager has this utility method.
+    public static Point getMidPoint(Point a, Point b, int subtype)
+        throws CreateGeometryException {
+        double x = (a.getX() + b.getX()) / 2;
+        double y = (a.getY() + b.getY()) / 2;
+        return createPoint(x, y, subtype);
+    }
+
+    // FIXME: Deletes method when geometry manager has this utility method.
+    public static Point createPoint(double x, double y, int subtype)
+        throws CreateGeometryException {
+        Point point = null;
+        point =
+            (Point) GeometryLocator.getGeometryManager().create(TYPES.POINT,
+                subtype);
+        point.setX(x);
+        point.setY(y);
+        return point;
+    }
+
+    // FIXME: Deletes method when geometry manager has this utility methods.
+    public static Point[] getPerpendicular(Double m, Double b, Point perp,
+        int subtype) throws CreateGeometryException {
+        if (m == Double.POSITIVE_INFINITY) {
+            Point[] res = new Point[2];
+            res[0] = createPoint(0, perp.getY(), subtype);
+            res[1] = createPoint(1, perp.getY(), subtype);
+            return res;
+        } else if (m == Double.NEGATIVE_INFINITY) {
+            Point[] res = new Point[2];
+            res[0] = createPoint(1, perp.getY(), subtype);
+            res[1] = createPoint(0, perp.getY(), subtype);
+            return res;
+        } else {
+            // Pendiente de la recta perpendicular
+            Double m1 = -1 / m;
+
+            // b de la funcion de la recta perpendicular
+            Double b1 = perp.getY() - (m1 * perp.getX());
+
+            // Obtenemos un par de puntos
+            Point[] res = new Point[2];
+
+            if (Double.isInfinite(m1)) {
+                res[0] = createPoint(perp.getX(), 0.0, subtype);
+                res[1] = createPoint(perp.getX(), perp.getY(), subtype);
+            } else {
+                res[0] = createPoint(0, 0.0 + b1, subtype);
+                res[1] =
+                    createPoint(perp.getX(), (m1 * perp.getX()) + b1, subtype);
+            }
+
+            return res;
+        }
+    }
+
+    // FIXME: Deletes method when geometry manager has this utility method.
+    public static Double[] getLineParams(Point point, Point nextPoint) {
+        Double[] lineParams = new Double[2];
+        double denom = nextPoint.getX() - point.getX();
+        if (denom != 0) {
+            lineParams[0] = (nextPoint.getY() - point.getY()) / denom;
+            lineParams[1] = point.getY() - (lineParams[0] * point.getX());
+        } else {
+            if (nextPoint.getY() >= point.getY()) {
+                lineParams[0] = Double.POSITIVE_INFINITY;
+                lineParams[1] = Double.NEGATIVE_INFINITY;
+                if (point.getX() == 0) {
+                    lineParams[1] = 0.0;
+                }
+            } else {
+                lineParams[0] = Double.NEGATIVE_INFINITY;
+                lineParams[1] = Double.POSITIVE_INFINITY;
+                if (point.getX() == 0) {
+                    lineParams[1] = 0.0;
+                }
+            }
+        }
+        return lineParams;
+    }
+
+    // FIXME: Deletes method when geometry manager has this utility method.
+    public static Point getIntersection(Point[] lineA, Point[] lineB,
+        int subtype) throws CreateGeometryException {
+        Point p1 = lineA[0];
+        Point p2 = lineA[1];
+        Point p3 = lineB[0];
+        Point p4 = lineB[1];
+
+        double m1 = Double.POSITIVE_INFINITY;
+
+        if ((p2.getX() - p1.getX()) != 0) {
+            m1 = (p2.getY() - p1.getY()) / (p2.getX() - p1.getX());
+        }
+
+        double m2 = Double.POSITIVE_INFINITY;
+
+        if ((p4.getX() - p3.getX()) != 0) {
+            m2 = (p4.getY() - p3.getY()) / (p4.getX() - p3.getX());
+        }
+
+        if ((m1 == Double.POSITIVE_INFINITY)
+            && (m2 == Double.POSITIVE_INFINITY)) {
+            return null;
+        }
+
+        double b1 = p2.getY() - (m1 * p2.getX());
+
+        double b2 = p4.getY() - (m2 * p4.getX());
+
+        if ((m1 != Double.POSITIVE_INFINITY)
+            && (m2 != Double.POSITIVE_INFINITY)) {
+            if (m1 == m2) {
+                return null;
+            }
+
+            double x = (b2 - b1) / (m1 - m2);
+
+            return createPoint(x, (m1 * x) + b1, subtype);
+        } else if (m1 == Double.POSITIVE_INFINITY) {
+            double x = p1.getX();
+
+            return createPoint(x, (m2 * x) + b2, subtype);
+        } else if (m2 == Double.POSITIVE_INFINITY) {
+            double x = p3.getX();
+
+            return createPoint(x, (m1 * x) + b1, subtype);
+        }
+
+        return null;
+    }
+
+    // FIXME: Deletes method when geometry manager has this utility method.
+    public static double getAngle(Point start, Point end)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+        double angle =
+            Math.acos((end.getX() - start.getX()) / start.distance(end));
+
+        if (start.getY() > end.getY()) {
+            angle = -angle;
+        }
+
+        if (angle < 0) {
+            angle += (2 * Math.PI);
+        }
+
+        return angle;
+    }
+
+    public static Point getCenterOfCurve(Point p1, Point p2, Point p3, Point p4)
+        throws CreateGeometryException {
+
+        if (!p1.equals(p2) && !p3.equals(p4)) {
+
+            int subtype = p1.getGeometryType().getSubType();
+
+            Point midPointChord1 =
+                SplitOperationUtils.getMidPoint(p1, p2, subtype);
+            Point midPointChord2 =
+                SplitOperationUtils.getMidPoint(p3, p4, subtype);
+
+            Double[] bisector1Params =
+                SplitOperationUtils.getLineParams(p1, p2);
+
+            Double[] bisector2Params =
+                SplitOperationUtils.getLineParams(p3, p4);
+
+            Point[] bisector1 =
+                SplitOperationUtils.getPerpendicular(bisector1Params[0],
+                    bisector1Params[1], midPointChord1, subtype);
+            Point[] bisector2 =
+                SplitOperationUtils.getPerpendicular(bisector2Params[0],
+                    bisector2Params[1], midPointChord2, subtype);
+
+            return getIntersection(bisector1, bisector2, subtype);
+        }
+        return null;
+    }
+
+    public static Point getCenterOfCurve(Point p1, Point p2, Point p3)
+        throws CreateGeometryException {
+
+        if (!p1.equals(p2) && !p2.equals(p3)) {
+
+            int subtype = p1.getGeometryType().getSubType();
+
+            Double[] lineAParams = SplitOperationUtils.getLineParams(p1, p2);
+            Double[] lineBParams = SplitOperationUtils.getLineParams(p2, p3);
+
+            double mA = lineAParams[0]; // slope of A line
+            double mB = lineBParams[0]; // slope of B line
+            
+            if (mB - mA != 0) {
+                
+                double x =
+                    (mA * mB * (p1.getY() - p3.getY()) + mB
+                        * (p1.getX() + p2.getX()) - mA
+                        * (p2.getX() + p3.getX()))
+                        / (2 * (mB - mA));
+
+                Point midPointA =
+                    SplitOperationUtils.getMidPoint(p1, p2, subtype);
+
+                Point[] bisectorA =
+                    SplitOperationUtils.getPerpendicular(lineAParams[0],
+                        lineAParams[1], midPointA, subtype);
+
+                Double[] bisectorAParams =
+                    SplitOperationUtils.getLineParams(bisectorA[0],
+                        bisectorA[1]);
+
+                double mBisector = bisectorAParams[0]; // slope of bisector
+                double yBisector = bisectorAParams[1]; // y-intercept of
+                                                       // bisector
+
+                double y = x * mBisector + yBisector;
+
+                return createPoint(x, y, subtype);
+
+            }
+        }
+        return null;
+    }
+    
+    /**
+     * Method use to know what segment intersect with projected point. Due to
+     * accuracy of doubles it is necessary to create a buffer of line to know if
+     * it intersects.
+     * 
+     * @param curve
+     *            segment of line
+     * @param projectedPoint
+     *            of line
+     * @return true if segment intersects with projected point, else false.
+     */
+    public static boolean intersects(Curve curve, Point projectedPoint)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+
+        double tolerance = 2;
+
+        return curve.buffer(tolerance).intersects(projectedPoint);
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/CurveSplitOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/CurveSplitOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/CurveSplitOperation.java	(revision 1663)
@@ -0,0 +1,133 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.split.operation;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryException;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.aggregate.MultiPoint;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+
+/**
+ * @author llmarques
+ *
+ */
+public class CurveSplitOperation implements SplitOperation {
+
+    /*
+     * Strategy:
+     *
+     * 1. Get intersection points.
+     * 2. Get difference between geometry and splitter. If splitter does not
+     * touch geometry return original geometry.
+     * 3. If any intersection points are not equal to first or last vertex of
+     * original geometry, join last and first curve splitted. It's necessary do
+     * it because the difference between geometry and splitter returns a
+     * multicurve that its first curve starts at first vertex of ORGINAL and
+     * ends at first intersection point and its last curve starts at
+     * last intersection point and ends at last vertex of ORIGINAL geometry, so
+     * we have to join them. If any intersection points are equal to first or
+     * last vertex do nothing.
+     */
+    public Geometry split(Geometry geometryToBeSplitted, Geometry splitter)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, GeometryException {
+
+        Curve curveToBeSplitted = (Curve) geometryToBeSplitted.cloneGeometry();
+
+        Geometry intersection = geometryToBeSplitted.intersection(splitter);
+        MultiCurve multicurveSplitted = null;
+
+        if (intersection instanceof MultiPoint) {
+            MultiPoint intersectionMultiPoint = (MultiPoint) intersection;
+            Point firstVertex = intersectionMultiPoint.getPointAt(0);
+            Point lastVertex =
+                intersectionMultiPoint.getPointAt(intersectionMultiPoint
+                    .getPrimitivesNumber() - 1);
+
+            MultiCurve difference =
+                (MultiCurve) geometryToBeSplitted.difference(splitter);
+
+            if (difference == null) {
+                return geometryToBeSplitted;
+            }
+            if(!(curveToBeSplitted instanceof Line)){
+                curveToBeSplitted = (Curve) curveToBeSplitted.toLines().getPrimitiveAt(0);
+            }
+
+            if ((!firstVertex.equals(curveToBeSplitted.getVertex(0)) && !lastVertex
+                .equals(curveToBeSplitted.getVertex(0)))
+                && isClosed(curveToBeSplitted)) {
+
+                Curve firstCurve = difference.getCurveAt(0);
+                Curve lastCurve =
+                    difference.getCurveAt(difference.getPrimitivesNumber() - 1);
+
+                Curve union =
+                    GeometryLocator.getGeometryManager().createLine(
+                        geometryToBeSplitted.getGeometryType().getSubType());
+                for (int i = 0; i < lastCurve.getNumVertices(); i++) {
+                    union.addVertex(lastCurve.getVertex(i));
+                }
+
+                for (int i = 0; i < firstCurve.getNumVertices(); i++) {
+                    union.addVertex(firstCurve.getVertex(i));
+                }
+
+                multicurveSplitted =
+                    GeometryLocator.getGeometryManager().createMultiCurve(
+                        geometryToBeSplitted.getGeometryType().getSubType());
+
+                multicurveSplitted.addCurve(union);
+                for (int i = 1; i < difference.getPrimitivesNumber() - 1; i++) {
+                    multicurveSplitted.addCurve(difference.getCurveAt(i));
+                }
+            }
+        }
+
+        if(multicurveSplitted == null){
+            return geometryToBeSplitted.difference(splitter);
+        }
+
+        return multicurveSplitted;
+    }
+
+    private boolean isClosed(Curve curveToBeSplitted) {
+
+        Point firstPoint = curveToBeSplitted.getVertex(0);
+        Point lastPoint =
+            curveToBeSplitted.getVertex(curveToBeSplitted.getNumVertices()-1);
+
+        if (firstPoint.equals(lastPoint)) {
+            return true;
+        }
+        return false;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/ArcSplitOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/ArcSplitOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/ArcSplitOperation.java	(revision 1663)
@@ -0,0 +1,174 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.split.operation;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.aggregate.MultiPoint;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * @author llmarques
+ *
+ */
+public class ArcSplitOperation implements SplitOperation {
+
+    private static Logger logger = LoggerFactory
+        .getLogger(ArcSplitOperation.class);
+
+    /*
+     * Strategy:
+     * 
+     * 1. Get intersection points.
+     * 2. Get center and radius
+     * 3. Order intersections points by angle
+     * 4. Iterate over ordered intersection points and create splitted arcs.
+     * Stop iteration when all intersections points have been iterated.
+     */
+    public Geometry split(Geometry geometryToBeSplitted, Geometry splitter)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, CreateGeometryException {
+
+        int subtype = geometryToBeSplitted.getGeometryType().getSubType();
+        GeometryManager geoManager = GeometryLocator.getGeometryManager();
+
+        Arc arcToBeSplitted = (Arc) geometryToBeSplitted;
+
+        Geometry intersections = arcToBeSplitted.intersection(splitter);
+
+        if (intersections == null) {
+            return geometryToBeSplitted;
+        } else if (intersections instanceof Point) {
+            
+            if(isClosed(arcToBeSplitted)){ // Closed arcs can be splitted by one point
+                return arcToBeSplitted;
+            } else {
+                return arcToBeSplitted.difference(splitter);
+            }
+            
+            
+        } else if (intersections instanceof MultiPoint) {
+
+            // Two or more intersection points
+            MultiPoint multiIntersection = (MultiPoint) intersections;
+
+            // Arc#getCenterPoint can return null if two points of arc are the
+            // same
+            Point tmpCenter = arcToBeSplitted.getCenterPoint();
+            if (tmpCenter == null) {
+                // If center is null, we use this "trick". Get center of arc
+                // envelope.
+                tmpCenter =
+                    SplitOperationUtils.createPoint(arcToBeSplitted
+                        .getEnvelope().getCenter(0), arcToBeSplitted
+                        .getEnvelope().getCenter(1), subtype);
+            }
+            final Point center = tmpCenter;
+
+            double radius = center.distance(arcToBeSplitted.getEndPoint());
+
+            // Order intersection points by angle to create arcs correctly
+            List<Point> orderedIntersectionPoints = new ArrayList<Point>();
+            for (int i = 0; i < multiIntersection.getPrimitivesNumber(); i++) {
+                orderedIntersectionPoints.add(multiIntersection.getPointAt(i));
+            }
+
+            // Sort by angle
+            Collections.sort(orderedIntersectionPoints,
+                new Comparator<Point>() {
+
+                    public int compare(Point p1, Point p2) {
+                        double angle1 = 0;
+                        double angle2 = 0;
+                        try {
+                            angle1 = SplitOperationUtils.getAngle(center, p1);
+                            angle2 = SplitOperationUtils.getAngle(center, p2);
+                        } catch (BaseException e) {
+                            logger
+                                .warn("Problems getting angle between center and"
+                                    + " one intersection point");
+                            return 0;
+                        }
+                        return Double.compare(angle1, angle2);
+                    }
+                });
+
+            MultiCurve splittedArcs = geoManager.createMultiCurve(subtype);
+
+            for (int i = 0; i < orderedIntersectionPoints.size(); i++) {
+                Point intersecctionPoint = orderedIntersectionPoints.get(i);
+                Point nextIntersecctionPoint;
+
+                if (i + 1 >= orderedIntersectionPoints.size()) {
+                    nextIntersecctionPoint = orderedIntersectionPoints.get(0);
+                } else {
+                    nextIntersecctionPoint =
+                        orderedIntersectionPoints.get(i + 1);
+                }
+
+                double angle1 =
+                    SplitOperationUtils.getAngle(center, intersecctionPoint);
+                double angle2 =
+                    SplitOperationUtils
+                        .getAngle(center, nextIntersecctionPoint);
+
+                Arc arc = (Arc) geoManager.create(Geometry.TYPES.ARC, subtype);
+
+                arc.setPointsStartEnd(center, radius, angle1, angle2);
+                splittedArcs.addCurve(arc);
+            }
+
+            return splittedArcs;
+        }
+        return arcToBeSplitted;
+    }
+
+    private boolean isClosed(Arc arc) {
+       
+        Point initPoint = arc.getInitPoint();
+        Point endPoint = arc.getEndPoint();
+        Point centerPoint = arc.getCenterPoint();
+        
+        if(initPoint.equals(endPoint) || centerPoint == null){
+            return true;
+        }
+        return false;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/LineSplitOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/LineSplitOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/LineSplitOperation.java	(revision 1663)
@@ -0,0 +1,130 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.split.operation;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.aggregate.MultiLine;
+import org.gvsig.fmap.geom.aggregate.MultiPoint;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+
+/**
+ * @author llmarques
+ *
+ */
+public class LineSplitOperation implements SplitOperation {
+
+    /*
+     * Strategy:
+     *
+     * 1. Get intersection points.
+     * 2. Get difference between geometry and splitter. If splitter does not
+     * touch geometry return original geometry.
+     * 3. If any intersection points are not equal to first or last vertex of
+     * original geometry, join last and first curve splitted. It's necessary do
+     * it because the difference between geometry and splitter returns a
+     * multicurve that its first curve starts at first vertex of ORGINAL and
+     * ends at first intersection point and its last curve starts at
+     * last intersection point and ends at last vertex of ORIGINAL geometry, so
+     * we have to join them. If any intersection points are equal to first or
+     * last vertex do nothing.
+     */
+    public Geometry split(Geometry geometryToBeSplitted, Geometry splitter)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, CreateGeometryException {
+
+        Line lineToBeSplitted = (Line) geometryToBeSplitted;
+
+        Geometry intersection = geometryToBeSplitted.intersection(splitter);
+        MultiLine multilineSplitted = null;
+
+        if (intersection instanceof MultiPoint) {
+            MultiPoint intersectionMultiPoint = (MultiPoint) intersection;
+            Point firstVertex = intersectionMultiPoint.getPointAt(0);
+            Point lastVertex =
+                intersectionMultiPoint.getPointAt(intersectionMultiPoint
+                    .getPrimitivesNumber() - 1);
+
+            MultiLine difference =
+                (MultiLine) geometryToBeSplitted.difference(splitter);
+
+            if (difference == null) {
+                return geometryToBeSplitted;
+            }
+
+            if ((!firstVertex.equals(lineToBeSplitted.getVertex(0)) && !lastVertex
+                .equals(lineToBeSplitted.getVertex(0)))
+                && isClosed(lineToBeSplitted)) {
+
+                Line firstLine = (Line) difference.getPrimitiveAt(0);
+                Line lastLine =
+                    (Line) difference.getPrimitiveAt(difference.getPrimitivesNumber() - 1);
+
+                Curve union =
+                    GeometryLocator.getGeometryManager().createLine(
+                        geometryToBeSplitted.getGeometryType().getSubType());
+                for (int i = 0; i < lastLine.getNumVertices(); i++) {
+                    union.addVertex(lastLine.getVertex(i));
+                }
+
+                for (int i = 0; i < firstLine.getNumVertices(); i++) {
+                    union.addVertex(firstLine.getVertex(i));
+                }
+
+                multilineSplitted =
+                    GeometryLocator.getGeometryManager().createMultiLine(
+                        geometryToBeSplitted.getGeometryType().getSubType());
+
+                multilineSplitted.addPrimitive(union);
+                for (int i = 1; i < difference.getPrimitivesNumber() - 1; i++) {
+                    multilineSplitted.addPrimitive(difference.getPrimitiveAt(i));
+                }
+            }
+        }
+
+        if(multilineSplitted == null){
+            return geometryToBeSplitted.difference(splitter);
+        }
+
+        return multilineSplitted;
+    }
+
+    private boolean isClosed(Line lineToBeSplitted) {
+
+        Point firstPoint = lineToBeSplitted.getVertex(0);
+        Point lastPoint =
+            lineToBeSplitted.getVertex(lineToBeSplitted.getNumVertices()-1);
+
+        if (firstPoint.equals(lastPoint)) {
+            return true;
+        }
+        return false;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/splitsurface/SplitEdgeStar.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/splitsurface/SplitEdgeStar.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/splitsurface/SplitEdgeStar.java	(revision 1663)
@@ -0,0 +1,234 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+/* Spatial Operations & Editing Tools for uDig
+ * 
+ * Axios Engineering under a funding contract with: 
+ *      Diputación Foral de Gipuzkoa, Ordenación Territorial 
+ *
+ *      http://b5m.gipuzkoa.net
+ *      http://www.axios.es 
+ *
+ * (C) 2006, Diputación Foral de Gipuzkoa, Ordenación Territorial (DFG-OT). 
+ * DFG-OT agrees to licence under Lesser General Public License (LGPL).
+ * 
+ * You can redistribute it and/or modify it under the terms of the 
+ * GNU Lesser General Public License as published by the Free Software 
+ * Foundation; version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ */
+package org.gvsig.vectorediting.lib.prov.split.operation.splitsurface;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import com.vividsolutions.jts.algorithm.Angle;
+import com.vividsolutions.jts.algorithm.CGAlgorithms;
+import com.vividsolutions.jts.geom.Coordinate;
+import com.vividsolutions.jts.geomgraph.DirectedEdge;
+import com.vividsolutions.jts.geomgraph.DirectedEdgeStar;
+import com.vividsolutions.jts.geomgraph.EdgeEnd;
+import com.vividsolutions.jts.util.Assert;
+
+/**
+ * A {@link DirectedEdgeStar} for the {@link SplitGraphNode nodes} in a {@link SplitGraph}
+ * 
+ * @author Gabriel Roldán, Axios Engineering
+ * @author Mauricio Pazos, Axios Engineering
+ * @since 1.1.0
+ */
+class SplitEdgeStar extends DirectedEdgeStar {
+
+    /**
+     * Adds a DirectedEdge to the list of incident edges on this star
+     * 
+     * @param de non null directed edge to insert on this node star
+     */
+    public void insert( DirectedEdge de ) {
+        if (de == null) {
+            throw new NullPointerException();
+        }
+        insertEdgeEnd(de, de);
+    }
+
+    /**
+     * Overrides {@link DirectedEdgeStar#insert(EdgeEnd)} just to delegate to
+     * {@link #insert(DirectedEdge)} forcing the argument type
+     */
+    @Override
+    public void insert( EdgeEnd ee ) {
+        insert((DirectedEdge) ee);
+    }
+
+    /**
+     * Removes the given edge from this edge star
+     * 
+     * @param edge
+     * @throws IllegalArgumentException if <code>edge</code> is not one of this star's edges
+     */
+    public void remove( DirectedEdge edge ) {
+        if (edge == null) {
+            throw new NullPointerException("edge");
+        }
+        int degree = getDegree();
+        Object removed = edgeMap.remove(edge);
+        int afterDegree = getDegree();
+        Assert.isTrue(afterDegree == degree - 1);
+        if (edge != removed) {
+            throw new IllegalArgumentException(
+                                               "Tried to remove an edge not registered in this edge star: "
+                                                       + edge);
+        }
+        edgeList = null; // edge list has changed - clear the cache
+    }
+
+    /**
+     * Returns the list of Directed edges whose direction is outgoing from this star's node. That
+     * is, for all the DirectedEdges in the star, if the edge's start point is coincident whith the
+     * edge star node, returns the same DirectedNode, otherwise returns the edge's
+     * {@link DirectedEdge#getSym() symmetric edge}.
+     * 
+     * @return
+     */
+    private List getOutgoingEdges() {
+        final Coordinate nodeCoord = getCoordinate();
+        final List edges = getEdges();
+        final List outgoingEdges = new ArrayList(edges.size());
+        for( Iterator it = edges.iterator(); it.hasNext(); ) {
+            DirectedEdge edge = (DirectedEdge) it.next();
+            if (!nodeCoord.equals2D(edge.getCoordinate())) {
+                edge = edge.getSym();
+            }
+            assert nodeCoord.equals2D(edge.getCoordinate());
+            outgoingEdges.add(edge);
+        }
+        return outgoingEdges;
+    }
+
+    /**
+     * Finds the first edge to the passed in in the <code>searchDrirection</code> direction.
+     * 
+     * @param searchDirection one of {@link CGAlgorithms#CLOCKWISE},
+     *        {@link CGAlgorithms#COUNTERCLOCKWISE}
+     * @return the edge forming the acutest angle with <code>edge</code> in the
+     *         <code>prefferredDirection</code> or <code>null</code> if there are no edges in
+     *         the prefferred direction.
+     */
+    public DirectedEdge findClosestEdgeInDirection( DirectedEdge edge, final int searchDirection ) {
+        if (edge == null) {
+            throw new NullPointerException("edge");
+        }
+        if (CGAlgorithms.CLOCKWISE != searchDirection
+                && CGAlgorithms.COUNTERCLOCKWISE != searchDirection) {
+            throw new IllegalArgumentException("Allowed values for for searchDirection "
+                    + "are CGAlgorithms.CLOCKWISE and CGAlgorithms.COUNTERCLOCKWISE: "
+                    + searchDirection);
+        }
+
+        // ensure we're using the node's outgoing edge
+        if (super.findIndex(edge) == -1) {
+            edge = edge.getSym();
+            if (super.findIndex(edge) == -1) {
+                throw new IllegalArgumentException("Edge does not belongs to this edgestar");
+            }
+        }
+        final int degree = getDegree();
+        if (degree < 2) {
+            throw new IllegalStateException("there must be at least two edges in the edge star");
+        }
+        final Coordinate nodeCoord = getCoordinate();
+
+        assert nodeCoord.equals2D(edge.getCoordinate());
+
+        double acutestAngle = Double.MAX_VALUE;
+        DirectedEdge acutest = null;
+        DirectedEdge adjacentEdge = null;
+
+        final Coordinate tip1 = edge.getDirectedCoordinate();
+        final Coordinate tail = nodeCoord;
+
+        // ensure we're using outgoing edges
+        final List outgoingEdges = getOutgoingEdges();
+        for( Iterator it = outgoingEdges.iterator(); it.hasNext(); ) {
+            adjacentEdge = (DirectedEdge) it.next();
+
+            if (adjacentEdge == edge) {
+                continue;
+            }
+
+            Coordinate tip2 = adjacentEdge.getDirectedCoordinate();
+
+            double angle = computeAngleInDirection(tip1, tail, tip2, searchDirection);
+
+            if (angle < acutestAngle) {
+                acutestAngle = angle;
+                acutest = adjacentEdge;
+            }
+        }
+
+        return acutest;
+    }
+
+    /**
+     * Computes the angle comprised between the vector <code>tail:tip1</code> looking in the
+     * specified <code>direction</code> to the vector <code>tail:tip2</code>
+     * 
+     * @param tip1
+     * @param tail
+     * @param tip2
+     * @param direction one of {@link CGAlgorithms#CLOCKWISE},
+     *        {@link CGAlgorithms#COUNTERCLOCKWISE}
+     * @return the angle in radians defined by the vectors tail-tip1:tail-tip2 calculated in the
+     *         specified <code>direction</code> from tail-tip1
+     */
+    public double computeAngleInDirection( Coordinate tip1, Coordinate tail, Coordinate tip2,
+                                           int direction ) {
+        final int orientation = CGAlgorithms.computeOrientation(tail, tip1, tip2);
+
+        // minimal angle (non oriented)
+        double angle = Angle.angleBetween(tip1, tail, tip2);
+        if (orientation != direction) {
+            angle = Angle.PI_TIMES_2 - angle;
+        }
+        return angle;
+    }
+
+    public String toString() {
+        StringBuffer sb = new StringBuffer("SplitEdgeStar[degree: ");
+        sb.append(getDegree()).append(", edges: ");
+        for( Iterator it = getEdges().iterator(); it.hasNext(); ) {
+            DirectedEdge de = (DirectedEdge) it.next();
+            sb.append("DirectedEdge[");
+            sb.append(de.getEdge()).append(" ");
+            sb.append("]");
+        }
+        sb.append("]");
+        return sb.toString();
+    }
+
+}
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/splitsurface/SplitGraphNodeFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/splitsurface/SplitGraphNodeFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/splitsurface/SplitGraphNodeFactory.java	(revision 1663)
@@ -0,0 +1,64 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+/* Spatial Operations & Editing Tools for uDig
+ * 
+ * Axios Engineering under a funding contract with: 
+ *      Diputación Foral de Gipuzkoa, Ordenación Territorial 
+ *
+ *      http://b5m.gipuzkoa.net
+ *      http://www.axios.es 
+ *
+ * (C) 2006, Diputación Foral de Gipuzkoa, Ordenación Territorial (DFG-OT). 
+ * DFG-OT agrees to licence under Lesser General Public License (LGPL).
+ * 
+ * You can redistribute it and/or modify it under the terms of the 
+ * GNU Lesser General Public License as published by the Free Software 
+ * Foundation; version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ */
+package org.gvsig.vectorediting.lib.prov.split.operation.splitsurface;
+
+import com.vividsolutions.jts.geom.Coordinate;
+import com.vividsolutions.jts.geomgraph.Node;
+import com.vividsolutions.jts.geomgraph.NodeFactory;
+
+/**
+ * Custom node factory to create {@link SplitGraphNode}s initialized with an empty
+ * {@link SplitEdgeStar}
+ * 
+ * @author Gabriel Roldán, Axios Engineering
+ * @author Mauricio Pazos, Axios Engineering
+ * @since 1.1.0
+ * @see SplitGraphNode
+ */
+class SplitGraphNodeFactory extends NodeFactory {
+
+    public Node createNode( Coordinate coord ) {
+        return new SplitGraphNode(coord, new SplitEdgeStar());
+    }
+}
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/splitsurface/SplitGraph.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/splitsurface/SplitGraph.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/splitsurface/SplitGraph.java	(revision 1663)
@@ -0,0 +1,282 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+/* Spatial Operations & Editing Tools for uDig
+ *
+ * Axios Engineering under a funding contract with:
+ *      Diputación Foral de Gipuzkoa, Ordenación Territorial
+ *
+ *      http://b5m.gipuzkoa.net
+ *      http://www.axios.es
+ *
+ * (C) 2006, Diputación Foral de Gipuzkoa, Ordenación Territorial (DFG-OT).
+ * DFG-OT agrees to licence under Lesser General Public License (LGPL).
+ *
+ * You can redistribute it and/or modify it under the terms of the
+ * GNU Lesser General Public License as published by the Free Software
+ * Foundation; version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ */
+package org.gvsig.vectorediting.lib.prov.split.operation.splitsurface;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.slf4j.LoggerFactory;
+
+import com.vividsolutions.jts.geom.Coordinate;
+import com.vividsolutions.jts.geom.CoordinateArrays;
+import com.vividsolutions.jts.geom.Geometry;
+import com.vividsolutions.jts.geom.GeometryFactory;
+import com.vividsolutions.jts.geom.LineString;
+import com.vividsolutions.jts.geom.Location;
+import com.vividsolutions.jts.geom.Point;
+import com.vividsolutions.jts.geom.Polygon;
+import com.vividsolutions.jts.geomgraph.DirectedEdge;
+import com.vividsolutions.jts.geomgraph.Edge;
+import com.vividsolutions.jts.geomgraph.Label;
+import com.vividsolutions.jts.geomgraph.NodeFactory;
+import com.vividsolutions.jts.geomgraph.PlanarGraph;
+import com.vividsolutions.jts.geomgraph.Position;
+import com.vividsolutions.jts.geomgraph.Quadrant;
+
+/**
+ * A {@link PlanarGraph} that builds itself from a {@link Polygon} and a
+ * {@link LineString splitting line}.
+ * <p>
+ * The resulting graph will have the following characteristics:
+ * <ul>
+ * <li>It will contain as many edges as linestrings in the boundary of the intersection geometry
+ * between the polygon and the splitting line string.
+ * <li>All edges will be labelled {@link Location#BOUNDARY} at {@link Position#ON}</li>
+ * <li>The edges from the polygon's exterior ring will be labelled {@link Location#EXTERIOR} at the
+ * {@link Position#LEFT}, {@link Location#INTERIOR} at {@link Position#RIGHT}</li>
+ * <li>The edges from the polygon's holes will be labelled {@link Location#INTERIOR} at the
+ * {@link Position#LEFT}, {@link Location#EXTERIOR} at {@link Position#RIGHT}</li>
+ * </ul>
+ * <p>
+ * Note the provided polygon may result modified as the result of {@link Polygon#normalize()},
+ * which is called in order to ensure propper orientation of the shell and holes.
+ * </p>
+ * </p>
+ *
+ * @author Gabriel Roldán, Axios Engineering
+ * @author Mauricio Pazos, Axios Engineering
+ * @since 1.1.0
+ */
+class SplitGraph extends PlanarGraph {
+
+    private static final NodeFactory NODE_FACTORY = new SplitGraphNodeFactory();
+
+    private final Polygon            polygon;
+
+    private final LineString         splitter;
+
+    public SplitGraph( Polygon polygon, LineString splitter ) {
+        super(NODE_FACTORY);
+        this.polygon = polygon;
+        // after normalize() we know the shell is oriented CW and the holes CCW
+        this.polygon.normalize();
+
+        this.splitter = normalizeSplitter(splitter);
+        buildGraph();
+    }
+
+    private LineString normalizeSplitter( final LineString original ) {
+        // ensure the splitter has no endpoints lying inside the polygon
+        LineString splitter = removeInteriorEndPoints(polygon, original);
+        // endure the splitter is directed clockwise, as its going
+        // to become part of the shell boundary when the tesselation
+        // process eliminates other shell edges from the graph
+        Coordinate[] splitterCoords = splitter.getCoordinates();
+        Coordinate coord0 = splitterCoords[0];
+        Coordinate coord1 = splitterCoords[1];
+
+        // determine the orientation of the coordinate sequence given the
+        // quadrant of its first vector
+        // 1 | 0
+        // --+--
+        // 2 | 3
+        final int quadrant = Quadrant.quadrant(coord0, coord1);
+        boolean isCounterClockWise = 1 == quadrant || 2 == quadrant;
+        if (isCounterClockWise) {
+            CoordinateArrays.reverse(splitterCoords);
+            GeometryFactory gf = original.getFactory();
+            splitter = gf.createLineString(splitterCoords);
+        }
+        return splitter;
+    }
+
+    /**
+     * Removes the given edge and its related {@link DirectedEdge}'s from this graph
+     *
+     * @param edge the edge to remove
+     * @throws IllegalArgumentException if no enclosing DirectedEdge is found for <code>edge</code>
+     * @see #remove(DirectedEdge)
+     */
+    public void remove( final SplitEdge edge ) {
+        DirectedEdge edgeEnd = (DirectedEdge) findEdgeEnd(edge);
+        if (edgeEnd == null) {
+            throw new IllegalArgumentException("No enclosing edge end found for " + edge);
+        }
+        remove(edgeEnd);
+    }
+
+    /**
+     * Removes a DirectedEdge, its sym and its {@link SplitEdge} from this graph. May lead to the
+     * graph containing dangling nodes.
+     *
+     * @param edgeEnd
+     */
+    public void remove( final DirectedEdge edgeEnd ) {
+        if (edgeEnd == null) {
+            throw new NullPointerException();
+        }
+        if (edgeEndList.remove(edgeEnd)) {
+            DirectedEdge sym = edgeEnd.getSym();
+            edgeEndList.remove(sym);
+
+            // shared edge between both ends
+            Edge edge = edgeEnd.getEdge();
+            edges.remove(edge);
+
+            // node of directed edge end
+            SplitGraphNode node = (SplitGraphNode) edgeEnd.getNode();
+            // node of symetric directed edge end
+            SplitGraphNode endNode = (SplitGraphNode) sym.getNode();
+            node.remove(edgeEnd);
+            endNode.remove(sym);
+        }
+    }
+
+    /**
+     * Builds a linestrnig from splitter such that it contains no endpoints lying inside the polygon
+     *
+     * @param polygon
+     * @param splitter
+     * @return
+     */
+    private LineString removeInteriorEndPoints( Polygon polygon, LineString splitter ) {
+        final Coordinate[] coords = splitter.getCoordinates();
+        final GeometryFactory gf = splitter.getFactory();
+        int useFrom;
+        int useTo;
+
+        for( useFrom = 0; useFrom < coords.length; useFrom++ ) {
+            Point p = gf.createPoint(coords[useFrom]);
+            if (!polygon.contains(p)) {
+                break;
+            }
+        }
+        for( useTo = coords.length - 1; useTo >= useFrom; useTo-- ) {
+            Point p = gf.createPoint(coords[useTo]);
+            if (!polygon.contains(p)) {
+                break;
+            }
+        }
+
+        if (useFrom == useTo) {
+            throw new IllegalArgumentException("Line lies completely inside polygon");
+        }
+
+        int length = 1 + (useTo - useFrom);
+        Coordinate[] crossingLineCoords = new Coordinate[length];
+        System.arraycopy(coords, useFrom, crossingLineCoords, 0, length);
+        LineString surelyCrossingLine = gf.createLineString(crossingLineCoords);
+        return surelyCrossingLine;
+    }
+
+    /**
+     * <pre>
+     * <code>
+     *
+     *                  +----------o-----------+
+     *                  |          |           |
+     *                  |          |           |
+     *                  |    +-----------+     |
+     *                  |    |     |     |     |
+     *                  |    |     |     |     |
+     *                  |    |     |     |     |
+     *                  |    o__\__o_____|     |
+     *                  |       /  |           |
+     *                 /|\        /|\          |
+     *                  o__________o___________|
+     *
+     *
+     * </code>
+     * </pre>
+     *
+     * @throws Exception
+     */
+    private void buildGraph() {
+        Geometry intersectingLineStrings = polygon.intersection(splitter);
+        Geometry nodedShell = polygon.getExteriorRing().difference(splitter);
+
+        LineString[] interiorRings = new LineString[polygon.getNumInteriorRing()];
+        for( int i = 0; i < polygon.getNumInteriorRing(); i++ ) {
+            LineString interiorRingN = polygon.getInteriorRingN(i);
+            interiorRings[i] = interiorRingN;
+        }
+        GeometryFactory factory = polygon.getFactory();
+        Geometry interiorRingCollection = factory.createMultiLineString(interiorRings);
+        Geometry nodedHoles = interiorRingCollection.difference(splitter);
+
+        // shell segments oriented CW means exterior at the left, interior at
+        // the right
+        addEdges(nodedShell, Location.BOUNDARY, Location.EXTERIOR, Location.INTERIOR);
+        // hole segments oriented CCW means interior at the left, exterior at
+        // the right
+        addEdges(nodedHoles, Location.BOUNDARY, Location.INTERIOR, Location.EXTERIOR);
+        // splitter intersection segments have interior location at both left
+        // and right
+        addEdges(intersectingLineStrings, Location.BOUNDARY, Location.INTERIOR, Location.INTERIOR);
+    }
+
+    private void addEdges( Geometry linearGeom, int onLoc, int leftLoc, int rightLoc ) {
+        final int nParts = linearGeom.getNumGeometries();
+        Geometry currGeom;
+        Coordinate[] coords;
+        List edges = new ArrayList();
+        for( int i = 0; i < nParts; i++ ) {
+            currGeom = linearGeom.getGeometryN(i);
+            coords = currGeom.getCoordinates();
+            if (coords.length<2)
+            	continue;
+            Label label = new Label(onLoc, leftLoc, rightLoc);
+            Edge edge = new SplitEdge(coords, label);
+            edges.add(edge);
+        }
+        // for each edge in the list, adds two DirectedEdge, one reflecting
+        // the given edge and other the opposite
+        try{
+        	super.addEdges(edges);
+        }catch (Exception e) {
+			LoggerFactory.getLogger(this.getClass()).error(e.getLocalizedMessage(),e);
+		}
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/splitsurface/SplitEdge.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/splitsurface/SplitEdge.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/splitsurface/SplitEdge.java	(revision 1663)
@@ -0,0 +1,99 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+/* Spatial Operations & Editing Tools for uDig
+ * 
+ * Axios Engineering under a funding contract with: 
+ *      Diputación Foral de Gipuzkoa, Ordenación Territorial 
+ *
+ *      http://b5m.gipuzkoa.net
+ *      http://www.axios.es 
+ *
+ * (C) 2006, Diputación Foral de Gipuzkoa, Ordenación Territorial (DFG-OT). 
+ * DFG-OT agrees to licence under Lesser General Public License (LGPL).
+ * 
+ * You can redistribute it and/or modify it under the terms of the 
+ * GNU Lesser General Public License as published by the Free Software 
+ * Foundation; version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ */
+package org.gvsig.vectorediting.lib.prov.split.operation.splitsurface;
+
+import com.vividsolutions.jts.geom.Coordinate;
+import com.vividsolutions.jts.geom.Location;
+import com.vividsolutions.jts.geomgraph.Edge;
+import com.vividsolutions.jts.geomgraph.Label;
+import com.vividsolutions.jts.geomgraph.Position;
+
+/**
+ * A custom edge class that knows if its an edge from the shell of the polygin being splitted, one
+ * of its holes or the splitting line, by inspecing its label.
+ * 
+ * @author Gabriel Roldán, Axios Engineering
+ * @author Mauricio Pazos, Axios Engineering
+ * @since 1.1.0
+ */
+final class SplitEdge extends Edge {
+    SplitEdge( Coordinate[] pts, Label label ) {
+        super(pts, label);
+    }
+
+    private int[] getLabelLocations() {
+        int[] locations = new int[3];
+        Label label = getLabel();
+        locations[Position.ON] = label.getLocation(0, Position.ON);
+        locations[Position.LEFT] = label.getLocation(0, Position.LEFT);
+        locations[Position.RIGHT] = label.getLocation(0, Position.RIGHT);
+        return locations;
+    }
+
+    public boolean isShellEdge() {
+        int[] loc = getLabelLocations();
+        return (loc[Position.LEFT] == Location.EXTERIOR && loc[Position.RIGHT] == Location.INTERIOR);
+    }
+
+    public boolean isHoleEdge() {
+        int[] loc = getLabelLocations();
+        return (loc[Position.LEFT] == Location.INTERIOR && loc[Position.RIGHT] == Location.EXTERIOR);
+    }
+
+    public boolean isInteriorEdge() {
+        int[] loc = getLabelLocations();
+        return (loc[Position.LEFT] == Location.INTERIOR && loc[Position.RIGHT] == Location.INTERIOR);
+    }
+
+    public String toString() {
+        StringBuffer sb = new StringBuffer("Edge[label=");
+        sb.append(getLabel()).append(", ");
+        Coordinate[] coords = getCoordinates();
+        for( int i = 0; i < coords.length; i++ ) {
+            sb.append(coords[i].x).append(",").append(coords[i].y).append(" ");
+        }
+        sb.append("]");
+        return sb.toString();
+    }
+}
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/splitsurface/SplitGraphNode.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/splitsurface/SplitGraphNode.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/splitsurface/SplitGraphNode.java	(revision 1663)
@@ -0,0 +1,92 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+/* Spatial Operations & Editing Tools for uDig
+ * 
+ * Axios Engineering under a funding contract with: 
+ *      Diputación Foral de Gipuzkoa, Ordenación Territorial 
+ *
+ *      http://b5m.gipuzkoa.net
+ *      http://www.axios.es 
+ *
+ * (C) 2006, Diputación Foral de Gipuzkoa, Ordenación Territorial (DFG-OT). 
+ * DFG-OT agrees to licence under Lesser General Public License (LGPL).
+ * 
+ * You can redistribute it and/or modify it under the terms of the 
+ * GNU Lesser General Public License as published by the Free Software 
+ * Foundation; version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ */
+package org.gvsig.vectorediting.lib.prov.split.operation.splitsurface;
+
+import com.vividsolutions.jts.geom.Coordinate;
+import com.vividsolutions.jts.geomgraph.DirectedEdge;
+import com.vividsolutions.jts.geomgraph.EdgeEnd;
+import com.vividsolutions.jts.geomgraph.Node;
+
+/**
+ * Custom node type. Does nothing special by now but to force the use of {@link SplitEdgeStar}
+ * instances as the node's list of incident edges and allow to remove edges from its list of
+ * incident edges.
+ * 
+ * @author Gabriel Roldán, Axios Engineering
+ * @author Mauricio Pazos, Axios Engineering
+ * @since 1.1.0
+ */
+class SplitGraphNode extends Node {
+    public SplitGraphNode( Coordinate coord, SplitEdgeStar incidentEdges ) {
+        super(coord, incidentEdges);
+    }
+
+    public void add( DirectedEdge edge ) {
+        super.add(edge);
+    }
+
+    @Override
+    public void add( EdgeEnd edge ) {
+        add((DirectedEdge) edge);
+    }
+
+    /**
+     * Removes the given <code>edge</code> from this node's {@link #getEdges() edge list}.
+     * 
+     * @param edge
+     */
+    public void remove( DirectedEdge edge ) {
+        SplitEdgeStar edges = (SplitEdgeStar) getEdges();
+        edges.remove(edge);
+    }
+
+    public String toString() {
+        StringBuffer sb = new StringBuffer("Node[");
+        sb.append(coord.x).append(":").append(coord.y);
+        sb.append(", ").append(label);
+        sb.append(", ").append(getEdges());
+        sb.append("]");
+        return sb.toString();
+    }
+}
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/splitsurface/SurfaceSplitOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/splitsurface/SurfaceSplitOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/operation/splitsurface/SurfaceSplitOperation.java	(revision 1663)
@@ -0,0 +1,395 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.split.operation.splitsurface;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import com.vividsolutions.jts.algorithm.CGAlgorithms;
+import com.vividsolutions.jts.geom.Coordinate;
+import com.vividsolutions.jts.geom.CoordinateArrays;
+import com.vividsolutions.jts.geom.GeometryFactory;
+import com.vividsolutions.jts.geom.LineString;
+import com.vividsolutions.jts.geom.LinearRing;
+import com.vividsolutions.jts.geom.Location;
+import com.vividsolutions.jts.geom.MultiLineString;
+import com.vividsolutions.jts.geom.MultiPolygon;
+import com.vividsolutions.jts.geom.Polygon;
+import com.vividsolutions.jts.geomgraph.DirectedEdge;
+import com.vividsolutions.jts.geomgraph.Node;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.operation.GeometryOperationContext;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.vectorediting.lib.prov.split.operation.SplitOperation;
+
+/**
+ * This class is based in the AXIOS team work for UDIG project.
+ *
+ * @author llmarques
+ *
+ */
+
+/*
+ * Performs a split of a LineString, MultiLineString, Polygon or MultiPolygon
+ * using a provided
+ * LineString as cutting edge.
+ *
+ * @author Gabriel Roldán, Axios Engineering
+ *
+ * @author Mauricio Pazos, Axios Engineering
+ *
+ * @since 1.1.0
+ */
+public class SurfaceSplitOperation implements SplitOperation {
+
+    /**
+     * Strategy:
+     * <ul>
+     * <li>Build a graph with all edges and intersection nodes between polygon
+     * and linestring.
+     * <li>Weigth the amount of nodes according to the number of incident edges.
+     * Nodes are only the intersection beetween polygon bondary and linestring
+     * and initial points of each part of boundary.
+     * <li>Weigth edges according to shared (linestring node) or non shared
+     * (boundary of polygon). Store edge cordinates at edge.
+     * <li>Iterate over node graph. Start at any node, starting at its first
+     * segment.
+     * <li>Iterate always to next node, choosing the edge that its first
+     * linestring segment that has less left angle (CCW) with the last segment
+     * of edge linestring.
+     * <li>Delete non shared used edges that was used
+     * <li>Decrease weight at 1 of used nodes
+     * <li>Delete of graph nodes with weight 1
+     * </ul>
+     *
+     * @author Gabriel Roldán, Axios Engineering
+     * @author Mauricio Pazos, Axios Engineering
+     * @since 1.1.0
+     */
+    public Geometry split(Geometry geometryToBeSplitted, Geometry splitter)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+
+        com.vividsolutions.jts.geom.Geometry jtsGeom =
+            (com.vividsolutions.jts.geom.Geometry) geometryToBeSplitted
+                .invokeOperation("toJTS", null);
+
+        com.vividsolutions.jts.geom.Geometry jtsSplitter =
+            (com.vividsolutions.jts.geom.Geometry) splitter.invokeOperation(
+                "toJTS", null);
+
+        if(jtsSplitter instanceof MultiLineString && jtsSplitter.getNumGeometries() == 1){
+            jtsSplitter = jtsSplitter.getGeometryN(0);
+        }
+
+        com.vividsolutions.jts.geom.Geometry result = null;
+        if (jtsSplitter instanceof LineString) {
+            if (jtsGeom instanceof Polygon) {
+                result = splitPolygon(jtsGeom, jtsSplitter);
+            } else if (jtsGeom instanceof MultiPolygon) {
+                result = splitMultiPolygon((MultiPolygon)jtsGeom, jtsSplitter);
+            }
+
+        }
+
+        if(result !=null){
+            GeometryManager manager = GeometryLocator.getGeometryManager();
+            GeometryOperationContext params = new GeometryOperationContext();
+            params.setAttribute("JTSGeometry", result);
+            return (Geometry) manager.invokeOperation("fromJTS", params);
+        }
+        return null;
+    }
+    private com.vividsolutions.jts.geom.Geometry splitMultiPolygon(
+        MultiPolygon jtsMultiPoligon,
+        com.vividsolutions.jts.geom.Geometry jtsSplitter) {
+
+        final GeometryFactory gf = jtsMultiPoligon.getFactory();
+        com.vividsolutions.jts.geom.Geometry result;
+        List<com.vividsolutions.jts.geom.Geometry> splittedGeometries = new ArrayList<com.vividsolutions.jts.geom.Geometry>();
+        for (int i = 0; i < jtsMultiPoligon.getNumGeometries(); i++) {
+            com.vividsolutions.jts.geom.Geometry jtsGeom = jtsMultiPoligon.getGeometryN(i);
+            com.vividsolutions.jts.geom.Geometry splittedGeometry;
+            if (jtsGeom instanceof MultiPolygon) {
+                splittedGeometry = splitMultiPolygon((MultiPolygon)jtsGeom, jtsSplitter);
+            } else {
+                splittedGeometry = splitPolygon(jtsGeom, jtsSplitter);
+            }
+
+            if (splittedGeometry instanceof MultiPolygon) {
+                for (int j = 0; j < ((MultiPolygon)splittedGeometry).getNumGeometries(); j++) {
+                    splittedGeometries.add(((MultiPolygon)splittedGeometry).getGeometryN(j));
+                }
+            } else {
+                splittedGeometries.add(splittedGeometry);
+            }
+        }
+        if (splittedGeometries.size() == 1) {
+            result = splittedGeometries.get(0);
+        } else {
+            Polygon[] array =
+                splittedGeometries.toArray(new Polygon[splittedGeometries
+                    .size()]);
+            result = gf.createMultiPolygon(array);
+        }
+        return result;
+    }
+
+    private com.vividsolutions.jts.geom.Geometry splitPolygon(
+        com.vividsolutions.jts.geom.Geometry jtsGeom,
+        com.vividsolutions.jts.geom.Geometry jtsSplitter) {
+        com.vividsolutions.jts.geom.Geometry result;
+        SplitGraph graph =
+            new SplitGraph((Polygon) jtsGeom, (LineString) jtsSplitter);
+        final GeometryFactory gf = jtsGeom.getFactory();
+
+        // store unsplitted holes for later addition
+        List<LinearRing> unsplittedHoles = findUnsplittedHoles(graph, gf);
+
+        List<List<SplitEdge>> allRings = findRings(graph);
+
+        List<Polygon> resultingPolygons =
+            buildSimplePolygons(allRings, unsplittedHoles, gf);
+
+        if (resultingPolygons.size() == 1) {
+            result = resultingPolygons.get(0);
+        } else {
+            Polygon[] array =
+                resultingPolygons.toArray(new Polygon[resultingPolygons
+                    .size()]);
+            result = gf.createMultiPolygon(array);
+        }
+        return result;
+    }
+
+    /**
+     * Finds out and removes from the graph the edges that were originally holes
+     * in the polygon and were not splitted by the splitting line.
+     *
+     * @param graph
+     * @param gf
+     * @return
+     */
+    private List<LinearRing> findUnsplittedHoles(SplitGraph graph,
+        GeometryFactory gf) {
+        final List<LinearRing> unsplittedHoles = new ArrayList<LinearRing>(2);
+
+        final List<SplitEdge> edges = new ArrayList<SplitEdge>();
+        for (Iterator it = graph.getEdgeIterator(); it.hasNext();) {
+            SplitEdge edge = (SplitEdge) it.next();
+            edges.add(edge);
+        }
+
+        for (Iterator it = edges.iterator(); it.hasNext();) {
+            SplitEdge edge = (SplitEdge) it.next();
+            if (edge.isHoleEdge()) {
+                Coordinate[] coordinates = edge.getCoordinates();
+                Coordinate start = coordinates[0];
+                Coordinate end = coordinates[coordinates.length - 1];
+                boolean isLinearRing = start.equals2D(end);
+                if (isLinearRing) {
+                    graph.remove(edge);
+                    LinearRing ring = gf.createLinearRing(coordinates);
+                    unsplittedHoles.add(ring);
+                }
+            }
+        }
+        return unsplittedHoles;
+    }
+
+    /**
+     * Builds a list of rings from the graph's edges
+     *
+     * @param graph
+     * @return
+     */
+    private List<List<SplitEdge>> findRings(SplitGraph graph) {
+        final List<List<SplitEdge>> rings = new ArrayList<List<SplitEdge>>();
+
+        DirectedEdge startEdge;
+        // build each ring starting with the first edge belonging to the
+        // shell found
+        while ((startEdge = findShellEdge(graph)) != null) {
+            List<SplitEdge> ring = buildRing(graph, startEdge);
+            rings.add(ring);
+        }
+        return rings;
+    }
+
+    /**
+     * Returns the first edge found that belongs to the shell (not an interior
+     * edge, not one of a hole boundary)
+     * <p>
+     * This method relies on shell edges being labeled {@link Location#EXTERIOR
+     * exterior} to the left and {@link Location#INTERIOR interior} to the
+     * right.
+     * </p>
+     *
+     * @param graph
+     * @return the first shell edge found, or <code>null</code> if there are no
+     *         more shell edges in <code>graph</code>
+     */
+    private DirectedEdge findShellEdge(SplitGraph graph) {
+        Iterator it = graph.getEdgeEnds().iterator();
+        DirectedEdge firstShellEdge = null;
+        while (it.hasNext()) {
+            DirectedEdge de = (DirectedEdge) it.next();
+            SplitEdge edge = (SplitEdge) de.getEdge();
+            if (edge.isShellEdge()) {
+                firstShellEdge = de;
+                break;
+            }
+        }
+        return firstShellEdge;
+    }
+
+    private List<SplitEdge> buildRing(final SplitGraph graph,
+        final DirectedEdge startEdge) {
+        final List<SplitEdge> ring = new ArrayList<SplitEdge>();
+
+        // follow this tessellation direction while possible,
+        // switch to the opposite when not, and continue with
+        // the same direction while possible.
+        // Start travelling clockwise, as we start with a shell edge,
+        // which is in clockwise order
+        final int direction = CGAlgorithms.COUNTERCLOCKWISE;
+
+        DirectedEdge currentDirectedEdge = startEdge;
+        DirectedEdge nextDirectedEdge = null;
+
+        while (nextDirectedEdge != startEdge) {
+            SplitEdge edge = (SplitEdge) currentDirectedEdge.getEdge();
+            if (ring.contains(edge)) {
+                throw new IllegalStateException("trying to add edge twice: "
+                    + edge);
+            }
+            ring.add(edge);
+
+            DirectedEdge sym = currentDirectedEdge.getSym();
+            SplitGraphNode endNode = (SplitGraphNode) sym.getNode();
+            SplitEdgeStar nodeEdges = (SplitEdgeStar) endNode.getEdges();
+            nextDirectedEdge =
+                nodeEdges.findClosestEdgeInDirection(sym, direction);
+
+            assert nextDirectedEdge != null;
+
+            currentDirectedEdge = nextDirectedEdge;
+        }
+
+        removeUnneededEdges(graph, ring);
+        return ring;
+    }
+
+    /**
+     * Removes from <code>graph</code> the edges in <code>ring</code> that are
+     * no more needed
+     *
+     * @param graph
+     * @param ring
+     */
+    private void removeUnneededEdges(final SplitGraph graph,
+        final List<SplitEdge> ring) {
+        for (SplitEdge edge : ring) {
+            if (!edge.isInteriorEdge()) {
+                graph.remove(edge);
+            }
+        }
+
+        for (SplitEdge edge : ring) {
+            if (edge.isInteriorEdge()) {
+                Node node = graph.find(edge.getCoordinate());
+                int degree = node.getEdges().getDegree();
+                if (degree < 2) {
+                    graph.remove(edge);
+                }
+            }
+        }
+    }
+
+    private List<Polygon> buildSimplePolygons(List<List<SplitEdge>> allRings,
+        List<LinearRing> unsplittedHoles, GeometryFactory gf) {
+
+        List<Polygon> polygons = new ArrayList<Polygon>(allRings.size());
+
+        for (List<SplitEdge> edgeList : allRings) {
+            Polygon poly = buildPolygon(edgeList, gf);
+            List<LinearRing> thisPolyHoles =
+                new ArrayList<LinearRing>(unsplittedHoles.size());
+            for (LinearRing holeRing : unsplittedHoles) {
+                if (poly.covers(holeRing)) {
+                    thisPolyHoles.add(holeRing);
+                }
+            }
+            unsplittedHoles.removeAll(thisPolyHoles);
+
+            int numHoles = thisPolyHoles.size();
+            if (numHoles > 0) {
+                LinearRing[] holes =
+                    thisPolyHoles.toArray(new LinearRing[numHoles]);
+                LinearRing shell =
+                    gf.createLinearRing(poly.getExteriorRing().getCoordinates());
+                poly = gf.createPolygon(shell, holes);
+            }
+
+            polygons.add(poly);
+        }
+
+        return polygons;
+    }
+
+    private Polygon buildPolygon(List<SplitEdge> edgeList, GeometryFactory gf) {
+        List<Coordinate> coords = new ArrayList<Coordinate>();
+        Coordinate[] lastCoordinates = null;
+        for (SplitEdge edge : edgeList) {
+            Coordinate[] coordinates = edge.getCoordinates();
+            if (lastCoordinates != null) {
+                Coordinate endPoint =
+                    lastCoordinates[lastCoordinates.length - 1];
+                Coordinate startPoint = coordinates[0];
+                if (!endPoint.equals2D(startPoint)) {
+                    coordinates = CoordinateArrays.copyDeep(coordinates);
+                    CoordinateArrays.reverse(coordinates);
+                }
+            }
+            lastCoordinates = coordinates;
+            for (int i = 0; i < coordinates.length; i++) {
+                Coordinate coord = coordinates[i];
+                coords.add(coord);
+            }
+        }
+        Coordinate[] shellCoords = new Coordinate[coords.size()];
+        coords.toArray(shellCoords);
+        shellCoords = CoordinateArrays.removeRepeatedPoints(shellCoords);
+        LinearRing shell = gf.createLinearRing(shellCoords);
+        Polygon poly = gf.createPolygon(shell, (LinearRing[]) null);
+        return poly;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/SplitEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/SplitEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/SplitEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,90 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.split;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author llmarques
+ *
+ */
+public class SplitEditingProviderFactory extends AbstractProviderFactory
+    implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "modify-split";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Splits geometries through line";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", false, null,
+                new int[] { 
+                    Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE,
+                    Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                    Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, 
+                    Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE 
+                });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new SplitEditingProvider(services, parameters);
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/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
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/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	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/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	(revision 1663)
@@ -0,0 +1,95 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.split;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.Library;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.prov.split.operation.ArcSplitOperation;
+import org.gvsig.vectorediting.lib.prov.split.operation.CurveSplitOperation;
+import org.gvsig.vectorediting.lib.prov.split.operation.LineSplitOperation;
+import org.gvsig.vectorediting.lib.prov.split.operation.SplitOperationUtils;
+import org.gvsig.vectorediting.lib.prov.split.operation.splitsurface.SurfaceSplitOperation;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * @author llmarques
+ *
+ */
+public class SplitEditingLibrary extends AbstractLibrary implements Library {
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new SplitEditingProviderFactory());
+
+        SplitOperationUtils.register(new ArcSplitOperation(),
+            Geometry.TYPES.ARC);
+        SplitOperationUtils.register(new CurveSplitOperation(),
+            Geometry.TYPES.CURVE);
+        SplitOperationUtils.register(new LineSplitOperation(),
+            Geometry.TYPES.LINE);
+        SplitOperationUtils.register(new CurveSplitOperation(),
+            Geometry.TYPES.SPLINE);
+        SplitOperationUtils.register(new CurveSplitOperation(),
+            Geometry.TYPES.CIRCUMFERENCE);
+        SplitOperationUtils.register(new CurveSplitOperation(),
+            Geometry.TYPES.PERIELLIPSE);
+        SplitOperationUtils.register(new SurfaceSplitOperation(),
+            Geometry.TYPES.SURFACE);
+        SplitOperationUtils.register(new SurfaceSplitOperation(),
+            Geometry.TYPES.POLYGON);
+        SplitOperationUtils.register(new SurfaceSplitOperation(),
+            Geometry.TYPES.CIRCLE);
+        SplitOperationUtils.register(new SurfaceSplitOperation(),
+            Geometry.TYPES.ELLIPSE);
+        SplitOperationUtils.register(new SurfaceSplitOperation(),
+            Geometry.TYPES.FILLEDSPLINE);
+        SplitOperationUtils.register(new SurfaceSplitOperation(),
+                Geometry.TYPES.ELLIPTICARC);
+
+        manager.registerIcon("vectorediting-tools", "modify-split", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "split-editing");
+    }
+
+}

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/java/org/gvsig/vectorediting/lib/prov/polyline/PolylineEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/java/org/gvsig/vectorediting/lib/prov/polyline/PolylineEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/java/org/gvsig/vectorediting/lib/prov/polyline/PolylineEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,86 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.polyline;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+public class PolylineEditingProviderFactory extends AbstractProviderFactory
+implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "insert-polyline";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Inserts a polyline on the view";
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    public void initialize() {
+
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", true, null,
+                new int[] { 
+                    Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                    Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE 
+                });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new PolylineEditingProvider(services, parameters);
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/java/org/gvsig/vectorediting/lib/prov/polyline/PolylineEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/java/org/gvsig/vectorediting/lib/prov/polyline/PolylineEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/java/org/gvsig/vectorediting/lib/prov/polyline/PolylineEditingLibrary.java	(revision 1663)
@@ -0,0 +1,74 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.polyline;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * Library for default implementation initialization and configuration.
+ *
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class PolylineEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new PolylineEditingProviderFactory());
+        manager.addProviderFactory(new PolygonEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "insert-polygon", this
+            .getClass().getClassLoader(), this.getClass().getName());
+        manager.registerIcon("vectorediting-tools", "insert-polyline", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "polyline-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/java/org/gvsig/vectorediting/lib/prov/polyline/PolygonEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/java/org/gvsig/vectorediting/lib/prov/polyline/PolygonEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/java/org/gvsig/vectorediting/lib/prov/polyline/PolygonEditingProvider.java	(revision 1663)
@@ -0,0 +1,80 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.polyline;
+
+import java.util.LinkedHashMap;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.primitive.Surface;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+
+public class PolygonEditingProvider extends PolylineEditingProvider implements
+    EditingProvider {
+
+    public PolygonEditingProvider(ProviderServices providerServices,
+        DynObject parameters) {
+        super(providerServices, parameters);
+    }
+
+    @Override
+    public Geometry finish() throws FinishServiceException {
+        try {
+            GeometryType storeGeomType =
+                editingProviderServices.getGeomType(featureStore);
+            GeometryManager geomManager = GeometryLocator.getGeometryManager();
+
+            Surface surface =
+                geomManager.createPolygon(storeGeomType.getSubType());
+            calculateFinalGeometry(storeGeomType, surface);
+            surface = (Surface) closeGeometryIfNecessary(surface);
+            if (storeGeomType.isTypeOf(MULTISURFACE)) {
+                MultiSurface multiSurface =
+                    geomManager.createMultiSurface(storeGeomType.getSubType());
+                multiSurface.addSurface(surface);
+                return multiSurface;
+            } else {
+                return surface;
+            }
+        } catch (Exception e) {
+            throw new FinishServiceException(e);
+        }
+    }
+
+    @Override
+    public String getName() {
+        return PolygonEditingProviderFactory.PROVIDER_NAME;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/java/org/gvsig/vectorediting/lib/prov/polyline/PolylineEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/java/org/gvsig/vectorediting/lib/prov/polyline/PolylineEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/java/org/gvsig/vectorediting/lib/prov/polyline/PolylineEditingProvider.java	(revision 1663)
@@ -0,0 +1,511 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.polyline;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryException;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.aggregate.MultiLine;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.OrientablePrimitive;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Surface;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.VectorEditingException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+public class PolylineEditingProvider extends AbstractEditingProvider implements EditingProvider {
+
+    protected EditingProviderServices editingProviderServices = (EditingProviderServices) getProviderServices();
+
+    protected EditingServiceParameter points;
+
+    protected Map<String, String> options;
+
+    private boolean arcMode;
+
+    private boolean finishPolyline;
+
+    private boolean closeGeometry;
+
+    private List<MyPolyLinePoint> values;
+
+    protected FeatureStore featureStore;
+
+    public PolylineEditingProvider(ProviderServices providerServices, DynObject parameters) {
+        super(providerServices);
+
+        // Initialize all provider variables.
+        this.featureStore = (FeatureStore) parameters.getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        I18nManager i18nManager = ToolsLocator.getI18nManager();
+
+        options = new LinkedHashMap<String, String>();
+        options.put(i18nManager.getTranslation("key_arc_mode"), "arc_mode");
+        options.put(i18nManager.getTranslation("key_line_mode"), "line_mode");
+        options.put(i18nManager.getTranslation("key_close"), "close_polyline");
+        options.put(i18nManager.getTranslation("key_finish"), "finish");
+        options.put(i18nManager.getTranslation("key_remove_last_point"), "remove_last_point");
+
+        String consoleMsg = editingProviderServices.makeConsoleMessage("indicate_new_point", options);
+
+        points =
+            new DefaultEditingServiceParameter("insert_point", consoleMsg, options, TYPE.LIST_POSITIONS, TYPE.OPTION);
+
+        arcMode = false;
+        finishPolyline = false;
+        closeGeometry = false;
+    }
+
+    /**
+     * Calculates polyline with stored values and last position received as
+     * parameter. If last position is null calculates only with stored values.
+     *
+     * @param lastPosition
+     *            of polyline.
+     * @return A drawing status value with a list of geometries. See
+     *         {@link DrawingStatus#getGeometries()}.
+     */
+    private DrawingStatus calculatePolyline(Point lastPosition) throws VectorEditingException {
+        DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+        EditingProviderManager editingProviderManager = EditingProviderLocator.getProviderManager();
+        ISymbol lineSymbolEditing = editingProviderManager.getSymbol("line-symbol-editing");
+        ISymbol auxiliaryLineSymbolEditing = editingProviderManager.getSymbol("auxiliary-line-symbol-editing");
+        ISymbol auxiliaryPointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+
+        Double antm = null;
+        Double antb = null;
+        Double m = null;
+        Double b = null;
+        Point center = null;
+        double radius = 0.0;
+        double startAngle = 0.0;
+        double endAngle = 0.0;
+        double angleExt = 0.0;
+        boolean right = false;
+        boolean addGeom = false;
+
+        GeometryManager geomManager = GeometryLocator.getGeometryManager();
+
+        Curve lineAntPointToPoint = null;
+
+        if (values.size() >= 1) {
+            for (int i = 0; i < values.size(); i++) {
+
+                MyPolyLinePoint polyLinePoint = values.get(i);
+                MyPolyLinePoint polyLineNextPoint = getNextPoint(i);
+
+                Point point = polyLinePoint.getPoint();
+                Point nextPoint;
+
+                if (polyLineNextPoint == null) {
+                    nextPoint = lastPosition;
+                    addGeom = true;
+                } else {
+                    nextPoint = polyLineNextPoint.getPoint();
+                }
+
+                if (nextPoint == null) {
+                    return drawingStatus;
+                }
+                try {
+                    if (polyLinePoint.isArcMode()) {
+                        EditingProviderServices editingProviderServices =
+                            ((EditingProviderServices) getProviderServices());
+                        int subtype = editingProviderServices.getSubType(featureStore);
+
+                        lineAntPointToPoint = editingProviderServices.createLine(point, nextPoint, subtype);
+
+                        Double[] lineParams = editingProviderServices.getLineParams(point, nextPoint);
+                        m = lineParams[0];
+                        b = lineParams[1];
+
+                        Point[] pointPerpendicular =
+                            editingProviderServices.getPerpendicular(antm, antb, point, subtype);
+                        Line linePointPerpendicular = geomManager.createLine(subtype);
+                        linePointPerpendicular.setPoints(pointPerpendicular[0], pointPerpendicular[1]);
+
+                        Point midPoint = editingProviderServices.getMidPoint(point, nextPoint, subtype);
+                        Point[] bisector = editingProviderServices.getPerpendicular(m, b, midPoint, subtype);
+                        Line lineBisector = geomManager.createLine(subtype);
+                        lineBisector.setPoints(bisector[0], bisector[1]);
+
+                        center = editingProviderServices.getIntersection(bisector, pointPerpendicular, subtype);
+
+                        if (center != null) {
+                            startAngle = editingProviderServices.getAngle(center, point);
+                            endAngle = editingProviderServices.getAngle(center, nextPoint);
+
+                            radius = center.distance(point);
+                        } else {
+                            String msg =
+                                String.format("Can't get intersection between bisector" + " [(%1$s,%2$s),(%3$s,%4$s)]"
+                                    + " and perperdicular" + " [(%5$s,%6$s),(%7$s,%8$s)]", bisector[0].getX(),
+                                    bisector[0].getY(), bisector[1].getX(), bisector[1].getY(),
+                                    pointPerpendicular[0].getX(), pointPerpendicular[0].getY(),
+                                    pointPerpendicular[1].getX(), pointPerpendicular[1].getY());
+
+                            throw new DrawServiceException(msg, null);
+                        }
+
+                        Double[] lineCenterNextParams = editingProviderServices.getLineParams(center, nextPoint);
+                        double mcn = lineParams[0];
+                        double bcn = lineParams[1];
+
+                        if (right) {
+                            if (m >= antm) {
+                                    if(mcn >= antm){
+                                        angleExt = -editingProviderServices.angleDistance(startAngle, endAngle);
+                                    } else {
+                                        angleExt = editingProviderServices.angleDistance(endAngle, startAngle);
+                                    }
+                                right = !(nextPoint.getY() >= center.getY());
+                            } else {
+                                angleExt = -editingProviderServices.angleDistance(startAngle, endAngle);
+                                right = (nextPoint.getY() >= center.getY());
+                            }
+                        } else {
+                            if (m >= antm) {
+                                angleExt = editingProviderServices.angleDistance(endAngle, startAngle);
+                                right = !(nextPoint.getY() >= center.getY());
+                            } else {
+                                angleExt = -editingProviderServices.angleDistance(startAngle, endAngle);
+                                right = (nextPoint.getY() >= center.getY());
+                            }
+                        }
+
+                        Arc arco = null;
+                        arco = editingProviderServices.createArc(center, radius, startAngle, angleExt, Geometry.SUBTYPES.GEOM2D);
+//                        Arc inverseArc = (Arc) geomManager.create(Geometry.TYPES.ARC, subtype);
+//                        inverseArc.setPoints(arco.getEndPoint(), arco.getMiddlePoint(), arco.getInitPoint());
+//                        arco = inverseArc;
+
+                        antm = -(nextPoint.getX() - center.getX()) / (nextPoint.getY() - center.getY());
+                        if (antm == Double.POSITIVE_INFINITY) {
+                            antb = Double.NEGATIVE_INFINITY;
+                            if (nextPoint.getX() == 0) {
+                                antb = 0.0;
+                            }
+                        } else if (antm == Double.NEGATIVE_INFINITY) {
+                            antb = Double.POSITIVE_INFINITY;
+                            if (nextPoint.getX() == 0) {
+                                antb = 0.0;
+                            }
+                        } else {
+                            antb = nextPoint.getY() - (antm * nextPoint.getX());
+                        }
+
+                        // Draw geometries.
+                        if (addGeom) {
+                            drawingStatus.addStatus(point, auxiliaryPointSymbolEditing, "");
+                            drawingStatus.addStatus(nextPoint, auxiliaryPointSymbolEditing, "");
+                            drawingStatus.addStatus(center, auxiliaryPointSymbolEditing, "");
+                            drawingStatus.addStatus(lineAntPointToPoint, auxiliaryLineSymbolEditing, "");
+
+                        }
+                        drawingStatus.addStatus(arco, lineSymbolEditing, "");
+
+                    } else {
+                        int subtype = editingProviderServices.getSubType(featureStore);
+                        Curve geometry = editingProviderServices.createLine(point, nextPoint, subtype);
+                        if (addGeom) {
+                            drawingStatus.addStatus(point, auxiliaryPointSymbolEditing, "");
+                            drawingStatus.addStatus(nextPoint, auxiliaryPointSymbolEditing, "");
+                        }
+                        drawingStatus.addStatus(geometry, lineSymbolEditing, "");
+
+                        Double[] antLineParams = editingProviderServices.getLineParams(point, nextPoint);
+                        antm = antLineParams[0];
+                        antb = antLineParams[1];
+                        right = (nextPoint.getX() >= point.getX());
+                    }
+                } catch (Exception e) {
+                    throw new DrawServiceException(e);
+                }
+            }
+            return drawingStatus;
+        }
+        return null;
+    }
+
+    protected Geometry closeGeometryIfNecessary(Geometry geometry) {
+        if (!isClose(geometry) && (geometry != null)) {
+
+            if (geometry instanceof Surface) {
+                Surface surface = (Surface) geometry;
+                Point firstp = surface.getVertex(0);
+                firstp = (Point) firstp.cloneGeometry();
+                surface.addVertex(firstp);
+                return surface;
+            } else if (geometry instanceof Curve) {
+                Curve line = (Curve) geometry;
+                Point firstp = line.getVertex(0);
+                firstp = (Point) firstp.cloneGeometry();
+                line.addVertex(firstp);
+                return line;
+            }
+        }
+        return geometry;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition) throws DrawServiceException {
+
+        try {
+            return calculatePolyline(mousePosition);
+
+        } catch (Exception e) {
+            throw new DrawServiceException(e);
+        }
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+        try {
+            Geometry geometry = finish();
+            if (geometry != null) {
+                editingProviderServices.insertGeometryIntoFeatureStore(geometry, featureStore);
+            }
+        } catch (Exception e) {
+            throw new FinishServiceException(e);
+        }
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        try {
+            GeometryManager geomManager = GeometryLocator.getGeometryManager();
+            GeometryType storeGeomType = editingProviderServices.getGeomType(featureStore);
+            Line line = geomManager.createLine(storeGeomType.getSubType());
+            calculateFinalGeometry(storeGeomType, line);
+
+            if (closeGeometry) {
+                line = (Line) closeGeometryIfNecessary(line);
+            }
+
+            if (storeGeomType.isTypeOf(MULTICURVE)) {
+                MultiCurve multiCurve = geomManager.createMultiCurve(storeGeomType.getSubType());
+                multiCurve.addCurve(line);
+                return multiCurve;
+            } else {
+                return line;
+            }
+
+        } catch (BaseException e) {
+            throw new FinishServiceException(e);
+        }
+    }
+
+    /**
+     * Calculate the final geometry reversing the geometries of the
+     * drawingStatus if needed.
+     *
+     * @param geometryType
+     * @param orientablePrimitive
+     * @throws DataException
+     * @throws VectorEditingException
+     * @throws GeometryException
+     * @throws GeometryOperationException
+     * @throws GeometryOperationNotSupportedException
+     */
+    protected void calculateFinalGeometry(GeometryType geometryType, OrientablePrimitive orientablePrimitive)
+        throws DataException, VectorEditingException, GeometryException, GeometryOperationNotSupportedException, GeometryOperationException {
+        DrawingStatus drawingStatus = calculatePolyline(null);
+        Point vertexAnt = null;
+        for (Geometry geometry : drawingStatus.getGeometries()) {
+            if (geometry instanceof Line) {
+                Line line = (Line) geometry;
+                for (int i = 0; i < line.getNumVertices(); i++) {
+                    if ((vertexAnt == null) || !vertexAnt.equals(line.getVertex(i))) {
+                        orientablePrimitive.addVertex(line.getVertex(i));
+                        vertexAnt = line.getVertex(i);
+                    }
+                }
+            } else if(geometry instanceof Curve){
+                MultiLine multiline = geometry.toLines();
+                for(int i=0; i<multiline.getPrimitivesNumber(); i++){
+                    Line line = (Line)multiline.getPrimitiveAt(i);
+                    if(line.getNumVertices()>0 && vertexAnt!= null && line.getVertex(0)!=vertexAnt){
+                        line.flip();
+                    }
+                    for (int j = 0; j < line.getNumVertices(); j++) {
+                        if ((vertexAnt == null) || !vertexAnt.equals(line.getVertex(j))) {
+                            orientablePrimitive.addVertex(line.getVertex(j));
+                            vertexAnt = line.getVertex(j);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    public String getName() {
+        return PolylineEditingProviderFactory.PROVIDER_NAME;
+    }
+
+    private MyPolyLinePoint getNextPoint(int i) {
+        if (!values.isEmpty() && (i < (values.size() - 1))) {
+            return values.get(i + 1);
+        }
+        return null;
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> list = new ArrayList<EditingServiceParameter>();
+        list.add(points);
+        return list;
+    }
+
+    private boolean isClose(Geometry geometry) {
+
+        if (geometry != null) {
+
+            if (geometry instanceof OrientablePrimitive) {
+                OrientablePrimitive orientablePrimitive = (OrientablePrimitive) geometry;
+                Point firstPoint = orientablePrimitive.getVertex(0);
+                Point lastPoint = orientablePrimitive.getVertex(orientablePrimitive.getNumVertices() - 1);
+                if (firstPoint.equals(lastPoint)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    public EditingServiceParameter next() {
+        if (finishPolyline) {
+            return null;
+        } else {
+            return points;
+        }
+
+    }
+
+    public void start() throws StartServiceException {
+        // Stop service;
+        stop();
+
+        values = new ArrayList<MyPolyLinePoint>();
+    }
+
+    public void stop() {
+        if (values != null) {
+            values.clear();
+        }
+        arcMode = false;
+        finishPolyline = false;
+        closeGeometry = false;
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter param, Object value) throws InvalidEntryException {
+        if (value instanceof String) {
+            String option = (String) value;
+            I18nManager i18nManager = ToolsLocator.getI18nManager();
+
+            if (option.equalsIgnoreCase(i18nManager.getTranslation("key_finish"))) {
+                finishPolyline = true;
+                return;
+            }
+
+            if (values.size() > 0) {
+                if (option.equalsIgnoreCase(i18nManager.getTranslation("key_remove_last_point"))) {
+                    arcMode = values.get(values.size() - 1).isArcMode();
+                    if (values.size() > 2) {
+                        values.get(values.size() - 2).setArcMode(arcMode);
+                    } else {
+                        arcMode = false;
+                    }
+                    values.remove(values.size() - 1);
+                    return;
+                }
+            }
+
+            if (values.size() >= 2) {
+
+                if (option.equalsIgnoreCase(i18nManager.getTranslation("key_arc_mode"))) {
+
+                    arcMode = true;
+
+                } else if (option.equalsIgnoreCase(i18nManager.getTranslation("key_line_mode"))) {
+
+                    arcMode = false;
+
+                } else if (option.equalsIgnoreCase(i18nManager.getTranslation("key_close"))) {
+
+                    closeGeometry = true;
+                    finishPolyline = true;
+                }
+            } else {
+                throw new InvalidEntryException(null);
+            }
+
+            if (values.size() > 0) {
+                values.get(values.size() - 1).setArcMode(arcMode);
+                return;
+            }
+
+        } else if ((param == points) && (value instanceof Point)) {
+            values.add(new MyPolyLinePoint((Point) value, arcMode));
+            return;
+        }
+        throw new InvalidEntryException(null);
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter param = next();
+        validateAndInsertValue(param, value);
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/java/org/gvsig/vectorediting/lib/prov/polyline/MyPolyLinePoint.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/java/org/gvsig/vectorediting/lib/prov/polyline/MyPolyLinePoint.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/java/org/gvsig/vectorediting/lib/prov/polyline/MyPolyLinePoint.java	(revision 1663)
@@ -0,0 +1,56 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.polyline;
+
+import org.gvsig.fmap.geom.primitive.Point;
+
+public class MyPolyLinePoint {
+
+    private Point point;
+
+    private boolean arcMode;
+
+    public MyPolyLinePoint(Point point, boolean mode) {
+        this.point = point;
+        this.arcMode = mode;
+    }
+
+    public Point getPoint() {
+        return point;
+    }
+
+    public void setPoint(Point point) {
+        this.point = point;
+    }
+
+    public boolean isArcMode() {
+        return arcMode;
+    }
+
+    public void setArcMode(boolean arcMode) {
+        this.arcMode = arcMode;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/java/org/gvsig/vectorediting/lib/prov/polyline/PolygonEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/java/org/gvsig/vectorediting/lib/prov/polyline/PolygonEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/java/org/gvsig/vectorediting/lib/prov/polyline/PolygonEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,90 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.polyline;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+public class PolygonEditingProviderFactory extends AbstractProviderFactory
+implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "insert-polygon";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Inserts a polygon on the view";
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    public void initialize() {
+
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(
+                PROVIDER_NAME,
+                "",
+                true,
+                null,
+                new int[] { 
+                    Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, 
+                    Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE 
+                });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new PolygonEditingProvider(services, parameters);
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.polyline.PolylineEditingLibrary
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/resources/images/vectorediting-tools/insert-polygon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/resources/images/vectorediting-tools/insert-polygon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/resources/images/vectorediting-tools/insert-polyline.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/main/resources/images/vectorediting-tools/insert-polyline.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/test/resources/cartography/hidro_andalucia.shp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/test/resources/cartography/hidro_andalucia.shp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/test/resources/cartography/hidro_andalucia.dbf
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/test/resources/cartography/hidro_andalucia.dbf
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/test/resources/cartography/hidro_andalucia.shx
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/test/resources/cartography/hidro_andalucia.shx
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/test/java/org/gvsig/vectorediting/lib/prov/polyline/PolylineTest.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/test/java/org/gvsig/vectorediting/lib/prov/polyline/PolylineTest.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/src/test/java/org/gvsig/vectorediting/lib/prov/polyline/PolylineTest.java	(revision 1663)
@@ -0,0 +1,462 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.polyline;
+
+import java.io.File;
+import java.net.URL;
+import java.util.List;
+
+import org.gvsig.fmap.crs.CRSFactory;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingService;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.VectorEditingException;
+import org.gvsig.vectorediting.lib.impl.DefaultEditingManager;
+
+/**
+ * Polyline provider test
+ *
+ * This test uses src/test/resources/cartography
+ *
+ * @author llmarques
+ *
+ */
+public class PolylineTest extends AbstractLibraryAutoInitTestCase {
+
+    DefaultEditingManager editingManager;
+    GeometryManager geoManager;
+    FeatureStore featureStoreTest;
+    EditingService service;
+    DataManager dataManager;
+    MapContext mapContextTest;
+
+    @Override
+    protected void doSetUp() throws Exception {
+        editingManager = new DefaultEditingManager();
+
+        geoManager = GeometryLocator.getGeometryManager();
+
+        try {
+            featureStoreTest = openTestFeatureStore();
+        } catch (Exception e) {
+            fail("Unexpected exception opening test feature store: "
+                + e.getMessage());
+        }
+
+        mapContextTest =
+            new MapContext(new ViewPort(featureStoreTest
+                .getDefaultFeatureType().getDefaultSRS()));
+
+        service =
+            editingManager.getEditingService(
+                PolylineEditingProviderFactory.PROVIDER_NAME, featureStoreTest,
+                mapContextTest);
+
+        service.start();
+
+    }
+
+    public void testFinish() {
+
+        // Finish without values
+        try {
+
+            service.finish();
+            fail("No exception has been thrown");
+
+        } catch (NullPointerException e) {
+            // Test OK, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception finishing service: " + e.getMessage());
+        }
+
+        // Finish with one value
+        Point point = null;
+        try {
+            point = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+
+            service.setValue(point);
+            service.finish();
+        } catch (Exception e) {
+            fail("Unexpected exception has been thrown endig service. "
+                + e.getMessage());
+        }
+
+        // Finish with two values mode line
+        Point point2 = null;
+        try {
+            point2 = geoManager.createPoint(10, 10, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(point2);
+
+            Geometry geom = service.finish();
+
+            assertTrue(geom instanceof MultiCurve);
+            MultiCurve multicurve = (MultiCurve) geom;
+            Curve curve = multicurve.getCurveAt(0);
+
+            assertTrue(curve.getVertex(0).getX() == point.getX());
+            assertTrue(curve.getVertex(0).getY() == point.getY());
+            assertTrue(curve.getVertex(1).getX() == point2.getX());
+            assertTrue(curve.getVertex(1).getY() == point2.getY());
+
+        } catch (Exception e) {
+            fail("Unexpected exception has been thrown ending service. "
+                + e.getMessage());
+        }
+
+        // Restart service
+        restartService();
+
+        // Finish with three aligned values mode arc
+        Point point3;
+        try {
+            point3 = geoManager.createPoint(20, 20, Geometry.SUBTYPES.GEOM2D);
+
+            service.setValue(point);
+            service.setValue(point2);
+            service.setValue("A");
+            service.setValue(point3);
+
+            service.finish();
+        } catch (FinishServiceException e) {
+            // Test ok, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception has been thrown ending service. "
+                + e.getMessage());
+        }
+
+        // Restart service
+        restartService();
+
+        // Finish with random values
+        try {
+            for (int i = 0; i < 200; i++) {
+                point =
+                    geoManager.createPoint(Math.random() * 10000,
+                        Math.random() * 10000, Geometry.SUBTYPES.GEOM2D);
+                service.setValue(point);
+                if (i > 3) {
+                    if ((int) (Math.random() * 2) > 0) {
+                        service.setValue("A");
+                    } else {
+                        service.setValue("L");
+                    }
+                }
+            }
+
+            service.finish();
+        } catch (Exception e) {
+            fail("Unexpected exception has been thrown ending service. "
+                + e.getMessage());
+        }
+
+    }
+
+    public void testfinishAndStore() {
+        // Finish without values
+        try {
+
+            service.finishAndStore();
+            fail("No exception has been thrown");
+
+        } catch (FinishServiceException e) {
+            // Test OK, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception finishing service: " + e.getMessage());
+        }
+
+        // Finish with one value
+        Point point = null;
+        try {
+            point = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+
+            service.setValue(point);
+            featureStoreTest.edit();
+            service.finishAndStore();
+            featureStoreTest.finishEditing();
+        } catch (Exception e) {
+            fail("Unexpected exception has been thrown endig service. "
+                + e.getMessage());
+        }
+
+        // Finish with two values mode line
+        Point point2 = null;
+        try {
+            point2 = geoManager.createPoint(10, 10, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(point2);
+
+            featureStoreTest.edit();
+            service.finishAndStore();
+            featureStoreTest.finishEditing();
+
+        } catch (Exception e) {
+            fail("Unexpected exception has been thrown ending service. "
+                + e.getMessage());
+        }
+
+        // Restart service
+        restartService();
+
+        // Finish with three aligned values mode arc
+        Point point3;
+        try {
+            point3 = geoManager.createPoint(20, 20, Geometry.SUBTYPES.GEOM2D);
+
+            service.setValue(point);
+            service.setValue(point2);
+            service.setValue("A");
+            service.setValue(point3);
+
+            service.finishAndStore();
+        } catch (FinishServiceException e) {
+            // Test ok, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception has been thrown ending service. "
+                + e.getMessage());
+        }
+
+        // Restart service
+        restartService();
+
+        // Finish with random values
+        try {
+            for (int i = 0; i < 200; i++) {
+                point =
+                    geoManager.createPoint(Math.random() * 10000,
+                        Math.random() * 10000, Geometry.SUBTYPES.GEOM2D);
+                service.setValue(point);
+                if (i > 3) {
+                    if ((int) (Math.random() * 2) > 0) {
+                        service.setValue("A");
+                    } else {
+                        service.setValue("L");
+                    }
+                }
+            }
+
+            featureStoreTest.edit();
+            service.finishAndStore();
+            featureStoreTest.finishEditing();
+        } catch (Exception e) {
+            fail("Unexpected exception has been thrown ending service. "
+                + e.getMessage());
+        }
+
+    }
+
+    public void testgetDrawingStatus() {
+
+        // Without values and mouse point null
+        try {
+            service.getDrawingStatus(null);
+        } catch (NullPointerException e) {
+            // Testk ok, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception has been thrown getting drawing status. "
+                + e.getMessage());
+        }
+
+        // Without values and valid mouse point
+        Point mousePoint = null;
+        try {
+
+            mousePoint =
+                geoManager.createPoint(20, 50, Geometry.SUBTYPES.GEOM2D);
+            DrawingStatus drawingStatus = service.getDrawingStatus(mousePoint);
+
+            assertNull(drawingStatus);
+
+        } catch (Exception e) {
+            fail("Unexpected exception has been thrown getting drawing status. "
+                + e.getMessage());
+        }
+
+        // One valid values and valid mouse position
+        Point point1;
+        try {
+
+            point1 = geoManager.createPoint(20, 50, Geometry.SUBTYPES.GEOM2D);
+
+            service.setValue(point1);
+            DrawingStatus drawingStatus = service.getDrawingStatus(mousePoint);
+
+            assertNotNull(drawingStatus);
+            assertTrue(drawingStatus.getGeometries().size() == 1);
+            Geometry geometry = drawingStatus.getGeometries().get(0);
+            assertTrue(geometry instanceof Line);
+
+            Line line = (Line) geometry;
+            assertTrue(line.getVertex(0).getX() == point1.getX());
+            assertTrue(line.getVertex(0).getY() == point1.getY());
+            assertTrue(line.getVertex(1).getX() == point1.getX());
+            assertTrue(line.getVertex(1).getY() == point1.getY());
+
+        } catch (Exception e) {
+            fail("Unexpected exception has been thrown getting drawing status. "
+                + e.getMessage());
+        }
+
+    }
+
+    public void testgetName() {
+
+        assertEquals(PolylineEditingProviderFactory.PROVIDER_NAME,
+            service.getName());
+
+    }
+
+    public void testgetParameters() {
+
+        List<EditingServiceParameter> parameters = service.getParameters();
+
+        assertTrue(parameters.size() == 1);
+        assertTrue(parameters.get(0).getTypes()
+            .contains(EditingServiceParameter.TYPE.LIST_POSITIONS));
+    }
+
+    public void testNext() {
+
+        assertNotNull(service.next());
+
+        List<EditingServiceParameter> parameters = service.getParameters();
+        assertEquals(parameters.get(0), service.next());
+
+        for (int i = 0; i < 10; i++) {
+            try {
+                Point point =
+                    geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+                service.setValue(point);
+
+            } catch (Exception e) {
+                fail("Unexpected exception creating point or setting value. "
+                    + e.getMessage());
+            }
+        }
+
+        assertEquals(parameters.get(0), service.next());
+    }
+
+    public void testsetValue() {
+
+        // Valid point
+        try {
+            Point point =
+                geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(point);
+        } catch (Exception e) {
+            fail("Unexpected exception setting value. " + e.getMessage());
+        }
+
+        // Invalid value
+        try {
+            Point point = null;
+            service.setValue(point);
+        } catch (InvalidEntryException e) {
+            // Test ok, got expected value
+        } catch (Exception e) {
+            fail("Unexpected exception setting value. " + e.getMessage());
+        }
+
+    }
+
+    public void testStart() {
+        service =
+            editingManager.getEditingService(
+                PolylineEditingProviderFactory.PROVIDER_NAME, featureStoreTest,
+                mapContextTest);
+
+        try {
+            service.start();
+        } catch (VectorEditingException e) {
+            fail("Unexpected exception starting service: " + e.getMessage());
+        }
+    }
+
+    public void testStop() {
+        service =
+            editingManager.getEditingService(
+                PolylineEditingProviderFactory.PROVIDER_NAME, featureStoreTest,
+                mapContextTest);
+
+        try {
+            service.start();
+            service.stop();
+        } catch (VectorEditingException e) {
+            fail("Unexpected exception stopping service: " + e.getMessage());
+        }
+    }
+
+    private FeatureStore openTestFeatureStore() throws Exception {
+
+        URL shapeURL =
+            this.getClass().getResource("/cartography/hidro_andalucia.shp");
+        if (shapeURL == null) {
+            throw new IllegalStateException("Can't locate cartography resource");
+        }
+        File shapeFile = new File(shapeURL.getFile());
+        if (!shapeFile.exists()) {
+            throw new IllegalStateException("cartography resource not exists");
+        }
+
+        dataManager = DALLocator.getDataManager();
+
+        DataStoreParameters params = dataManager.createStoreParameters("Shape");
+
+        params.setDynValue("shpfile", shapeFile);
+        params.setDynValue("CRS", CRSFactory.getCRS("EPSG:23030"));
+        params.setDynValue("useNullGeometry", false);
+        params.validate();
+
+        return (FeatureStore) dataManager.openStore("Shape", params);
+
+    }
+
+    public void restartService() {
+        try {
+            service.stop();
+            service.start();
+        } catch (Exception e) {
+            fail("Unexpected exception has been thrown restarting service. "
+                + e.getMessage());
+        }
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.polyline</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.polyline</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polyline
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.simplify.SimplifyEditingLibrary
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify/src/main/resources/images/vectorediting-tools/modify-simplify.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify/src/main/resources/images/vectorediting-tools/modify-simplify.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify/src/main/java/org/gvsig/vectorediting/lib/prov/simplify/SimplifyEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify/src/main/java/org/gvsig/vectorediting/lib/prov/simplify/SimplifyEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify/src/main/java/org/gvsig/vectorediting/lib/prov/simplify/SimplifyEditingProvider.java	(revision 1663)
@@ -0,0 +1,423 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.simplify;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryException;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Polygon;
+import org.gvsig.fmap.geom.primitive.Surface;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.tools.visitor.VisitCanceledException;
+import org.gvsig.tools.visitor.Visitor;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author llmarques
+ *
+ */
+public class SimplifyEditingProvider extends AbstractEditingProvider implements
+    EditingProvider {
+
+    private EditingServiceParameter selection;
+
+    private EditingServiceParameter tolerance;
+
+    private FeatureStore featureStore;
+
+    private Map<EditingServiceParameter, Object> values;
+
+    /**
+     * Default constructor.
+     *
+     * @param providerServices
+     *            available services for this provider
+     * @param parameters
+     *            of this provider
+     */
+    public SimplifyEditingProvider(DynObject parameters,
+        ProviderServices services) {
+        super(services);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.selection =
+            new DefaultEditingServiceParameter("selection", "selection",
+                TYPE.SELECTION);
+
+        this.tolerance =
+            new DefaultEditingServiceParameter("tolerance", "tolerance",
+                TYPE.VALUE);
+    }
+
+    public EditingServiceParameter next() {
+        if (values.get(selection) == null) {
+            return selection;
+        } else if (values.get(tolerance) == null) {
+            return tolerance;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        return null;
+    }
+
+    public void stop() throws StopServiceException {
+        if (values != null) {
+            values.clear();
+        }
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(selection);
+        parameters.add(tolerance);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter parameter,
+        Object value) throws InvalidEntryException {
+
+        if (parameter == selection) {
+
+            FeatureSelection featureSelection = (FeatureSelection) value;
+
+            if (featureSelection.getSelectedCount() > 0) {
+                try {
+                    featureSelection.accept(new Visitor() {
+
+                        public void visit(Object obj)
+                            throws VisitCanceledException, BaseException {
+
+                            Feature feature = (Feature) obj;
+                            Geometry geometry = feature.getDefaultGeometry();
+                            GeometryType geometryType =
+                                geometry.getGeometryType();
+
+                            if (!geometryType
+                                .isTypeOf(Geometry.TYPES.MULTISURFACE)
+                                && !geometryType
+                                    .isTypeOf(Geometry.TYPES.SURFACE)
+                                && !geometryType.isTypeOf(Geometry.TYPES.CURVE)
+                                && !geometryType
+                                    .isTypeOf(Geometry.TYPES.MULTICURVE)) {
+
+                                throw new InvalidEntryException(null);
+                            }
+                        }
+                    });
+
+                    values.put(selection, value);
+                    return;
+                } catch (BaseException e) {
+                    throw new InvalidEntryException(e);
+                }
+            }
+        } else if (parameter == tolerance) {
+            if (value instanceof Double) {
+                Double toleranceValue = (Double) value;
+                if (toleranceValue >= 0) {
+                    values.put(tolerance, value);
+                    return;
+                }
+            }
+        }
+        throw new InvalidEntryException(null);
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+
+        if (values != null) {
+
+            FeatureSelection featureSelection =
+                (FeatureSelection) values.get(selection);
+            ToolsLocator.getDisposableManager().bind(featureSelection);
+
+
+            final Double toleranceValue = (Double) values.get(tolerance);
+
+            final EditingProviderServices editingProviderServices =
+                (EditingProviderServices) getProviderServices();
+
+            try {
+                final int subtype =
+                    editingProviderServices.getSubType(featureStore);
+
+                featureSelection.accept(new Visitor() {
+
+                    public void visit(Object obj)
+                        throws VisitCanceledException, BaseException {
+
+                        Feature feature = (Feature) obj;
+                        Geometry geometry = feature.getDefaultGeometry();
+                        GeometryType geoType = geometry.getGeometryType();
+
+                        if (geoType.isTypeOf(CURVE)
+                            || (geoType.isTypeOf(SURFACE))) {
+
+                            if (geoType.isTypeOf(CURVE)) {
+
+                                Curve curveToSimplify = (Curve) geometry;
+                                curveToSimplify =
+                                    simplifyLine(curveToSimplify,
+                                        toleranceValue);
+                                geometry = curveToSimplify;
+
+                            } else {
+
+                                Surface surfaceToSimplify = (Surface) geometry;
+                                surfaceToSimplify =
+                                    simplifySurface(surfaceToSimplify,
+                                        toleranceValue);
+                                geometry = surfaceToSimplify;
+
+                            }
+
+                            EditableFeature eFeature = feature.getEditable();
+                            eFeature.setDefaultGeometry(geometry);
+                            editingProviderServices
+                                .updateFeatureInFeatureStore(eFeature,
+                                    featureStore);
+
+                        } else if (geoType.isTypeOf(MULTICURVE)
+                            || geoType.isTypeOf(MULTISURFACE)) {
+
+                            if (geoType.isTypeOf(MULTICURVE)) {
+
+                                MultiCurve multiCurveToSimplify =
+                                    (MultiCurve) geometry;
+
+                                MultiCurve multiCurveSimplified =
+                                    GeometryLocator.getGeometryManager()
+                                        .createMultiCurve(subtype);
+
+                                for (int i = 0; i < multiCurveToSimplify
+                                    .getPrimitivesNumber(); i++) {
+
+                                    Curve curveToSimplify =
+                                        (Curve) multiCurveToSimplify
+                                            .getPrimitiveAt(i);
+
+                                    curveToSimplify =
+                                        simplifyLine(curveToSimplify,
+                                            toleranceValue);
+
+                                    multiCurveSimplified
+                                        .addCurve(curveToSimplify);
+
+                                    geometry = multiCurveSimplified;
+                                }
+
+                            } else {
+
+                                MultiSurface multiSurfaceToSimplify =
+                                    (MultiSurface) geometry;
+
+                                MultiSurface multiSurfaceSimplified =
+                                    GeometryLocator.getGeometryManager()
+                                        .createMultiSurface(subtype);
+
+                                for (int i = 0; i < multiSurfaceToSimplify
+                                    .getPrimitivesNumber(); i++) {
+
+                                    Surface surfaceToSimplify =
+                                        (Surface) multiSurfaceToSimplify
+                                            .getPrimitiveAt(i);
+
+                                    surfaceToSimplify =
+                                        simplifySurface(surfaceToSimplify,
+                                            toleranceValue);
+
+                                    multiSurfaceSimplified
+                                        .addSurface(surfaceToSimplify);
+
+                                    geometry = multiSurfaceSimplified;
+                                }
+                            }
+
+                            EditableFeature eFeature = feature.getEditable();
+                            eFeature.setDefaultGeometry(geometry);
+                            editingProviderServices
+                                .updateFeatureInFeatureStore(eFeature,
+                                    featureStore);
+                        }
+                    }
+                });
+
+                featureStore.getFeatureSelection().deselectAll();
+                featureSelection.dispose();
+
+            } catch (BaseException e) {
+                throw new FinishServiceException(e);
+            }
+        }
+    }
+
+    private Surface simplifySurface(Surface surfaceToSimplify,
+        Double toleranceValue) throws GeometryException, DataException,
+        GeometryOperationNotSupportedException, GeometryOperationException {
+
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        int subtype = editingProviderServices.getSubType(featureStore);
+
+        Line lineToSimplify =
+            GeometryLocator.getGeometryManager().createLine(subtype);
+
+        for (int i = 0; i < surfaceToSimplify.getNumVertices(); i++) {
+            lineToSimplify.addVertex(surfaceToSimplify.getVertex(i));
+        }
+
+        Line simplifiedLine = simplifyLine(lineToSimplify, toleranceValue);
+        Polygon simplifiedPolygon =
+            GeometryLocator.getGeometryManager().createPolygon(subtype);
+
+        for (int i = 0; i < simplifiedLine.getNumVertices(); i++) {
+            simplifiedPolygon.addVertex(simplifiedLine.getVertex(i));
+        }
+
+        // Close polygon
+        simplifiedPolygon.addVertex(simplifiedLine.getVertex(0));
+
+        return simplifiedPolygon;
+    }
+
+    private Line simplifyLine(Curve curveToSimplify, Double toleranceValue)
+        throws DataException, CreateGeometryException,
+        GeometryOperationNotSupportedException, GeometryOperationException {
+
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        int subtype = editingProviderServices.getSubType(featureStore);
+
+        Line simplifiedLine =
+            (Line) GeometryLocator.getGeometryManager().createLine(subtype);
+
+        // Add first vertex
+        simplifiedLine.addVertex(curveToSimplify.getVertex(0));
+
+        // Iterate over vertices
+        for (int i = 0; i < curveToSimplify.getNumVertices() - 2; i++) {
+
+            Point vertex = curveToSimplify.getVertex(i);
+            Point nextVertex = curveToSimplify.getVertex(i + 1);
+            Point nextNextVertex = curveToSimplify.getVertex(i + 2);
+
+            // Creates line between i vertex and i+2 vertex
+            Line tmpLine =
+                editingProviderServices.createLine(vertex, nextNextVertex,
+                    subtype);
+
+            // If distance between line and i+1 vertex is bigger than tolerance
+            // add point to simplifiedLine, else skip vertex
+            if (tmpLine.distance(nextVertex) > toleranceValue) {
+                simplifiedLine.addVertex(nextVertex);
+            } else {
+                i++;
+            }
+        }
+
+        // Add last vertex
+        simplifiedLine.addVertex(curveToSimplify.getVertex(curveToSimplify
+            .getNumVertices() - 1));
+
+        return simplifiedLine;
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        values = new HashMap<EditingServiceParameter, Object>();
+
+        FeatureSelection selected = null;
+        if (featureStore != null) {
+            try {
+                selected = featureStore.getFeatureSelection();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            }
+            if (selected.getSelectedCount() > 0) {
+                try {
+                    setValue(selected);
+                } catch (InvalidEntryException e) {
+                    throw new InvalidEntryException(e);
+                }
+            }
+        }
+    }
+
+    public String getName() {
+        return SimplifyEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify/src/main/java/org/gvsig/vectorediting/lib/prov/simplify/SimplifyEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify/src/main/java/org/gvsig/vectorediting/lib/prov/simplify/SimplifyEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify/src/main/java/org/gvsig/vectorediting/lib/prov/simplify/SimplifyEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,91 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.simplify;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author llmarques
+ *
+ */
+public class SimplifyEditingProviderFactory extends AbstractProviderFactory
+    implements EditingProviderFactory {
+
+    public static final String PROVIDER_NAME = "modify-simplify";
+
+    private final static String PROVIDER_DESCRIPTION =
+        "Simplifies geometries given a tolerance";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", false, null,
+                new int[] { 
+                    Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE, 
+                    Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, 
+                    Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                    Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE 
+                });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new SimplifyEditingProvider(parameters, services);
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject dynobject = super.createParameters();
+        dynobject.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return dynobject;
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify/src/main/java/org/gvsig/vectorediting/lib/prov/simplify/SimplifyEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify/src/main/java/org/gvsig/vectorediting/lib/prov/simplify/SimplifyEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify/src/main/java/org/gvsig/vectorediting/lib/prov/simplify/SimplifyEditingLibrary.java	(revision 1663)
@@ -0,0 +1,71 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.simplify;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.Library;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+
+/**
+ * @author llmarques
+ *
+ */
+public class SimplifyEditingLibrary extends AbstractLibrary implements Library {
+    
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new SimplifyEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "modify-simplify", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n.text",
+            this.getClass().getClassLoader(), "simplify-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.simplify</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.simplify</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangularmatrix/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangularmatrix/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangularmatrix/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.rectangularmatrix.RectangularMatrixEditingLibrary
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangularmatrix/src/main/resources/images/vectorediting-tools/insert-rectangular-matrix.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangularmatrix/src/main/resources/images/vectorediting-tools/insert-rectangular-matrix.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangularmatrix/src/main/java/org/gvsig/vectorediting/lib/prov/rectangularmatrix/RectangularMatrixEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangularmatrix/src/main/java/org/gvsig/vectorediting/lib/prov/rectangularmatrix/RectangularMatrixEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangularmatrix/src/main/java/org/gvsig/vectorediting/lib/prov/rectangularmatrix/RectangularMatrixEditingProvider.java	(revision 1663)
@@ -0,0 +1,479 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.rectangularmatrix;
+
+import java.awt.geom.AffineTransform;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.Aggregate;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.aggregate.MultiPoint;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Surface;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.symbology.SymbologyLocator;
+import org.gvsig.symbology.SymbologyManager;
+import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.ISimpleTextSymbol;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.tools.visitor.VisitCanceledException;
+import org.gvsig.tools.visitor.Visitor;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author llmarques
+ *
+ */
+public class RectangularMatrixEditingProvider extends AbstractEditingProvider
+    implements EditingProvider {
+
+    private FeatureStore featureStore;
+
+    private Map<EditingServiceParameter, Object> values;
+
+    private EditingServiceParameter selection;
+
+    private EditingServiceParameter columns;
+
+    private EditingServiceParameter rows;
+
+    private EditingServiceParameter basePoint;
+
+    private EditingServiceParameter columnDistance;
+
+    private EditingServiceParameter rowDistance;
+
+    /**
+     * Default constructor.
+     *
+     * @param providerServices
+     *            available services for this provider
+     * @param parameters
+     *            of this provider
+     */
+    public RectangularMatrixEditingProvider(DynObject parameters,
+        ProviderServices services) {
+        super(services);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.selection =
+            new DefaultEditingServiceParameter("selection", "selection",
+                EditingServiceParameter.TYPE.SELECTION);
+
+        this.basePoint =
+            new DefaultEditingServiceParameter("indicate_new_point",
+                "indicate_new_point", EditingServiceParameter.TYPE.POSITION);
+
+        this.columns =
+            new DefaultEditingServiceParameter("columns_number",
+                "columns_number", EditingServiceParameter.TYPE.VALUE);
+
+        this.rows =
+            new DefaultEditingServiceParameter("rows_number", "rows_number",
+                EditingServiceParameter.TYPE.VALUE);
+
+        this.columnDistance =
+            new DefaultEditingServiceParameter("distance_between_columns",
+                "distance_between_columns", EditingServiceParameter.TYPE.VALUE,
+                EditingServiceParameter.TYPE.POSITION);
+
+        this.rowDistance =
+            new DefaultEditingServiceParameter("distance_between_rows",
+                "distance_between_rows", EditingServiceParameter.TYPE.VALUE,
+                EditingServiceParameter.TYPE.POSITION);
+    }
+
+    public EditingServiceParameter next() {
+        if (values.get(selection) == null) {
+            return selection;
+        } else if (values.get(columns) == null) {
+            return columns;
+        } else if (values.get(rows) == null) {
+            return rows;
+        } else if (values.get(basePoint) == null) {
+            return basePoint;
+        } else if (values.get(columnDistance) == null) {
+            return columnDistance;
+        } else if (values.get(rowDistance) == null) {
+            return rowDistance;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+
+        DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        I18nManager i18nManager = ToolsLocator.getI18nManager();
+
+        FeatureSelection featureSelection =
+            (FeatureSelection) values.get(selection);
+        Integer columnsValue = (Integer) values.get(columns);
+        Integer rowsValue = (Integer) values.get(rows);
+        Point basePointValue = (Point) values.get(basePoint);
+        Double columnDistanceValue = (Double) values.get(columnDistance);
+        Double rowDistanceValue = (Double) values.get(rowDistance);
+
+        if (featureSelection != null && columnsValue != null
+            && rowsValue != null && basePointValue != null) {
+
+            int subtype = basePointValue.getGeometryType().getSubType();
+
+            if (columnDistanceValue == null) {
+                columnDistanceValue =
+                    mousePosition.getX() - basePointValue.getX();
+            }
+
+            if (rowDistanceValue == null) {
+                rowDistanceValue = mousePosition.getY() - basePointValue.getY();
+            }
+
+            // Creation of symbology
+            EditingProviderManager editingProviderManager =
+                EditingProviderLocator.getProviderManager();
+            ISymbol auxiliaryPointSymbolEditing =
+                editingProviderManager
+                    .getSymbol("auxiliary-point-symbol-editing");
+
+            // Create base point indicator
+            drawingStatus.addStatus(basePointValue,
+                auxiliaryPointSymbolEditing, "");
+
+            // Create distance text indicator
+            try {
+                double textDistance =
+                    basePointValue.distance(mousePosition) / 6;
+                String columnsText =
+                    i18nManager.getTranslation("distance_between_columns")
+                        .concat(" ")
+                        .concat(String.valueOf(columnDistanceValue));
+                Geometry pointText =
+                    geometryManager.createPoint(
+                        mousePosition.getX() + textDistance
+                            * Math.cos(Math.PI / 4),
+                        mousePosition.getY() + textDistance
+                            * Math.sin(Math.PI / 4), subtype);
+
+                drawingStatus
+                    .addStatus(pointText, getTextSymbol(), columnsText);
+
+                String rowsText =
+                    i18nManager.getTranslation("distance_between_rows")
+                        .concat(" ").concat(String.valueOf(rowDistanceValue));
+                pointText =
+                    geometryManager.createPoint(
+                        mousePosition.getX() + textDistance
+                            * Math.cos(Math.PI / 4),
+                        mousePosition.getY() + textDistance
+                            * Math.sin(3 * Math.PI / 2), subtype);
+
+                drawingStatus.addStatus(pointText, getTextSymbol(), rowsText);
+
+            } catch (BaseException e) {
+                throw new DrawServiceException(e);
+            }
+
+            DisposableIterator it = null;
+            try {
+                it = featureSelection.fastIterator();
+                while (it.hasNext()) {
+                    Feature feature = (Feature) it.next();
+                    Geometry geometry = feature.getDefaultGeometry();
+                    Geometry[][] matrix =
+                        createRectangularMatrix(geometry, columnsValue,
+                            rowsValue, basePointValue, columnDistanceValue,
+                            rowDistanceValue);
+
+                    for (int i = 0; i < matrix.length; i++) {
+                        for (int j = 0; j < matrix[i].length; j++) {
+
+                            ISymbol symbol = getSymbol(matrix[i][j]);
+
+                            if (matrix[i][j] instanceof Aggregate) {
+                                int primitivesNumber =
+                                    ((Aggregate) matrix[i][j])
+                                        .getPrimitivesNumber();
+                                for (int k = 0; k < primitivesNumber; k++) {
+                                    drawingStatus.addStatus(
+                                        ((Aggregate) matrix[i][j])
+                                            .getPrimitiveAt(k), symbol, "");
+                                }
+                            } else {
+                                drawingStatus.addStatus(matrix[i][j], symbol,
+                                    "");
+                            }
+                        }
+                    }
+                }
+            } catch (BaseException e) {
+                throw new DrawServiceException(e);
+            } finally {
+                it.dispose();
+            }
+        }
+        return drawingStatus;
+    }
+
+    private ISymbol getSymbol(Geometry geometry) {
+
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol auxiliaryPointSymbolEditing =
+            editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+        ISymbol lineSymbolEditing =
+            editingProviderManager.getSymbol("line-symbol-editing");
+        ISymbol polygonSymbolEditing =
+            editingProviderManager.getSymbol("polygon-symbol-editing");
+
+        if (geometry instanceof Curve || geometry instanceof MultiCurve) {
+            return lineSymbolEditing;
+        } else if (geometry instanceof Surface
+            || geometry instanceof MultiSurface) {
+            return polygonSymbolEditing;
+        } else if (geometry instanceof Point || geometry instanceof MultiPoint) {
+            return auxiliaryPointSymbolEditing;
+        }
+        return null;
+    }
+
+    private ISimpleTextSymbol getTextSymbol() {
+        SymbologyManager symbologyManager =
+            SymbologyLocator.getSymbologyManager();
+        ISimpleTextSymbol textSymbol =
+            symbologyManager.createSimpleTextSymbol();
+        textSymbol.setFontSize(10);
+        return textSymbol;
+    }
+
+    private Geometry[][] createRectangularMatrix(Geometry geometry,
+        int columnsValue, int rowsValue, Point basePointValue,
+        double spacingColumns, double spacingRows) throws BaseException {
+
+        Geometry[][] geometryMatrix = new Geometry[columnsValue][rowsValue];
+
+        for (int i = 0; i < columnsValue; i++) {
+
+            for (int j = 0; j < rowsValue; j++) {
+
+                if (i == 0 && j == 0) {
+                    continue;
+                }
+
+                AffineTransform at = new AffineTransform();
+                at.translate(spacingColumns * i, spacingRows * j);
+                Geometry clonedGeoemtry = geometry.cloneGeometry();
+                clonedGeoemtry.transform(at);
+                geometryMatrix[i][j] = clonedGeoemtry;
+            }
+        }
+
+        return geometryMatrix;
+    }
+
+    public void stop() throws StopServiceException {
+        values.clear();
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(basePoint);
+        parameters.add(columns);
+        parameters.add(rows);
+        parameters.add(columnDistance);
+        parameters.add(rowDistance);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter parameter,
+        Object value) throws InvalidEntryException {
+        boolean insertedValue = false;
+
+        if (parameter.equals(selection) && value instanceof FeatureSelection) {
+            FeatureSelection featureSelection = (FeatureSelection) value;
+            if (featureSelection.getSelectedCount() > 0) {
+                values.put(parameter, featureSelection);
+                insertedValue = true;
+            }
+        } else if (parameter.equals(columns) || parameter.equals(rows)) {
+
+            if (value instanceof Double) {
+                Double number = (Double) value;
+                values.put(parameter, number.intValue());
+                insertedValue = true;
+            }
+
+        } else if (parameter.equals(basePoint) && value instanceof Point) {
+
+            values.put(basePoint, value);
+            insertedValue = true;
+
+        } else if (parameter.equals(columnDistance)
+            || parameter.equals(rowDistance)) {
+
+            if (value instanceof Double) {
+                Double doubleValue = (Double) value;
+                values.put(parameter, doubleValue);
+                insertedValue = true;
+
+            } else if (value instanceof Point) {
+
+                Point basePointValue = (Point) values.get(basePoint);
+                Point valuePoint = (Point) value;
+                double distance = 0;
+                if (parameter.equals(columnDistance)) {
+                    distance = valuePoint.getX() - basePointValue.getX();
+                    values.put(columnDistance, distance);
+                } else if (parameter.equals(rowDistance)) {
+                    distance = valuePoint.getY() - basePointValue.getY();
+                    values.put(rowDistance, distance);
+                }
+                insertedValue = true;
+            }
+        }
+
+        if (!insertedValue) {
+            throw new InvalidEntryException(null);
+        }
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+
+        FeatureSelection featureSelection =
+            (FeatureSelection) values.get(selection);
+        final Integer columnsValue = (Integer) values.get(columns);
+        final Integer rowsValue = (Integer) values.get(rows);
+        final Point basePointValue = (Point) values.get(basePoint);
+        final Double spacingColumnsValue = (Double) values.get(columnDistance);
+        final Double spacingRowsValue = (Double) values.get(rowDistance);
+
+        final EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        if (featureSelection != null && columnsValue != null
+            && rowsValue != null && basePointValue != null
+            && spacingColumnsValue != null && spacingRowsValue != null) {
+
+            try {
+                featureSelection.accept(new Visitor() {
+
+                    public void visit(Object obj)
+                        throws VisitCanceledException, BaseException {
+
+                        Feature feature = (Feature) obj;
+                        Geometry geometry = feature.getDefaultGeometry();
+                        Geometry[][] matrix =
+                            createRectangularMatrix(geometry, columnsValue,
+                                rowsValue, basePointValue, spacingColumnsValue,
+                                spacingRowsValue);
+
+                        for (int i = 0; i < matrix.length; i++) {
+                            for (int j = 0; j < matrix[i].length; j++) {
+                                EditableFeature eFeature =
+                                    editingProviderServices
+                                        .getFeatureCopyWithoutPK(featureStore,
+                                            feature);
+                                eFeature.setDefaultGeometry(matrix[i][j]);
+                                editingProviderServices
+                                    .insertFeatureIntoFeatureStore(eFeature,
+                                        featureStore);
+                            }
+                        }
+                    }
+                });
+            } catch (BaseException e) {
+                throw new FinishServiceException(e);
+            }
+        }
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        values = new HashMap<EditingServiceParameter, Object>();
+        FeatureSelection selected = null;
+        if (featureStore != null && values.get(selection) == null) {
+            try {
+                selected = featureStore.getFeatureSelection();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            }
+            if (selected.getSelectedCount() > 0) {
+                try {
+                    setValue(selected);
+                } catch (InvalidEntryException e) {
+                    throw new InvalidEntryException(e);
+                }
+            }
+        }
+    }
+
+    public String getName() {
+        return RectangularMatrixEditingProviderFactory.PROVIDER_NAME;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangularmatrix/src/main/java/org/gvsig/vectorediting/lib/prov/rectangularmatrix/RectangularMatrixEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangularmatrix/src/main/java/org/gvsig/vectorediting/lib/prov/rectangularmatrix/RectangularMatrixEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangularmatrix/src/main/java/org/gvsig/vectorediting/lib/prov/rectangularmatrix/RectangularMatrixEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,90 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.rectangularmatrix;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author llmarques
+ *
+ */
+public class RectangularMatrixEditingProviderFactory extends
+    AbstractProviderFactory implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "insert-rectangular-matrix";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Creates a rectangular matrix of geometries";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, PROVIDER_DESCRIPTION, true, null,
+                new int[] { Geometry.TYPES.POINT, Geometry.TYPES.MULTIPOINT,
+                    Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE,
+                    Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                    Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, 
+                    Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new RectangularMatrixEditingProvider(parameters, services);
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangularmatrix/src/main/java/org/gvsig/vectorediting/lib/prov/rectangularmatrix/RectangularMatrixEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangularmatrix/src/main/java/org/gvsig/vectorediting/lib/prov/rectangularmatrix/RectangularMatrixEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangularmatrix/src/main/java/org/gvsig/vectorediting/lib/prov/rectangularmatrix/RectangularMatrixEditingLibrary.java	(revision 1663)
@@ -0,0 +1,73 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.rectangularmatrix;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.Library;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+
+/**
+ * @author llmarques
+ *
+ */
+public class RectangularMatrixEditingLibrary extends AbstractLibrary implements
+    Library {
+    
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new RectangularMatrixEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "insert-rectangular-matrix",
+            this.getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "insert-rectangular-matrix-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangularmatrix/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangularmatrix/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangularmatrix/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.rectangularmatrix</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.rectangularmatrix</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangularmatrix
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/java/org/gvsig/vectorediting/lib/prov/remove/RemoveEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/java/org/gvsig/vectorediting/lib/prov/remove/RemoveEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/java/org/gvsig/vectorediting/lib/prov/remove/RemoveEditingLibrary.java	(revision 1663)
@@ -0,0 +1,70 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.remove;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+
+/**
+ * @author fdiaz
+ *
+ */
+public class RemoveEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new RemoveEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "remove", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "remove");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/java/org/gvsig/vectorediting/lib/prov/remove/RemoveEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/java/org/gvsig/vectorediting/lib/prov/remove/RemoveEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/java/org/gvsig/vectorediting/lib/prov/remove/RemoveEditingProvider.java	(revision 1663)
@@ -0,0 +1,191 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.remove;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dispose.DisposeUtils;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.tools.visitor.VisitCanceledException;
+import org.gvsig.tools.visitor.Visitor;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author fdiaz
+ *
+ */
+public class RemoveEditingProvider extends AbstractEditingProvider implements
+    EditingProvider {
+
+    private EditingServiceParameter selection;
+
+    private FeatureStore featureStore;
+
+    private Map<EditingServiceParameter, Object> values;
+
+    /**
+     * Default constructor.
+     *
+     * @param providerServices
+     *            available services for this provider
+     * @param parameters
+     *            of this provider
+     */
+    public RemoveEditingProvider(ProviderServices providerServices,
+        DynObject parameters) {
+        super(providerServices);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.selection =
+            new DefaultEditingServiceParameter("selection", "selection",
+                TYPE.SELECTION);
+
+    }
+
+    public EditingServiceParameter next() {
+        if (values.get(selection) == null) {
+            return selection;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        return null;
+    }
+
+    public void stop() throws StopServiceException {
+        if (values != null) {
+            values.clear();
+        }
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(selection);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter parameter,
+        Object value) {
+
+        if (parameter == selection) {
+            if (value instanceof FeatureSelection) {
+                if (((FeatureSelection) value).getSelectedCount() > 0) {
+                    values.put(selection, value);
+                }
+            }
+        }
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+
+        if (values != null) {
+
+            final FeatureSelection featureSelection =
+                (FeatureSelection) values.get(selection);
+            ToolsLocator.getDisposableManager().bind(featureSelection);
+
+
+            try {
+                featureSelection.accept(new Visitor() {
+
+                    public void visit(Object obj)
+                        throws VisitCanceledException, BaseException {
+                        final Feature feature = (Feature) obj;
+
+                        ((EditingProviderServices) getProviderServices())
+                            .deleteFeatureFromFeatureSet(feature,
+                                featureStore, featureSelection);
+                    }
+                });
+
+                featureSelection.deselectAll();
+                featureSelection.dispose();
+            } catch (BaseException e) {
+                throw new FinishServiceException(e);
+            }
+        }
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        values = new HashMap<EditingServiceParameter, Object>();
+        FeatureSelection selected = null;
+        if (featureStore != null) {
+            try {
+                selected = featureStore.getFeatureSelection();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            }
+            try {
+                setValue(selected);
+            } catch (InvalidEntryException e) {
+                throw new InvalidEntryException(e);
+            }
+        }
+    }
+
+    public String getName() {
+        return RemoveEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/java/org/gvsig/vectorediting/lib/prov/remove/RemoveEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/java/org/gvsig/vectorediting/lib/prov/remove/RemoveEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/java/org/gvsig/vectorediting/lib/prov/remove/RemoveEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,89 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.remove;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author fdiaz
+ *
+ */
+public class RemoveEditingProviderFactory extends AbstractProviderFactory
+    implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "remove";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Remove selected geometries";
+
+    public void initialize() {
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", false, null,
+                new int[] { Geometry.TYPES.POINT, Geometry.TYPES.MULTIPOINT,
+                    Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE,
+                    Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                    Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, 
+                    Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new RemoveEditingProvider(services, parameters);
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.remove.RemoveEditingLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/resources/images/vectorediting-tools/remove.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/resources/images/vectorediting-tools/remove.png
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.remove</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.remove</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.multipoint/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.multipoint/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.multipoint/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.multipoint.MultipointEditingProviderLibrary
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.multipoint/src/main/resources/images/vectorediting-tools/insert-multipoint.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.multipoint/src/main/resources/images/vectorediting-tools/insert-multipoint.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.multipoint/src/main/java/org/gvsig/vectorediting/lib/prov/multipoint/MultipointEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.multipoint/src/main/java/org/gvsig/vectorediting/lib/prov/multipoint/MultipointEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.multipoint/src/main/java/org/gvsig/vectorediting/lib/prov/multipoint/MultipointEditingProvider.java	(revision 1663)
@@ -0,0 +1,215 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.multipoint;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.aggregate.MultiPoint;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author llmarques
+ *
+ */
+public class MultipointEditingProvider extends AbstractEditingProvider
+    implements EditingProvider {
+
+    private EditingServiceParameter points;
+
+    private List<Point> values;
+
+    private boolean finish;
+
+    private FeatureStore featureStore;
+
+    /**
+     * Default constructor.
+     *
+     * @param providerServices
+     *            available services for this provider
+     * @param parameters
+     *            of this provider
+     */
+    public MultipointEditingProvider(DynObject parameters,
+        ProviderServices services) {
+        super(services);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.finish = false;
+
+        I18nManager i18nManager = ToolsLocator.getI18nManager();
+
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        Map<String, String> options = new LinkedHashMap<String, String>();
+        options.put(i18nManager.getTranslation("key_finish"), "finish");
+
+        String consoleMsg =
+            editingProviderServices.makeConsoleMessage("indicate_new_point",
+                options);
+
+        this.points =
+            new DefaultEditingServiceParameter("indicate_new_point",
+                consoleMsg, options, TYPE.LIST_POSITIONS, TYPE.OPTION);
+
+    }
+
+    public EditingServiceParameter next() {
+        if (finish) {
+            return null;
+        } else {
+            return points;
+        }
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol pointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+
+        for (Point point : values) {
+            drawingStatus.addStatus(point, pointSymbolEditing, "");
+        }
+
+        return drawingStatus;
+    }
+
+    public void stop() throws StopServiceException {
+        if (values != null) {
+            values.clear();
+        }
+        finish = false;
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(points);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter parameter,
+        Object value) {
+
+        if (parameter == points) {
+            if (value instanceof Point) {
+                values.add((Point) value);
+            } else if (value instanceof String) {
+
+                String option = (String) value;
+                I18nManager i18nManager = ToolsLocator.getI18nManager();
+                if (option.equalsIgnoreCase(i18nManager
+                    .getTranslation("key_finish"))) {
+                    finish = true;
+                }
+            }
+        }
+    }
+
+    public Geometry finish() throws FinishServiceException {
+
+        if (values != null && values.size() > 0) {
+
+            EditingProviderServices editingProviderServices =
+                (EditingProviderServices) getProviderServices();
+
+            try {
+
+                int subtype = editingProviderServices.getSubType(featureStore);
+
+                MultiPoint multiPoint =
+                    GeometryLocator.getGeometryManager().createMultiPoint(
+                        subtype);
+
+                for (Point point : values) {
+                    multiPoint.addPoint(point);
+                }
+
+                return multiPoint;
+
+            } catch (BaseException e) {
+                throw new FinishServiceException(e);
+            }
+        }
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+        Geometry geom = finish();
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+        editingProviderServices.insertGeometryIntoFeatureStore(geom,
+            featureStore);
+
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        values = new ArrayList<Point>();
+    }
+
+    public String getName() {
+        return MultipointEditingProviderFactory.PROVIDER_DESCRIPTION;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.multipoint/src/main/java/org/gvsig/vectorediting/lib/prov/multipoint/MultipointEditingProviderLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.multipoint/src/main/java/org/gvsig/vectorediting/lib/prov/multipoint/MultipointEditingProviderLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.multipoint/src/main/java/org/gvsig/vectorediting/lib/prov/multipoint/MultipointEditingProviderLibrary.java	(revision 1663)
@@ -0,0 +1,68 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.multipoint;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.Library;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+
+/**
+ * @author llmarques
+ *
+ */
+public class MultipointEditingProviderLibrary extends AbstractLibrary implements
+    Library {
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new MultipointEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "insert-multipoint", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+    
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "insert-multipoint");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.multipoint/src/main/java/org/gvsig/vectorediting/lib/prov/multipoint/MultipointEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.multipoint/src/main/java/org/gvsig/vectorediting/lib/prov/multipoint/MultipointEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.multipoint/src/main/java/org/gvsig/vectorediting/lib/prov/multipoint/MultipointEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,86 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.multipoint;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author llmarques
+ *
+ */
+public class MultipointEditingProviderFactory extends AbstractProviderFactory
+    implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "insert-multipoint";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Inserts multipoitns geometries";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", true, null,
+                new int[] { Geometry.TYPES.MULTIPOINT });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new MultipointEditingProvider(parameters, services);
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.multipoint/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.multipoint/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.multipoint/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.multipoint</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.multipoint</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.multipoint
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/java/org/gvsig/vectorediting/lib/prov/rectangle/FilledRectangleEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/java/org/gvsig/vectorediting/lib/prov/rectangle/FilledRectangleEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/java/org/gvsig/vectorediting/lib/prov/rectangle/FilledRectangleEditingProvider.java	(revision 1663)
@@ -0,0 +1,126 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.rectangle;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Polygon;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author llmarques
+ *
+ */
+public class FilledRectangleEditingProvider extends RectangleEditingProvider
+implements EditingProvider {
+
+    /**
+     * Default constructor.
+     *
+     * @param parameters
+     *            of service.
+     * @param providerServices
+     *            available services. See {@link EditingProviderServices}.
+     */
+    public FilledRectangleEditingProvider(ProviderServices providerServices,
+        DynObject parameters) {
+        super(providerServices, parameters);
+    }
+
+    @Override
+    public Geometry finish() throws FinishServiceException {
+
+        if (values != null) {
+            Point firstPointValue = (Point) values.get(firstPoint);
+            Point oppistePointValue = (Point) values.get(oppositePoint);
+
+            if ((firstPointValue != null) && (oppistePointValue != null)) {
+
+                EditingProviderServices editingProviderServices =
+                    (EditingProviderServices) getProviderServices();
+                GeometryManager geometryManager =
+                    GeometryLocator.getGeometryManager();
+
+                try {
+                    int subtype =
+                        editingProviderServices.getSubType(featureStore);
+                    Polygon rectangle = geometryManager.createPolygon(subtype);
+
+                    rectangle.addVertex(firstPointValue);
+
+                    Point secondPoint =
+                        editingProviderServices.createPoint(
+                            oppistePointValue.getX(), firstPointValue.getY(),
+                            subtype);
+
+                    rectangle.addVertex(secondPoint);
+
+                    rectangle.addVertex(oppistePointValue);
+
+                    Point thirdPoint =
+                        editingProviderServices.createPoint(
+                            firstPointValue.getX(), oppistePointValue.getY(),
+                            subtype);
+
+                    rectangle.addVertex(thirdPoint);
+
+                    rectangle.addVertex((Point)firstPointValue.cloneGeometry());
+
+                    rectangle.ensureOrientation(false);
+
+                    GeometryType geomType =
+                        editingProviderServices.getGeomType(featureStore);
+
+                    if (geomType.isTypeOf(MULTISURFACE)) {
+                        MultiSurface multisurface;
+                        multisurface =
+                            GeometryLocator.getGeometryManager()
+                            .createMultiSurface(geomType.getSubType());
+                        multisurface.addSurface(rectangle);
+                        return multisurface;
+                    }
+
+                    return rectangle;
+                } catch (BaseException e) {
+                    throw new FinishServiceException(e);
+                }
+            }
+        }
+        return null;
+    }
+
+    public String getName() {
+        return FilledRectangleEditingProviderFactory.PROVIDER_NAME;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/java/org/gvsig/vectorediting/lib/prov/rectangle/RectangleEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/java/org/gvsig/vectorediting/lib/prov/rectangle/RectangleEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/java/org/gvsig/vectorediting/lib/prov/rectangle/RectangleEditingProvider.java	(revision 1663)
@@ -0,0 +1,307 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.rectangle;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author llmarques
+ *
+ */
+public class RectangleEditingProvider extends AbstractEditingProvider implements
+EditingProvider {
+
+    protected EditingServiceParameter firstPoint;
+
+    protected EditingServiceParameter oppositePoint;
+
+    protected Map<EditingServiceParameter, Object> values;
+
+    protected FeatureStore featureStore;
+
+    /**
+     * Default constructor.
+     *
+     * @param parameters
+     *            of service.
+     * @param providerServices
+     *            available services. See {@link EditingProviderServices}.
+     */
+    public RectangleEditingProvider(ProviderServices providerServices,
+        DynObject parameters) {
+        super(providerServices);
+
+        this.featureStore =
+            (FeatureStore) parameters
+            .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.firstPoint =
+            new DefaultEditingServiceParameter("first_point", "first_point",
+                EditingServiceParameter.TYPE.POSITION);
+
+        this.oppositePoint =
+            new DefaultEditingServiceParameter("second_point", "second_point",
+                EditingServiceParameter.TYPE.POSITION);
+    }
+
+    public EditingServiceParameter next() {
+        if (values.get(firstPoint) == null) {
+            return firstPoint;
+        } else if (values.get(oppositePoint) == null) {
+            return oppositePoint;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol lineSymbolEditing = editingProviderManager.getSymbol("line-symbol-editing");
+//        ISymbol auxiliaryLineSymbolEditing = editingProviderManager.getSymbol("auxiliary-line-symbol-editing");
+        ISymbol auxiliaryPointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+
+
+        if (values != null) {
+
+            Point firstPointValue = (Point) values.get(firstPoint);
+
+            if (firstPointValue != null) {
+                drawingStatus.addStatus(firstPointValue, auxiliaryPointSymbolEditing, "");
+                drawingStatus.addStatus(mousePosition, auxiliaryPointSymbolEditing, "");
+
+                EditingProviderServices editingProviderServices =
+                    (EditingProviderServices) getProviderServices();
+                GeometryManager geometryManager =
+                    GeometryLocator.getGeometryManager();
+
+                try {
+                    int subtype =
+                        editingProviderServices.getSubType(featureStore);
+                    Line rectangle = geometryManager.createLine(subtype);
+
+                    rectangle.addVertex(firstPointValue);
+
+                    Point secondPoint =
+                        editingProviderServices.createPoint(
+                            mousePosition.getX(), firstPointValue.getY(),
+                            subtype);
+
+                    rectangle.addVertex(secondPoint);
+
+                    rectangle.addVertex(mousePosition);
+
+                    Point thirdPoint =
+                        editingProviderServices.createPoint(
+                            firstPointValue.getX(), mousePosition.getY(),
+                            subtype);
+
+                    rectangle.addVertex(thirdPoint);
+
+                    rectangle.addVertex(firstPointValue);
+                    drawingStatus.addStatus(rectangle, lineSymbolEditing, "");
+
+//                    drawingStatus.addGeometry(rectangle);
+                } catch (BaseException e) {
+                    throw new DrawServiceException(e);
+                }
+            }
+        }
+
+        return drawingStatus;
+    }
+
+    public void stop() throws StopServiceException {
+        values.clear();
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(firstPoint);
+        parameters.add(oppositePoint);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter param = next();
+        validateAndInsertValue(param, value);
+    }
+
+    /**
+     * Checks if value is valid to parameter received as parameter.
+     *
+     * @param param
+     *            of value
+     * @param value
+     *            to e inserted
+     * @throws InvalidEntryException
+     *             If values is no valid throw an InvalidEntryException
+     */
+    private void validateAndInsertValue(EditingServiceParameter param,
+        Object value) throws InvalidEntryException {
+        if (param == firstPoint) {
+            if (value instanceof Point) {
+                values.put(param, value);
+                return;
+            }
+        } else if (param == oppositePoint) {
+            if (value instanceof Point) {
+                values.put(param, value);
+                return;
+            }
+        }
+        throw new InvalidEntryException(null);
+    }
+
+    public Geometry finish() throws FinishServiceException {
+
+        if (values != null) {
+            Point oppistePointValue = (Point) values.get(oppositePoint);
+
+            EditingProviderServices editingProviderServices =
+                (EditingProviderServices) getProviderServices();
+            GeometryManager geometryManager =
+                GeometryLocator.getGeometryManager();
+
+            try {
+                int subtype =
+                    editingProviderServices.getSubType(featureStore);
+
+                Line rectangle = geometryManager.createLine(subtype);
+                Point firstPointValue = (Point) values.get(firstPoint);
+                rectangle.addVertex(firstPointValue);
+                Point secondPoint =
+                    editingProviderServices.createPoint(
+                        oppistePointValue.getX(), firstPointValue.getY(),
+                        subtype);
+
+                rectangle.addVertex(secondPoint);
+
+                rectangle.addVertex(oppistePointValue);
+
+                Point fourthPoint =
+                    editingProviderServices.createPoint(
+                        firstPointValue.getX(), oppistePointValue.getY(),
+                        subtype);
+
+                rectangle.addVertex(fourthPoint);
+
+                rectangle.addVertex(firstPointValue);
+
+                GeometryType geomType =
+                    editingProviderServices.getGeomType(featureStore);
+
+                if (geomType.isTypeOf(MULTICURVE)) {
+                    MultiCurve multicurve;
+                    multicurve =
+                        GeometryLocator.getGeometryManager().createMultiCurve(
+                            geomType.getSubType());
+                    multicurve.addCurve(rectangle);
+                    return multicurve;
+                }
+
+                return rectangle;
+            } catch (BaseException e) {
+                throw new FinishServiceException(
+                    "There are some problem finalize" + this.getName(), e);
+            }
+        }
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+        Geometry geometry = this.finish();
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+        editingProviderServices.insertGeometryIntoFeatureStore(geometry,
+            featureStore);
+
+    }
+
+    public void start() throws StartServiceException {
+        values = new HashMap<EditingServiceParameter, Object>();
+    }
+
+    public String getName() {
+        return RectangleEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/java/org/gvsig/vectorediting/lib/prov/rectangle/FilledRectangleEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/java/org/gvsig/vectorediting/lib/prov/rectangle/FilledRectangleEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/java/org/gvsig/vectorediting/lib/prov/rectangle/FilledRectangleEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,97 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.rectangle;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author llmarques
+ *
+ */
+public class FilledRectangleEditingProviderFactory extends
+AbstractProviderFactory implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "insert-filled-rectangle";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Inserts a filled rectangle on the view";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(
+                PROVIDER_NAME,
+                "",
+                true,
+                null,
+                new int[] { 
+                    Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, 
+                    Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE 
+                });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new FilledRectangleEditingProvider(services, parameters);
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+    @Override
+    public String getName() {
+        return PROVIDER_NAME;
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/java/org/gvsig/vectorediting/lib/prov/rectangle/RectangleEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/java/org/gvsig/vectorediting/lib/prov/rectangle/RectangleEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/java/org/gvsig/vectorediting/lib/prov/rectangle/RectangleEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,91 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.rectangle;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author llmarques
+ *
+ */
+public class RectangleEditingProviderFactory extends AbstractProviderFactory
+implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "insert-rectangle";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Inserts a rectangle on the view";
+
+    @Override
+    public String getName() {
+        return PROVIDER_NAME;
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", true, null,
+                new int[] { Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new RectangleEditingProvider(services, parameters);
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/java/org/gvsig/vectorediting/lib/prov/rectangle/RectangleEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/java/org/gvsig/vectorediting/lib/prov/rectangle/RectangleEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/java/org/gvsig/vectorediting/lib/prov/rectangle/RectangleEditingLibrary.java	(revision 1663)
@@ -0,0 +1,95 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.rectangle;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * @author llmarques
+ *
+ */
+public class RectangleEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new RectangleEditingProviderFactory());
+        manager.addProviderFactory(new FilledRectangleEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "insert-rectangle", this
+            .getClass().getClassLoader(), this.getClass().getName());
+        manager.registerIcon("vectorediting-tools", "insert-filled-rectangle",
+            this.getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "rectangle-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/resources/images/vectorediting-tools/insert-filled-rectangle.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/resources/images/vectorediting-tools/insert-filled-rectangle.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/resources/images/vectorediting-tools/insert-rectangle.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/resources/images/vectorediting-tools/insert-rectangle.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.rectangle.RectangleEditingLibrary
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.rectangle</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.rectangle</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rectangle
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.regularpolygon.RegularPolygonEditingLibrary
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/resources/defaultvalues/regularpolygon/defaultvalues.properties
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/resources/defaultvalues/regularpolygon/defaultvalues.properties	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/resources/defaultvalues/regularpolygon/defaultvalues.properties	(revision 1663)
@@ -0,0 +1,2 @@
+sides=5
+mode=key_inscribed
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/resources/images/vectorediting-tools/insert-regular-polygon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/resources/images/vectorediting-tools/insert-regular-polygon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/resources/images/vectorediting-tools/insert-filled-regular-polygon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/resources/images/vectorediting-tools/insert-filled-regular-polygon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/regularpolygon/FilledRegularPolygonEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/regularpolygon/FilledRegularPolygonEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/regularpolygon/FilledRegularPolygonEditingProvider.java	(revision 1663)
@@ -0,0 +1,167 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.regularpolygon;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Polygon;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author llmarques
+ *
+ */
+public class FilledRegularPolygonEditingProvider extends
+RegularPolygonEditingProvider implements EditingProvider {
+
+    /**
+     * Default constructor.
+     *
+     * @param services
+     *            Available services to this provider.
+     * @param parameters
+     *            Needed parameters to create and instance of this provider
+     */
+    public FilledRegularPolygonEditingProvider(DynObject services,
+        ProviderServices parameters) {
+        super(parameters, services);
+    }
+
+    @Override
+    public Geometry finish() throws FinishServiceException {
+
+        if (values != null) {
+
+            Integer sidesValue = (Integer) values.get(polygonSides);
+            String modeValue = (String) values.get(mode);
+            Point centerValue = (Point) values.get(center);
+            Point pointOfCircleValue = (Point) values.get(pointOfCircle);
+
+            try {
+
+                Polygon polygon =
+                    calculateFilledPolygon(modeValue, centerValue,
+                        pointOfCircleValue, sidesValue);
+
+                EditingProviderServices editingProviderServices =
+                    (EditingProviderServices) getProviderServices();
+                GeometryType geomType =
+                    editingProviderServices.getGeomType(featureStore);
+
+                if (geomType.isTypeOf(Geometry.TYPES.MULTISURFACE)) {
+                    GeometryManager geometryManager =
+                        GeometryLocator.getGeometryManager();
+                    MultiSurface multiSurface =
+                        geometryManager.createMultiSurface(geomType
+                            .getSubType());
+                    multiSurface.addSurface(polygon);
+                    return multiSurface;
+                }
+
+                return polygon;
+            } catch (Exception e) {
+                throw new FinishServiceException(e);
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Calculates filled polygon as of mode (inscribed or circumscribed), center
+     * of polygon, point of circle of polygon and number of sides.
+     *
+     * @param modeValue
+     *            inscribed or circumscribed
+     * @param centerValue
+     *            of filled polygon
+     * @param pointOfCircleValue
+     *            of circle of filled polygon
+     * @param sides
+     *            of filled polygon
+     * @return Surface with calculated filled polygon.
+     */
+    private Polygon calculateFilledPolygon(String modeValue, Point centerValue,
+        Point pointOfCircleValue, int sides) throws BaseException {
+
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+        int subtype = editingProviderServices.getSubType(featureStore);
+        Polygon filledPolygon =
+            GeometryLocator.getGeometryManager().createPolygon(subtype);
+
+        Curve polygon =
+            calculateRegularPolygon(modeValue, centerValue, pointOfCircleValue,
+                sides);
+
+        Point vertexAnt = null;
+        for (int i = 0; i < polygon.getNumVertices(); i++) {
+            if ((vertexAnt == null) || !vertexAnt.equals(polygon.getVertex(i))) {
+                filledPolygon.addVertex(polygon.getVertex(i));
+                vertexAnt = filledPolygon.getVertex(i);
+            }
+        }
+
+        filledPolygon = (Polygon) closeGeometry(filledPolygon);
+        return filledPolygon;
+    }
+
+    @Override
+    public String getName() {
+        return FilledRegularPolygonEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/regularpolygon/RegularPolygonEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/regularpolygon/RegularPolygonEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/regularpolygon/RegularPolygonEditingProvider.java	(revision 1663)
@@ -0,0 +1,530 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.regularpolygon;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.Geometry.TYPES;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.primitive.Circumference;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.OrientablePrimitive;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Surface;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ *
+ * @author llmarques
+ *
+ */
+public class RegularPolygonEditingProvider extends AbstractEditingProvider
+    implements EditingProvider {
+
+    protected final Integer DEFAULT_VALUE_SIDES = 5;
+    protected final String DEFAULT_VALUE_MODE = "key_inscribed";
+    protected final String SIDES_KEY= "sides";
+    protected final String MODE_KEY = "mode";
+
+    protected EditingServiceParameter polygonSides;
+
+    protected EditingServiceParameter center;
+
+    protected EditingServiceParameter mode;
+
+    protected EditingServiceParameter pointOfCircle;
+
+    protected Map<EditingServiceParameter, Object> values;
+
+    protected Map<String, String> defaultValues = null;
+
+    protected Map<String, String> options;
+
+    protected FeatureStore featureStore;
+
+    public RegularPolygonEditingProvider(ProviderServices providerServices,
+        DynObject parameters) {
+        super(providerServices);
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        Integer sideDefaultValue = Integer.valueOf((String)getDefaultValues().get(SIDES_KEY));
+        if (sideDefaultValue == null){
+            sideDefaultValue = DEFAULT_VALUE_SIDES;
+        }
+
+        polygonSides =
+            new DefaultEditingServiceParameter(SIDES_KEY, sideDefaultValue,
+                "sides_of_regular_polygon", EditingServiceParameter.TYPE.VALUE);
+
+        I18nManager i18nManager = ToolsLocator.getI18nManager();
+        options = new LinkedHashMap<String, String>();
+        options.put(i18nManager.getTranslation("key_inscribed"), "inscribed");
+        options.put(i18nManager.getTranslation("key_circumscribed"),
+            "circumscribed");
+
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        String consoleMsg =
+            editingProviderServices.makeConsoleMessage(null, options);
+
+        String modeDefaultValue = (String)getDefaultValues().get(MODE_KEY);
+        if (modeDefaultValue == null){
+            modeDefaultValue = DEFAULT_VALUE_MODE;
+        }
+
+        mode =
+            new DefaultEditingServiceParameter(MODE_KEY, consoleMsg, options,
+                modeDefaultValue,
+                EditingServiceParameter.TYPE.OPTION);
+
+        center =
+            new DefaultEditingServiceParameter("center",
+                "center_of_regular_polygon",
+                EditingServiceParameter.TYPE.POSITION);
+
+        pointOfCircle =
+            new DefaultEditingServiceParameter("point_of_circle",
+                "point_of_circle", EditingServiceParameter.TYPE.POSITION);
+    }
+
+    private Map<String, String> getDefaultValues() {
+        if (this.defaultValues == null){
+            EditingProviderManager editingProviderManager =
+                EditingProviderLocator.getProviderManager();
+            this.defaultValues = editingProviderManager.getDefaultValues("regularpolygon");
+        }
+        return this.defaultValues;
+    }
+
+    public EditingServiceParameter next() {
+        if (values.get(polygonSides) == null) {
+            return polygonSides;
+        } else if (values.get(mode) == null) {
+            return mode;
+        } else if (values.get(center) == null) {
+            return center;
+        } else if (values.get(pointOfCircle) == null) {
+            return pointOfCircle;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol lineSymbolEditing = editingProviderManager.getSymbol("line-symbol-editing");
+        ISymbol auxiliaryLineSymbolEditing = editingProviderManager.getSymbol("auxiliary-line-symbol-editing");
+        ISymbol auxiliaryPointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+
+        if (values != null) {
+
+            Integer sidesValue = (Integer) values.get(polygonSides);
+            String modeValue = (String) values.get(mode);
+            Point centerValue = (Point) values.get(center);
+
+            if (centerValue != null) {
+
+                try {
+
+                    EditingProviderServices editingProviderServices =
+                        (EditingProviderServices) getProviderServices();
+                    int subtype =
+                        editingProviderServices.getSubType(featureStore);
+
+                    if (modeValue == null) {
+                        modeValue = (String)getDefaultValues().get(MODE_KEY);
+                    }
+
+                    Curve polygon =
+                        calculateRegularPolygon(modeValue, centerValue,
+                            mousePosition, sidesValue);
+                    Curve line =
+                        editingProviderServices.createLine(centerValue,
+                            mousePosition, subtype);
+
+                    double radius = mousePosition.distance(centerValue);
+                    Circumference circumference = (Circumference) geometryManager.create(TYPES.CIRCUMFERENCE, SUBTYPES.GEOM2D);
+                    circumference.setPoints(centerValue, radius);
+
+                    drawingStatus.addStatus(circumference, auxiliaryLineSymbolEditing, "");
+                    drawingStatus.addStatus(polygon, lineSymbolEditing, "");
+                    drawingStatus.addStatus(centerValue, auxiliaryPointSymbolEditing, "");
+                    drawingStatus.addStatus(line, auxiliaryLineSymbolEditing, "");
+
+                } catch (BaseException e) {
+                    throw new DrawServiceException(e);
+                }
+            }
+        }
+        return drawingStatus;
+    }
+
+    /**
+     * Calculates polygon as of mode (inscribed or circumscribed), center of
+     * polygon, point of circle and number of sides.
+     *
+     * @param modeValue
+     *            of polygon (inscribed or circumscribed).
+     * @param centerValue
+     *            of polygon
+     * @param pointOfCircleValue
+     *            of circle that inscribe or circumscribe polygon
+     * @param sidesValue
+     *            number of sides.
+     */
+    protected Curve calculateRegularPolygon(String modeValue,
+        Point centerValue, Point pointOfCircle, int sidesValue)
+        throws BaseException {
+
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+        int subtype = editingProviderServices.getSubType(featureStore);
+
+        Curve polygon =
+            (Curve) geometryManager.create(Geometry.TYPES.CURVE, subtype);
+
+        double initAngle =
+            editingProviderServices.getAngle(centerValue, pointOfCircle);
+        double radiusValue = pointOfCircle.distance(centerValue);
+        double theta = -(2 * Math.PI) / sidesValue;
+
+        if (modeValue.equalsIgnoreCase("key_inscribed")) {
+
+            for (int i = 0; i < sidesValue; ++i) {
+
+                double x =
+                    centerValue.getX()
+                        + (radiusValue * Math.cos((theta * i) + initAngle));
+                double y =
+                    centerValue.getY()
+                        + (radiusValue * Math.sin((theta * i) + initAngle));
+
+                Point createPoint =
+                    editingProviderServices.createPoint(x, y, subtype);
+
+                polygon.addVertex(createPoint);
+            }
+
+        } else if (modeValue.equalsIgnoreCase("key_circumscribed")) {
+
+            for (int i = 0; i < sidesValue; ++i) {
+
+                double x =
+                    centerValue.getX()
+                        + (radiusValue * Math.cos((theta * i) + initAngle));
+                double y =
+                    centerValue.getY()
+                        + (radiusValue * Math.sin((theta * i) + initAngle));
+
+                Point apothemPoint =
+                    editingProviderServices.createPoint(x, y, subtype);
+
+                Double[] apothemParams =
+                    editingProviderServices.getLineParams(centerValue,
+                        apothemPoint);
+                Point[] perpendicular =
+                    editingProviderServices.getPerpendicular(apothemParams[0],
+                        apothemParams[1], apothemPoint, subtype);
+
+                double x1 =
+                    centerValue.getX()
+                        + (radiusValue * Math
+                            .cos((theta * (i + 1)) + initAngle));
+                double y1 =
+                    centerValue.getY()
+                        + (radiusValue * Math
+                            .sin((theta * (i + 1)) + initAngle));
+
+                Point nextApothemPoint =
+                    editingProviderServices.createPoint(x1, y1, subtype);
+
+                Double[] nextApothemParams =
+                    editingProviderServices.getLineParams(centerValue,
+                        nextApothemPoint);
+                Point[] nextPerpendicular =
+                    editingProviderServices.getPerpendicular(
+                        nextApothemParams[0], nextApothemParams[1],
+                        nextApothemPoint, subtype);
+
+                Point vertex =
+                    editingProviderServices.getIntersection(perpendicular,
+                        nextPerpendicular, subtype);
+
+                polygon.addVertex(vertex);
+            }
+        }
+        polygon = (Curve) closeGeometry(polygon);
+        return polygon;
+    }
+
+    /**
+     * Close geometry if it is necessary.
+     *
+     * @param geometry
+     *            to be closed.
+     */
+    protected Geometry closeGeometry(Geometry geometry) {
+
+        if (!isClose(geometry) && (geometry != null)) {
+
+            if (geometry instanceof Surface) {
+                Surface surface = (Surface) geometry;
+                Point firstp = surface.getVertex(0);
+                firstp = (Point) firstp.cloneGeometry();
+                surface.addVertex(firstp);
+                return surface;
+            } else if (geometry instanceof Curve) {
+                Curve line = (Curve) geometry;
+                Point firstp = line.getVertex(0);
+                firstp = (Point) firstp.cloneGeometry();
+                line.addVertex(firstp);
+                return line;
+            }
+        }
+        return geometry;
+    }
+
+    /**
+     * Gets if the geometry received by parameter is closed or not.
+     *
+     * @param geometry
+     * @return True if geometry is closed, otherwise false.
+     */
+    private boolean isClose(Geometry geometry) {
+
+        if (geometry != null) {
+
+            if (geometry instanceof OrientablePrimitive) {
+                OrientablePrimitive orientablePrimitive =
+                    (OrientablePrimitive) geometry;
+                Point firstPoint = orientablePrimitive.getVertex(0);
+                Point lastPoint =
+                    orientablePrimitive.getVertex(orientablePrimitive
+                        .getNumVertices() - 1);
+                if (firstPoint.equals(lastPoint)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    public void stop() throws StopServiceException {
+        if (values != null) {
+            values.clear();
+        }
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(polygonSides);
+        parameters.add(mode);
+        parameters.add(center);
+        parameters.add(pointOfCircle);
+
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter param,
+        Object value) throws InvalidEntryException {
+
+        if (param == polygonSides) {
+            if (value instanceof Double) {
+
+                Integer sides = ((Double) value).intValue();
+
+                if (sides > 2) {
+                    values.put(param, sides);
+                    getDefaultValues().put(SIDES_KEY, sides.toString());
+                    polygonSides.setDefaultValue(sides.toString());
+                    return;
+                } else {
+                    throw new InvalidEntryException(null);
+                }
+            } else if (value instanceof Point) {
+
+                values.put(param, Integer.valueOf((String)getDefaultValues().get(SIDES_KEY)));
+                values.put(center, (Point) value);
+                return;
+            }
+        } else if (param == mode) {
+
+            if (value instanceof String) {
+
+                I18nManager i18nManager = ToolsLocator.getI18nManager();
+                String option = (String) value;
+
+                if (option.equalsIgnoreCase(i18nManager
+                    .getTranslation("key_inscribed"))) {
+
+                    values.put(param, "key_inscribed");
+                    getDefaultValues().put(MODE_KEY, "key_inscribed");
+                    mode.setDefaultValue("key_inscribed");
+                    return;
+
+                } else if (option.equalsIgnoreCase(i18nManager
+                    .getTranslation("key_circumscribed"))) {
+
+                    values.put(param, "key_circumscribed");
+                    getDefaultValues().put(MODE_KEY, "key_circumscribed");
+                    mode.setDefaultValue("key_circumscribed");
+                    return;
+
+                } else {
+                    throw new InvalidEntryException(null);
+                }
+            } else if (value instanceof Point) {
+
+                values.put(param, getDefaultValues().get(MODE_KEY));
+                if(values.get(center) != null){
+                    values.put(pointOfCircle, (Point) value);
+                } else {
+                    values.put(center, (Point) value);
+                }
+                return;
+            }
+
+        } else if (param == center) {
+
+            if (value instanceof Point) {
+                values.put(param, value);
+                return;
+            }
+
+        } else if (param == pointOfCircle) {
+            if (value instanceof Point) {
+                values.put(param, value);
+                return;
+            }
+
+        }
+        throw new InvalidEntryException(null);
+    }
+
+    public Geometry finish() throws FinishServiceException {
+
+        if (values != null) {
+
+            Integer sidesValue = (Integer) values.get(polygonSides);
+            String modeValue = (String) values.get(mode);
+            Point centerValue = (Point) values.get(center);
+            Point pointOfCircleValue = (Point) values.get(pointOfCircle);
+
+            try {
+                Curve polygon =
+                    calculateRegularPolygon(modeValue, centerValue,
+                        pointOfCircleValue, sidesValue);
+
+                EditingProviderServices editingProviderServices =
+                    (EditingProviderServices) getProviderServices();
+                GeometryType geomType =
+                    editingProviderServices.getGeomType(featureStore);
+
+                if (geomType.isTypeOf(Geometry.TYPES.MULTICURVE)) {
+//                    return polygon.toLines();
+
+                    MultiCurve multiCurve =
+                        GeometryLocator.getGeometryManager().createMultiCurve(
+                            geomType.getSubType());
+                    multiCurve.addCurve(polygon);
+                    return multiCurve;
+                }
+
+                return polygon;
+            } catch (Exception e) {
+                throw new FinishServiceException(e);
+            }
+        }
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+        try {
+            Geometry geometry = finish();
+            if (geometry != null) {
+                EditingProviderServices editingProviderServices =
+                    (EditingProviderServices) getProviderServices();
+                editingProviderServices.insertGeometryIntoFeatureStore(
+                    geometry, featureStore);
+            }
+        } catch (Exception e) {
+            throw new FinishServiceException(e);
+        }
+
+    }
+
+    public void start() throws StartServiceException {
+        values = new HashMap<EditingServiceParameter, Object>();
+    }
+
+    public String getName() {
+        return RegularPolygonEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/regularpolygon/FilledRegularPolygonEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/regularpolygon/FilledRegularPolygonEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/regularpolygon/FilledRegularPolygonEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,111 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.regularpolygon;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author llmarques
+ *
+ */
+public class FilledRegularPolygonEditingProviderFactory extends
+AbstractProviderFactory implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "insert-filled-regular-polygon";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Inserts filled regular polygons on the view";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", true, null,
+                new int[] { 
+                    Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, 
+                    Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE
+                });
+
+        return serviceInfo;
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject services, ProviderServices parameters) {
+        return new FilledRegularPolygonEditingProvider(services, parameters);
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/regularpolygon/RegularPolygonEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/regularpolygon/RegularPolygonEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/regularpolygon/RegularPolygonEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,86 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.regularpolygon;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ *
+ * @author llmarques
+ *
+ */
+public class RegularPolygonEditingProviderFactory extends
+AbstractProviderFactory implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "insert-regular-polygon";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Inserts regular polygons on the view";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", true, null,
+                new int[] { Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE });
+
+        return serviceInfo;
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+        return dynclass;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new RegularPolygonEditingProvider(services, parameters);
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/regularpolygon/RegularPolygonEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/regularpolygon/RegularPolygonEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/regularpolygon/RegularPolygonEditingLibrary.java	(revision 1663)
@@ -0,0 +1,77 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.regularpolygon;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ *
+ * @author llmarques
+ *
+ */
+public class RegularPolygonEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new RegularPolygonEditingProviderFactory());
+        manager
+        .addProviderFactory(new FilledRegularPolygonEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "insert-regular-polygon",
+            this.getClass().getClassLoader(), this.getClass().getName());
+        manager.registerIcon("vectorediting-tools",
+            "insert-filled-regular-polygon", this.getClass().getClassLoader(),
+            this.getClass().getName());
+
+        registerTranslations();
+        manager.registerDefaultValues("regularpolygon", this.getClass().getClassLoader());
+
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "regular-polygon-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.regularpolygon</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.regularpolygon</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.regularpolygon
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.reversedirection/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.reversedirection/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.reversedirection/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.reversedirection</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.reversedirection</name>
+</project>
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.reversedirection/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.reversedirection/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.reversedirection/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.reversedirection.ReverseDirectionEditingLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.reversedirection/src/main/resources/images/vectorediting-tools/modify-reverse-direction.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.reversedirection/src/main/resources/images/vectorediting-tools/modify-reverse-direction.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.reversedirection/src/main/java/org/gvsig/vectorediting/lib/prov/reversedirection/ReverseDirectionEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.reversedirection/src/main/java/org/gvsig/vectorediting/lib/prov/reversedirection/ReverseDirectionEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.reversedirection/src/main/java/org/gvsig/vectorediting/lib/prov/reversedirection/ReverseDirectionEditingProvider.java	(revision 1663)
@@ -0,0 +1,263 @@
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.reversedirection;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.Geometry.TYPES;
+import org.gvsig.fmap.geom.GeometryException;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Spline;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dispose.DisposeUtils;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.tools.visitor.VisitCanceledException;
+import org.gvsig.tools.visitor.Visitor;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ *
+ * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
+ *
+ */
+public class ReverseDirectionEditingProvider extends AbstractEditingProvider
+    implements EditingProvider {
+
+    private EditingServiceParameter selectionParameter;
+
+    private FeatureSelection selection;
+
+    private FeatureStore featureStore;
+
+    public ReverseDirectionEditingProvider(ProviderServices providerServices,
+        DynObject parameters) {
+        super(providerServices);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.selectionParameter =
+            new DefaultEditingServiceParameter("selection", "selection",
+                TYPE.SELECTION);
+    }
+
+    public EditingServiceParameter next() {
+        if (selection == null) {
+            return this.selectionParameter;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        return null;
+    }
+
+    public void stop() throws StopServiceException {
+        ToolsLocator.getDisposableManager().release(selection);
+        DisposeUtils.disposeQuietly(selection);
+        this.selection = null;
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(selectionParameter);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter parameter,
+        Object value) throws InvalidEntryException {
+
+        if (parameter == selectionParameter) {
+
+            if (value instanceof FeatureSelection) {
+                FeatureSelection featureSelection = (FeatureSelection) value;
+
+                if (featureSelection.getSelectedCount() > 0) {
+                    try {
+                        featureSelection.accept(new Visitor() {
+
+                            public void visit(Object obj)
+                                throws VisitCanceledException, BaseException {
+
+                                Feature feature = (Feature) obj;
+                                Geometry geometry =
+                                    feature.getDefaultGeometry();
+                                GeometryType geometryType =
+                                    geometry.getGeometryType();
+
+                                if (!geometryType.isTypeOf(TYPES.CURVE)
+                                    && !geometryType.isTypeOf(TYPES.MULTICURVE)) {
+                                    throw new InvalidEntryException(null);
+                                }
+                            }
+                        });
+                    } catch (BaseException e) {
+                        throw new InvalidEntryException(e);
+                    }
+                    ToolsLocator.getDisposableManager().bind(
+                        (FeatureSelection) value);
+                    this.selection = featureSelection;
+                } else {
+                    throw new InvalidEntryException(null);
+                }
+            }
+        }
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+
+        if (selection != null) {
+
+            final EditingProviderServices editingProviderServices =
+                (EditingProviderServices) getProviderServices();
+
+            try {
+                selection.accept(new Visitor() {
+
+                    public void visit(Object obj)
+                        throws VisitCanceledException, BaseException {
+
+                        Feature feature = (Feature) obj;
+                        EditableFeature eFeature = feature.getEditable();
+                        Geometry geometry = eFeature.getDefaultGeometry();
+
+                        eFeature.setDefaultGeometry(reverseDirection(geometry));
+                        editingProviderServices.updateFeatureInFeatureStore(
+                            eFeature, featureStore);
+                    }
+                });
+
+                ToolsLocator.getDisposableManager().release(selection);
+                DisposeUtils.dispose(selection);
+                featureStore.getFeatureSelection().deselectAll();
+
+            } catch (BaseException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+        }
+    }
+
+    private Geometry reverseDirection(Geometry geometry)
+        throws GeometryException, GeometryOperationNotSupportedException, GeometryOperationException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        GeometryType geometryType = geometry.getGeometryType();
+
+        if (geometryType.isTypeOf(TYPES.MULTICURVE)) {
+            MultiCurve reversedMultiCurve =
+                geometryManager.createMultiCurve(geometryType.getSubType());
+            MultiCurve multicurve = (MultiCurve) geometry;
+            for (int i = 0; i < multicurve.getPrimitivesNumber(); i++) {
+                reversedMultiCurve.addCurve(reverseCurve(multicurve.getCurveAt(i)));
+            }
+            return reversedMultiCurve;
+        } else if (geometryType.isTypeOf(TYPES.CURVE)) {
+            return reverseCurve((Curve) geometry);
+        } else {
+            throw new IllegalArgumentException(String.format(
+                "Can't reverse geometry with {} type", geometryType.getType()));
+        }
+    }
+
+    private Curve reverseCurve(Curve curve) throws GeometryException, GeometryOperationNotSupportedException, GeometryOperationException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        Curve curveToReverse = null;
+        Curve reverseCurve = null;
+        if(curve instanceof Line || curve instanceof Spline){
+            reverseCurve = (Curve) curve.cloneGeometry();
+            reverseCurve.flip();
+        } else {
+            curveToReverse = (Curve) curve.toLines().getPrimitiveAt(0);
+            reverseCurve = (Curve) geometryManager.create(Geometry.TYPES.LINE, curve.getGeometryType().getSubType());
+            for (int i = curveToReverse.getNumVertices() - 1; i >= 0; i--) {
+                reverseCurve.addVertex(curveToReverse.getVertex(i));
+            }
+        }
+        return reverseCurve;
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        FeatureSelection selected = null;
+        if (featureStore != null) {
+            try {
+                selected = featureStore.getFeatureSelection();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            }
+
+            if (selected.getSelectedCount() > 0) {
+                try {
+                    setValue(selected);
+                } catch (InvalidEntryException e) {
+                    throw new InvalidEntryException(e);
+                }
+            }
+        }
+    }
+
+    public String getName() {
+        return ReverseDirectionEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.reversedirection/src/main/java/org/gvsig/vectorediting/lib/prov/reversedirection/ReverseDirectionEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.reversedirection/src/main/java/org/gvsig/vectorediting/lib/prov/reversedirection/ReverseDirectionEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.reversedirection/src/main/java/org/gvsig/vectorediting/lib/prov/reversedirection/ReverseDirectionEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,88 @@
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.reversedirection;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * 
+ * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
+ *
+ */
+public class ReverseDirectionEditingProviderFactory extends
+    AbstractProviderFactory implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "modify-reverse-direction";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Reverse direction of geometries";
+
+    public void initialize() {
+
+    }
+    
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, PROVIDER_DESCRIPTION,
+                false, null, new int[] { 
+                    Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                    Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE
+                });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new ReverseDirectionEditingProvider(services, parameters);
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.reversedirection/src/main/java/org/gvsig/vectorediting/lib/prov/reversedirection/ReverseDirectionEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.reversedirection/src/main/java/org/gvsig/vectorediting/lib/prov/reversedirection/ReverseDirectionEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.reversedirection/src/main/java/org/gvsig/vectorediting/lib/prov/reversedirection/ReverseDirectionEditingLibrary.java	(revision 1663)
@@ -0,0 +1,61 @@
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.reversedirection;
+
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * 
+ * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
+ *
+ */
+public class ReverseDirectionEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager
+            .addProviderFactory(new ReverseDirectionEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "modify-reverse-direction",
+            this.getClass().getClassLoader(), this.getClass().getName());
+
+    }
+
+}

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.reversedirection
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.autopolygon/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.autopolygon/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.autopolygon/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.autopolygon.AutopolygonEditingLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.autopolygon/src/main/resources/images/vectorediting-tools/insert-autopolygon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.autopolygon/src/main/resources/images/vectorediting-tools/insert-autopolygon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.autopolygon/src/main/java/org/gvsig/vectorediting/lib/prov/autopolygon/AutopolygonEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.autopolygon/src/main/java/org/gvsig/vectorediting/lib/prov/autopolygon/AutopolygonEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.autopolygon/src/main/java/org/gvsig/vectorediting/lib/prov/autopolygon/AutopolygonEditingLibrary.java	(revision 1663)
@@ -0,0 +1,71 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.autopolygon;
+
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * Library for default implementation initialization and configuration.
+ *
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class AutopolygonEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new AutopolygonEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "insert-autopolygon",
+            this.getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "insert-autopolygon");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.autopolygon/src/main/java/org/gvsig/vectorediting/lib/prov/autopolygon/AutopolygonEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.autopolygon/src/main/java/org/gvsig/vectorediting/lib/prov/autopolygon/AutopolygonEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.autopolygon/src/main/java/org/gvsig/vectorediting/lib/prov/autopolygon/AutopolygonEditingProvider.java	(revision 1663)
@@ -0,0 +1,202 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.autopolygon;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.cresques.cts.IProjection;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureQuery;
+import org.gvsig.fmap.dal.feature.FeatureSet;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Surface;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.layers.vectorial.SpatialEvaluatorsFactory;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.evaluator.Evaluator;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+@SuppressWarnings("UseSpecificCatch")
+public class AutopolygonEditingProvider extends AbstractEditingProvider
+    implements EditingProvider {
+
+    private final EditingServiceParameter geometryParameter;
+
+    private final FeatureStore featureStore;
+
+    private Geometry geometryValue;
+
+    public AutopolygonEditingProvider(ProviderServices services,
+        DynObject parameters) {
+        super(services);
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.geometryParameter =
+            new DefaultEditingServiceParameter("Draw geometry",
+                "draw_geometry_to_autopolygon", Geometry.TYPES.MULTISURFACE, TYPE.GEOMETRY);
+    }
+
+    public EditingServiceParameter next() {
+        if (geometryValue == null) {
+            return geometryParameter;
+        }
+
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        return null;
+    }
+
+    public void stop() throws StopServiceException {
+        geometryValue = null;
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> list = new ArrayList<>();
+        list.add(geometryParameter);
+        return list;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter param = next();
+        validateAndInsertValue(param, value);
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter param,
+        Object value) throws InvalidEntryException {
+
+        if (param == geometryParameter) {
+            if (value instanceof Geometry ) {
+                Geometry geometry = (Geometry)value;
+                GeometryType geometryType = geometry.getGeometryType();
+                if (geometryType.isTypeOf(Geometry.TYPES.MULTISURFACE) ||
+                    geometryType.isTypeOf(Geometry.TYPES.SURFACE)) {
+                    geometryValue = geometry;
+                    return;
+                }
+            }
+        }
+        throw new InvalidEntryException(null);
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+        Geometry geometry = finish();
+        editingProviderServices.insertGeometryIntoFeatureStore(geometry,
+            featureStore);
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        Geometry geometry = geometryValue.cloneGeometry();
+        FeatureQuery query;
+        try {
+            query = queryByGeometry(geometry);
+            if (query != null) {
+                FeatureSet features = featureStore.getFeatureSet(query);
+                DisposableIterator featuresIterator = features.fastIterator();
+                while (featuresIterator.hasNext()) {
+                    Feature feature = (Feature) featuresIterator.next();
+                    geometry =
+                        geometry.difference(feature.getDefaultGeometry());
+                }
+                featuresIterator.dispose();
+                features.dispose();
+            }
+            GeometryType storeGeomType =
+                editingProviderServices.getGeomType(featureStore);
+
+            if (storeGeomType.isTypeOf(MULTISURFACE)) {
+                MultiSurface multisurface;
+                multisurface =
+                    GeometryLocator.getGeometryManager().createMultiSurface(
+                        storeGeomType.getSubType());
+                multisurface.addSurface((Surface)geometry);
+                return multisurface;
+            }
+
+        } catch (Exception e) {
+            throw new FinishServiceException(e);
+        }
+        return geometry;
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        geometryValue = null;
+    }
+
+    public String getName() {
+        return AutopolygonEditingProviderFactory.PROVIDER_NAME;
+    }
+
+    private FeatureQuery queryByGeometry(Geometry geometry) throws DataException {
+        FeatureQuery featureQuery = featureStore.createFeatureQuery();
+        FeatureType featureType = featureStore.getDefaultFeatureType();
+        String geomName = featureType.getDefaultGeometryAttributeName();
+        featureQuery.setFeatureType(featureType);
+
+        IProjection query_proj = featureType.getDefaultSRS();
+        Evaluator iee = SpatialEvaluatorsFactory.getInstance().intersects(
+            geometry, 
+            query_proj, 
+            featureStore
+        );
+        featureQuery.setFilter(iee);
+        featureQuery.setAttributeNames(null);
+        return featureQuery;
+    }
+
+
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.autopolygon/src/main/java/org/gvsig/vectorediting/lib/prov/autopolygon/AutopolygonEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.autopolygon/src/main/java/org/gvsig/vectorediting/lib/prov/autopolygon/AutopolygonEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.autopolygon/src/main/java/org/gvsig/vectorediting/lib/prov/autopolygon/AutopolygonEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,88 @@
+package org.gvsig.vectorediting.lib.prov.autopolygon;
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.dynobject.DynObjectManager;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+public class AutopolygonEditingProviderFactory extends
+AbstractProviderFactory implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "insert-autopolygon";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Creates autopolygons";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(
+                PROVIDER_NAME,
+                "",
+                false,
+                null,
+                new int[] { Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new AutopolygonEditingProvider(services, parameters);
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynObjectManager dynObjectManager = ToolsLocator.getDynObjectManager();
+        DynClass dynclass =
+            dynObjectManager
+            .createDynClass(PROVIDER_NAME, PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.autopolygon/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.autopolygon/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.autopolygon/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.autopolygon</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.autopoligon</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.autopolygon
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.smoothline.SmoothLineEditingLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/resources/images/vectorediting-tools/modify-smooth-line.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/resources/images/vectorediting-tools/modify-smooth-line.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/BSpline.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/BSpline.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/BSpline.java	(revision 1663)
@@ -0,0 +1,58 @@
+package org.gvsig.vectorediting.lib.prov.smoothline;
+
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+
+
+public class BSpline extends ControlCurve {
+
+    public BSpline(final Line line) {
+        super(line);
+    }
+
+    // the basis function for a cubic B spline
+    float b(final int i, float t) {
+        switch (i) {
+        case -2:
+            return (((-t + 3) * t - 3) * t + 1) / 6;
+        case -1:
+            return (((3 * t - 6) * t) * t + 4) / 6;
+        case 0:
+            return (((-3 * t + 3) * t + 3) * t + 1) / 6;
+        case 1:
+            return (t * t * t) / 6;
+        }
+        return 0; // we only get here if an invalid i is specified
+    }
+
+    // evaluate a point on the B spline
+    private Point p(final int i, final float t, int subtype) throws CreateGeometryException {
+        GeometryManager geomManager = GeometryLocator.getGeometryManager();
+        float px = 0;
+        float py = 0;
+        for (int j = -2; j <= 1; j++) {
+            px += b(j, t) * m_X[i + j];
+            py += b(j, t) * m_Y[i + j];
+        }
+        return geomManager.createPoint((int) Math.round(px), (int) Math.round(py), subtype);
+    }
+
+    @Override
+    public Line getSmoothedLine(final int iSteps, int subtype) throws CreateGeometryException {
+        GeometryManager geomManager = GeometryLocator.getGeometryManager();
+        Line line = geomManager.createLine(subtype);
+
+        Point q = p(2, 0, subtype);
+        line.addVertex(q.getX(), q.getY());
+        for (int i = 2; i < m_X.length - 1; i++) {
+            for (int j = 1; j <= iSteps; j++) {
+                q = p(i, j / (float) iSteps, subtype);
+                line.addVertex(q);
+            }
+        }
+        return line;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/Bezier.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/Bezier.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/Bezier.java	(revision 1663)
@@ -0,0 +1,57 @@
+package org.gvsig.vectorediting.lib.prov.smoothline;
+
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+
+public class Bezier extends ControlCurve {
+
+    public Bezier(final Line line) {
+        super(line);
+    }
+
+    // the basis function for a Bezier spline
+    static float b(final int i, final float t) {
+        switch (i) {
+        case 0:
+            return (1 - t) * (1 - t) * (1 - t);
+        case 1:
+            return 3 * t * (1 - t) * (1 - t);
+        case 2:
+            return 3 * t * t * (1 - t);
+        case 3:
+            return t * t * t;
+        }
+        return 0; // we only get here if an invalid i is specified
+    }
+
+    // evaluate a point on the B spline
+    Point p(final int i, final float t, int subtype) throws CreateGeometryException {
+        GeometryManager geomManager = GeometryLocator.getGeometryManager();
+        float px = 0;
+        float py = 0;
+        for (int j = 0; j <= 3; j++) {
+            px += b(j, t) * m_X[i + j];
+            py += b(j, t) * m_Y[i + j];
+        }
+        return geomManager.createPoint((int) Math.round(px), (int) Math.round(py),subtype);
+    }
+
+    @Override
+    public Line getSmoothedLine(final int iSteps, int subtype) throws CreateGeometryException {
+        GeometryManager geomManager = GeometryLocator.getGeometryManager();
+        Line line = geomManager.createLine(subtype);
+
+        Point q = p(0, 0, subtype);
+        line.addVertex(q);
+        for (int i = 0; i < m_X.length - 3; i += 3) {
+            for (int j = 1; j <= iSteps; j++) {
+                q = p(i, j / (float) iSteps, subtype);
+                line.addVertex(q);
+            }
+        }
+        return line;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/SmoothLineEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/SmoothLineEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/SmoothLineEditingProvider.java	(revision 1663)
@@ -0,0 +1,420 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.smoothline;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryException;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Polygon;
+import org.gvsig.fmap.geom.primitive.Spline;
+import org.gvsig.fmap.geom.primitive.Surface;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.tools.visitor.VisitCanceledException;
+import org.gvsig.tools.visitor.Visitor;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author fdiaz
+ *
+ */
+public class SmoothLineEditingProvider extends AbstractEditingProvider implements
+    EditingProvider {
+
+    private EditingServiceParameter selection;
+
+    private EditingServiceParameter steps;
+
+    private EditingServiceParameter algorithm;
+
+    private FeatureStore featureStore;
+
+    private Map<EditingServiceParameter, Object> values;
+
+    protected Map<String, String> options;
+
+    public static final String    NATURAL_CUBIC_SPLINES = "natural_cubic_splines";
+    public static final String    BEZIER_CURVES         = "bezier_curves";
+    public static final String    BSPLINES              = "b_splines";
+
+    /**
+     * Default constructor.
+     *
+     * @param providerServices
+     *            available services for this provider
+     * @param parameters
+     *            of this provider
+     */
+    public SmoothLineEditingProvider(DynObject parameters,
+        ProviderServices services) {
+        super(services);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.selection =
+            new DefaultEditingServiceParameter("selection", "selection",
+                TYPE.SELECTION);
+
+        this.steps =
+            new DefaultEditingServiceParameter("steps", "intermediate_steps_1_9",
+                TYPE.VALUE);
+
+        I18nManager i18nManager = ToolsLocator.getI18nManager();
+//        "Natural cubic splines","Bezier curves", "B splines"
+        options = new LinkedHashMap<String, String>();
+        options.put(i18nManager.getTranslation("key_natural_cubic_splines"), NATURAL_CUBIC_SPLINES);
+        options.put(i18nManager.getTranslation("key_bezier_curves"),BEZIER_CURVES);
+        options.put(i18nManager.getTranslation("key_b_splines"),BSPLINES);
+
+
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        String consoleMsg =
+            editingProviderServices.makeConsoleMessage(null, options);
+
+        this.algorithm =
+            new DefaultEditingServiceParameter("algorithm", consoleMsg, options,
+                EditingServiceParameter.TYPE.OPTION);
+}
+
+    public EditingServiceParameter next() {
+        if (values.get(selection) == null) {
+            return selection;
+        } else if (values.get(steps) == null) {
+            return steps;
+        } else if (values.get(algorithm) == null) {
+            return algorithm;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        return null;
+    }
+
+    public void stop() throws StopServiceException {
+        if (values != null) {
+            values.clear();
+        }
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(selection);
+        parameters.add(steps);
+        parameters.add(algorithm);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter parameter,
+        Object value) throws InvalidEntryException {
+
+        if (parameter == selection) {
+
+            FeatureSelection featureSelection = (FeatureSelection) value;
+
+            if (featureSelection.getSelectedCount() > 0) {
+                try {
+                    featureSelection.accept(new Visitor() {
+
+                        public void visit(Object obj)
+                            throws VisitCanceledException, BaseException {
+
+                            Feature feature = (Feature) obj;
+                            Geometry geometry = feature.getDefaultGeometry();
+                            GeometryType geometryType =
+                                geometry.getGeometryType();
+
+                            if (!geometryType.isTypeOf(Geometry.TYPES.CURVE)
+                                && !geometryType.isTypeOf(Geometry.TYPES.MULTICURVE)) {
+
+                                throw new InvalidEntryException(null);
+                            }
+                        }
+                    });
+
+                    values.put(selection, value);
+                    return;
+                } catch (BaseException e) {
+                    throw new InvalidEntryException(e);
+                }
+            }
+        } else if (parameter == steps) {
+            if (value instanceof Double) {
+                Integer stepsValue = ((Double) value).intValue();
+                if (stepsValue > 0 && stepsValue < 10 ) {
+                    values.put(steps, stepsValue);
+                    return;
+                }
+            }
+        }  else if (parameter == algorithm) {
+
+            if (value instanceof String) {
+
+                I18nManager i18nManager = ToolsLocator.getI18nManager();
+                String option = (String) value;
+
+                if (option.equalsIgnoreCase(i18nManager.getTranslation("key_natural_cubic_splines"))){
+                    values.put(parameter, "key_natural_cubic_splines");
+                    return;
+                }
+                if (option.equalsIgnoreCase(i18nManager.getTranslation("key_bezier_curves"))){
+                    values.put(parameter, "key_bezier_curves");
+                    return;
+                }
+                if (option.equalsIgnoreCase(i18nManager.getTranslation("key_b_splines"))){
+                    values.put(parameter, "key_b_splines");
+                    return;
+                }
+            }
+            throw new InvalidEntryException(null);
+
+        }
+        throw new InvalidEntryException(null);
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+
+        if (values != null) {
+
+            FeatureSelection featureSelection =
+                (FeatureSelection) values.get(selection);
+            ToolsLocator.getDisposableManager().bind(featureSelection);
+
+
+            final Integer stepsValue = (Integer) values.get(steps);
+
+            final String algorithmValue = (String)values.get(algorithm);
+
+            final EditingProviderServices editingProviderServices =
+                (EditingProviderServices) getProviderServices();
+
+            try {
+                final int subtype =
+                    editingProviderServices.getSubType(featureStore);
+
+                featureSelection.accept(new Visitor() {
+
+                    public void visit(Object obj)
+                        throws VisitCanceledException, BaseException {
+
+                        Feature feature = (Feature) obj;
+                        Geometry geometry = feature.getDefaultGeometry();
+                        GeometryType geoType = geometry.getGeometryType();
+
+                        if (geoType.isTypeOf(AGGREGATE)) {
+
+                            MultiCurve multiCurveToSmooth =
+                                (MultiCurve) geometry;
+
+                            MultiCurve multiCurveSmoothed =
+                                GeometryLocator.getGeometryManager()
+                                    .createMultiCurve(subtype);
+
+                            for (int i = 0; i < multiCurveToSmooth
+                                .getPrimitivesNumber(); i++) {
+
+                                Curve curveToSmooth =
+                                    (Curve) multiCurveToSmooth
+                                        .getPrimitiveAt(i);
+                                curveToSmooth =
+                                    smoothLine(curveToSmooth, stepsValue, algorithmValue);
+                                multiCurveSmoothed.addCurve(curveToSmooth);
+                                geometry = multiCurveSmoothed;
+                            }
+                        } else {
+                            Curve curveToSmooth = (Curve) geometry;
+                            curveToSmooth =
+                                smoothLine(curveToSmooth, stepsValue, algorithmValue);
+                            geometry = curveToSmooth;
+                        }
+
+                        EditableFeature eFeature = feature.getEditable();
+                        eFeature.setDefaultGeometry(geometry);
+                        editingProviderServices.updateFeatureInFeatureStore(
+                            eFeature, featureStore);
+                    }
+                });
+
+                featureStore.getFeatureSelection().deselectAll();
+                featureSelection.dispose();
+
+            } catch (BaseException e) {
+                throw new FinishServiceException(e);
+            }
+        }
+    }
+
+    private Line smoothLine(Curve curveToSmooth, Integer steps, String algorithm) throws DataException, CreateGeometryException{
+
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        int subtype = editingProviderServices.getSubType(featureStore);
+        Line lineToSmooth = null;
+
+        if (curveToSmooth instanceof Arc || curveToSmooth instanceof Spline) {
+            lineToSmooth = geometryManager.createLine(curveToSmooth.getGeometryType().getSubType());
+            lineToSmooth.setGeneralPath(curveToSmooth.getGeneralPath());
+
+        } else {
+            lineToSmooth = (Line)curveToSmooth;
+        }
+
+        ControlCurve operation;
+        if (algorithm.equalsIgnoreCase("key_natural_cubic_splines")){
+            operation = new NatCubic(lineToSmooth);
+        } else if (algorithm.equalsIgnoreCase("key_bezier_curves")){
+            operation = new Bezier(lineToSmooth);
+        } else if (algorithm.equalsIgnoreCase("key_b_splines")){
+            operation = new BSpline(lineToSmooth);
+        } else {
+            return null;
+        }
+        return operation.getSmoothedLine(steps, subtype);
+
+    }
+
+
+    private Line simplifyLine(Curve curveToSimplify, Double toleranceValue)
+        throws DataException, CreateGeometryException,
+        GeometryOperationNotSupportedException, GeometryOperationException {
+
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        int subtype = editingProviderServices.getSubType(featureStore);
+
+        Line simplifiedLine =
+            (Line) GeometryLocator.getGeometryManager().createLine(subtype);
+
+        // Add first vertex
+        simplifiedLine.addVertex(curveToSimplify.getVertex(0));
+
+        // Iterate over vertices
+        for (int i = 0; i < curveToSimplify.getNumVertices() - 2; i++) {
+
+            Point vertex = curveToSimplify.getVertex(i);
+            Point nextVertex = curveToSimplify.getVertex(i + 1);
+            Point nextNextVertex = curveToSimplify.getVertex(i + 2);
+
+            // Creates line between i vertex and i+2 vertex
+            Line tmpLine =
+                editingProviderServices.createLine(vertex, nextNextVertex,
+                    subtype);
+
+            // If distance between line and i+1 vertex is bigger than tolerance
+            // add point to simplifiedLine, else skip vertex
+            if (tmpLine.distance(nextVertex) > toleranceValue) {
+                simplifiedLine.addVertex(nextVertex);
+            } else {
+                i++;
+            }
+        }
+
+        // Add last vertex
+        simplifiedLine.addVertex(curveToSimplify.getVertex(curveToSimplify
+            .getNumVertices() - 1));
+
+        return simplifiedLine;
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        values = new HashMap<EditingServiceParameter, Object>();
+
+        FeatureSelection selected = null;
+        if (featureStore != null) {
+            try {
+                selected = featureStore.getFeatureSelection();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            }
+            if (selected.getSelectedCount() > 0) {
+                try {
+                    setValue(selected);
+                } catch (InvalidEntryException e) {
+                    throw new InvalidEntryException(e);
+                }
+            }
+        }
+    }
+
+    public String getName() {
+        return SmoothLineEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/ControlCurve.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/ControlCurve.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/ControlCurve.java	(revision 1663)
@@ -0,0 +1,27 @@
+package org.gvsig.vectorediting.lib.prov.smoothline;
+
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.primitive.Line;
+
+public abstract class ControlCurve {
+
+    protected double[] m_X;
+    protected double[] m_Y;
+    protected Line line;
+
+    public ControlCurve(final Line line) {
+
+       m_X = new double[line.getNumVertices()];
+       m_Y = new double[line.getNumVertices()];
+       for (int i = 0; i < line.getNumVertices(); i++) {
+          m_X[i] = line.getVertex(i).getX();
+          m_Y[i] = line.getVertex(i).getY();
+       }
+       this.line = line;
+
+    }
+
+    public abstract Line getSmoothedLine(int iSteps, int subtype) throws CreateGeometryException;
+
+ }
+
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/Cubic.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/Cubic.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/Cubic.java	(revision 1663)
@@ -0,0 +1,23 @@
+package org.gvsig.vectorediting.lib.prov.smoothline;
+
+
+public class Cubic {
+
+    double a, b, c, d; /* a + b*u + c*u^2 +d*u^3 */
+
+
+    public Cubic(final double a,
+                 final double b,
+                 final double c,
+                 final double d) {
+       this.a = a;
+       this.b = b;
+       this.c = c;
+       this.d = d;
+    }
+
+    /** evaluate cubic */
+    public double eval(final double u) {
+       return (((d * u) + c) * u + b) * u + a;
+    }
+ }
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/NatCubic.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/NatCubic.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/NatCubic.java	(revision 1663)
@@ -0,0 +1,96 @@
+package org.gvsig.vectorediting.lib.prov.smoothline;
+
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.primitive.Line;
+
+public class NatCubic extends ControlCurve {
+
+    /*
+     * calculates the natural cubic spline that interpolates
+     * y[0], y[1], ... y[n]
+     * The first segment is returned as
+     * C[0].a + C[0].b*u + C[0].c*u^2 + C[0].d*u^3 0<=u <1
+     * the other segments are in C[1], C[2], ... C[n-1]
+     */
+
+    public NatCubic(final Line line) {
+        super(line);
+    }
+
+    Cubic[] calcNaturalCubic(final int n, final double[] x) {
+        final double[] gamma = new double[n + 1];
+        final double[] delta = new double[n + 1];
+        final double[] D = new double[n + 1];
+        int i;
+        /*
+         * We solve the equation
+         * [2 1 ] [D[0]] [3(x[1] - x[0]) ]
+         * |1 4 1 | |D[1]| |3(x[2] - x[0]) |
+         * | 1 4 1 | | . | = | . |
+         * | ..... | | . | | . |
+         * | 1 4 1| | . | |3(x[n] - x[n-2])|
+         * [ 1 2] [D[n]] [3(x[n] - x[n-1])]
+         *
+         * by using row operations to convert the matrix to upper triangular
+         * and then back sustitution. The D[i] are the derivatives at the knots.
+         */
+
+        gamma[0] = 1.0f / 2.0f;
+        for (i = 1; i < n; i++) {
+            gamma[i] = 1 / (4 - gamma[i - 1]);
+        }
+        gamma[n] = 1 / (2 - gamma[n - 1]);
+
+        delta[0] = 3 * (x[1] - x[0]) * gamma[0];
+        for (i = 1; i < n; i++) {
+            delta[i] = (3 * (x[i + 1] - x[i - 1]) - delta[i - 1]) * gamma[i];
+        }
+        delta[n] = (3 * (x[n] - x[n - 1]) - delta[n - 1]) * gamma[n];
+
+        D[n] = delta[n];
+        for (i = n - 1; i >= 0; i--) {
+            D[i] = delta[i] - gamma[i] * D[i + 1];
+        }
+
+        /* now compute the coefficients of the cubics */
+        final Cubic[] C = new Cubic[n];
+        for (i = 0; i < n; i++) {
+            C[i] =
+                new Cubic(x[i], D[i], 3 * (x[i + 1] - x[i]) - 2 * D[i]
+                    - D[i + 1], 2 * (x[i] - x[i + 1]) + D[i] + D[i + 1]);
+        }
+        return C;
+    }
+
+    @Override
+    public Line getSmoothedLine(final int iSteps, int subtype) throws CreateGeometryException {
+        GeometryManager geomManager = GeometryLocator.getGeometryManager();
+
+        if (m_X.length >= 2) {
+            final Cubic[] X = calcNaturalCubic(m_X.length - 1, m_X);
+            final Cubic[] Y = calcNaturalCubic(m_Y.length - 1, m_Y);
+
+            Line line = geomManager.createLine(subtype);
+            /*
+             * very crude technique - just break each segment up into steps
+             * lines
+             */
+            line.addVertex((int) Math.round(X[0].eval(0)),
+                (int) Math.round(Y[0].eval(0)));
+
+            for (int i = 0; i < X.length; i++) {
+                for (int j = 1; j <= iSteps; j++) {
+                    final float u = j / (float) iSteps;
+                    line.addVertex(X[i].eval(u), Y[i].eval(u));
+                }
+            }
+
+            return line;
+
+        } else {
+            return this.line;
+        }
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/SmoothLineEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/SmoothLineEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/SmoothLineEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,88 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.smoothline;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author fdiaz
+ *
+ */
+public class SmoothLineEditingProviderFactory extends AbstractProviderFactory
+    implements EditingProviderFactory {
+
+    public static final String PROVIDER_NAME = "modify-smooth-line";
+
+    private final static String PROVIDER_DESCRIPTION =
+        "Smooth lines";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", false, null,
+                new int[] { 
+                    Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                    Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE 
+                });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new SmoothLineEditingProvider(parameters, services);
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject dynobject = super.createParameters();
+        dynobject.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return dynobject;
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/SmoothLineEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/SmoothLineEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/SmoothLineEditingLibrary.java	(revision 1663)
@@ -0,0 +1,71 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.smoothline;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.Library;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+
+/**
+ * @author fdiaz
+ *
+ */
+public class SmoothLineEditingLibrary extends AbstractLibrary implements Library {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new SmoothLineEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "modify-smooth-line", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n.text",
+            this.getClass().getClassLoader(), "smooth-line-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/pom.xml	(revision 1663)
@@ -0,0 +1,11 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.smoothline</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.smoothline</name>
+  <description>Editing provider to smooth lines</description>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/TrimLineEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/TrimLineEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/TrimLineEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,89 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.trimline;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author llmarques
+ *
+ */
+public class TrimLineEditingProviderFactory extends AbstractProviderFactory
+    implements EditingProviderFactory {
+
+    public static final String PROVIDER_NAME = "modify-trim-line";
+
+    private final static String PROVIDER_DESCRIPTION =
+        "Trim lines by cutting edges";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, PROVIDER_DESCRIPTION,
+                false, null, new int[] { 
+                    Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                    Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE 
+                });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new TrimLineEditingProvider(services, parameters);
+    }
+    
+    @Override
+    public DynObject createParameters() {
+        DynObject dynobject = super.createParameters();
+        dynobject.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return dynobject;
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/TrimLineEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/TrimLineEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/TrimLineEditingLibrary.java	(revision 1663)
@@ -0,0 +1,73 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.trimline;
+
+import org.gvsig.fmap.geom.Geometry.TYPES;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.Library;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.prov.trimline.operation.ArcTrimLineOperation;
+import org.gvsig.vectorediting.lib.prov.trimline.operation.CurveTrimLineOperation;
+import org.gvsig.vectorediting.lib.prov.trimline.operation.TrimLineOperationUtils;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * @author llmarques
+ *
+ */
+public class TrimLineEditingLibrary extends AbstractLibrary implements Library {
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new TrimLineEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "modify-trim-line", this
+            .getClass().getClassLoader(), this.getClass().getName());
+        
+        TrimLineOperationUtils.register(new ArcTrimLineOperation(), TYPES.ARC);
+        TrimLineOperationUtils.register(new CurveTrimLineOperation(), TYPES.SPLINE);
+        TrimLineOperationUtils.register(new CurveTrimLineOperation(), TYPES.LINE);
+        TrimLineOperationUtils.register(new CurveTrimLineOperation(), TYPES.CURVE);
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "modify-trim-line");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/operation/TrimLineOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/operation/TrimLineOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/operation/TrimLineOperation.java	(revision 1663)
@@ -0,0 +1,75 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.trimline.operation;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.tools.locator.LocatorException;
+
+/**
+ * Represents an operation to trim curve.
+ * 
+ * @author llmarques
+ *
+ */
+public interface TrimLineOperation {
+
+    /**
+     * Trim line, taking as cutting edges the boundary objects received as
+     * parameters.
+     * 
+     * Inserted point is the point inserted by user. It is used to determinate
+     * what segment of curve it must trimmed.
+     * 
+     * If curveToBeExtended does not intersect with any geometry, the geometry
+     * will not be modified.
+     * 
+     * @param curveToTrim
+     *            Curve to trim
+     * @param insertedPoint
+     *            Point inserted by user to determinate what side of curve must
+     *            be extended.
+     * @param boundaryObjects
+     *            If curveToBeExtended intersects with some boundary object, it
+     *            will
+     *            be extend to it. If there are several boundary objects that
+     *            intersects with curveToBeExtended, it will be extended to
+     *            nearest
+     *            point.
+     * @return Trimmed line
+     */
+    public MultiCurve trimLine(Curve curveToTrim, Point insertedPoint,
+        FeatureSelection boundaryObjects)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, DataException, CreateGeometryException,
+        LocatorException;
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/operation/TrimLineOperationUtils.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/operation/TrimLineOperationUtils.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/operation/TrimLineOperationUtils.java	(revision 1663)
@@ -0,0 +1,116 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.trimline.operation;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.gvsig.fmap.geom.Geometry.TYPES;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.tools.locator.LocatorException;
+
+/**
+ * @author llmarques
+ *
+ */
+public class TrimLineOperationUtils {
+
+    /**
+     * Use it to indicate start side should be trimmed
+     */
+    public static final String START_SIDE = "start";
+
+    /**
+     * Use it to indicate end side should be trimmed
+     */
+    public static final String END_SIDE = "end";
+
+    private static Map<Integer, TrimLineOperation> operations =
+        new HashMap<Integer, TrimLineOperation>();
+
+    public TrimLineOperationUtils() {
+    }
+
+    public static void register(TrimLineOperation operation, int geometryType) {
+        operations.put(geometryType, operation);
+    }
+
+    public static TrimLineOperation getOperation(Primitive geom) {
+        Integer type = geom.getGeometryType().getType();
+
+        TrimLineOperation operation = operations.get(type);
+
+        return operation;
+    }
+
+    // FIXME: remove this method when geometry library has this utility method
+    public static double getAngle(Point start, Point end)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+        double angle = Math.acos((end.getX() - start.getX()) / start.distance(end));
+
+        if (start.getY() > end.getY()) {
+            angle = -angle;
+        }
+
+        if (angle < 0) {
+            angle += (2 * Math.PI);
+        }
+
+        return angle;
+    }
+    
+    public static Arc createArc(Point center, double radius, Point initPoint,
+        Point endPoint, int subtype) throws CreateGeometryException,
+        LocatorException, GeometryOperationNotSupportedException,
+        GeometryOperationException {
+
+        Arc arc =
+            (Arc) GeometryLocator.getGeometryManager().create(TYPES.ARC,
+                subtype);
+
+        double startAngle = TrimLineOperationUtils.getAngle(center, initPoint);
+        double endAngle = TrimLineOperationUtils.getAngle(center, endPoint);
+
+        arc.setPointsStartEnd(center, radius, startAngle, endAngle);
+        return arc;
+    }
+    
+    public static boolean intersects(Curve curve, Point projectedPoint)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+
+        double tolerance = 1;
+
+        return curve.buffer(tolerance).intersects(projectedPoint);
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/operation/CurveTrimLineOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/operation/CurveTrimLineOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/operation/CurveTrimLineOperation.java	(revision 1663)
@@ -0,0 +1,177 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.trimline.operation;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.locator.LocatorException;
+
+/**
+ * Operation to trim curves.
+ * 
+ * @author llmarques
+ */
+public class CurveTrimLineOperation implements TrimLineOperation {
+
+    /*
+     * Strategy:
+     * 
+     * 1. Get arc segments between curve and boundary objects.
+     * 2. Determinate what segment of curve must be deleted
+     * 3. Rebuild curve taking into account the segment that must be deleted
+     */
+    public MultiCurve trimLine(Curve curveToTrim, Point insertedPoint,
+        FeatureSelection boundaryObjects)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, DataException, CreateGeometryException,
+        LocatorException {
+
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        int subType = curveToTrim.getGeometryType().getSubType();
+
+        DisposableIterator it = boundaryObjects.fastIterator();
+        MultiCurve segmentedLine = geometryManager.createMultiCurve(subType);
+        segmentedLine.addCurve(curveToTrim);
+
+        while (it.hasNext()) {
+            Feature feature = (Feature) it.next();
+            Geometry geometry = feature.getDefaultGeometry();
+
+            Geometry tmpDifference = segmentedLine.difference(geometry);
+            if (tmpDifference instanceof MultiCurve) {
+                segmentedLine = (MultiCurve) tmpDifference;
+            } else if(tmpDifference instanceof Curve) {
+                // Sometimes line to split and splitter are so close ( distance
+                // between geometries < 0.00000000001 ). In this cases, we try
+                // to do an enhance difference.
+                // If the result is instance of Curve, it is considered that
+                // lines don't intersect.
+                // If the result is instance of Multicurve, lines are so close
+                // and it is considered that lines intersect.
+                Geometry enchancedGeometry = enhancedDifference(geometry, (Curve) tmpDifference);
+                if(enchancedGeometry instanceof MultiCurve){
+                    segmentedLine = (MultiCurve) enchancedGeometry;
+                } 
+            }
+        }
+
+        if (segmentedLine.getPrimitivesNumber() == 1) {
+            return segmentedLine;
+        }
+
+        int index = 0;
+        Curve curve;
+        double minDistance = Double.POSITIVE_INFINITY;
+        for (int i = 0; i < segmentedLine.getPrimitivesNumber(); i++) {
+            curve = segmentedLine.getCurveAt(i);
+            double distance = curve.distance(insertedPoint);
+            if (distance < minDistance) {
+                index = i;
+                minDistance = distance;
+            }
+        }
+
+        MultiCurve trimmedCurve = geometryManager.createMultiCurve(subType);
+
+        Curve tmpCurve = null;
+        for (int i = 0; i < segmentedLine.getPrimitivesNumber(); i++) {
+
+            if (i == index) {
+                if (tmpCurve != null) {
+                    trimmedCurve.addCurve(tmpCurve);
+                    tmpCurve = null;
+                }
+                continue;
+            }
+
+            if (tmpCurve != null) {
+                tmpCurve = union(tmpCurve, segmentedLine.getCurveAt(i));
+            } else {
+                tmpCurve = segmentedLine.getCurveAt(i);
+            }
+        }
+        if (tmpCurve != null) {
+            trimmedCurve.addCurve(tmpCurve);
+        }
+
+        return trimmedCurve;
+    }
+
+    private Curve union(Curve firstCurve, Curve secondCurve)
+        throws CreateGeometryException, LocatorException,
+        GeometryOperationNotSupportedException, GeometryOperationException {
+
+        int subtype1 = firstCurve.getGeometryType().getSubType();
+        int subtype2 = secondCurve.getGeometryType().getSubType();
+
+        if (subtype1 == subtype2) {
+            Curve union =
+                GeometryLocator.getGeometryManager().createLine(subtype1);
+
+            for (int i = 0; i < firstCurve.getNumVertices() - 1; i++) {
+                union.addVertex(firstCurve.getVertex(i));
+            }
+
+            Point lastVertex =
+                firstCurve.getVertex(firstCurve.getNumVertices() - 2);
+            for (int i = 0; i < secondCurve.getNumVertices(); i++) {
+
+                if (i == 0) {
+                    Line tmpLine =
+                        GeometryLocator.getGeometryManager().createLine(
+                            subtype1);
+                    tmpLine.setPoints(lastVertex, secondCurve.getVertex(1));
+                    if (TrimLineOperationUtils.intersects(tmpLine,
+                        secondCurve.getVertex(0))) {
+                        continue;
+                    }
+                }
+                union.addVertex(secondCurve.getVertex(i));
+            }
+
+            return union;
+        }
+        return null;
+    }
+    
+    private Geometry enhancedDifference(Geometry splitter, Curve curve)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+        Geometry snapTo = curve.snapTo(splitter, 0.1);
+        return snapTo.difference(splitter);
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/operation/ArcTrimLineOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/operation/ArcTrimLineOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/operation/ArcTrimLineOperation.java	(revision 1663)
@@ -0,0 +1,171 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.trimline.operation;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.locator.LocatorException;
+
+/**
+ * Operation to trim arcs.
+ * 
+ * @author llmarques
+ *
+ */
+public class ArcTrimLineOperation implements TrimLineOperation {
+
+    /*
+     * Strategy:
+     * 
+     * 1. Get arc segments between arc and boundary objects.
+     * 2. Determinate what segment of arc must be deleted
+     * 3. Rebuild arc taking into account the segment that must be deleted
+     */
+    public MultiCurve trimLine(Curve curveToTrim, Point insertedPoint,
+        FeatureSelection boundaryObjects)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, DataException, CreateGeometryException,
+        LocatorException {
+
+        final Arc arcToTrim = (Arc) curveToTrim;
+
+        GeometryManager geoManager = GeometryLocator.getGeometryManager();
+        int subtype = arcToTrim.getGeometryType().getSubType();
+
+        MultiCurve segmentedArc = geoManager.createMultiCurve(subtype);
+        segmentedArc.addCurve(curveToTrim);
+
+        DisposableIterator it = boundaryObjects.fastIterator();
+
+        while (it.hasNext()) {
+            Feature feature = (Feature) it.next();
+            Geometry geometry = feature.getDefaultGeometry();
+
+            Geometry tmpDifference = segmentedArc.difference(geometry);
+            if (tmpDifference instanceof MultiCurve) {
+                segmentedArc = (MultiCurve) tmpDifference;
+            }
+        }
+
+        int index = 0;
+        Curve arc;
+        double minDistance = Double.POSITIVE_INFINITY;
+        for (int i = 0; i < segmentedArc.getPrimitivesNumber(); i++) {
+            arc = segmentedArc.getCurveAt(i);
+            double distance = arc.distance(insertedPoint);
+            if (distance < minDistance) {
+                index = i;
+                minDistance = distance;
+            }
+        }
+
+        MultiCurve trimmedArc = geoManager.createMultiCurve(subtype);
+        Point center = arcToTrim.getCenterPoint();
+
+        // If Arc#getCenter() return null, we will have to use this "trick" to
+        // get arc center.
+        if (center == null) {
+            center =
+                geoManager.createPoint(arcToTrim.getEnvelope().getCenter(0),
+                    arcToTrim.getEnvelope().getCenter(1), subtype);
+        }
+
+        double radius = center.distance(arcToTrim.getInitPoint());
+
+        Curve tmpCurve = null;
+        for (int i = 0; i < segmentedArc.getPrimitivesNumber(); i++) {
+
+            if (i == index) {
+                if (tmpCurve != null) {
+                    trimmedArc.addCurve(tmpCurve);
+                    tmpCurve = null;
+                }
+                continue;
+            }
+
+            if (tmpCurve != null) {
+                tmpCurve =
+                    union(center, radius, tmpCurve, segmentedArc.getCurveAt(i));
+            } else {
+                tmpCurve = segmentedArc.getCurveAt(i);
+            }
+        }
+        if (tmpCurve != null) {
+            trimmedArc.addCurve(tmpCurve);
+        }
+
+        return trimmedArc;
+    }
+
+    private Arc union(Point center, double radius, Curve curveA, Curve curveB)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, CreateGeometryException, LocatorException {
+
+        int subtype1 = curveA.getGeometryType().getSubType();
+        int subtype2 = curveB.getGeometryType().getSubType();
+
+        Arc arc1 =
+            TrimLineOperationUtils.createArc(center, radius,
+                curveA.getVertex(0),
+                curveA.getVertex(curveA.getNumVertices() - 1), subtype1);
+        Arc arc2 =
+            TrimLineOperationUtils.createArc(center, radius,
+                curveB.getVertex(0),
+                curveB.getVertex(curveB.getNumVertices() - 1), subtype1);
+
+        if (subtype1 == subtype2) {
+
+            double Xcenter1 = arc1.getCenterPoint().getX();
+            double Ycenter1 = arc1.getCenterPoint().getY();
+            double Xcenter2 = arc2.getCenterPoint().getX();
+            double Ycenter2 = arc2.getCenterPoint().getY();
+
+            double differenceX = Xcenter1 - Xcenter2;
+            double differenceY = Ycenter1 - Ycenter2;
+
+            if (Math.abs(differenceX) <= 0.001
+                && Math.abs(differenceY) <= 0.001) {
+
+                Point tmpCenter = arc1.getCenterPoint();
+                double tmpRadius = center.distance(arc1.getInitPoint());
+                return TrimLineOperationUtils.createArc(tmpCenter, tmpRadius,
+                    arc1.getInitPoint(), arc2.getEndPoint(), subtype1);
+            }
+        }
+        return null;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/TrimLineEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/TrimLineEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/java/org/gvsig/vectorediting/lib/prov/trimline/TrimLineEditingProvider.java	(revision 1663)
@@ -0,0 +1,443 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.trimline;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.cresques.cts.IProjection;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureQuery;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureSet;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.layers.vectorial.SpatialEvaluatorsFactory;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.dispose.DisposeUtils;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.evaluator.Evaluator;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.tools.visitor.VisitCanceledException;
+import org.gvsig.tools.visitor.Visitor;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.prov.trimline.operation.TrimLineOperation;
+import org.gvsig.vectorediting.lib.prov.trimline.operation.TrimLineOperationUtils;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * @author llmarques
+ *
+ */
+public class TrimLineEditingProvider extends AbstractEditingProvider implements
+    EditingProvider {
+
+    private final int TOLERANCE_PIXELS = 3;
+
+    private Point insertedPoint;
+
+    private final EditingServiceParameter selectionParameter;
+
+    private final EditingServiceParameter linesToTrimParameter;
+
+    private FeatureSelection selection;
+
+    private FeatureSet linesToTrim;
+
+    private final FeatureStore featureStore;
+
+    private final MapContext mapContext;
+
+    /**
+     * Default constructor.
+     *
+     * @param services
+     *            available services for this provider
+     * @param parameters
+     *            of this provider
+     */
+    public TrimLineEditingProvider(ProviderServices services,
+        DynObject parameters) {
+        super(services);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.mapContext =
+            (MapContext) parameters
+                .getDynValue(EditingProviderFactory.MAPCONTEXT_FIELD);
+
+        this.selectionParameter =
+            new DefaultEditingServiceParameter("selection", "selection",
+                TYPE.SELECTION);
+
+        this.linesToTrimParameter =
+            new DefaultEditingServiceParameter("line_to_trim", "line_to_trim",
+                TYPE.POSITION);
+    }
+
+    public EditingServiceParameter next() {
+        if (selection == null) {
+            return selectionParameter;
+        } else if (linesToTrim == null) {
+            return linesToTrimParameter;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        if (selection != null) {
+            DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+
+            EditingProviderManager editingProviderManager =
+                EditingProviderLocator.getProviderManager();
+            ISymbol lineSymbolEditing =
+                editingProviderManager.getSymbol("line-symbol-editing");
+
+            double tolerance =
+                mapContext.getViewPort().toMapDistance(TOLERANCE_PIXELS);
+
+            Geometry buffer;
+            FeatureSet geometries;
+            DisposableIterator it = null;
+            try {
+                // Create buffer with tolerance to get the geometry to be
+                // extended
+                buffer = mousePosition.buffer(tolerance);
+                geometries = getGeometryByBuffer(buffer);
+
+                it = geometries.fastIterator();
+                while (it.hasNext()) {
+                    Feature feature = (Feature) it.next();
+                    if (!selection.isSelected(feature)) {
+                        Geometry geometry = feature.getDefaultGeometry();
+
+                        if (geometry instanceof MultiCurve) {
+                            MultiCurve multiCurve = (MultiCurve) geometry;
+
+                            for (int i = 0; i < multiCurve
+                                .getPrimitivesNumber(); i++) {
+
+                                Curve curve = multiCurve.getCurveAt(i);
+                                MultiCurve extendedCurve =
+                                    trimLine(mousePosition, curve);
+                                for (int j = 0; j < extendedCurve
+                                    .getPrimitivesNumber(); j++) {
+                                    drawingStatus.addStatus(
+                                        extendedCurve.getCurveAt(j),
+                                        lineSymbolEditing, "");
+                                }
+                            }
+
+                        } else if (geometry instanceof Curve) {
+                            Curve curve = (Curve) geometry;
+                            MultiCurve extendedCurve =
+                                trimLine(mousePosition, curve);
+                            for (int j = 0; j < extendedCurve
+                                .getPrimitivesNumber(); j++) {
+                                drawingStatus.addStatus(
+                                    extendedCurve.getCurveAt(j),
+                                    lineSymbolEditing, "");
+                            }
+                        }
+                    }
+                }
+            } catch (BaseException e) {
+                throw new DrawServiceException(e);
+            } finally {
+                DisposeUtils.disposeQuietly(it);
+            }
+            return drawingStatus;
+        }
+        return null;
+    }
+
+    private MultiCurve trimLine(Point point, Curve curve)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, DataException, CreateGeometryException {
+
+        TrimLineOperation operation =
+            TrimLineOperationUtils.getOperation((Primitive) curve);
+
+        return operation.trimLine(curve, point, selection);
+    }
+
+    public void stop() throws StopServiceException {
+        linesToTrim = null;
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<>();
+        parameters.add(selectionParameter);
+        parameters.add(linesToTrimParameter);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+    }
+
+    private void validateAndInsertValue(
+        final EditingServiceParameter parameter, Object value)
+        throws InvalidEntryException {
+
+        if (parameter == selectionParameter
+            && value instanceof FeatureSelection) {
+
+            FeatureSelection featureSelection = (FeatureSelection) value;
+
+            if (featureSelection.getSelectedCount() > 0) {
+                try {
+                    featureSelection.accept(new Visitor() {
+
+                        public void visit(Object obj)
+                            throws VisitCanceledException, BaseException {
+                            Feature feature = (Feature) obj;
+                            Geometry geometry = feature.getDefaultGeometry();
+                            GeometryType geoType = geometry.getGeometryType();
+
+                            if (!geoType.isTypeOf(SURFACE)
+                                && !geoType.isTypeOf(MULTISURFACE)
+                                && !geoType.isTypeOf(CURVE)
+                                && !geoType.isTypeOf(MULTICURVE)) {
+                                throw new InvalidEntryException(null);
+                            }
+                        }
+                    });
+
+                    selection = featureSelection;
+                    return;
+                } catch (BaseException e) {
+                    throw new InvalidEntryException(e);
+                }
+            }
+        } else if (parameter == linesToTrimParameter && value instanceof Point) {
+
+            Point point = (Point) value;
+
+            try {
+                double tolerance =
+                    mapContext.getViewPort().toMapDistance(TOLERANCE_PIXELS);
+
+                // Create buffer with tolerance to get geometries to be
+                // extended
+                Geometry buffer = point.buffer(tolerance);
+                FeatureSet geometries = getGeometryByBuffer(buffer);
+
+                if (geometries.getSize() > 0) {
+
+                    geometries.accept(new Visitor() {
+
+                        public void visit(Object obj)
+                            throws VisitCanceledException, BaseException {
+
+                            Feature feature = (Feature) obj;
+                            final Geometry geometry =
+                                feature.getDefaultGeometry();
+                            GeometryType geoType = geometry.getGeometryType();
+
+                            if (!geoType.isTypeOf(CURVE)
+                                && !geoType.isTypeOf(MULTICURVE)) {
+                                throw new InvalidEntryException(null);
+                            }
+                        }
+                    });
+
+                    insertedPoint = point;
+                    linesToTrim = geometries;
+                    return;
+                }
+            } catch (BaseException e) {
+                throw new InvalidEntryException(e);
+            }
+        }
+        throw new InvalidEntryException(null);
+    }
+
+    private FeatureSet getGeometryByBuffer(Geometry buffer)
+        throws DataException {
+        FeatureQuery queryByGeometry = featureStore.createFeatureQuery();
+
+        // Get default SRS of default feature type
+        IProjection defaultSRS =
+            this.featureStore.getDefaultFeatureType().getDefaultSRS();
+
+        Evaluator iee = SpatialEvaluatorsFactory.getInstance().intersects(
+                buffer, 
+                defaultSRS, 
+                featureStore
+        );
+
+        queryByGeometry.setFilter(iee);
+        queryByGeometry.setAttributeNames(null);
+        return this.featureStore.getFeatureSet(queryByGeometry);
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+
+        if (selection != null && linesToTrim != null) {
+
+            try {
+                linesToTrim.accept(new Visitor() {
+
+                    public void visit(Object obj)
+                        throws VisitCanceledException, BaseException {
+                        Feature feature = (Feature) obj;
+                        Geometry geometry = feature.getDefaultGeometry();
+                        EditableFeature eFeature = feature.getEditable();
+
+                        if (geometry instanceof Curve) {
+
+                            Curve curveToTrim = (Curve) geometry;
+                            MultiCurve result =
+                                trimLine(insertedPoint, curveToTrim);
+                            eFeature.setDefaultGeometry(result);
+
+                        } else if (geometry instanceof MultiCurve) {
+
+                            int subType =
+                                geometry.getGeometryType().getSubType();
+                            MultiCurve multiCurveTrimmed =
+                                createMultiCurve(subType);
+                            MultiCurve multiCurveToTrim = (MultiCurve) geometry;
+
+                            double minDistance = Double.POSITIVE_INFINITY;
+                            int nearestCurveIndex = -1;
+
+                            for (int i = 0; i < multiCurveToTrim
+                                .getPrimitivesNumber(); i++) {
+
+                                Curve curveToTrim =
+                                    multiCurveToTrim.getCurveAt(i);
+
+                                double distance =
+                                    curveToTrim.distance(insertedPoint);
+                                if (distance < minDistance) {
+                                    nearestCurveIndex = i;
+                                    minDistance = distance;
+                                }
+                            }
+
+                            MultiCurve result =
+                                trimLine(insertedPoint, multiCurveToTrim
+                                    .getCurveAt(nearestCurveIndex));
+
+                            for (int i = 0; i < result.getPrimitivesNumber(); i++) {
+                                multiCurveTrimmed.addCurve(result.getCurveAt(i));
+                            }
+
+                            for (int i = 0; i < multiCurveToTrim
+                                .getPrimitivesNumber(); i++) {
+                                if (i != nearestCurveIndex) {
+                                    multiCurveTrimmed.addCurve(multiCurveToTrim
+                                        .getCurveAt(i));
+                                }
+                            }
+
+                            eFeature.setDefaultGeometry(multiCurveTrimmed);
+                        }
+
+                        linesToTrim.update(eFeature);
+                    }
+                });
+            } catch (BaseException e) {
+                throw new FinishServiceException(e);
+            }
+        }
+    }
+
+    private MultiCurve createMultiCurve(int subtype)
+        throws FinishServiceException, CreateGeometryException {
+
+        GeometryManager geoManager = GeometryLocator.getGeometryManager();
+        MultiCurve extendedMultiCurve;
+
+        extendedMultiCurve = geoManager.createMultiCurve(subtype);
+
+        return extendedMultiCurve;
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        linesToTrim = null;
+        FeatureSelection selected = null;
+        if (featureStore != null && selection == null) {
+            try {
+                selected = featureStore.getFeatureSelection();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            }
+            if (selected.getSelectedCount() > 0) {
+                try {
+                    setValue(selected);
+                } catch (InvalidEntryException e) {
+                    throw new InvalidEntryException(e);
+                }
+            }
+        }
+
+    }
+
+    public String getName() {
+        return TrimLineEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.trimline.TrimLineEditingLibrary
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/resources/images/vectorediting-tools/modify-trim-line.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/src/main/resources/images/vectorediting-tools/modify-trim-line.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.trimline</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.trimline</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.trimline
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.internalpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/internalpolygon/InternalPolygonEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.internalpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/internalpolygon/InternalPolygonEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.internalpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/internalpolygon/InternalPolygonEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,91 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.internalpolygon;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.dynobject.DynObjectManager;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+public class InternalPolygonEditingProviderFactory extends
+AbstractProviderFactory implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "modify-internal-polygon";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Creates interal polygons on geometries";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(
+                PROVIDER_NAME,
+                "",
+                false,
+                null,
+                new int[] { 
+                    Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, 
+                    Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE 
+                });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new InternalPolygonEditingProvider(services, parameters);
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynObjectManager dynObjectManager = ToolsLocator.getDynObjectManager();
+        DynClass dynclass =
+            dynObjectManager
+            .createDynClass(PROVIDER_NAME, PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.internalpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/internalpolygon/InternalPolygonEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.internalpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/internalpolygon/InternalPolygonEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.internalpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/internalpolygon/InternalPolygonEditingLibrary.java	(revision 1663)
@@ -0,0 +1,71 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.internalpolygon;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * Library for default implementation initialization and configuration.
+ *
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class InternalPolygonEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new InternalPolygonEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "modify-internal-polygon",
+            this.getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "internal-polygon-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.internalpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/internalpolygon/InternalPolygonEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.internalpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/internalpolygon/InternalPolygonEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.internalpolygon/src/main/java/org/gvsig/vectorediting/lib/prov/internalpolygon/InternalPolygonEditingProvider.java	(revision 1663)
@@ -0,0 +1,295 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.internalpolygon;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryException;
+import org.gvsig.fmap.geom.aggregate.MultiPolygon;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Polygon;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+public class InternalPolygonEditingProvider extends AbstractEditingProvider
+    implements EditingProvider {
+
+    private EditingServiceParameter selectionParameter;
+
+    private EditingServiceParameter geometryParameter;
+
+    private FeatureStore featureStore;
+
+    private Map<EditingServiceParameter, Object> values;
+
+    public InternalPolygonEditingProvider(ProviderServices services,
+        DynObject parameters) {
+        super(services);
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.selectionParameter =
+            new DefaultEditingServiceParameter("selection", "selection",
+                TYPE.SELECTION);
+
+        this.geometryParameter =
+            new DefaultEditingServiceParameter("Draw geometry",
+                "draw_geometry_to_internal_polygon", Geometry.TYPES.MULTISURFACE, TYPE.GEOMETRY);
+    }
+
+    public EditingServiceParameter next() {
+        if (values.get(selectionParameter) == null) {
+            return selectionParameter;
+        } else if (values.get(geometryParameter) == null) {
+            return geometryParameter;
+        }
+
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        return null;
+    }
+
+    public void stop() throws StopServiceException {
+        values.clear();
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> list =
+            new ArrayList<EditingServiceParameter>();
+        list.add(selectionParameter);
+        list.add(geometryParameter);
+        return list;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter param = next();
+        validateAndInsertValue(param, value);
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter param,
+        Object value) throws InvalidEntryException {
+        if (param == selectionParameter) {
+
+            if (value instanceof FeatureSelection) {
+
+                // Before set value checks if all geometries selected are
+                // instance of surface or multisurface
+                FeatureSelection selection = (FeatureSelection) value;
+                DisposableIterator it = null;
+
+                if (selection.getSelectedCount() > 0) {
+                    try {
+                        it = selection.fastIterator();
+
+                        while (it.hasNext()) {
+                            Feature feature = (Feature) it.next();
+                            Geometry geometry = feature.getDefaultGeometry();
+                            GeometryType geometryType =
+                                geometry.getGeometryType();
+
+                            if (!geometryType
+                                .isTypeOf(Geometry.TYPES.MULTISURFACE)
+                                && !geometryType
+                                    .isTypeOf(Geometry.TYPES.SURFACE)
+                                && !geometryType
+                                    .isTypeOf(Geometry.TYPES.MULTIPOLYGON)
+                                && !geometryType
+                                    .isTypeOf(Geometry.TYPES.POLYGON)
+                                ) {
+
+                                throw new InvalidEntryException(null);
+                            }
+                        }
+
+                        values.put(selectionParameter, selection);
+
+                    } catch (BaseException e) {
+                        throw new InvalidEntryException(e);
+                    } finally {
+                        it.dispose();
+                    }
+                } else {
+                    throw new InvalidEntryException(null);
+                }
+
+            }
+        } else if (param == geometryParameter) {
+            if (value instanceof Geometry && !(value instanceof Point)) {
+
+                // Before set value checks if some geometry contains the
+                // geometry received as parameter.
+                Geometry geometry = (Geometry) value;
+                FeatureSelection selection =
+                    (FeatureSelection) values.get(selectionParameter);
+                DisposableIterator it = null;
+
+                try {
+                    it = selection.fastIterator();
+
+                    while (it.hasNext()) {
+                        Feature feature = (Feature) it.next();
+                        if (feature.getDefaultGeometry().contains(geometry)) {
+                            values.put(param, value);
+                            return;
+                        }
+                    }
+
+                    if (values.get(geometryParameter) == null) {
+                        throw new InvalidEntryException(null);
+                    }
+                } catch (BaseException e) {
+                    throw new InvalidEntryException(e);
+                } finally {
+                    it.dispose();
+                }
+            }
+        }
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+        FeatureSelection selected =
+            (FeatureSelection) values.get(selectionParameter);
+        Geometry geometry = (Geometry) values.get(geometryParameter);
+        DisposableIterator it = null;
+
+        try {
+            if (!selected.isEmpty()) {
+                it = selected.fastIterator();
+
+                while (it.hasNext()) {
+                    Feature feature = (Feature) it.next();
+                    Geometry geometryFeature =
+                        feature.getDefaultGeometry().cloneGeometry();
+
+                    if (geometryFeature.contains(geometry)) {
+
+                        Geometry newGeom = null;
+                        if(geometryFeature instanceof Polygon){
+                            newGeom = geometryFeature.cloneGeometry();
+                        } else {
+                            newGeom = geometryFeature.toPolygons();
+                        }
+
+                        if(newGeom instanceof MultiPolygon){
+                            MultiPolygon newMultiPolygon = (MultiPolygon)newGeom;
+                            for (int i = 0; i < newMultiPolygon.getPrimitivesNumber(); i++) {
+                                Polygon primitive = (Polygon) newMultiPolygon.getPrimitiveAt(i);
+                                if(primitive.contains(geometry)){
+                                    addInteriorRings(primitive, geometry);
+                                }
+                            }
+                        } else {
+                            if(newGeom.contains(geometry)){
+                                addInteriorRings((Polygon)newGeom, geometry);
+                            }
+                        }
+
+                        EditingProviderServices editingProviderServices =
+                            (EditingProviderServices) getProviderServices();
+
+                        EditableFeature editableFeature = feature.getEditable();
+                        editableFeature.setDefaultGeometry(newGeom);
+                        editingProviderServices.updateFeatureInFeatureStore(
+                            editableFeature, featureStore);
+                    }
+                }
+            }
+        } catch (BaseException e) {
+            throw new FinishServiceException(
+                "Can't finalize " + this.getName(), e);
+        } finally {
+            it.dispose();
+        }
+    }
+
+    private void addInteriorRings(Polygon polygon, Geometry geometry) throws GeometryException {
+        if (geometry instanceof Polygon) {
+            polygon.addInteriorRing((Polygon) geometry);
+        } else {
+            MultiPolygon multiPolygon = geometry.toPolygons();
+            for (int i = 0; i < multiPolygon.getPrimitivesNumber(); i++) {
+                Polygon surface = (Polygon) multiPolygon.getPrimitiveAt(i);
+                polygon.addInteriorRing(surface);
+            }
+        }
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        this.values = new HashMap<EditingServiceParameter, Object>();
+        FeatureSelection selected = null;
+        if (featureStore != null) {
+            try {
+                selected = featureStore.getFeatureSelection();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            }
+            if (selected.getSelectedCount() > 0) {
+                try {
+                    setValue(selected);
+                } catch (InvalidEntryException e) {
+                    throw new InvalidEntryException(e);
+                }
+            }
+        }
+    }
+
+    public String getName() {
+        return InternalPolygonEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.internalpolygon/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.internalpolygon/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.internalpolygon/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.internalpolygon.InternalPolygonEditingLibrary
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.internalpolygon/src/main/resources/images/vectorediting-tools/modify-internal-polygon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.internalpolygon/src/main/resources/images/vectorediting-tools/modify-internal-polygon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.internalpolygon/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.internalpolygon/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.internalpolygon/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.internalpolygon</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.internalpolygon</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.internalpolygon
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/test/java/org/gvsig/vectorediting/lib/prov/circlecr/CircumferenceCRTest.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/test/java/org/gvsig/vectorediting/lib/prov/circlecr/CircumferenceCRTest.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/test/java/org/gvsig/vectorediting/lib/prov/circlecr/CircumferenceCRTest.java	(revision 1663)
@@ -0,0 +1,214 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.circlecr;
+
+import java.io.File;
+import java.net.URL;
+
+import org.gvsig.fmap.crs.CRSFactory;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase;
+import org.gvsig.vectorediting.lib.api.EditingManager;
+import org.gvsig.vectorediting.lib.api.EditingService;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.impl.DefaultEditingManager;
+
+/**
+ * Circumference provider test
+ *
+ * This test uses src/test/resources/cartography
+ *
+ * @author llmarques
+ *
+ */
+public class CircumferenceCRTest extends AbstractLibraryAutoInitTestCase {
+
+    GeometryManager geoManager;
+    DataManager dataManager;
+    EditingManager editingManager;
+    EditingService service;
+    FeatureStore featureStoreTest;
+    MapContext mapContextTest;
+
+    @Override
+    protected void doSetUp() throws Exception {
+
+        editingManager = new DefaultEditingManager();
+
+        geoManager = GeometryLocator.getGeometryManager();
+
+        try {
+            featureStoreTest = openFeatureStoretest("hidro_andalucia.shp");
+        } catch (Exception e) {
+            fail("Unexpected exception" + e.getMessage());
+        }
+
+        mapContextTest =
+            new MapContext(new ViewPort(featureStoreTest
+                .getDefaultFeatureType().getDefaultSRS()));
+
+        service =
+            editingManager.getEditingService(
+                CircumferenceCREditingProviderFactory.PROVIDER_NAME,
+                featureStoreTest, mapContextTest);
+
+        service.start();
+    }
+
+    public void testFinish() {
+        // Try to finish without values
+        try {
+            service.finish();
+        } catch (NullPointerException e) {
+            // test ok, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception ending service: " + e.getMessage());
+        }
+
+        // Try to finish with only center value
+        Point center = null;
+        try {
+            center = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+
+            service.setValue(center);
+            service.finish();
+            fail("No exception has been thrown");
+
+        } catch (NullPointerException e) {
+            // Test ok, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception ending service: " + e.getMessage());
+        }
+
+        // Restart service
+        try {
+            service.stop();
+            service.start();
+        } catch (Exception e) {
+            fail("Unexpected exception restarting service: " + e.getMessage());
+        }
+
+        // Try to finish with valid points
+        Double radius;
+        try {
+            radius = 10.0;
+
+            service.setValue(center);
+            service.setValue(radius);
+
+            Geometry geom = service.finish();
+
+            assertNotNull("geometry is null", geom);
+
+            assertEquals("geometry type != MULTICURVE", geom.getType(),
+                Geometry.TYPES.MULTICURVE);
+            MultiCurve multicurve = (MultiCurve) geom;
+
+            assertTrue(multicurve.getCurveAt(0) instanceof Arc);
+            Arc arc = (Arc) multicurve.getCurveAt(0);
+
+            assertTrue(arc.getCenterPoint().getX() == center.getX());
+            assertTrue(arc.getCenterPoint().getY() == center.getY());
+
+            Point initPoint = arc.getInitPoint();
+            assertTrue(initPoint.distance(center) == radius);
+
+            Point endPoint = arc.getEndPoint();
+            assertTrue(endPoint.distance(center) == radius);
+
+        } catch (Exception e) {
+            fail("Unexpected exception ending service. " + e.getMessage());
+        }
+
+        // Try to finish with null featureStore
+        try {
+
+            service =
+                editingManager.getEditingService(
+                    CircumferenceCREditingProviderFactory.PROVIDER_NAME, null,
+                    mapContextTest);
+
+            service.start();
+
+            center = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+            radius = 10.0;
+
+            service.setValue(center);
+            service.setValue(radius);
+
+            service.finish();
+            fail("No exception has been thrown");
+        } catch (FinishServiceException e) {
+            // Test OK, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception finishing with null feature store: "
+                + e.getMessage());
+        }
+
+    }
+
+    public void testgetName() {
+        assertEquals(CircumferenceCREditingProviderFactory.PROVIDER_NAME,
+            service.getName());
+    }
+
+    private FeatureStore openFeatureStoretest(String resourceName)
+        throws Exception {
+
+        URL shapeURL =
+            this.getClass().getResource("/cartography/" + resourceName);
+        if (shapeURL == null) {
+            throw new IllegalStateException("Can't locate cartography resource");
+        }
+        File shapeFile = new File(shapeURL.getFile());
+        if (!shapeFile.exists()) {
+            throw new IllegalStateException("cartography resource not exists");
+        }
+
+        dataManager = DALLocator.getDataManager();
+
+        DataStoreParameters params = dataManager.createStoreParameters("Shape");
+
+        params.setDynValue("shpfile", shapeFile);
+        params.setDynValue("CRS", CRSFactory.getCRS("EPSG:23030"));
+        params.setDynValue("useNullGeometry", false);
+        params.validate();
+
+        return (FeatureStore) dataManager.openStore("Shape", params);
+
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/test/java/org/gvsig/vectorediting/lib/prov/circlecr/CircleCrTest.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/test/java/org/gvsig/vectorediting/lib/prov/circlecr/CircleCrTest.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/test/java/org/gvsig/vectorediting/lib/prov/circlecr/CircleCrTest.java	(revision 1663)
@@ -0,0 +1,510 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.circlecr;
+
+import java.io.File;
+import java.net.URL;
+import java.util.List;
+
+import org.gvsig.fmap.crs.CRSFactory;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.primitive.Circle;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Surface;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingManager;
+import org.gvsig.vectorediting.lib.api.EditingService;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.VectorEditingException;
+import org.gvsig.vectorediting.lib.impl.DefaultEditingManager;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+
+/**
+ * Circle CR provider test.
+ *
+ * This test uses src/test/resources/cartography
+ *
+ * @author llmarques
+ *
+ */
+public class CircleCrTest extends AbstractLibraryAutoInitTestCase {
+
+    GeometryManager geoManager;
+    DataManager dataManager;
+    EditingManager editingManager;
+    EditingService service;
+    FeatureStore featureStoreTest;
+    MapContext mapContextTest;
+
+    @Override
+    protected void doSetUp() throws Exception {
+
+        editingManager = new DefaultEditingManager();
+
+        geoManager = GeometryLocator.getGeometryManager();
+
+        try {
+            featureStoreTest = openFeatureStoretest("provincias_andalucia.shp");
+        } catch (Exception e) {
+            fail("Unexpected exception opening test feature store: "
+                + e.getMessage());
+        }
+
+        mapContextTest =
+            new MapContext(new ViewPort(featureStoreTest
+                .getDefaultFeatureType().getDefaultSRS()));
+
+        service =
+            editingManager.getEditingService(
+                CircleCREditingProviderFactory.PROVIDER_NAME, featureStoreTest,
+                mapContextTest);
+
+        service.start();
+
+    }
+
+    public void testFinish() {
+
+        // Try to finish without values.
+        try {
+
+            service.finish();
+            fail("No exception has been thrown");
+
+        } catch (NullPointerException e) {
+            // Test OK, got expected exception
+        } catch (FinishServiceException e) {
+            fail("Unexpected exception ending service: " + e.getMessage());
+        }
+
+        // Try to finish only with center value
+        Point center = null;
+        try {
+            center = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+
+            service.setValue(center);
+
+            service.finish();
+            fail("No exception has been thrown");
+
+        } catch (NullPointerException e) {
+            // Test OK, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception ending service: " + e.getMessage());
+        }
+
+        // Restart service
+        try {
+            service.stop();
+            service.start();
+        } catch (Exception e) {
+            fail("Unexpected exception restarting service: " + e.getMessage());
+        }
+
+        // Try to finish with valid points
+        Double radius;
+        try {
+            radius = 10.0;
+
+            service.setValue(center);
+            service.setValue(radius);
+
+            Geometry geom = service.finish();
+
+            assertNotNull("geometry is null", geom);
+            assertEquals("geometry type != MULTISURFACE", geom.getType(),
+                Geometry.TYPES.MULTISURFACE);
+
+            Surface surface = ((MultiSurface) geom).getSurfaceAt(0);
+            assertTrue(surface instanceof Circle);
+            assertTrue(((Circle) surface).getCenter().getX() == 0);
+            assertTrue(((Circle) surface).getCenter().getY() == 0);
+            assertTrue(((Circle) surface).getRadious() == 10.0);
+
+        } catch (Exception e) {
+            fail("Unexpected exception ending service. " + e.getMessage());
+        }
+
+        // Try to finish with null featureStore
+        try {
+
+            service =
+                editingManager.getEditingService(
+                    CircleCREditingProviderFactory.PROVIDER_NAME, null,
+                    mapContextTest);
+
+            service.start();
+
+            center = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+            radius = 10.0;
+
+            service.setValue(center);
+            service.setValue(radius);
+
+            service.finish();
+            fail("No exception has been thrown");
+        } catch (FinishServiceException e) {
+            // Test OK, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception finishing with null feature store: "
+                + e.getMessage());
+        }
+
+    }
+
+    public void testfinishAndStore() {
+
+        // Try to finish and store without values
+        try {
+
+            service.finishAndStore();
+            fail("No exception has been thrown");
+
+        } catch (NullPointerException e) {
+            // Test OK, got expected exception
+        } catch (FinishServiceException e) {
+            fail("Unexpected exception ending and storing service: "
+                + e.getMessage());
+        }
+
+        // Try to finish and store only with center value
+        Point center = null;
+        try {
+
+            center = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+
+            service.finishAndStore();
+            fail("No exception has been thrown");
+
+        } catch (NullPointerException e) {
+            // Test OK, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception ending and storing service: "
+                + e.getMessage());
+        }
+
+        // Try to finish and store with null featureStore
+        Double radius;
+        try {
+
+            service =
+                editingManager.getEditingService(
+                    CircleCREditingProviderFactory.PROVIDER_NAME, null,
+                    mapContextTest);
+
+            service.start();
+
+            center = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+            radius = 10.0;
+
+            service.setValue(center);
+            service.setValue(radius);
+
+            service.finishAndStore();
+            fail("No exception has been thrown");
+        } catch (FinishServiceException e) {
+            // Test OK, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception ending and storing service: "
+                + e.getMessage());
+        }
+
+        // Try to finish and store with valid values
+        try {
+
+            service =
+                editingManager.getEditingService(
+                    CircleCREditingProviderFactory.PROVIDER_NAME,
+                    featureStoreTest, mapContextTest);
+
+            service.start();
+
+            center = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+            radius = 10.0;
+
+            service.setValue(center);
+            service.setValue(radius);
+
+            featureStoreTest.edit();
+            service.finishAndStore();
+            featureStoreTest.finishEditing();
+
+        } catch (Exception e) {
+            fail("Unexpected exception ending service. " + e.getMessage());
+        }
+
+    }
+
+    public void testgetDrawingStatus() {
+
+        // Try to get drawing status without values
+        Point mousePosition = null;
+        DrawingStatus dws = new DefaultDrawingStatus();
+        try {
+            mousePosition =
+                geoManager.createPoint(10, 10, Geometry.SUBTYPES.GEOM2D);
+            dws = service.getDrawingStatus(mousePosition);
+            assertNull(dws);
+        } catch (Exception e) {
+            fail("Unexpected exception get drawing status. " + e.getMessage());
+        }
+
+        // Try to get drawing status with valid center value
+        Point center;
+        try {
+            center = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(center);
+            dws = service.getDrawingStatus(mousePosition);
+
+            assertNotNull(dws);
+            assertTrue(dws.getGeometries().size() == 3);
+            assertNotNull(dws.getGeometries().get(0));
+            assertNotNull(dws.getGeometries().get(1));
+            assertNotNull(dws.getGeometries().get(2));
+
+        } catch (Exception e) {
+            fail("Unexpected exception get drawing status. " + e.getMessage());
+        }
+
+        // Try to get drawing status with valid center and radius values
+        Double raidus = 10.0;
+        try {
+            service.setValue(raidus);
+            dws = service.getDrawingStatus(mousePosition);
+
+            assertNull(dws);
+        } catch (Exception e) {
+            fail("Unexpected exception get drawing status. " + e.getMessage());
+        }
+
+    }
+
+    public void testgetName() {
+
+        assertEquals(CircleCREditingProviderFactory.PROVIDER_NAME,
+            service.getName());
+
+    }
+
+    public void testgetParameters() {
+        List<EditingServiceParameter> parameters = service.getParameters();
+
+        assertNotNull(parameters);
+        assertTrue(parameters.size() == 2);
+
+        EditingServiceParameter parameter = parameters.get(0);
+
+        assertTrue(parameter.getTypes().size() == 1);
+        assertTrue(parameter.getTypes().iterator().next() == EditingServiceParameter.TYPE.POSITION);
+
+        parameter = parameters.get(1);
+        assertTrue(parameter.getTypes().size() == 2);
+        assertTrue(parameter.getTypes().contains(
+            EditingServiceParameter.TYPE.POSITION));
+        assertTrue(parameter.getTypes().contains(
+            EditingServiceParameter.TYPE.VALUE));
+    }
+
+    public void testNext() {
+
+        // Try to set values in correct order
+        assertNotNull(service.next());
+
+        List<EditingServiceParameter> parameters = service.getParameters();
+        EditingServiceParameter centerParameter = parameters.get(0);
+        EditingServiceParameter radiusParamenter = parameters.get(1);
+
+        assertEquals(centerParameter, service.next());
+
+        Point center;
+        try {
+            center = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(center);
+        } catch (Exception e) {
+            fail("Unexpected exception getting next parameter: "
+                + e.getMessage());
+        }
+
+        assertNotNull(service.next());
+
+        assertEquals(radiusParamenter, service.next());
+
+        Double radius = 10.0;
+        try {
+            service.setValue(radius);
+        } catch (Exception e) {
+            fail("Unexpected exception getting next parameter: "
+                + e.getMessage());
+        }
+
+        assertNull(service.next());
+
+        // Try to set first radius.
+        try {
+            service.stop();
+            service.start();
+        } catch (Exception e) {
+            fail();
+        }
+
+        assertNotNull(service.next());
+        assertEquals(centerParameter, service.next());
+
+        try {
+            service.setValue(radius);
+        } catch (InvalidEntryException e) {
+            // Got expected value when radius is instance of Double. If radius
+            // is a string point, service will set that value like center.
+        }
+
+        // Check service.next() returns center
+        assertEquals(centerParameter, service.next());
+
+    }
+
+    public void testsetValue() {
+
+        // Try to set invalid center
+        Point center = null;
+        try {
+            service.setValue(center);
+        } catch (InvalidEntryException e1) {
+            // Test ok, got expected exception
+        }
+
+        // Try to set radius = 0
+        double radius = 0;
+        try {
+            service.setValue(radius);
+        } catch (InvalidEntryException e1) {
+            // Test ok, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception setting radius = 0: " + e.getMessage());
+        }
+
+        // Try to set negative radius
+        radius = -1;
+        try {
+            service.setValue(radius);
+        } catch (InvalidEntryException e1) {
+            // Test ok, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception setting negative radius: "
+                + e.getMessage());
+        }
+
+        // Try to set valid center
+        try {
+            center = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(center);
+        } catch (Exception e) {
+            fail("Unexpected exception setting valid center: " + e.getMessage());
+        }
+
+        // Check center has been set
+        assertTrue(service.next().getTypes().size() == 2);
+        assertTrue(service.next().getTypes()
+            .contains(EditingServiceParameter.TYPE.VALUE));
+        assertTrue(service.next().getTypes()
+            .contains(EditingServiceParameter.TYPE.POSITION));
+
+        // Try to set valid radius value
+        radius = 10.0;
+        try {
+            service.setValue(radius);
+        } catch (InvalidEntryException e) {
+            fail("Unexpected exception setting valid radius: " + e.getMessage());
+        }
+
+        assertNull(service.next());
+    }
+
+    public void testStart() {
+        service =
+            editingManager.getEditingService(
+                CircleCREditingProviderFactory.PROVIDER_NAME, featureStoreTest,
+                mapContextTest);
+
+        try {
+            service.start();
+        } catch (VectorEditingException e) {
+            fail("Unexpected exception starting service: " + e.getMessage());
+        }
+    }
+
+    public void testStop() {
+        service =
+            editingManager.getEditingService(
+                CircleCREditingProviderFactory.PROVIDER_NAME, featureStoreTest,
+                mapContextTest);
+
+        try {
+            service.start();
+            service.stop();
+        } catch (VectorEditingException e) {
+            fail("Unexpected exception starting or stopping service: "
+                + e.getMessage());
+        }
+    }
+
+    private FeatureStore openFeatureStoretest(String resourceName)
+        throws Exception {
+
+        URL shapeURL =
+            this.getClass().getResource("/cartography/" + resourceName);
+        if (shapeURL == null) {
+            throw new IllegalStateException("Can't locate cartography resource");
+        }
+        File shapeFile = new File(shapeURL.getFile());
+        if (!shapeFile.exists()) {
+            throw new IllegalStateException("cartography resource not exists");
+        }
+
+        dataManager = DALLocator.getDataManager();
+
+        DataStoreParameters params = dataManager.createStoreParameters("Shape");
+
+        params.setDynValue("shpfile", shapeFile);
+        params.setDynValue("CRS", CRSFactory.getCRS("EPSG:23030"));
+        params.setDynValue("useNullGeometry", false);
+        params.validate();
+
+        return (FeatureStore) dataManager.openStore("Shape", params);
+
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/test/resources/cartography/provincias_andalucia.shx
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/test/resources/cartography/provincias_andalucia.shx
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/test/resources/cartography/provincias_andalucia.shp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/test/resources/cartography/provincias_andalucia.shp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/test/resources/cartography/provincias_andalucia.dbf
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/test/resources/cartography/provincias_andalucia.dbf
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/java/org/gvsig/vectorediting/lib/prov/circlecr/CircleCREditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/java/org/gvsig/vectorediting/lib/prov/circlecr/CircleCREditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/java/org/gvsig/vectorediting/lib/prov/circlecr/CircleCREditingProvider.java	(revision 1663)
@@ -0,0 +1,230 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.circlecr;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Circle;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+public class CircleCREditingProvider extends AbstractEditingProvider implements
+EditingProvider {
+
+    protected EditingServiceParameter center;
+
+    protected EditingServiceParameter radius;
+
+    protected Map<EditingServiceParameter, Object> values;
+
+    protected FeatureStore featureStore;
+
+    public CircleCREditingProvider(ProviderServices providerServices,
+        DynObject parameters) {
+        super(providerServices);
+
+        this.featureStore =
+            (FeatureStore) parameters
+            .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.center =
+            new DefaultEditingServiceParameter("center", "center",
+                TYPE.POSITION);
+
+        this.radius =
+            new DefaultEditingServiceParameter("radius", "radius",
+                TYPE.POSITION, TYPE.VALUE);
+    }
+
+    public DefaultDrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        DefaultDrawingStatus geometries = new DefaultDrawingStatus();
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol polygonSymbolEditing = editingProviderManager.getSymbol("polygon-symbol-editing");
+        ISymbol auxiliaryLineSymbolEditing = editingProviderManager.getSymbol("auxiliary-line-symbol-editing");
+        ISymbol auxiliaryPointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+
+        if ((values != null) && (values.get(center) != null)
+            && (values.get(radius) == null)) {
+            Point centerPoint = (Point) values.get(center);
+            EditingProviderServices editingProviderServices =
+                (EditingProviderServices) getProviderServices();
+
+            try {
+                int subtype = editingProviderServices.getSubType(featureStore);
+                Curve line =
+                    editingProviderServices.createLine(centerPoint,
+                        mousePosition, subtype);
+                Circle circle = editingProviderServices.createCircle(centerPoint, mousePosition.distance(centerPoint), subtype);
+                geometries.addStatus(centerPoint, auxiliaryPointSymbolEditing, "");
+                geometries.addStatus(line, auxiliaryLineSymbolEditing, "");
+                geometries.addStatus(circle, polygonSymbolEditing, "");
+
+            } catch (Exception e) {
+                throw new DrawServiceException(e);
+            }
+
+            return geometries;
+        }
+
+        return null;
+
+    }
+
+    public EditingServiceParameter next() {
+        if (values.get(center) == null) {
+            return this.center;
+        } else if (values.get(radius) == null) {
+            return this.radius;
+        }
+        return null;
+    }
+
+    public void stop() {
+        values.clear();
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter param,
+        Object value) throws InvalidEntryException {
+        if (param == center) {
+            if (value instanceof Point) {
+                values.put(param, value);
+                return;
+            }
+        } else if (param == radius) {
+
+            if (value instanceof Point) {
+                Double radiusValue = null;
+
+                try {
+                    radiusValue =
+                        ((Point) value).distance((Point) values.get(center));
+                } catch (Exception e) {
+                    throw new InvalidEntryException(e);
+                }
+
+                if (radiusValue != null) {
+                    values.put(param, radiusValue);
+                    return;
+                }
+
+            } else if (value instanceof Double) {
+
+                if ((((Double) value) - 0.01) > 0) {
+                    values.put(param, value);
+                    return;
+                }
+
+            }
+        }
+        throw new InvalidEntryException(null);
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> list =
+            new ArrayList<EditingServiceParameter>();
+        list.add(center);
+        list.add(radius);
+        return list;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter param = next();
+        validateAndInsertValue(param, value);
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+        Geometry geometry = finish();
+        editingProviderServices.insertGeometryIntoFeatureStore(geometry,
+            featureStore);
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        Point centerPoint = (Point) values.get(center);
+        double radiusValue = (Double) values.get(radius);
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        try {
+            int subtype = editingProviderServices.getSubType(featureStore);
+            GeometryType storeGeomType =
+                editingProviderServices.getGeomType(featureStore);
+            Geometry geometry =
+                editingProviderServices.createCircle(centerPoint, radiusValue,
+                    subtype);
+
+            if (storeGeomType.isTypeOf(MULTISURFACE)) {
+                MultiSurface multisurface;
+                multisurface =
+                    GeometryLocator.getGeometryManager().createMultiSurface(
+                        storeGeomType.getSubType());
+                multisurface.addSurface((Circle) geometry);
+                return multisurface;
+            }
+
+            return geometry;
+        } catch (Exception e) {
+            throw new FinishServiceException(e);
+        }
+    }
+
+    public void start() throws StartServiceException {
+        this.values = new HashMap<EditingServiceParameter, Object>();
+    }
+
+    public String getName() {
+        return CircleCREditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/java/org/gvsig/vectorediting/lib/prov/circlecr/CircumferenceCREditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/java/org/gvsig/vectorediting/lib/prov/circlecr/CircumferenceCREditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/java/org/gvsig/vectorediting/lib/prov/circlecr/CircumferenceCREditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,82 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.circlecr;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+public class CircumferenceCREditingProviderFactory extends
+AbstractProviderFactory implements EditingProviderFactory {
+
+    public static final String PROVIDER_NAME = "insert-circumference-cr";
+
+    private final static String PROVIDER_DESCRIPTION =
+        "Creates circumferences from the center and radius";
+
+    public void initialize() {
+
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", true, null,
+                new int[] { Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new CircumferenceCREditingProvider(services, parameters);
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+        return dynclass;
+
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/java/org/gvsig/vectorediting/lib/prov/circlecr/CircleCREditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/java/org/gvsig/vectorediting/lib/prov/circlecr/CircleCREditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/java/org/gvsig/vectorediting/lib/prov/circlecr/CircleCREditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,86 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.circlecr;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+public class CircleCREditingProviderFactory extends AbstractProviderFactory
+implements EditingProviderFactory {
+
+    public static final String PROVIDER_NAME = "insert-circle-cr";
+
+    private final static String PROVIDER_DESCRIPTION =
+        "Creates circles from the center and radius";
+
+    public void initialize() {
+
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(
+                PROVIDER_NAME,
+                "",
+                true,
+                null,
+                new int[] { Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new CircleCREditingProvider(services, parameters);
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+        return dynclass;
+
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/java/org/gvsig/vectorediting/lib/prov/circlecr/CircumferenceCREditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/java/org/gvsig/vectorediting/lib/prov/circlecr/CircumferenceCREditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/java/org/gvsig/vectorediting/lib/prov/circlecr/CircumferenceCREditingProvider.java	(revision 1663)
@@ -0,0 +1,124 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.circlecr;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.primitive.Circumference;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+public class CircumferenceCREditingProvider extends CircleCREditingProvider
+implements EditingProvider {
+
+    public CircumferenceCREditingProvider(ProviderServices providerServices,
+        DynObject parameters) {
+        super(providerServices, parameters);
+    }
+
+    public DefaultDrawingStatus getDrawingStatus(Point mousePosition) throws DrawServiceException {
+        DefaultDrawingStatus geometries = new DefaultDrawingStatus();
+        EditingProviderManager editingProviderManager = EditingProviderLocator.getProviderManager();
+        GeometryManager geomManager = GeometryLocator.getGeometryManager();
+        ISymbol lineSymbolEditing = editingProviderManager.getSymbol("line-symbol-editing");
+        ISymbol auxiliaryLineSymbolEditing = editingProviderManager.getSymbol("auxiliary-line-symbol-editing");
+        ISymbol auxiliaryPointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+
+        if ((values != null) && (values.get(center) != null)
+            && (values.get(radius) == null)) {
+            Point centerPoint = (Point) values.get(center);
+            EditingProviderServices editingProviderServices =
+                (EditingProviderServices) getProviderServices();
+
+            try {
+                int subtype = editingProviderServices.getSubType(featureStore);
+                Curve line =  editingProviderServices.createLine(centerPoint, mousePosition, subtype);
+                Circumference circumference = (Circumference) geomManager.create(CIRCUMFERENCE, subtype);
+                circumference.setPoints(centerPoint, mousePosition.distance(centerPoint));
+
+                geometries.addStatus(centerPoint, auxiliaryPointSymbolEditing, "");
+                geometries.addStatus(line, auxiliaryLineSymbolEditing, "");
+                geometries.addStatus(circumference, lineSymbolEditing, "");
+
+            } catch (Exception e) {
+                throw new DrawServiceException(e);
+            }
+
+            return geometries;
+        }
+
+        return null;
+
+    }
+
+
+    @Override
+    public Geometry finish() throws FinishServiceException {
+        GeometryManager geomManager = GeometryLocator.getGeometryManager();
+        Point centerPoint = (Point) values.get(center);
+        double radiusValue = (Double) values.get(radius);
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+        try {
+            int subtype = editingProviderServices.getSubType(featureStore);
+            GeometryType storeGeomType =
+                editingProviderServices.getGeomType(featureStore);
+            Circumference circumference = (Circumference) geomManager.create(CIRCUMFERENCE, subtype);
+            circumference.setPoints(centerPoint, radiusValue);
+
+            if (storeGeomType.isTypeOf(MULTICURVE)) {
+                MultiCurve multicurve;
+                multicurve =
+                    GeometryLocator.getGeometryManager().createMultiCurve(
+                        storeGeomType.getSubType());
+                multicurve.addCurve((Circumference) circumference);
+                return multicurve;
+            }
+
+            return circumference;
+        } catch (Exception e) {
+            throw new FinishServiceException(e);
+        }
+    }
+
+    @Override
+    public String getName() {
+        return CircumferenceCREditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/java/org/gvsig/vectorediting/lib/prov/circlecr/CircleCREditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/java/org/gvsig/vectorediting/lib/prov/circlecr/CircleCREditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/java/org/gvsig/vectorediting/lib/prov/circlecr/CircleCREditingLibrary.java	(revision 1663)
@@ -0,0 +1,68 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.circlecr;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+public class CircleCREditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new CircleCREditingProviderFactory());
+        manager.addProviderFactory(new CircumferenceCREditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "insert-circle-cr", this
+            .getClass().getClassLoader(), this.getClass().getName());
+        manager.registerIcon("vectorediting-tools", "insert-circumference-cr",
+            this.getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "circle-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.circlecr.CircleCREditingLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/resources/images/vectorediting-tools/insert-circle-cr.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/resources/images/vectorediting-tools/insert-circle-cr.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/resources/images/vectorediting-tools/insert-circumference-cr.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/src/main/resources/images/vectorediting-tools/insert-circumference-cr.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.circlecr</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.circlecr</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circlecr
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.scale/src/main/java/org/gvsig/vectorediting/lib/prov/scale/ScaleEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.scale/src/main/java/org/gvsig/vectorediting/lib/prov/scale/ScaleEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.scale/src/main/java/org/gvsig/vectorediting/lib/prov/scale/ScaleEditingProvider.java	(revision 1663)
@@ -0,0 +1,508 @@
+package org.gvsig.vectorediting.lib.prov.scale;
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+
+
+import java.awt.Font;
+import java.awt.geom.AffineTransform;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.Aggregate;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.aggregate.MultiPoint;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Surface;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.symbology.SymbologyLocator;
+import org.gvsig.symbology.SymbologyManager;
+import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.ISimpleTextSymbol;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.tools.visitor.VisitCanceledException;
+import org.gvsig.tools.visitor.Visitor;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+public class ScaleEditingProvider extends AbstractEditingProvider implements
+    EditingProvider {
+
+    private I18nManager i18nManager = ToolsLocator.getI18nManager();
+
+    private EditingServiceParameter selectionParameter;
+
+    private EditingServiceParameter originPointParameter;
+
+    private EditingServiceParameter scaleFactorOrReferencePointParameter;
+
+    private EditingServiceParameter secondScalePointParameter;
+
+    private Map<EditingServiceParameter, Object> values;
+
+    private FeatureStore featureStore;
+
+    private MapContext mapContext;
+
+    public ScaleEditingProvider(ProviderServices providerServices,
+        DynObject parameters) {
+        super(providerServices);
+        this.mapContext =
+            (MapContext) parameters
+                .getDynValue(EditingProviderFactory.MAPCONTEXT_FIELD);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.selectionParameter =
+            new DefaultEditingServiceParameter("selection",
+                i18nManager.getTranslation("selection"), TYPE.SELECTION);
+
+        this.originPointParameter =
+            new DefaultEditingServiceParameter("origin_point",
+                i18nManager.getTranslation("origin_point"), TYPE.VALUE, TYPE.POSITION);
+
+        this.scaleFactorOrReferencePointParameter =
+            new DefaultEditingServiceParameter("scale_factor_or_reference_point",
+                i18nManager.getTranslation("scale_factor_or_reference_point"), TYPE.VALUE, TYPE.POSITION);
+
+        this.secondScalePointParameter =
+            new DefaultEditingServiceParameter("second_scale_point",
+                i18nManager.getTranslation("second_scale_point"), TYPE.POSITION);
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> list =
+            new ArrayList<EditingServiceParameter>();
+        list.add(selectionParameter);
+        list.add(originPointParameter);
+        list.add(secondScalePointParameter);
+        return list;
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter param,
+        Object value) throws InvalidEntryException {
+        if (param == selectionParameter) {
+            if (value instanceof FeatureSelection) {
+                values.put(param, value);
+                return;
+            }
+        } else if (param == originPointParameter) {
+            if (value instanceof Point) {
+                values.put(param, value);
+                return;
+            }
+        } else if (param == scaleFactorOrReferencePointParameter) {
+            if (value instanceof Point) {
+                if (((Point) value).getX() == ((Point)values.get(originPointParameter)).getX()){
+                    throw new InvalidEntryException(null);
+                }
+                values.put(param, value);
+                return;
+            } else if (value instanceof Double) {
+                if ((Double)value == 0.0){
+                    throw new InvalidEntryException(null);
+                }
+                values.put(param, value);
+                return;
+            }
+        } else if (param == secondScalePointParameter) {
+            if (value instanceof Point) {
+                values.put(param, value);
+                return;
+            }
+        }
+    }
+
+    public EditingServiceParameter next() {
+        if (values.get(selectionParameter) == null) {
+            return this.selectionParameter;
+        } else if (values.get(originPointParameter) == null) {
+            return this.originPointParameter;
+        } else if (values.get(scaleFactorOrReferencePointParameter) == null) {
+            return this.scaleFactorOrReferencePointParameter;
+        } else {
+            if (values.get(scaleFactorOrReferencePointParameter) instanceof Point ) {
+                if (values.get(secondScalePointParameter) == null) {
+                    return this.secondScalePointParameter;
+                }
+            }
+        }
+        return null;
+    }
+
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol ruleMarkerSymbol = editingProviderManager.getSymbol("rule-marker-symbol");
+        ViewPort vp = this.mapContext.getViewPort();
+
+
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        FeatureSelection selected =
+            (FeatureSelection) values.get(this.selectionParameter);
+        try {
+            int subType =
+                editingProviderServices
+                .getSubType(featureStore);
+            if ((selected != null) && !selected.isEmpty()) {
+                Point origin = (Point) values.get(this.originPointParameter);
+                if (origin != null) {
+                    Object scaleFactorOrReferencePointValue =
+                        values.get(this.scaleFactorOrReferencePointParameter);
+                    Double scale = 1.0;
+
+                    if (scaleFactorOrReferencePointValue != null) {
+                        if (scaleFactorOrReferencePointValue instanceof Double) {
+                            scale = (Double) scaleFactorOrReferencePointValue;
+                        } else if (scaleFactorOrReferencePointValue instanceof Point) {
+                            double unity = ((Point) scaleFactorOrReferencePointValue).getX()-origin.getX();
+                            // Unidad de referencia
+                            createRule(drawingStatus, origin, unity, unity, subType); //+(Math.signum(unity)*0.01), subType);
+
+                            Object secondScalePointParameter =
+                                values.get(this.secondScalePointParameter);
+                            if (secondScalePointParameter != null
+                                && secondScalePointParameter instanceof Point) {
+                                double rawScale = ((Point) secondScalePointParameter).getX()-origin.getX();
+                                scale = rawScale / unity;
+                                createRule(drawingStatus, origin, unity, rawScale, subType);
+
+                                Point marker = null;
+                                marker = geometryManager.createPoint(origin.getX()+rawScale,origin.getY(), subType);
+                                drawingStatus.addStatus(marker, ruleMarkerSymbol, "");
+                                ISimpleTextSymbol textSymbol = getTextSymbol();
+                                Point textPoint = geometryManager.createPoint(marker.getX()-vp.toMapDistance(10), marker.getY()-vp.toMapDistance(20), subType);
+                                drawingStatus.addStatus(textPoint, textSymbol, String.valueOf(Math.round(scale*100.0)/100.0));
+
+                            } else {
+                                double rawScale = mousePosition.getX()-origin.getX();
+                                scale = rawScale / unity;
+                                createRule(drawingStatus, origin, unity, rawScale, subType);
+
+                                Point marker = null;
+                                marker = geometryManager.createPoint(origin.getX()+rawScale,origin.getY(), subType);
+                                drawingStatus.addStatus(marker, ruleMarkerSymbol, "");
+                                ISimpleTextSymbol textSymbol = getTextSymbol();
+                                Point textPoint = geometryManager.createPoint(marker.getX()-vp.toMapDistance(10), marker.getY()-vp.toMapDistance(20), subType);
+                                drawingStatus.addStatus(textPoint, textSymbol, String.valueOf(Math.round(scale*100.0)/100.0));
+
+                                AffineTransform at;
+                                try {
+                                    at = getScaleAffineTransform(origin, scale);
+                                } catch (Exception e) {
+                                    throw new DrawServiceException(e);
+                                }
+                                applyTransformToDrawingStatus(drawingStatus, selected, at);
+                            }
+                        }
+                    } else {
+                        double unity = mousePosition.getX()-origin.getX();
+                        createRule(drawingStatus, origin, unity, unity, subType); //+(Math.signum(unity)*0.01), subType);
+
+                    }
+
+                }
+                return drawingStatus;
+            }
+        } catch (Exception e) {
+            throw new DrawServiceException(e);
+        }
+        return null;
+    }
+
+    private Line createHorizontalLineFromAPointWithLenght(Point origin,
+        double length, int subType) throws CreateGeometryException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+
+        Line line = geometryManager.createLine(subType);
+        line.addVertex(origin);
+        Point p3 =
+            geometryManager.createPoint(origin.getX() + length,
+                origin.getY(), subType);
+        line.addVertex(p3);
+        return line;
+    }
+
+    private ISimpleTextSymbol getTextSymbol(){
+        SymbologyManager symbologyManager = SymbologyLocator.getSymbologyManager();
+        ISimpleTextSymbol textSymbol = symbologyManager.createSimpleTextSymbol();
+        textSymbol.setFontSize(10);
+        return textSymbol;
+    }
+
+    private void createRule(DefaultDrawingStatus drawingStatus, Point point, double unity, double length, int subType) throws CreateGeometryException {
+        if(unity==0.0 || length==0.0){
+            return;
+        }
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol ruleUnitySymbol = editingProviderManager.getSymbol("rule-unity-symbol");
+        ISymbol ruleDecimalSymbol = editingProviderManager.getSymbol("rule-decimal-symbol");
+        ISymbol ruleAxisSymbol = editingProviderManager.getSymbol("rule-axis-symbol");
+
+        ViewPort vp = this.mapContext.getViewPort();
+
+        Line line =
+            createHorizontalLineFromAPointWithLenght(point, length, subType);
+        drawingStatus.addStatus(line, ruleAxisSymbol, "");
+
+        double pos = 0.0;
+        int i = 0;
+        // Se le a�ade 0.01 del length a la condici�n de parada del bucle para evitar
+        // que por problemas de precisi�n de los n�meros en punto flotante
+        // no se termine de dibujar la regla
+        while (Math.abs(pos)<=Math.abs(length)*1.01) {
+            Point mark = null;
+            mark = geometryManager.createPoint(point.getX()+pos,point.getY(), subType);
+            if (i%10==0){
+                drawingStatus.addStatus(mark, ruleUnitySymbol, "");
+                ISimpleTextSymbol textSymbol = getTextSymbol();
+                Point textPoint = geometryManager.createPoint(mark.getX()-vp.toMapDistance(3), mark.getY()-vp.toMapDistance(10), subType);
+                drawingStatus.addStatus(textPoint, textSymbol, String.valueOf(((int)Math.signum(length*unity))*i/10));
+
+            } else {
+                drawingStatus.addStatus(mark, ruleDecimalSymbol, "");
+            }
+            pos += Math.signum(length)*Math.signum(unity)*unity/10;
+            i++;
+        }
+    }
+
+
+
+    private void applyTransformToDrawingStatus(
+        final DefaultDrawingStatus drawingStatus, FeatureSelection selected,
+        final AffineTransform at) throws BaseException {
+
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+
+        final ISymbol lineSymbolEditing = editingProviderManager.getSymbol("line-symbol-editing");
+        final ISymbol polygonSymbolEditing = editingProviderManager.getSymbol("polygon-symbol-editing");
+        final ISymbol auxiliaryPointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+
+        selected.accept(new Visitor() {
+
+            public void visit(Object obj) throws VisitCanceledException,
+                BaseException {
+                Feature feature = (Feature) obj;
+
+                Geometry transformedGeometry = feature.getDefaultGeometry().cloneGeometry();
+                transformedGeometry.transform(at);
+
+                ISymbol symbol=null;
+                if(transformedGeometry instanceof Curve || transformedGeometry instanceof MultiCurve){
+                    symbol = lineSymbolEditing;
+                } else if(transformedGeometry instanceof Surface || transformedGeometry instanceof MultiSurface){
+                    symbol = polygonSymbolEditing;
+                } else if(transformedGeometry instanceof Point || transformedGeometry instanceof MultiPoint){
+                    symbol = auxiliaryPointSymbolEditing;
+                }
+                if(transformedGeometry instanceof Aggregate){
+                    int primitivesNumber = ((Aggregate)transformedGeometry).getPrimitivesNumber();
+                    for (int i = 0; i < primitivesNumber; i++) {
+                        drawingStatus.addStatus(((Aggregate)transformedGeometry).getPrimitiveAt(i), symbol, "");
+                    }
+                } else {
+                    drawingStatus.addStatus(transformedGeometry, symbol, "");
+                }
+
+
+            }
+        });
+    }
+
+    private AffineTransform getScaleAffineTransform(Point axisP1, Double scale)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+
+        AffineTransform translate =
+            AffineTransform
+                .getTranslateInstance(-axisP1.getX(), -axisP1.getY());
+
+        AffineTransform scaleTransform = AffineTransform.getScaleInstance(scale,scale);
+
+        AffineTransform inverseTranslate =
+            AffineTransform.getTranslateInstance(axisP1.getX(), axisP1.getY());
+        AffineTransform at = new AffineTransform(translate);
+
+        at.preConcatenate(scaleTransform);
+        at.preConcatenate(inverseTranslate);
+        return at;
+    }
+
+
+    public void stop() {
+        values.clear();
+    }
+
+
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter param = next();
+        validateAndInsertValue(param, value);
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+
+        FeatureSelection selected =
+            (FeatureSelection) values.get(selectionParameter);
+        try {
+            if (!selected.isEmpty()) {
+                Point origin = (Point) values.get(this.originPointParameter);
+                Double scale = null;
+                if (origin != null) {
+                    Object scaleFactorOrReferencePointValue =
+                        values.get(this.scaleFactorOrReferencePointParameter);
+
+                    if (scaleFactorOrReferencePointValue != null) {
+                        if (scaleFactorOrReferencePointValue instanceof Double) {
+                            scale = (Double) scaleFactorOrReferencePointValue;
+                        } else if (scaleFactorOrReferencePointValue instanceof Point) {
+                            Object secondScalePointParameter =
+                                values.get(this.secondScalePointParameter);
+                            if (secondScalePointParameter != null
+                                && secondScalePointParameter instanceof Point) {
+                                double unity = ((Point) scaleFactorOrReferencePointValue).getX()-origin.getX();
+                                double rawScale = ((Point) secondScalePointParameter).getX()-origin.getX();
+                                scale = rawScale / unity;
+                            }
+                        }
+                    }
+                }
+
+                if ((origin != null) && (scale != null)) {
+
+                    final AffineTransform at;
+                    try {
+                        at = getScaleAffineTransform(origin, scale);
+                    } catch (GeometryOperationNotSupportedException e) {
+                        throw new FinishServiceException(e);
+                    } catch (GeometryOperationException e) {
+                        throw new FinishServiceException(e);
+                    }
+
+                    try {
+                        selected.accept(new Visitor() {
+
+                            public void visit(Object obj)
+                                throws VisitCanceledException, BaseException {
+                                Feature feature = (Feature) obj;
+                                Geometry geom =
+                                    feature.getDefaultGeometry()
+                                        .cloneGeometry();
+                                geom.transform(at);
+                                // Se sustituye la geometr�a original por la
+                                // calculada
+                                EditableFeature editableFeature =
+                                    feature.getEditable();
+                                editableFeature.setDefaultGeometry(geom);
+                                ((EditingProviderServices) getProviderServices())
+                                    .updateFeatureInFeatureStore(
+                                        editableFeature, featureStore);
+                            }
+                        });
+                    } catch (BaseException e) {
+                        throw new FinishServiceException(e);
+                    }
+                    featureStore.getFeatureSelection().deselectAll();
+                }
+            }
+        } catch (DataException e) {
+            throw new FinishServiceException(e);
+        }
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void start() throws StartServiceException {
+        this.values = new HashMap<EditingServiceParameter, Object>();
+        FeatureSelection selected = null;
+        if (featureStore != null) {
+            try {
+                selected =
+                    (FeatureSelection) featureStore.getFeatureSelection()
+                        .clone();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            } catch (CloneNotSupportedException e) {
+                // Do nothing
+            }
+            if ((selected != null) && (selected.getSelectedCount() > 0)) {
+                values.put(selectionParameter, selected);
+            }
+        }
+    }
+
+    public String getName() {
+        return ScaleEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/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
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/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	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/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	(revision 1663)
@@ -0,0 +1,87 @@
+package org.gvsig.vectorediting.lib.prov.scale;
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+public class ScaleEditingProviderFactory extends AbstractProviderFactory
+implements EditingProviderFactory {
+
+    public static final String PROVIDER_NAME = "modify-scale";
+
+    private final static String PROVIDER_DESCRIPTION =
+        "Scale selected geometries";
+
+    public void initialize() {
+
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", false, null,
+                new int[] { Geometry.TYPES.POINT, Geometry.TYPES.MULTIPOINT,
+                Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE,
+                Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, 
+                Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new ScaleEditingProvider(services, parameters);
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject dynobject = super.createParameters();
+        dynobject.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return dynobject;
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.scale/src/main/java/org/gvsig/vectorediting/lib/prov/scale/ScaleEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.scale/src/main/java/org/gvsig/vectorediting/lib/prov/scale/ScaleEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.scale/src/main/java/org/gvsig/vectorediting/lib/prov/scale/ScaleEditingLibrary.java	(revision 1663)
@@ -0,0 +1,71 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.scale;
+
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * Library for default implementation initialization and configuration.
+ *
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class ScaleEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new ScaleEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "modify-scale", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n.text",
+            this.getClass().getClassLoader(), "scale-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.scale/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.scale/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.scale/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.scale.ScaleEditingLibrary
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.scale/src/main/resources/images/vectorediting-tools/modify-scale.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.scale/src/main/resources/images/vectorediting-tools/modify-scale.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.scale/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.scale/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.scale/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.scale</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.scale</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.scale
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.ellipse.EllipseEditingLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/resources/images/vectorediting-tools/insert-filled-ellipse.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/resources/images/vectorediting-tools/insert-filled-ellipse.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/resources/images/vectorediting-tools/insert-ellipse.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/resources/images/vectorediting-tools/insert-ellipse.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/java/org/gvsig/vectorediting/lib/prov/ellipse/EllipseEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/java/org/gvsig/vectorediting/lib/prov/ellipse/EllipseEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/java/org/gvsig/vectorediting/lib/prov/ellipse/EllipseEditingProvider.java	(revision 1663)
@@ -0,0 +1,119 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.ellipse;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.primitive.PeriEllipse;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+public class EllipseEditingProvider extends FilledEllipseEditingProvider implements
+EditingProvider {
+
+    public EllipseEditingProvider(ProviderServices services,
+        DynObject parameters) {
+        super(services, parameters);
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        if (values != null) {
+
+            EditingProviderServices editingProviderService =
+                (EditingProviderServices) getProviderServices();
+
+            Point firstPointAxis1Value = (Point) values.get(firstPointAxisA);
+            Point secondPointAxis1Value = (Point) values.get(secondPointAxisA);
+            double lengthAxis2Value = (Double) values.get(lengthAxisB);
+
+            if ((firstPointAxis1Value != null)
+                && (secondPointAxis1Value != null) && (lengthAxis2Value > 0)) {
+
+                try {
+                    GeometryType storeGeomType = editingProviderService.getGeomType(featureStore);
+                    int subtype = storeGeomType.getSubType();
+
+                    PeriEllipse periEllipse = (PeriEllipse) GeometryLocator.getGeometryManager().create(Geometry.TYPES.PERIELLIPSE, subtype);
+                    periEllipse.setPoints(firstPointAxis1Value, secondPointAxis1Value, lengthAxis2Value / 2);
+
+                    if (storeGeomType.isTypeOf(MULTICURVE)) {
+                        MultiCurve multicurve;
+                        multicurve =
+                            GeometryLocator.getGeometryManager().createMultiCurve(
+                                storeGeomType.getSubType());
+                        multicurve.addCurve((PeriEllipse) periEllipse);
+                        return multicurve;
+                    }
+
+                    return periEllipse;
+                } catch (Exception e) {
+                    throw new FinishServiceException(e);
+                }
+            }
+        }
+        return null;
+    }
+
+    public String getName() {
+        return EllipseEditingProviderFactory.PROVIDER_NAME;
+    }
+
+    protected void addEllipseToStatus(DefaultDrawingStatus drawingStatus, Geometry ellipse) {
+        EditingProviderManager editingProviderManager = EditingProviderLocator.getProviderManager();
+        ISymbol lineSymbolEditing = editingProviderManager.getSymbol("line-symbol-editing");
+        drawingStatus.addStatus(ellipse, lineSymbolEditing, "");
+    }
+
+    /**
+     * @param drawingStatus
+     * @param firstPointAxis1Value
+     * @param secondPointAxis1Value
+     * @param subtype
+     * @param distance
+     * @throws CreateGeometryException
+     */
+    protected void addTemporaryGeometryToDrawingStatus(DefaultDrawingStatus drawingStatus, Point firstPointAxis1Value,
+        Point secondPointAxis1Value, int subtype, double distance) throws CreateGeometryException {
+        PeriEllipse periEllipse = (PeriEllipse) GeometryLocator.getGeometryManager().create(Geometry.TYPES.PERIELLIPSE, subtype);
+        periEllipse.setPoints(firstPointAxis1Value, secondPointAxis1Value, distance);
+
+        EditingProviderManager editingProviderManager = EditingProviderLocator.getProviderManager();
+        ISymbol lineSymbolEditing = editingProviderManager.getSymbol("line-symbol-editing");
+        drawingStatus.addStatus(periEllipse, lineSymbolEditing, "");
+    }
+
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/java/org/gvsig/vectorediting/lib/prov/ellipse/FilledEllipseEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/java/org/gvsig/vectorediting/lib/prov/ellipse/FilledEllipseEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/java/org/gvsig/vectorediting/lib/prov/ellipse/FilledEllipseEditingProvider.java	(revision 1663)
@@ -0,0 +1,371 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.ellipse;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Ellipse;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+public class FilledEllipseEditingProvider extends AbstractEditingProvider implements
+EditingProvider {
+
+    protected EditingServiceParameter firstPointAxisA;
+
+    protected EditingServiceParameter secondPointAxisA;
+
+    protected EditingServiceParameter lengthAxisB;
+
+    protected Map<EditingServiceParameter, Object> values;
+
+    protected FeatureStore featureStore;
+
+    public FilledEllipseEditingProvider(ProviderServices providerServices,
+        DynObject parameters) {
+        super(providerServices);
+
+        this.featureStore =
+            (FeatureStore) parameters
+            .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.firstPointAxisA =
+            new DefaultEditingServiceParameter("first_point_A_axis",
+                "first_point_A_axis", EditingServiceParameter.TYPE.POSITION);
+
+        this.secondPointAxisA =
+            new DefaultEditingServiceParameter("second_point_A_axis",
+                "second_point_A_axis", EditingServiceParameter.TYPE.POSITION);
+
+        this.lengthAxisB =
+            new DefaultEditingServiceParameter("length_of_B_axis",
+                "length_of_B_axis", EditingServiceParameter.TYPE.POSITION,
+                EditingServiceParameter.TYPE.VALUE);
+    }
+
+    public EditingServiceParameter next() {
+        if (values.get(firstPointAxisA) == null) {
+            return firstPointAxisA;
+        } else if (values.get(secondPointAxisA) == null) {
+            return secondPointAxisA;
+        } else if (values.get(lengthAxisB) == null) {
+            return lengthAxisB;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol auxiliaryLineSymbolEditing = editingProviderManager.getSymbol("auxiliary-line-symbol-editing");
+        ISymbol auxiliaryPointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+
+
+        if (values != null) {
+            EditingProviderServices editingServiceProvider =
+                (EditingProviderServices) getProviderServices();
+
+            Point firstPointAxis1Value = (Point) values.get(firstPointAxisA);
+            Point secondPointAxis1Value = (Point) values.get(secondPointAxisA);
+
+            if (firstPointAxis1Value != null) {
+                drawingStatus.addStatus(firstPointAxis1Value, auxiliaryPointSymbolEditing, "");
+
+
+                if (secondPointAxis1Value == null) {
+
+                    try {
+                        int subtype =
+                            editingServiceProvider.getSubType(featureStore);
+                        Curve line =
+                            editingServiceProvider.createLine(
+                                firstPointAxis1Value, mousePosition, subtype);
+                        drawingStatus.addStatus(mousePosition, auxiliaryPointSymbolEditing, "");
+                        drawingStatus.addStatus(line, auxiliaryLineSymbolEditing, "");
+                        return drawingStatus;
+                    } catch (Exception e) {
+                        throw new DrawServiceException(e);
+                    }
+
+                } else {
+
+                    try {
+                        int subtype =
+                            editingServiceProvider.getSubType(featureStore);
+                        Point center =
+                            editingServiceProvider.getMidPoint(
+                                firstPointAxis1Value, secondPointAxis1Value,
+                                subtype);
+                        double distance = center.distance(mousePosition);
+                        drawingStatus.addStatus(secondPointAxis1Value, auxiliaryPointSymbolEditing, "");
+                        drawingStatus.addStatus(center, auxiliaryPointSymbolEditing, "");
+
+                        Curve aAxis =
+                            editingServiceProvider.createLine(
+                                firstPointAxis1Value, secondPointAxis1Value,
+                                subtype);
+                        drawingStatus.addStatus(aAxis, auxiliaryLineSymbolEditing, "");
+
+                        addTemporaryGeometryToDrawingStatus(drawingStatus, firstPointAxis1Value, secondPointAxis1Value,
+                            subtype, distance);
+
+                        Double[] lineParams =
+                            editingServiceProvider.getLineParams(
+                                firstPointAxis1Value, secondPointAxis1Value);
+                        Point[] bisector =
+                            editingServiceProvider.getPerpendicular(
+                                lineParams[0], lineParams[1], center, subtype);
+                        Double[] bisectorParams =
+                            editingServiceProvider.getLineParams(bisector[0],
+                                bisector[1]);
+
+                        double m = bisectorParams[0]; // Line slope
+                        double y0 = bisectorParams[1]; // Y-Intercept line
+                        double mp2 = Math.pow(m, 2); // slope�
+
+                        Curve line;
+                        if (!Double.isInfinite(m)) {
+                            double a = 1 + mp2;
+                            double b = (-2 - (2 * mp2)) * center.getX();
+                            double c =
+                                ((1 + mp2) * Math.pow(center.getX(), 2))
+                                - Math.pow(distance, 2);
+
+                            double x1 =
+                                (-b + Math.sqrt((Math.pow(b, 2) - (4 * a * c))))
+                                / (2 * a);
+                            double y1 = (m * x1) + y0;
+
+                            double x2 =
+                                (-b - Math.sqrt((Math.pow(b, 2) - (4 * a * c))))
+                                / (2 * a);
+                            double y2 = (m * x2) + y0;
+
+                            line =
+                                editingServiceProvider.createLine(x1, y1, x2,
+                                    y2, subtype);
+                            drawingStatus.addStatus(line, auxiliaryLineSymbolEditing, "");
+
+
+                        } else {
+                            double x1 = center.getX();
+                            double y1 = center.getY() + distance;
+                            double y2 = center.getY() - distance;
+
+                            line =
+                                editingServiceProvider.createLine(x1, y1, x1,
+                                    y2, subtype);
+                            drawingStatus.addStatus(line, auxiliaryLineSymbolEditing, "");
+                        }
+
+                        drawingStatus.addStatus(aAxis, auxiliaryLineSymbolEditing, "");
+
+                    } catch (Exception e) {
+                        throw new DrawServiceException(e);
+                    }
+                }
+            }
+        }
+        return drawingStatus;
+    }
+
+    /**
+     * @param drawingStatus
+     * @param firstPointAxis1Value
+     * @param secondPointAxis1Value
+     * @param subtype
+     * @param distance
+     * @throws CreateGeometryException
+     */
+    protected void addTemporaryGeometryToDrawingStatus(DefaultDrawingStatus drawingStatus, Point firstPointAxis1Value,
+        Point secondPointAxis1Value, int subtype, double distance) throws CreateGeometryException {
+        Ellipse ellipse = (Ellipse) GeometryLocator.getGeometryManager().create(Geometry.TYPES.ELLIPSE, subtype);
+        ellipse.setPoints(firstPointAxis1Value, secondPointAxis1Value, distance);
+
+        EditingProviderManager editingProviderManager = EditingProviderLocator.getProviderManager();
+        ISymbol polygonSymbolEditing = editingProviderManager.getSymbol("polygon-symbol-editing");
+        drawingStatus.addStatus(ellipse, polygonSymbolEditing, "");
+    }
+
+    public void stop() throws StopServiceException {
+        if (values != null) {
+            values.clear();
+        }
+
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> list =
+            new ArrayList<EditingServiceParameter>();
+        list.add(firstPointAxisA);
+        list.add(secondPointAxisA);
+        list.add(lengthAxisB);
+        return list;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = this.next();
+        validateAndInsertValue(parameter, value);
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter param,
+        Object value) throws InvalidEntryException {
+
+        if ((param == firstPointAxisA) || (param == secondPointAxisA)) {
+            if (value instanceof Point) {
+                values.put(param, value);
+                return;
+            }
+
+        } else if (param == lengthAxisB) {
+            if (value instanceof Point) {
+                Double length = null;
+
+                try {
+                    EditingProviderServices editingProviderServices =
+                        (EditingProviderServices) getProviderServices();
+
+                    Point firstPointAxis1Value =
+                        (Point) values.get(firstPointAxisA);
+                    Point firstPointAxis2Value =
+                        (Point) values.get(secondPointAxisA);
+                    int subtype =
+                        editingProviderServices.getSubType(featureStore);
+                    Point center =
+                        editingProviderServices
+                        .getMidPoint(firstPointAxis1Value,
+                            firstPointAxis2Value, subtype);
+                    length = ((Point) value).distance(center) * 2;
+
+                } catch (Exception e) {
+                    throw new InvalidEntryException(e);
+                }
+
+                if (length != null) {
+                    values.put(param, length);
+                    return;
+                }
+
+            } else if (value instanceof Double) {
+
+                if ((((Double) value) - 0.01) > 0) {
+                    values.put(param, value);
+                    return;
+                }
+            }
+        }
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        if (values != null) {
+
+            EditingProviderServices editingProviderServices =
+                (EditingProviderServices) getProviderServices();
+
+            Point firstPointAxis1Value = (Point) values.get(firstPointAxisA);
+            Point secondPointAxis1Value = (Point) values.get(secondPointAxisA);
+            double lengthAxis2Value = (Double) values.get(lengthAxisB);
+
+            if ((firstPointAxis1Value != null)
+                && (secondPointAxis1Value != null) && (lengthAxis2Value > 0)) {
+
+
+                try {
+                    int subtype = editingProviderServices.getSubType(featureStore);
+                    GeometryType storeGeomType = editingProviderServices.getGeomType(featureStore);
+
+                    Ellipse ellipse =
+                        (Ellipse) GeometryLocator.getGeometryManager().create(Geometry.TYPES.ELLIPSE, subtype);
+                    ellipse.setPoints(firstPointAxis1Value, secondPointAxis1Value, lengthAxis2Value / 2);
+
+//                    if (storeGeomType.isTypeOf(MULTISURFACE)) {
+//                        return ellipse.toPolygons();
+//                    }
+
+                    if (storeGeomType.isTypeOf(MULTISURFACE)) {
+                        MultiSurface multisurface;
+                        multisurface =
+                            GeometryLocator.getGeometryManager().createMultiSurface(
+                                storeGeomType.getSubType());
+                        multisurface.addSurface((Ellipse) ellipse);
+                        return multisurface;
+                    }
+
+                    return ellipse;
+                } catch (Exception e) {
+                    throw new FinishServiceException(e);
+                }
+            }
+        }
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+        Geometry geometry = finish();
+        editingProviderServices.insertGeometryIntoFeatureStore(geometry,
+            featureStore);
+    }
+
+    public void start() throws StartServiceException {
+        values = new HashMap<EditingServiceParameter, Object>();
+    }
+
+    public String getName() {
+        return FilledEllipseEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/java/org/gvsig/vectorediting/lib/prov/ellipse/EllipseEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/java/org/gvsig/vectorediting/lib/prov/ellipse/EllipseEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/java/org/gvsig/vectorediting/lib/prov/ellipse/EllipseEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,85 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.ellipse;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+public class EllipseEditingProviderFactory extends AbstractProviderFactory
+implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "insert-ellipse";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Inserts ellipses on the view";
+
+    @Override
+    public Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new EllipseEditingProvider(services, parameters);
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", true, null,
+                new int[] {
+                    Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                    Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE 
+                });
+
+        return serviceInfo;
+    }
+
+    public void initialize() {
+
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/java/org/gvsig/vectorediting/lib/prov/ellipse/FilledEllipseEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/java/org/gvsig/vectorediting/lib/prov/ellipse/FilledEllipseEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/java/org/gvsig/vectorediting/lib/prov/ellipse/FilledEllipseEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,86 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.ellipse;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+public class FilledEllipseEditingProviderFactory extends AbstractProviderFactory
+implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "insert-filled-ellipse";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Inserts filled ellipses on the view";
+
+    @Override
+    public Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new FilledEllipseEditingProvider(services, parameters);
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", true, null,
+                new int[] { 
+                    Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, 
+                    Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE 
+                });
+
+        return serviceInfo;
+    }
+
+    public void initialize() {
+
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/java/org/gvsig/vectorediting/lib/prov/ellipse/EllipseEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/java/org/gvsig/vectorediting/lib/prov/ellipse/EllipseEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/src/main/java/org/gvsig/vectorediting/lib/prov/ellipse/EllipseEditingLibrary.java	(revision 1663)
@@ -0,0 +1,69 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.ellipse;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+public class EllipseEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new EllipseEditingProviderFactory());
+        manager.addProviderFactory(new FilledEllipseEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "insert-ellipse", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        manager.registerIcon("vectorediting-tools", "insert-filled-ellipse", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "insert-ellipse-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.ellipse</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.ellipse</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.ellipse
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rotate/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rotate/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rotate/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.rotate</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.rotate</name>
+</project>
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rotate/src/main/resources/images/vectorediting-tools/modify-rotate.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rotate/src/main/resources/images/vectorediting-tools/modify-rotate.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rotate/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rotate/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rotate/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.rotate.RotateEditingLibrary
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rotate/src/main/java/org/gvsig/vectorediting/lib/prov/rotate/RotateEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rotate/src/main/java/org/gvsig/vectorediting/lib/prov/rotate/RotateEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rotate/src/main/java/org/gvsig/vectorediting/lib/prov/rotate/RotateEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,87 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.rotate;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+public class RotateEditingProviderFactory extends AbstractProviderFactory
+implements EditingProviderFactory {
+
+    public static final String PROVIDER_NAME = "modify-rotate";
+
+    private final static String PROVIDER_DESCRIPTION =
+        "Creates rotated geometries from selection";
+
+    public void initialize() {
+
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", false, null,
+                new int[] { Geometry.TYPES.POINT, Geometry.TYPES.MULTIPOINT,
+                Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE,
+                Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, 
+                Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new RotateEditingProvider(services, parameters);
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject dynobject = super.createParameters();
+        dynobject.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return dynobject;
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rotate/src/main/java/org/gvsig/vectorediting/lib/prov/rotate/RotateEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rotate/src/main/java/org/gvsig/vectorediting/lib/prov/rotate/RotateEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rotate/src/main/java/org/gvsig/vectorediting/lib/prov/rotate/RotateEditingLibrary.java	(revision 1663)
@@ -0,0 +1,71 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.rotate;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * Library for default implementation initialization and configuration.
+ *
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class RotateEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new RotateEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "modify-rotate", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n.text",
+            this.getClass().getClassLoader(), "rotate-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rotate/src/main/java/org/gvsig/vectorediting/lib/prov/rotate/RotateEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rotate/src/main/java/org/gvsig/vectorediting/lib/prov/rotate/RotateEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rotate/src/main/java/org/gvsig/vectorediting/lib/prov/rotate/RotateEditingProvider.java	(revision 1663)
@@ -0,0 +1,415 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.rotate;
+
+import java.awt.geom.AffineTransform;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.Aggregate;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.aggregate.MultiPoint;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Surface;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.symbology.SymbologyLocator;
+import org.gvsig.symbology.SymbologyManager;
+import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.ISimpleTextSymbol;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.tools.visitor.VisitCanceledException;
+import org.gvsig.tools.visitor.Visitor;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+public class RotateEditingProvider extends AbstractEditingProvider implements
+    EditingProvider {
+
+    private I18nManager i18nManager = ToolsLocator.getI18nManager();
+
+    private EditingServiceParameter selectionParameter;
+
+    private EditingServiceParameter centerPointParameter;
+
+    private EditingServiceParameter angleParameter;
+
+    private Map<EditingServiceParameter, Object> values;
+
+    private FeatureStore featureStore;
+
+    public RotateEditingProvider(ProviderServices providerServices,
+        DynObject parameters) {
+        super(providerServices);
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.selectionParameter =
+            new DefaultEditingServiceParameter("selection",
+                i18nManager.getTranslation("selection"), TYPE.SELECTION);
+
+        this.centerPointParameter =
+            new DefaultEditingServiceParameter("center_of_rotation",
+                i18nManager.getTranslation("center_of_rotation"), TYPE.POSITION);
+
+        this.angleParameter =
+            new DefaultEditingServiceParameter("angle_of_rotation",
+                i18nManager.getTranslation("angle_of_rotation"), TYPE.POSITION,
+                TYPE.VALUE);
+    }
+
+    private ISimpleTextSymbol getTextSymbol(){
+        SymbologyManager symbologyManager = SymbologyLocator.getSymbologyManager();
+        ISimpleTextSymbol textSymbol = symbologyManager.createSimpleTextSymbol();
+        textSymbol.setFontSize(10);
+        return textSymbol;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol auxiliaryPointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+        ISymbol auxiliaryLineSymbolEditing = editingProviderManager.getSymbol("auxiliary-line-symbol-editing");
+        ISymbol ruleAxisSymbol = editingProviderManager.getSymbol("rule-axis-symbol");
+        ISymbol lineSymbolEditing = editingProviderManager.getSymbol("line-symbol-editing");
+        ISymbol polygonSymbolEditing = editingProviderManager.getSymbol("polygon-symbol-editing");
+
+
+
+        FeatureSelection selected =
+            (FeatureSelection) values.get(selectionParameter);
+        try {
+            if ((selected != null) && !selected.isEmpty()) {
+                Point p1 = (Point) values.get(centerPointParameter);
+                if (p1 != null) {
+                    drawingStatus.addStatus(p1, auxiliaryPointSymbolEditing, "");
+                    Object angleValue = values.get(angleParameter);
+                    Double angle = null;
+                    EditingProviderServices editingProviderServices =
+                        (EditingProviderServices) getProviderServices();
+                    if ((angleValue != null) && (angleValue instanceof Double)) {
+                        angle = (Double) angleValue;
+                    } else {
+                        angle =
+                            editingProviderServices.getAngle(
+                                (Point) values.get(centerPointParameter),
+                                mousePosition);
+
+                        Line line;
+                        GeometryManager geometryManager =
+                            GeometryLocator.getGeometryManager();
+                        int subType =
+                            editingProviderServices.getSubType(featureStore);
+                        line = geometryManager.createLine(subType);
+                        line.addVertex(p1);
+                        Point p2 =
+                            geometryManager.createPoint(
+                                p1.getX() + p1.distance(mousePosition),
+                                p1.getY(), subType);
+                        line.addVertex(p2);
+                        drawingStatus.addStatus(line, ruleAxisSymbol, "");
+                        Line line2;
+                        line2 = geometryManager.createLine(subType);
+                        line2.addVertex(p1);
+                        line2.addVertex(mousePosition);
+                        drawingStatus.addStatus(line2, ruleAxisSymbol, "");
+                        Double ext = (2 * Math.PI) - angle;
+                        Arc arc =
+                            editingProviderServices
+                                .createArc(p1, p1.distance(mousePosition) / 2,
+                                    0, ext, Geometry.SUBTYPES.GEOM2D);
+                        drawingStatus.addStatus(arc, auxiliaryLineSymbolEditing, "");
+                        double textDistance = 3*p1.distance(mousePosition) / 4;
+                        Point pointText = geometryManager.createPoint(p1.getX()+textDistance*Math.cos(angle/2), p1.getY()+textDistance*Math.sin(angle/2), subType);
+                        ISimpleTextSymbol textSymbol = getTextSymbol();
+                        drawingStatus.addStatus(pointText, textSymbol, degToDms(Math.toDegrees(angle)));
+                    }
+
+                    DisposableIterator it;
+                    it = selected.fastIterator();
+
+                    AffineTransform at;
+                    try {
+                        at = getRotateAffineTransform(p1, angle);
+                    } catch (Exception e) {
+                        throw new DrawServiceException(e);
+                    }
+
+                    while (it.hasNext()) {
+                        Feature feat = (Feature) it.next();
+
+                        Geometry transformedGeometry = feat.getDefaultGeometry().cloneGeometry();
+                        transformedGeometry.transform(at);
+
+                        ISymbol symbol=null;
+                        if(transformedGeometry instanceof Curve || transformedGeometry instanceof MultiCurve){
+                            symbol = lineSymbolEditing;
+                        } else if(transformedGeometry instanceof Surface || transformedGeometry instanceof MultiSurface){
+                            symbol = polygonSymbolEditing;
+                        } else if(transformedGeometry instanceof Point || transformedGeometry instanceof MultiPoint){
+                            symbol = auxiliaryPointSymbolEditing;
+                        }
+                        if(transformedGeometry instanceof Aggregate){
+                            int primitivesNumber = ((Aggregate)transformedGeometry).getPrimitivesNumber();
+                            for (int i = 0; i < primitivesNumber; i++) {
+                                drawingStatus.addStatus(((Aggregate)transformedGeometry).getPrimitiveAt(i), symbol, "");
+                            }
+                        } else {
+                            drawingStatus.addStatus(transformedGeometry, symbol, "");
+                        }
+
+                    }
+                    it.dispose();
+                }
+                return drawingStatus;
+            }
+        } catch (Exception e) {
+            throw new DrawServiceException(e);
+        }
+
+        return null;
+
+    }
+
+    private String degToDms (double deg) {
+        int d = (int)Math.floor(deg);
+        double minfloat = (deg-d)*60;
+        int m = (int)Math.floor(minfloat);
+        double secfloat = (minfloat-m)*60;
+        int s = (int)Math.round(secfloat);
+        // After rounding, the seconds might become 60. These two
+        // if-tests are not necessary if no rounding is done.
+        if (s==60) {
+          m++;
+          s=0;
+        }
+        if (m==60) {
+          d++;
+          m=0;
+        }
+        return ("" + d + "\u00B0" + m + "\u2032" + s+"\u2033");
+     }
+
+    private AffineTransform getRotateAffineTransform(Point axisP1, Double angle)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+
+        AffineTransform translate =
+            AffineTransform
+                .getTranslateInstance(-axisP1.getX(), -axisP1.getY());
+
+        AffineTransform rotate = AffineTransform.getRotateInstance(angle);
+
+        AffineTransform inverseTranslate =
+            AffineTransform.getTranslateInstance(axisP1.getX(), axisP1.getY());
+        AffineTransform at = new AffineTransform(translate);
+
+        at.preConcatenate(rotate);
+        at.preConcatenate(inverseTranslate);
+        return at;
+    }
+
+    public EditingServiceParameter next() {
+        if (values.get(selectionParameter) == null) {
+            return this.selectionParameter;
+        } else if (values.get(centerPointParameter) == null) {
+            return this.centerPointParameter;
+        } else if (values.get(angleParameter) == null) {
+            return this.angleParameter;
+        }
+        return null;
+    }
+
+    public void stop() {
+        values.clear();
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter param,
+        Object value) throws InvalidEntryException {
+        if (param == selectionParameter) {
+            if (value instanceof FeatureSelection) {
+                values.put(param, value);
+                return;
+            }
+        } else if (param == centerPointParameter) {
+            if (value instanceof Point) {
+                values.put(param, value);
+                return;
+            }
+        } else if (param == angleParameter) {
+            if (value instanceof Point) {
+                Double angleValue = null;
+
+                try {
+                    EditingProviderServices editingProviderServices =
+                        (EditingProviderServices) getProviderServices();
+                    angleValue =
+                        editingProviderServices.getAngle(
+                            (Point) values.get(centerPointParameter),
+                            ((Point) value));
+                } catch (Exception e) {
+                    throw new InvalidEntryException(e);
+                }
+
+                if (angleValue != null) {
+                    values.put(param, angleValue);
+                    return;
+                }
+
+            } else if (value instanceof Double) {
+                values.put(param, (Double)value*Math.PI/180);
+                return;
+            }
+        }
+
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> list =
+            new ArrayList<EditingServiceParameter>();
+        list.add(selectionParameter);
+        list.add(centerPointParameter);
+        list.add(angleParameter);
+        return list;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter param = next();
+        validateAndInsertValue(param, value);
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+
+        FeatureSelection selected =
+            (FeatureSelection) values.get(selectionParameter);
+        try {
+            if (!selected.isEmpty()) {
+                Point p1 = (Point) values.get(centerPointParameter);
+                Double angle = (Double) values.get(angleParameter);
+                if ((p1 != null) && (angle != null)) {
+
+                    final AffineTransform at;
+                    try {
+                        at = getRotateAffineTransform(p1, angle);
+                    } catch (GeometryOperationNotSupportedException e) {
+                        throw new FinishServiceException(e);
+                    } catch (GeometryOperationException e) {
+                        throw new FinishServiceException(e);
+                    }
+
+                    try {
+                        selected.accept(new Visitor() {
+
+                            public void visit(Object obj)
+                                throws VisitCanceledException, BaseException {
+                                Feature feature = (Feature) obj;
+                                Geometry geom =
+                                    feature.getDefaultGeometry()
+                                        .cloneGeometry();
+                                geom.transform(at);
+                                // Se sustituye la geometr�a original por la
+                                // calculada
+                                EditableFeature editableFeature =
+                                    feature.getEditable();
+                                editableFeature.setDefaultGeometry(geom);
+                                ((EditingProviderServices) getProviderServices())
+                                    .updateFeatureInFeatureStore(
+                                        editableFeature, featureStore);
+                            }
+                        });
+                    } catch (BaseException e) {
+                        throw new FinishServiceException(e);
+                    }
+                    featureStore.getFeatureSelection().deselectAll();
+                }
+            }
+        } catch (DataException e) {
+            throw new FinishServiceException(e);
+        }
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void start() throws StartServiceException {
+        this.values = new HashMap<EditingServiceParameter, Object>();
+        FeatureSelection selected = null;
+        if (featureStore != null) {
+            try {
+                selected =
+                    (FeatureSelection) featureStore.getFeatureSelection()
+                        .clone();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            } catch (CloneNotSupportedException e) {
+                // Do nothing
+            }
+            if ((selected != null) && (selected.getSelectedCount() > 0)) {
+                values.put(selectionParameter, selected);
+            }
+        }
+    }
+
+    public String getName() {
+        return RotateEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.rotate
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.converttopolyline/src/main/java/org/gvsig/vectorediting/lib/prov/converttopolyline/ConvertToPolylineLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.converttopolyline/src/main/java/org/gvsig/vectorediting/lib/prov/converttopolyline/ConvertToPolylineLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.converttopolyline/src/main/java/org/gvsig/vectorediting/lib/prov/converttopolyline/ConvertToPolylineLibrary.java	(revision 1663)
@@ -0,0 +1,54 @@
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.converttopolyline;
+
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+
+public class ConvertToPolylineLibrary extends AbstractLibrary {
+    
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new ConvertToPolylineEditingProviderFactory());
+        
+        manager.registerIcon("vectorediting-tools", "modify-convert-to-polyline", this
+            .getClass().getClassLoader(), this.getClass().getName());
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.converttopolyline/src/main/java/org/gvsig/vectorediting/lib/prov/converttopolyline/ConvertToPolylineEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.converttopolyline/src/main/java/org/gvsig/vectorediting/lib/prov/converttopolyline/ConvertToPolylineEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.converttopolyline/src/main/java/org/gvsig/vectorediting/lib/prov/converttopolyline/ConvertToPolylineEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,86 @@
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.converttopolyline;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+
+public class ConvertToPolylineEditingProviderFactory extends
+    AbstractProviderFactory implements EditingProviderFactory {
+    
+    public static final String PROVIDER_NAME = "modify-convert-to-polyline";
+    
+    private final static String PROVIDER_DESCRIPTION =
+        "Convert arcs and splines entities to polylines";
+
+    public void initialize() {
+
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(
+                PROVIDER_NAME,
+                PROVIDER_DESCRIPTION,
+                true,
+                null,
+                new int[] { Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new ConvertToPolylineEditingProvider(services, parameters);
+    }
+    
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+        return dynclass;
+
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.converttopolyline/src/main/java/org/gvsig/vectorediting/lib/prov/converttopolyline/ConvertToPolylineEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.converttopolyline/src/main/java/org/gvsig/vectorediting/lib/prov/converttopolyline/ConvertToPolylineEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.converttopolyline/src/main/java/org/gvsig/vectorediting/lib/prov/converttopolyline/ConvertToPolylineEditingProvider.java	(revision 1663)
@@ -0,0 +1,235 @@
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.converttopolyline;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.Geometry.TYPES;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.dispose.DisposeUtils;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+public class ConvertToPolylineEditingProvider extends AbstractEditingProvider
+    implements EditingProvider {
+
+    private EditingServiceParameter selectionParameter;
+
+    private FeatureSelection featureSelection;
+
+    private FeatureStore featureStore;
+
+    public ConvertToPolylineEditingProvider(ProviderServices providerServices,
+        DynObject parameters) {
+        super(providerServices);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.selectionParameter =
+            new DefaultEditingServiceParameter("selection", "selection",
+                TYPE.SELECTION);
+    }
+
+    public EditingServiceParameter next() {
+        if (this.featureSelection == null) {
+            return selectionParameter;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        return null;
+    }
+
+    public void stop() throws StopServiceException {
+        DisposeUtils.disposeQuietly(featureSelection);
+        featureSelection = null;
+
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(selectionParameter);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter parameter,
+        Object value) throws InvalidEntryException {
+
+        if (parameter == selectionParameter) {
+
+            if (value instanceof FeatureSelection) {
+                FeatureSelection fSelection = (FeatureSelection) value;
+
+                if (fSelection.getSelectedCount() >= 1) {
+                    DisposableIterator it = null;
+
+                    try {
+                        it = fSelection.fastIterator();
+
+                        while (it.hasNext()) {
+
+                            Feature feature = (Feature) it.next();
+                            // Gets geometry type of first selected feature
+                            GeometryType geometryType =
+                                feature.getDefaultGeometry().getGeometryType();
+
+                            if (!geometryType.isTypeOf(TYPES.CURVE)
+                                && !geometryType.isTypeOf(TYPES.MULTICURVE)) {
+
+                                throw new InvalidEntryException(null);
+                            }
+                        }
+                        DisposeUtils.disposeQuietly(featureSelection);
+                        ToolsLocator.getDisposableManager().bind(fSelection);
+                        featureSelection = fSelection;
+                        return;
+                    } catch (DataException e) {
+                        throw new InvalidEntryException(e);
+                    } finally {
+                        it.dispose();
+                    }
+                }
+            }
+        }
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+
+        if (featureSelection != null) {
+
+            GeometryManager geometryManager =
+                GeometryLocator.getGeometryManager();
+
+            EditingProviderServices editingProviderServices =
+                (EditingProviderServices) getProviderServices();
+
+            DisposableIterator it = null;
+            try {
+                it = featureSelection.fastIterator();
+                while (it.hasNext()) {
+                    Feature feature = (Feature) it.next();
+                    EditableFeature eFeature = feature.getEditable();
+                    Geometry geometry = feature.getDefaultGeometry();
+
+                    if (geometry.getGeometryType().isTypeOf(TYPES.CURVE)) {
+
+                        eFeature.setDefaultGeometry(geometry.toLines().getPrimitiveAt(0));
+
+                    } else if (geometry.getGeometryType().isTypeOf(TYPES.MULTICURVE)) {
+
+                        eFeature.setDefaultGeometry(geometry.toLines());
+                    }
+                    DisposeUtils.disposeQuietly(featureSelection);
+                    editingProviderServices.updateFeatureInFeatureStore(
+                        eFeature, featureStore);
+                }
+
+                featureStore.getFeatureSelection().deselectAll();
+            } catch (BaseException e) {
+                throw new FinishServiceException(e);
+            } finally {
+                it.dispose();
+            }
+
+        }
+    }
+
+    private Line convertCurveToLine(Curve curve) throws CreateGeometryException {
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        Line newLine =
+            geometryManager.createLine(curve.getGeometryType().getSubType());
+        for (int i = 0; i < curve.getNumVertices(); i++) {
+            newLine.addVertex(curve.getVertex(i));
+        }
+        return newLine;
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        FeatureSelection selected = null;
+        if (featureStore != null) {
+            try {
+                selected = featureStore.getFeatureSelection();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            }
+            if (selected.getSelectedCount() >= 1) {
+                try {
+                    setValue(selected);
+                } catch (InvalidEntryException e) {
+                    throw new InvalidEntryException(e);
+                }
+            }
+        }
+    }
+
+    public String getName() {
+        return ConvertToPolylineEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.converttopolyline/src/main/resources/images/vectorediting-tools/modify-convert-to-polyline.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.converttopolyline/src/main/resources/images/vectorediting-tools/modify-convert-to-polyline.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.converttopolyline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.converttopolyline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.converttopolyline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.converttopolyline.ConvertToPolylineLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.converttopolyline/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.converttopolyline/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.converttopolyline/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.converttopolyline</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.converttopolyline</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.converttopolyline
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/ExtendLineEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/ExtendLineEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/ExtendLineEditingProvider.java	(revision 1663)
@@ -0,0 +1,433 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.extendline;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.cresques.cts.IProjection;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureQuery;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureSet;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.layers.vectorial.SpatialEvaluatorsFactory;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.dispose.DisposeUtils;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.evaluator.Evaluator;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.tools.visitor.VisitCanceledException;
+import org.gvsig.tools.visitor.Visitor;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.prov.extendline.operation.ExtendLineOperation;
+import org.gvsig.vectorediting.lib.prov.extendline.operation.ExtendLineOperationUtils;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * @author llmarques
+ *
+ */
+public class ExtendLineEditingProvider extends AbstractEditingProvider
+    implements EditingProvider {
+
+    private final int TOLERANCE_PIXELS = 3;
+
+    private Point insertedPoint;
+
+    private final EditingServiceParameter selectionParameter;
+
+    private final EditingServiceParameter linesToExtendParameter;
+
+    private FeatureSelection selection;
+
+    private FeatureSet linesToExtend;
+
+    private final FeatureStore featureStore;
+
+    private final MapContext mapContext;
+
+    /**
+     * Default constructor.
+     *
+     * @param services
+     *            available services for this provider
+     * @param parameters
+     *            of this provider
+     */
+    public ExtendLineEditingProvider(ProviderServices services,
+        DynObject parameters) {
+        super(services);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.mapContext =
+            (MapContext) parameters
+                .getDynValue(EditingProviderFactory.MAPCONTEXT_FIELD);
+
+        this.selectionParameter =
+            new DefaultEditingServiceParameter("selection", "selection",
+                TYPE.SELECTION);
+
+        this.linesToExtendParameter =
+            new DefaultEditingServiceParameter("line_to_extend",
+                "line_to_extend", TYPE.POSITION);
+    }
+
+    public EditingServiceParameter next() {
+        if (selection == null) {
+            return selectionParameter;
+        } else if (linesToExtend == null) {
+            return linesToExtendParameter;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+
+        if (selection != null) {
+            DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+            EditingProviderManager editingProviderManager =
+                EditingProviderLocator.getProviderManager();
+            ISymbol lineSymbolEditing = editingProviderManager.getSymbol("line-symbol-editing");
+
+            double tolerance =
+                mapContext.getViewPort().toMapDistance(TOLERANCE_PIXELS);
+
+            Geometry buffer;
+            FeatureSet geometries;
+            DisposableIterator it = null;
+            try {
+                // Create buffer with tolerance to get the geometry to be
+                // extended
+                buffer = mousePosition.buffer(tolerance);
+                geometries = getGeometryByBuffer(buffer);
+
+                it = geometries.fastIterator();
+                while (it.hasNext()) {
+                    Feature feature = (Feature) it.next();
+                    if (!selection.isSelected(feature)) {
+                        Geometry geometry = feature.getDefaultGeometry();
+
+
+                        if (geometry instanceof MultiCurve) {
+                            MultiCurve multiCurve = (MultiCurve) geometry;
+
+                            for (int i = 0; i < multiCurve
+                                .getPrimitivesNumber(); i++) {
+
+                                Curve curve = multiCurve.getCurveAt(i);
+                                if (!isClosed(curve)) {
+                                    Curve extendedCurve =
+                                        extendLine(mousePosition, curve);
+                                    drawingStatus.addStatus(extendedCurve,lineSymbolEditing, "");
+                                }
+                            }
+
+                        } else if (geometry instanceof Curve) {
+                            if (!isClosed((Curve) geometry)) {
+                                Curve extendedCurve =
+                                    extendLine(mousePosition, (Curve) geometry);
+                                drawingStatus.addStatus(extendedCurve,lineSymbolEditing, "");
+                            }
+                        }
+                    }
+                }
+
+            } catch (BaseException e) {
+                throw new DrawServiceException(e);
+            } finally {
+                DisposeUtils.dispose(it);
+            }
+            return drawingStatus;
+        }
+        return null;
+    }
+
+    private boolean isClosed(Curve curve) {
+        if (curve instanceof Arc) {
+            Arc arc = (Arc) curve;
+            if (arc.getInitPoint().equals(arc.getEndPoint())) {
+                return true;
+            }
+        } else if (curve instanceof Curve) {
+            Point firstPoint = curve.getVertex(0);
+            Point lastPoint = curve.getVertex(curve.getNumVertices() - 1);
+            if (firstPoint.equals(lastPoint)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private Curve extendLine(Point mousePosition, Curve curve)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, DataException, CreateGeometryException {
+        ExtendLineOperation operation =
+            ExtendLineOperationUtils.getOperation((Primitive) curve);
+
+        return operation.extendLine(curve, mousePosition, selection);
+    }
+
+    public void stop() throws StopServiceException {
+        linesToExtend = null;
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters = new ArrayList<>();
+        parameters.add(selectionParameter);
+        parameters.add(linesToExtendParameter);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+    }
+
+    private void validateAndInsertValue(
+        final EditingServiceParameter parameter, Object value)
+        throws InvalidEntryException {
+
+        if (parameter == selectionParameter) {
+            if (value instanceof FeatureSelection) {
+                FeatureSelection featureSelection = (FeatureSelection) value;
+                if (featureSelection.getSelectedCount() > 0) {
+                    try {
+                        featureSelection.accept(new Visitor() {
+
+                            public void visit(Object obj)
+                                throws VisitCanceledException, BaseException {
+                                Feature feature = (Feature) obj;
+                                Geometry geometry =
+                                    feature.getDefaultGeometry();
+                                GeometryType geoType =
+                                    geometry.getGeometryType();
+
+                                if (!geoType.isTypeOf(SURFACE)
+                                    && !geoType.isTypeOf(MULTISURFACE)
+                                    && !geoType.isTypeOf(CURVE)
+                                    && !geoType.isTypeOf(MULTICURVE)) {
+                                    throw new InvalidEntryException(null);
+                                }
+                            }
+                        });
+                        selection = featureSelection;
+                        return;
+                    } catch (BaseException e) {
+                        throw new InvalidEntryException(e);
+                    }
+                }
+            }
+        } else if (parameter == linesToExtendParameter) {
+            if (value instanceof Point) {
+                Point point = (Point) value;
+                try {
+                    double tolerance =
+                        mapContext.getViewPort()
+                            .toMapDistance(TOLERANCE_PIXELS);
+
+                    // Create buffer with tolerance to get geometries to be
+                    // extended
+                    Geometry buffer = point.buffer(tolerance);
+                    FeatureSet geometries = getGeometryByBuffer(buffer);
+
+                    if (geometries.getSize() > 0) {
+
+                        geometries.accept(new Visitor() {
+
+                            public void visit(Object obj)
+                                throws VisitCanceledException, BaseException {
+                                Feature feature = (Feature) obj;
+                                Geometry geometry =
+                                    feature.getDefaultGeometry();
+                                GeometryType geoType =
+                                    geometry.getGeometryType();
+
+                                if (!geoType.isTypeOf(CURVE)
+                                    && !geoType.isTypeOf(MULTICURVE)) {
+                                    throw new InvalidEntryException(null);
+                                }
+                            }
+                        });
+
+                        insertedPoint = point;
+                        linesToExtend = geometries;
+                        return;
+                    }
+                } catch (BaseException e) {
+                    throw new InvalidEntryException(e);
+                }
+            }
+        }
+        throw new InvalidEntryException(null);
+    }
+
+    private FeatureSet getGeometryByBuffer(Geometry buffer) throws DataException {
+        FeatureQuery queryByGeometry = featureStore.createFeatureQuery();
+
+        // Get default SRS of default feature type
+        IProjection defaultSRS =
+            this.featureStore.getDefaultFeatureType().getDefaultSRS();
+
+        Evaluator iee = SpatialEvaluatorsFactory.getInstance().intersects(
+                buffer, 
+                defaultSRS, 
+                featureStore
+        );
+
+        queryByGeometry.setFilter(iee);
+        queryByGeometry.setAttributeNames(null);
+        return this.featureStore.getFeatureSet(queryByGeometry);
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+        if (selection != null && linesToExtend != null) {
+
+            try {
+                linesToExtend.accept(new Visitor() {
+
+                    public void visit(Object obj)
+                        throws VisitCanceledException, BaseException {
+                        Feature feature = (Feature) obj;
+                        Geometry geometry = feature.getDefaultGeometry();
+                        EditableFeature eFeature = feature.getEditable();
+
+                        if (geometry instanceof MultiCurve) {
+
+                            // Create new multicurve geometry
+                            MultiCurve extendedMultiCurve =
+                                createMultiCurve(geometry);
+
+                            // Iterate overs primitives and execute extend
+                            // line operation
+                            MultiCurve multiCurve = (MultiCurve) geometry;
+
+                            for (int i = 0; i < multiCurve
+                                .getPrimitivesNumber(); i++) {
+
+                                Curve curve = multiCurve.getCurveAt(i);
+                                Curve extendedCurve =
+                                    extendLine(insertedPoint, curve);
+                                extendedMultiCurve.addCurve(extendedCurve);
+                            }
+
+                            eFeature.setDefaultGeometry(extendedMultiCurve);
+
+                        } else if (geometry instanceof Curve) {
+                            Curve extendedCurve =
+                                extendLine(insertedPoint, (Curve) geometry);
+                            eFeature.setDefaultGeometry(extendedCurve);
+                        }
+
+                        linesToExtend.update(eFeature);
+                    }
+                });
+
+                linesToExtend.dispose();
+
+            } catch (BaseException e) {
+                throw new FinishServiceException(e);
+            }
+        }
+    }
+
+    private MultiCurve createMultiCurve(Geometry geometry)
+        throws FinishServiceException {
+
+        GeometryManager geoManager = GeometryLocator.getGeometryManager();
+        int subtype = geometry.getGeometryType().getSubType();
+        MultiCurve extendedMultiCurve = null;
+
+        try {
+            extendedMultiCurve = geoManager.createMultiCurve(subtype);
+        } catch (CreateGeometryException e) {
+            throw new FinishServiceException(e);
+        }
+        return extendedMultiCurve;
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        linesToExtend = null;
+        FeatureSelection selected = null;
+        if (featureStore != null && selection == null) {
+            try {
+                selected = featureStore.getFeatureSelection();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            }
+            if (selected.getSelectedCount() > 0) {
+                try {
+                    setValue(selected);
+                } catch (InvalidEntryException e) {
+                    throw new InvalidEntryException(e);
+                }
+            }
+        }
+    }
+
+    public String getName() {
+        return ExtendLineEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/operation/ExtendLineOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/operation/ExtendLineOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/operation/ExtendLineOperation.java	(revision 1663)
@@ -0,0 +1,69 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.extendline.operation;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+
+/**
+ * Represents an operation to extend curve.
+ * 
+ * @author llmarques
+ *
+ */
+public interface ExtendLineOperation {
+
+    /**
+     * Extend line to boundary objects received as parameters.
+     * 
+     * Inserted point is the point inserted by user. It is used to determinate
+     * what side of curve it must extend.
+     * 
+     * If curveToBeExtended does not intersect with any geometry, the geometry will
+     * not be modified.
+     * 
+     * @param curveToBeExtended
+     *            Curve to be extended.
+     * @param insertedPoint
+     *            Point inserted by user to determinate what side of curve must
+     *            be extended.
+     * @param boundaryObjects
+     *            If curveToBeExtended intersects with some boundary object, it will
+     *            be extend to it. If there are several boundary objects that
+     *            intersects with curveToBeExtended, it will be extended to nearest
+     *            point.
+     * @return extended line.
+     */
+    public Curve extendLine(Curve curveToBeExtended, Point insertedPoint,
+        FeatureSelection boundaryObjects)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, DataException, CreateGeometryException;
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/operation/ExtendLineOperationUtils.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/operation/ExtendLineOperationUtils.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/operation/ExtendLineOperationUtils.java	(revision 1663)
@@ -0,0 +1,367 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.extendline.operation;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.Geometry.TYPES;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiPoint;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.tools.dispose.DisposableIterator;
+
+/**
+ * @author llmarques
+ *
+ */
+public class ExtendLineOperationUtils {
+
+    /**
+     * Use it to indicate start side should be extended
+     */
+    public static final String START_SIDE = "start";
+
+    /**
+     * Use it to indicate end side should be extended
+     */
+    public static final String END_SIDE = "end";
+
+    /**
+     * Number of projections computed to know intersection points.
+     */
+    private final static int PROJECTION_LIMIT = 100;
+
+    private static Map<Integer, ExtendLineOperation> operations =
+        new HashMap<Integer, ExtendLineOperation>();
+
+    public ExtendLineOperationUtils() {
+    }
+
+    public static void register(ExtendLineOperation operation, int geometryType) {
+        operations.put(geometryType, operation);
+    }
+
+    public static ExtendLineOperation getOperation(Primitive geom) {
+        Integer type = geom.getGeometryType().getType();
+
+        ExtendLineOperation operation = operations.get(type);
+
+        return operation;
+    }
+
+    /**
+     * Calculates the nearest intersection among curve and boundary objects
+     * depending on side received as parameter.
+     * 
+     * @param line
+     *            to be extended
+     * @param sideToExtend
+     *            What side will be extend. Use
+     *            {@link ExtendLineOperationUtils#START_SIDE} and
+     *            {@link ExtendLineOperationUtils#END_SIDE}
+     * @param boundaryObjects
+     *            to calculate intersection points.
+     * @return the nearest intersection point. Return Null if arc does not
+     *         intersect
+     *         with any boundary object
+     */
+    public static Point curveIntersection(Curve line, String sideToExtend,
+        FeatureSelection boundaryObjects) throws CreateGeometryException,
+        DataException, GeometryOperationNotSupportedException,
+        GeometryOperationException {
+
+        Point initPoint = null;
+        Point endPoint = null;
+
+        // Start side line is formed by second point and first point
+        if (sideToExtend.equalsIgnoreCase(START_SIDE)) {
+
+            initPoint = line.getVertex(1);
+            endPoint = line.getVertex(0);
+
+            // End side line is formed by penultimate point and last point
+        } else if (sideToExtend.equalsIgnoreCase(END_SIDE)) {
+
+            initPoint = line.getVertex(line.getNumVertices() - 2);
+            endPoint = line.getVertex(line.getNumVertices() - 1);
+
+        }
+
+        return getIntersectionOfProjectedLine(initPoint, endPoint,
+            boundaryObjects);
+    }
+
+    /**
+     * Calculates the nearest intersection point among arc and boundary objects
+     * depending on side received as parameter.
+     * 
+     * Strategy:
+     * 
+     * 1- Create a full arc with the same center and radius of arc received by
+     * parameter.
+     * 2- Iterate over boundary objects.
+     * 3- If some boundary object intersects with full arc, calculates the
+     * distance to start point or end point depending on side to be extend.
+     * 4- Return the nearest intersection point.
+     * 
+     * @param arcToBeExtended
+     *            Arc to be extended
+     * @param sideToExtend
+     *            What side will be extend. Use
+     *            {@link ExtendLineOperationUtils#START_SIDE} and
+     *            {@link ExtendLineOperationUtils#END_SIDE}
+     * @param boundaryObjects
+     *            to calculate intersection points.
+     * @return the nearest intersection point. Return Null if arc does not
+     *         intersect with any boundary object
+     */
+    public static Point arcIntersection(Arc arcToBeExtended,
+        String sideToExtend, FeatureSelection boundaryObjects)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, CreateGeometryException, DataException {
+
+        GeometryManager geoManager = GeometryLocator.getGeometryManager();
+        int subtype = arcToBeExtended.getGeometryType().getSubType();
+
+        Point center = arcToBeExtended.getCenterPoint();
+        double radius = center.distance(arcToBeExtended.getInitPoint());
+
+        Point intersection = null;
+
+        double minDistance = Double.POSITIVE_INFINITY;
+
+        Arc tmpArc = (Arc) geoManager.create(TYPES.ARC, subtype);
+        tmpArc.setPoints(center, radius, 0, Math.PI * 2);
+
+        DisposableIterator it = boundaryObjects.fastIterator();
+        while (it.hasNext()) {
+            Feature feature = (Feature) it.next();
+            Geometry geometry = feature.getDefaultGeometry();
+            if (tmpArc.intersects(geometry)) {
+                Geometry intersectionGeometry = tmpArc.intersection(geometry);
+
+                if (intersectionGeometry instanceof MultiPoint) {
+                    MultiPoint intersectionMultiPoint =
+                        (MultiPoint) intersectionGeometry;
+
+                    for (int i = 0; i < intersectionMultiPoint
+                        .getPrimitivesNumber(); i++) {
+                        Point point = intersectionMultiPoint.getPointAt(i);
+                        double distance = Double.POSITIVE_INFINITY;
+
+                        if (sideToExtend.equalsIgnoreCase(START_SIDE)) {
+                            distance =
+                                point.distance(arcToBeExtended.getInitPoint());
+                        } else if (sideToExtend.equalsIgnoreCase(END_SIDE)) {
+                            distance =
+                                point.distance(arcToBeExtended.getEndPoint());
+                        }
+
+                        if (distance < minDistance) {
+                            intersection = point;
+                            minDistance = distance;
+                        }
+                    }
+                } else if (intersectionGeometry instanceof Point) {
+                    Point intersectionPoint = (Point) intersectionGeometry;
+                    double distance = Double.POSITIVE_INFINITY;
+
+                    if (sideToExtend.equalsIgnoreCase("start")) {
+                        distance =
+                            intersectionPoint.distance(arcToBeExtended
+                                .getInitPoint());
+                    } else if (sideToExtend.equalsIgnoreCase("end")) {
+                        distance =
+                            intersectionPoint.distance(arcToBeExtended
+                                .getEndPoint());
+                    }
+
+                    if (distance < minDistance) {
+                        intersection = intersectionPoint;
+                        minDistance = distance;
+                    }
+                }
+            }
+        }
+        it.dispose();
+        return intersection;
+    }
+
+    // FIXME: remove this method when geometry library has this utility method
+    public static double getAngle(Point start, Point end)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+        double angle =
+            Math.acos((end.getX() - start.getX()) / start.distance(end));
+
+        if (start.getY() > end.getY()) {
+            angle = -angle;
+        }
+
+        if (angle < 0) {
+            angle += (2 * Math.PI);
+        }
+
+        return angle;
+    }
+
+    /**
+     * Gets intersection among the line formed by initPoint and endPoint and
+     * boundary objects. If line or its projection does not intersect with any
+     * boundary object return null.
+     * 
+     * Strategy:
+     * 
+     * 1- Get module of line to determine if an intersection point already be
+     * vertex of line. If the distance between intersection point and start
+     * point of line is less than module indicates that intersection point
+     * already be curve point.
+     * 2- Project line with the line parametric equation.
+     * 3- Iterate over boundary objects.
+     * 4- Check if boundary object does not contains end point of projected
+     * line.
+     * 5- If projected line intersects with any boundary object, get the nearest
+     * intersection point
+     * 6- Return it.
+     * 
+     * 
+     * @param initPoint
+     *            of curve to extend
+     * @param endPoint
+     *            end point of curve to extend
+     * @param boundaryObjects
+     *            to calculate intersection points.
+     * @return the nearest intersection point. Return Null if arc does not
+     *         intersect with any boundary object
+     */
+    public static Point getIntersectionOfProjectedLine(Point initPoint,
+        Point endPoint, FeatureSelection boundaryObjects)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, DataException, CreateGeometryException {
+
+        GeometryManager geoManager = GeometryLocator.getGeometryManager();
+        int subtype = initPoint.getGeometryType().getSubType();
+
+        double module = initPoint.distance(endPoint);
+
+        double minDistance = Double.POSITIVE_INFINITY;
+        Point intersectionPoint = null;
+
+        double x, y;
+        double x1 = initPoint.getX();
+        double y1 = initPoint.getY();
+        double x2 = endPoint.getX();
+        double y2 = endPoint.getY();
+
+        for (int t = 1; t < PROJECTION_LIMIT; t += 10) {
+            x = (x2 - x1) * t + x1;
+            y = (y2 - y1) * t + y1;
+
+            DisposableIterator it = boundaryObjects.fastIterator();
+            while (it.hasNext()) {
+                Feature feature = (Feature) it.next();
+                Geometry geometry = feature.getDefaultGeometry();
+                Point projectedPoint = geoManager.createPoint(x, y, subtype);
+
+                if (!geometry.contains(projectedPoint)) {
+                    Curve tmpLine = geoManager.createLine(subtype);
+                    tmpLine.setPoints(initPoint, projectedPoint);
+
+                    if (tmpLine.intersects(geometry)) {
+
+                        Geometry intersecionGeometry =
+                            geometry.intersection(tmpLine);
+
+                        if (intersecionGeometry instanceof Point) {
+
+                            double distance =
+                                ((Point) intersecionGeometry)
+                                    .distance(initPoint);
+
+                            if (distance < minDistance && distance > (module + 0.01)) {
+                                intersectionPoint = (Point) intersecionGeometry;
+                                minDistance = distance;
+                            }
+
+                        } else if (intersecionGeometry instanceof MultiPoint) {
+
+                            MultiPoint intersectionMultiPoint =
+                                (MultiPoint) intersecionGeometry;
+
+                            for (int i = 0; i < intersectionMultiPoint
+                                .getPrimitivesNumber(); i++) {
+
+                                double distance =
+                                    intersectionMultiPoint.getPointAt(i)
+                                        .distance(initPoint);
+
+                                if (distance < minDistance && distance > (module + 0.01)) {
+                                    intersectionPoint =
+                                        intersectionMultiPoint.getPointAt(i);
+                                    minDistance = distance;
+                                }
+                            }
+                        } else if (intersecionGeometry instanceof Curve) {
+
+                            Curve intersectionCurve =
+                                (Curve) intersecionGeometry;
+
+                            for (int i = 0; i < intersectionCurve
+                                .getNumVertices(); i++) {
+
+                                double distance =
+                                    intersectionCurve.getVertex(i).distance(
+                                        endPoint);
+
+                                if (distance < minDistance && distance > (module + 0.01)) {
+                                    intersectionPoint =
+                                        intersectionCurve.getVertex(i);
+                                    minDistance = distance;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            it.dispose();
+            if (intersectionPoint != null) {
+                break;
+            }
+        }
+        return intersectionPoint;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/operation/CurveExtendLineOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/operation/CurveExtendLineOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/operation/CurveExtendLineOperation.java	(revision 1663)
@@ -0,0 +1,84 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.extendline.operation;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+
+/**
+ * @author llmarques
+ *
+ */
+public class CurveExtendLineOperation implements ExtendLineOperation {
+
+    public Curve extendLine(Curve lineToExtend, Point insertedPoint,
+        FeatureSelection boundaryObjects)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, DataException, CreateGeometryException {
+
+        GeometryManager geoManager = GeometryLocator.getGeometryManager();
+        int subtype = lineToExtend.getGeometryType().getSubType();
+        Curve extendedLine = geoManager.createLine(subtype);
+
+        Point startVertex = lineToExtend.getVertex(0);
+        Point endVertex =
+            lineToExtend.getVertex(lineToExtend.getNumVertices() - 1);
+
+        Point startIntersectionPoint = null;
+        Point endIntersectionPoint = null;
+        if (insertedPoint.distance(startVertex) < insertedPoint
+            .distance(endVertex)) {
+            startIntersectionPoint =
+                ExtendLineOperationUtils.curveIntersection(lineToExtend,
+                    ExtendLineOperationUtils.START_SIDE, boundaryObjects);
+
+        } else {
+            endIntersectionPoint =
+                ExtendLineOperationUtils.curveIntersection(lineToExtend,
+                    ExtendLineOperationUtils.END_SIDE, boundaryObjects);
+        }
+
+        if (startIntersectionPoint != null) {
+            extendedLine.addVertex(startIntersectionPoint);
+        }
+
+        for (int i = 0; i < lineToExtend.getNumVertices(); i++) {
+            extendedLine.addVertex(lineToExtend.getVertex(i));
+        }
+
+        if (endIntersectionPoint != null) {
+            extendedLine.addVertex(endIntersectionPoint);
+        }
+
+        return extendedLine;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/operation/ArcExtendLineOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/operation/ArcExtendLineOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/operation/ArcExtendLineOperation.java	(revision 1663)
@@ -0,0 +1,92 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.extendline.operation;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.geom.Geometry.TYPES;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+
+/**
+ * @author llmarques
+ *
+ */
+public class ArcExtendLineOperation implements ExtendLineOperation {
+
+    public Curve extendLine(Curve lineToExtend, Point insertedPoint,
+        FeatureSelection boundaryObjects)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, DataException, CreateGeometryException {
+
+        Arc arcToBeExtend = (Arc) lineToExtend;
+
+        GeometryManager geoManager = GeometryLocator.getGeometryManager();
+        int subtype = lineToExtend.getGeometryType().getSubType();
+        Arc extendedArc = (Arc) geoManager.create(TYPES.ARC, subtype);
+
+        Point startVertex = arcToBeExtend.getInitPoint();
+        Point endVertex = arcToBeExtend.getEndPoint();
+
+        Point startIntersectionPoint = null;
+        Point endIntersectionPoint = null;
+
+        if (insertedPoint.distance(startVertex) < insertedPoint
+            .distance(endVertex)) {
+            startIntersectionPoint =
+                ExtendLineOperationUtils.arcIntersection(arcToBeExtend,
+                    ExtendLineOperationUtils.START_SIDE, boundaryObjects);
+
+        } else {
+            endIntersectionPoint =
+                ExtendLineOperationUtils.arcIntersection(arcToBeExtend,
+                    ExtendLineOperationUtils.END_SIDE, boundaryObjects);
+        }
+
+        if (startIntersectionPoint == null) {
+            startIntersectionPoint = arcToBeExtend.getInitPoint();
+        }
+
+        if (endIntersectionPoint == null) {
+            endIntersectionPoint = arcToBeExtend.getEndPoint();
+        }
+
+        Point center = arcToBeExtend.getCenterPoint();
+        double radius = center.distance(arcToBeExtend.getInitPoint());
+        double startAngle =
+            ExtendLineOperationUtils.getAngle(center, startIntersectionPoint);
+        double endAngle =
+            ExtendLineOperationUtils.getAngle(center, endIntersectionPoint);
+
+        extendedArc.setPointsStartEnd(center, radius, startAngle, endAngle);
+        return extendedArc;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/ExtendLineEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/ExtendLineEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/ExtendLineEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,88 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.extendline;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author llmarques
+ *
+ */
+public class ExtendLineEditingProviderFactory extends AbstractProviderFactory
+    implements EditingProviderFactory {
+
+    public static final String PROVIDER_NAME = "modify-extend-line";
+
+    private final static String PROVIDER_DESCRIPTION =
+        "Extends lines to selected objects";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, PROVIDER_DESCRIPTION,
+                false, null, new int[] { 
+                    Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                    Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE 
+                });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new ExtendLineEditingProvider(services, parameters);
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/ExtendLineEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/ExtendLineEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/java/org/gvsig/vectorediting/lib/prov/extendline/ExtendLineEditingLibrary.java	(revision 1663)
@@ -0,0 +1,82 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.extendline;
+
+import org.gvsig.fmap.geom.Geometry.TYPES;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.prov.extendline.operation.ArcExtendLineOperation;
+import org.gvsig.vectorediting.lib.prov.extendline.operation.CurveExtendLineOperation;
+import org.gvsig.vectorediting.lib.prov.extendline.operation.ExtendLineOperationUtils;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * @author llmarques
+ *
+ */
+public class ExtendLineEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new ExtendLineEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "modify-extend-line", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        ExtendLineOperationUtils.register(new ArcExtendLineOperation(),
+            TYPES.ARC);
+        ExtendLineOperationUtils.register(new CurveExtendLineOperation(),
+            TYPES.SPLINE);
+        ExtendLineOperationUtils.register(new CurveExtendLineOperation(),
+            TYPES.LINE);
+        ExtendLineOperationUtils.register(new CurveExtendLineOperation(),
+            TYPES.CURVE);
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "modidy-extend-line");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.extendline.ExtendLineEditingLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/resources/images/vectorediting-tools/modify-extend-line.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/src/main/resources/images/vectorediting-tools/modify-extend-line.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.extendline</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.extendline</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.extendline
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join/src/main/resources/images/vectorediting-tools/modify-join.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join/src/main/resources/images/vectorediting-tools/modify-join.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.join.JoinEditingLibrary
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join/src/main/java/org/gvsig/vectorediting/lib/prov/join/JoinEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join/src/main/java/org/gvsig/vectorediting/lib/prov/join/JoinEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join/src/main/java/org/gvsig/vectorediting/lib/prov/join/JoinEditingProvider.java	(revision 1663)
@@ -0,0 +1,337 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.join;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.dispose.DisposeUtils;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.tools.visitor.VisitCanceledException;
+import org.gvsig.tools.visitor.Visitor;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author llmarques
+ *
+ */
+public class JoinEditingProvider extends AbstractEditingProvider implements
+    EditingProvider {
+
+    private EditingServiceParameter selectionParameter;
+
+    private FeatureStore featureStore;
+
+    private FeatureSelection featureSelection;
+
+    /**
+     * Default constructor.
+     *
+     * @param providerServices
+     *            available services for this provider
+     * @param parameters
+     *            of this provider
+     */
+    public JoinEditingProvider(DynObject parameters, ProviderServices services) {
+        super(services);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.selectionParameter =
+            new DefaultEditingServiceParameter("selection", "selection",
+                TYPE.SELECTION);
+    }
+
+    public EditingServiceParameter next() {
+        if (featureSelection == null) {
+            return selectionParameter;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        return null;
+    }
+
+    public void stop() throws StopServiceException {
+        DisposeUtils.disposeQuietly(featureSelection);
+        featureSelection = null;
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(selectionParameter);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter parameter,
+        Object value) throws InvalidEntryException {
+
+        if (parameter == selectionParameter) {
+
+            if (value instanceof FeatureSelection) {
+                FeatureSelection fSelection = (FeatureSelection) value;
+
+                if (fSelection.getSelectedCount() > 1) {
+
+                    DisposableIterator it = null;
+
+                    try {
+                        it = fSelection.fastIterator();
+
+                        Feature feature = (Feature) it.next();
+                        // Gets geometry type of first selected feature
+                        GeometryType geometryType =
+                            feature.getDefaultGeometry().getGeometryType();
+
+                        // Iterate over remaining selected features
+                        while (it.hasNext()) {
+                            feature = (Feature) it.next();
+
+                            // Remaining selected features must be the same or
+                            // the equivalent multigeometry type of first
+                            // feature. If one of reamining geometries is
+                            // different, selection is not valid.
+                            if (geometryType.isTypeOf(CURVE)
+                                || geometryType.isTypeOf(MULTICURVE)) {
+
+                                GeometryType featureGeoType =
+                                    feature.getDefaultGeometry()
+                                        .getGeometryType();
+
+                                if (!(featureGeoType.isTypeOf(CURVE) || featureGeoType
+                                    .isTypeOf(MULTICURVE))) {
+                                    throw new InvalidEntryException(null);
+                                }
+
+                            } else if (geometryType.isTypeOf(SURFACE)
+                                || geometryType.isTypeOf(SURFACE)) {
+
+                                GeometryType featureGeoType =
+                                    feature.getDefaultGeometry()
+                                        .getGeometryType();
+
+                                if (!(featureGeoType.isTypeOf(SURFACE) || featureGeoType
+                                    .isTypeOf(MULTISURFACE))) {
+                                    throw new InvalidEntryException(null);
+                                }
+                            }
+                        }
+                        DisposeUtils.disposeQuietly(featureSelection);
+                        ToolsLocator.getDisposableManager().bind(fSelection);
+                        featureSelection = fSelection;
+                        return;
+                    } catch (DataException e) {
+                        throw new InvalidEntryException(e);
+                    } finally {
+                        it.dispose();
+                    }
+                }
+            }
+        }
+        throw new InvalidEntryException(null);
+    }
+
+    public Geometry finish() throws FinishServiceException {
+
+        if (featureSelection != null) {
+            DisposableIterator it = null;
+            Geometry joinedGeometry;
+
+            try {
+                it = featureSelection.fastIterator();
+                Feature feature = (Feature) it.next();
+                joinedGeometry = feature.getDefaultGeometry();
+
+                while (it.hasNext()) {
+
+                    Feature tmpFeature = (Feature) it.next();
+                    joinedGeometry =
+                        joinedGeometry.union(tmpFeature.getDefaultGeometry());
+                }
+
+            } catch (BaseException e) {
+                throw new FinishServiceException(e);
+            } finally {
+                it.dispose();
+            }
+
+            return joinedGeometry;
+        }
+        return null;
+    }
+
+    @SuppressWarnings("rawtypes")
+    public void finishAndStore() throws FinishServiceException {
+        Geometry geometry = finish();
+
+        final EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        FeatureType featureType = null;
+        EditableFeature eFeature = null;
+
+        try {
+            eFeature = featureStore.createNewFeature();
+            featureType = featureStore.getDefaultFeatureType();
+        } catch (DataException e) {
+            throw new FinishServiceException(e);
+        }
+
+        Iterator typeIterator = featureType.iterator();
+        // Iterate over feature type
+        while (typeIterator.hasNext()) {
+            boolean insertValue = true;
+            FeatureAttributeDescriptor attribute =
+                (FeatureAttributeDescriptor) typeIterator.next();
+
+            // If type is a primary key do nothing
+            if (!attribute.isPrimaryKey()) {
+
+                // int type = attribute.getType();
+
+                DisposableIterator featureIterator = null;
+                try {
+                    featureIterator = featureSelection.fastIterator();
+                    Feature feature = (Feature) featureIterator.next();
+
+                    // Restart iterator and initilize it at second position
+                    featureIterator.dispose();
+                    featureIterator = featureSelection.fastIterator(1);
+
+                    // Gets the type value of first feature
+                    Object value = feature.get(attribute.getName());
+
+                    // Compare first value with the rest of features. If values
+                    // are different, break bucle and don't insert value at new
+                    // feature.
+                    if (value != null) {
+
+                        while (featureIterator.hasNext()) {
+                            Feature nextFeature =
+                                (Feature) featureIterator.next();
+                            Object nextValue =
+                                nextFeature.get(attribute.getName());
+
+                            if (nextValue == null || !value.equals(nextValue)) {
+                                insertValue = false;
+                                break;
+                            }
+                        }
+
+                        if (insertValue) {
+                            eFeature.set(attribute.getName(), value);
+                        }
+                    }
+                } catch (DataException e) {
+                    throw new FinishServiceException(e);
+                } finally {
+                    featureIterator.dispose();
+                }
+            }
+        }
+
+        // Inserts new feature
+        eFeature.setDefaultGeometry(geometry);
+        editingProviderServices.insertFeatureIntoFeatureStore(eFeature,
+            featureStore);
+
+        // Deletes selected features
+        try {
+            featureSelection.accept(new Visitor() {
+
+                public void visit(Object obj) throws VisitCanceledException,
+                    BaseException {
+                    Feature feature = (Feature) obj;
+                    editingProviderServices.deleteFeatureFromFeatureStore(
+                        feature, featureStore);
+                }
+            });
+            featureStore.getFeatureSelection().deselectAll();
+        } catch (BaseException e) {
+            throw new FinishServiceException(e);
+        }
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        FeatureSelection selected = null;
+        if (featureStore != null) {
+            try {
+                selected = featureStore.getFeatureSelection();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            }
+            if (selected.getSelectedCount() > 1) {
+                try {
+                    setValue(selected);
+                } catch (InvalidEntryException e) {
+                    throw new InvalidEntryException(e);
+                }
+            }
+        }
+    }
+
+    public String getName() {
+        return JoinEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join/src/main/java/org/gvsig/vectorediting/lib/prov/join/JoinEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join/src/main/java/org/gvsig/vectorediting/lib/prov/join/JoinEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join/src/main/java/org/gvsig/vectorediting/lib/prov/join/JoinEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,88 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.join;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author llmarques
+ *
+ */
+public class JoinEditingProviderFactory extends AbstractProviderFactory
+    implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "modify-join";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Joins geometries into one multigeometries";
+
+    public void initialize() {
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", false, null,
+                new int[] { Geometry.TYPES.MULTIPOINT,
+                    Geometry.TYPES.MULTILINE, Geometry.TYPES.MULTIPOLYGON, 
+                    Geometry.TYPES.MULTICURVE, Geometry.TYPES.MULTISURFACE });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new JoinEditingProvider(parameters, services);
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join/src/main/java/org/gvsig/vectorediting/lib/prov/join/JoinEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join/src/main/java/org/gvsig/vectorediting/lib/prov/join/JoinEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join/src/main/java/org/gvsig/vectorediting/lib/prov/join/JoinEditingLibrary.java	(revision 1663)
@@ -0,0 +1,65 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.join;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.Library;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+
+/**
+ * @author llmarques
+ *
+ */
+public class JoinEditingLibrary extends AbstractLibrary implements Library {
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new JoinEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "modify-join", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "modify-join-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.join</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.join</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.explode/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.explode/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.explode/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.explode.ExplodeEditingLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.explode/src/main/resources/images/vectorediting-tools/modify-explode-geometry.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.explode/src/main/resources/images/vectorediting-tools/modify-explode-geometry.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.explode/src/main/java/org/gvsig/vectorediting/lib/prov/explode/ExplodeEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.explode/src/main/java/org/gvsig/vectorediting/lib/prov/explode/ExplodeEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.explode/src/main/java/org/gvsig/vectorediting/lib/prov/explode/ExplodeEditingProvider.java	(revision 1663)
@@ -0,0 +1,281 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.explode;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.aggregate.MultiPoint;
+import org.gvsig.fmap.geom.aggregate.MultiPrimitive;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.geom.primitive.Surface;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.tools.visitor.VisitCanceledException;
+import org.gvsig.tools.visitor.Visitor;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author llmarques
+ *
+ */
+public class ExplodeEditingProvider extends AbstractEditingProvider implements
+    EditingProvider {
+
+    private EditingServiceParameter selectionParameter;
+
+    private FeatureStore featureStore;
+
+    private FeatureSelection value;
+
+    /**
+     * Default constructor.
+     *
+     * @param providerServices
+     *            available services for this provider
+     * @param parameters
+     * @param parameters
+     *            of this provider
+     */
+    public ExplodeEditingProvider(ProviderServices providerServices,
+        DynObject parameters) {
+        super(providerServices);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.selectionParameter =
+            new DefaultEditingServiceParameter("selection", "selection",
+                TYPE.SELECTION);
+    }
+
+    public EditingServiceParameter next() {
+        if (value == null) {
+            return selectionParameter;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        return null;
+    }
+
+    public void stop() throws StopServiceException {
+        value = null;
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(selectionParameter);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter parameter,
+        Object object) throws InvalidEntryException {
+
+        if (parameter == selectionParameter) {
+
+            if (object instanceof FeatureSelection) {
+
+                final FeatureSelection selection = (FeatureSelection) object;
+
+                try {
+
+                    selection.accept(new Visitor() {
+
+                        public void visit(Object obj)
+                            throws VisitCanceledException, BaseException {
+                            Feature feature = (Feature) obj;
+                            Geometry defaultGeometry =
+                                feature.getDefaultGeometry();
+
+                            if (defaultGeometry instanceof MultiPrimitive) {
+
+                                MultiPrimitive multiPrimitive =
+                                    (MultiPrimitive) defaultGeometry;
+                                if (multiPrimitive.getPrimitivesNumber() > 1) {
+                                    value = selection;
+                                    return;
+                                }
+                            }
+
+                            throw new InvalidEntryException(null);
+                        }
+                    });
+
+                } catch (BaseException e) {
+                    throw new InvalidEntryException(e);
+                }
+            }
+        }
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+        if (value != null) {
+
+            try {
+                final EditingProviderServices editingProviderServices =
+                    (EditingProviderServices) getProviderServices();
+
+                value.accept(new Visitor() {
+
+                    public void visit(Object obj)
+                        throws VisitCanceledException, BaseException {
+
+                        Feature feature = (Feature) obj;
+                        MultiPrimitive defaultGeometry =
+                            (MultiPrimitive) feature.getDefaultGeometry();
+                        GeometryType geomType = defaultGeometry.getGeometryType();
+
+                        for (int i = 0; i < defaultGeometry
+                            .getPrimitivesNumber(); i++) {
+
+                            Primitive primitive =
+                                defaultGeometry.getPrimitiveAt(i);
+
+                            GeometryManager geometryManager =
+                                GeometryLocator.getGeometryManager();
+
+                            int subtype =
+                                editingProviderServices
+                                    .getSubType(featureStore);
+
+                            Geometry geometry = null;
+
+                            if (geomType.isTypeOf(MULTIPOINT)) {
+
+                                MultiPoint multiPoint =
+                                    geometryManager.createMultiPoint(subtype);
+                                multiPoint.addPoint((Point) primitive);
+
+                                geometry = multiPoint;
+
+                            } else if (geomType.isTypeOf(MULTICURVE)) {
+
+                                MultiCurve multiCurve =
+                                    geometryManager.createMultiCurve(subtype);
+                                multiCurve.addCurve((Curve) primitive);
+
+                                geometry = multiCurve;
+
+                            } else if (geomType.isTypeOf(MULTISURFACE)) {
+
+                                MultiSurface multiSurface =
+                                    geometryManager.createMultiSurface(subtype);
+                                multiSurface.addSurface((Surface) primitive);
+
+                                geometry = multiSurface;
+                            } 
+
+                            if (geometry != null) {
+                                EditableFeature newFeature =
+                                    editingProviderServices
+                                        .getFeatureCopyWithoutPK(featureStore,
+                                            feature);
+
+                                newFeature.setDefaultGeometry(geometry);
+
+                                editingProviderServices
+                                    .insertFeatureIntoFeatureStore(newFeature,
+                                        featureStore);
+
+                            }
+                        }
+                        
+                        editingProviderServices
+                        .deleteFeatureFromFeatureStore(feature,
+                            featureStore);
+                    }
+                });
+               
+                featureStore.getFeatureSelection().deselectAll();
+                value.dispose();
+
+            } catch (BaseException e) {
+                throw new FinishServiceException(e);
+            }
+        }
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        this.value = null;
+        FeatureSelection selected = null;
+        if (featureStore != null) {
+            try {
+                selected = featureStore.getFeatureSelection();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            }
+            try {
+                setValue(selected);
+            } catch (InvalidEntryException e) {
+                throw new InvalidEntryException(e);
+            }
+        }
+    }
+
+    public String getName() {
+        return ExplodeEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.explode/src/main/java/org/gvsig/vectorediting/lib/prov/explode/ExplodeEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.explode/src/main/java/org/gvsig/vectorediting/lib/prov/explode/ExplodeEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.explode/src/main/java/org/gvsig/vectorediting/lib/prov/explode/ExplodeEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,88 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.explode;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author llmarques
+ *
+ */
+public class ExplodeEditingProviderFactory extends AbstractProviderFactory
+    implements EditingProviderFactory {
+
+    public static final String PROVIDER_NAME = "modify-explode-geometry";
+
+    private final static String PROVIDER_DESCRIPTION =
+        "Explodes aggregate geometry in single geometries";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", false, null,
+                new int[] { Geometry.TYPES.MULTIPOINT,
+                    Geometry.TYPES.MULTILINE, Geometry.TYPES.MULTIPOLYGON, 
+                    Geometry.TYPES.MULTICURVE, Geometry.TYPES.MULTISURFACE
+                });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new ExplodeEditingProvider(services, parameters);
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.explode/src/main/java/org/gvsig/vectorediting/lib/prov/explode/ExplodeEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.explode/src/main/java/org/gvsig/vectorediting/lib/prov/explode/ExplodeEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.explode/src/main/java/org/gvsig/vectorediting/lib/prov/explode/ExplodeEditingLibrary.java	(revision 1663)
@@ -0,0 +1,69 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.explode;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * 
+ * @author llmarques
+ *
+ */
+public class ExplodeEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new ExplodeEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "modify-explode-geometry",
+            this.getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "modidy-explode-geometry");
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.explode/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.explode/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.explode/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.explode</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.explode</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.explode
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polarmatrix/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polarmatrix/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polarmatrix/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.polarmatrix.PolarMatrixEditingLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polarmatrix/src/main/resources/images/vectorediting-tools/insert-polar-matrix.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polarmatrix/src/main/resources/images/vectorediting-tools/insert-polar-matrix.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polarmatrix/src/main/java/org/gvsig/vectorediting/lib/prov/polarmatrix/PolarMatrixEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polarmatrix/src/main/java/org/gvsig/vectorediting/lib/prov/polarmatrix/PolarMatrixEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polarmatrix/src/main/java/org/gvsig/vectorediting/lib/prov/polarmatrix/PolarMatrixEditingLibrary.java	(revision 1663)
@@ -0,0 +1,72 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.polarmatrix;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.Library;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * @author llmarques
+ *
+ */
+public class PolarMatrixEditingLibrary extends AbstractLibrary implements
+    Library {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new PolarMatrixEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "insert-polar-matrix", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "insert-polar-matrix-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polarmatrix/src/main/java/org/gvsig/vectorediting/lib/prov/polarmatrix/PolarMatrixEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polarmatrix/src/main/java/org/gvsig/vectorediting/lib/prov/polarmatrix/PolarMatrixEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polarmatrix/src/main/java/org/gvsig/vectorediting/lib/prov/polarmatrix/PolarMatrixEditingProvider.java	(revision 1663)
@@ -0,0 +1,563 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.polarmatrix;
+
+import java.awt.geom.AffineTransform;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.Aggregate;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.aggregate.MultiPoint;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Surface;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.symbology.SymbologyLocator;
+import org.gvsig.symbology.SymbologyManager;
+import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.ISimpleTextSymbol;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.tools.visitor.VisitCanceledException;
+import org.gvsig.tools.visitor.Visitor;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author llmarques
+ *
+ */
+public class PolarMatrixEditingProvider extends AbstractEditingProvider
+    implements EditingProvider {
+
+    private FeatureStore featureStore;
+
+    private Map<EditingServiceParameter, Object> values;
+
+    private EditingServiceParameter selection;
+
+    private EditingServiceParameter elementsNumber;
+
+    private EditingServiceParameter centerPoint;
+
+    private EditingServiceParameter elementAngle;
+
+    private EditingServiceParameter rotateElements;
+
+    /**
+     * Default constructor.
+     *
+     * @param providerServices
+     *            available services for this provider
+     * @param parameters
+     *            of this provider
+     */
+    public PolarMatrixEditingProvider(DynObject parameters,
+        ProviderServices services) {
+        super(services);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.selection =
+            new DefaultEditingServiceParameter("selection", "selection",
+                EditingServiceParameter.TYPE.SELECTION);
+
+        this.elementsNumber =
+            new DefaultEditingServiceParameter("number_of_total_elements",
+                "number_of_total_elements", EditingServiceParameter.TYPE.VALUE);
+
+        I18nManager i18nManager = ToolsLocator.getI18nManager();
+        Map<String, String> options = new LinkedHashMap<String, String>();
+        options.put(i18nManager.getTranslation("key_yes"), "yes");
+        options.put(i18nManager.getTranslation("key_no"), "no");
+
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        this.rotateElements =
+            new DefaultEditingServiceParameter("rotate_elements",
+                editingProviderServices.makeConsoleMessage("rotate_elements",
+                    options), options, EditingServiceParameter.TYPE.OPTION);
+
+        this.centerPoint =
+            new DefaultEditingServiceParameter("center", "center",
+                EditingServiceParameter.TYPE.POSITION);
+
+        this.elementAngle =
+            new DefaultEditingServiceParameter("angle_between_elements",
+                "angle_between_elements", EditingServiceParameter.TYPE.VALUE,
+                EditingServiceParameter.TYPE.POSITION);
+    }
+
+    public EditingServiceParameter next() {
+        if (values.get(selection) == null) {
+            return selection;
+        } else if (values.get(elementsNumber) == null) {
+            return elementsNumber;
+        } else if (values.get(rotateElements) == null) {
+            return rotateElements;
+        } else if (values.get(centerPoint) == null) {
+            return centerPoint;
+        } else if (values.get(elementAngle) == null) {
+            return elementAngle;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+
+        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
+        DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        FeatureSelection featureSelection =
+            (FeatureSelection) values.get(selection);
+        Integer elementsNumberValue = (Integer) values.get(elementsNumber);
+        Boolean rotateElementsValue = (Boolean) values.get(rotateElements);
+        Point centerPointValue = (Point) values.get(centerPoint);
+
+        if (featureSelection != null && elementsNumberValue != null
+            && rotateElementsValue != null && centerPointValue != null) {
+
+            Double angle = (Double) values.get(elementAngle);
+            if (angle == null) {
+                try {
+                    angle =
+                        editingProviderServices.getAngle(centerPointValue,
+                            mousePosition);
+                } catch (BaseException e) {
+                    throw new DrawServiceException(e);
+                }
+            }
+
+            // Creation of symbology
+            EditingProviderManager editingProviderManager =
+                EditingProviderLocator.getProviderManager();
+            ISymbol auxiliaryPointSymbolEditing =
+                editingProviderManager
+                    .getSymbol("auxiliary-point-symbol-editing");
+            ISymbol ruleAxisSymbol =
+                editingProviderManager.getSymbol("rule-axis-symbol");
+            ISymbol auxiliaryLineSymbolEditing =
+                editingProviderManager
+                    .getSymbol("auxiliary-line-symbol-editing");
+
+            try {
+
+                drawingStatus.addStatus(centerPointValue,
+                    auxiliaryPointSymbolEditing, "");
+
+                // Grade indicator creation
+                int subtype = centerPointValue.getGeometryType().getSubType();
+                double textDistance =
+                    3 * centerPointValue.distance(mousePosition) / 4;
+                Geometry pointText =
+                    geometryManager.createPoint(
+                        centerPointValue.getX() + textDistance
+                            * Math.cos(angle / 2),
+                        centerPointValue.getY() + textDistance
+                            * Math.sin(angle / 2), subtype);
+                drawingStatus.addStatus(pointText, getTextSymbol(),
+                    degToDms(Math.toDegrees(angle)));
+
+                // Horizontal line of angle indicator creation
+                Line horizontalLine = geometryManager.createLine(subtype);
+                horizontalLine.setPoints(centerPointValue, geometryManager
+                    .createPoint(
+                        centerPointValue.getX()
+                            + centerPointValue.distance(mousePosition),
+                        centerPointValue.getY(), subtype));
+                drawingStatus.addStatus(horizontalLine, ruleAxisSymbol, "");
+
+                // Vertical line of angle indicator creation
+                Line verticalLine = geometryManager.createLine(subtype);
+                verticalLine.setPoints(centerPointValue, mousePosition);
+                drawingStatus.addStatus(verticalLine, ruleAxisSymbol, "");
+
+                // Arc angle indicator creation
+                Double ext = (2 * Math.PI) - angle;
+                Arc arc =
+                    editingProviderServices.createArc(centerPointValue,
+                        centerPointValue.distance(mousePosition) / 2, 0, ext,
+                        subtype);
+                drawingStatus.addStatus(arc, auxiliaryLineSymbolEditing, "");
+
+            } catch (BaseException e) {
+                throw new DrawServiceException(e);
+            }
+
+            DisposableIterator it = null;
+            try {
+                it = featureSelection.fastIterator();
+                while (it.hasNext()) {
+                    Feature feature = (Feature) it.next();
+                    Geometry geometry = feature.getDefaultGeometry();
+                    Geometry[] matrix =
+                        createPolarMatrix(geometry, elementsNumberValue,
+                            rotateElementsValue, centerPointValue, angle);
+
+                    for (int i = 0; i < matrix.length; i++) {
+
+                        ISymbol symbol = getSymbol(matrix[i]);
+
+                        if (matrix[i] instanceof Aggregate) {
+                            int primitivesNumber =
+                                ((Aggregate) matrix[i]).getPrimitivesNumber();
+                            for (int j = 0; j < primitivesNumber; j++) {
+                                drawingStatus.addStatus(
+                                    ((Aggregate) matrix[i]).getPrimitiveAt(j),
+                                    symbol, "");
+                            }
+                        } else {
+                            drawingStatus.addStatus(matrix[i], symbol, "");
+                        }
+                    }
+                }
+            } catch (BaseException e) {
+                throw new DrawServiceException(e);
+            } finally {
+                it.dispose();
+            }
+        }
+        return drawingStatus;
+    }
+
+    private ISymbol getSymbol(Geometry geometry) {
+
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol auxiliaryPointSymbolEditing =
+            editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+        ISymbol lineSymbolEditing =
+            editingProviderManager.getSymbol("line-symbol-editing");
+        ISymbol polygonSymbolEditing =
+            editingProviderManager.getSymbol("polygon-symbol-editing");
+
+        if (geometry instanceof Curve || geometry instanceof MultiCurve) {
+            return lineSymbolEditing;
+        } else if (geometry instanceof Surface
+            || geometry instanceof MultiSurface) {
+            return polygonSymbolEditing;
+        } else if (geometry instanceof Point || geometry instanceof MultiPoint) {
+            return auxiliaryPointSymbolEditing;
+        }
+        return null;
+    }
+
+    private ISimpleTextSymbol getTextSymbol() {
+        SymbologyManager symbologyManager =
+            SymbologyLocator.getSymbologyManager();
+        ISimpleTextSymbol textSymbol =
+            symbologyManager.createSimpleTextSymbol();
+        textSymbol.setFontSize(10);
+        return textSymbol;
+    }
+
+    private String degToDms(double deg) {
+        int d = (int) Math.floor(deg);
+        double minfloat = (deg - d) * 60;
+        int m = (int) Math.floor(minfloat);
+        double secfloat = (minfloat - m) * 60;
+        int s = (int) Math.round(secfloat);
+        // After rounding, the seconds might become 60. These two
+        // if-tests are not necessary if no rounding is done.
+        if (s == 60) {
+            m++;
+            s = 0;
+        }
+        if (m == 60) {
+            d++;
+            m = 0;
+        }
+        return ("" + d + "\u00B0" + m + "\u2032" + s + "\u2033");
+    }
+
+    private Geometry[] createPolarMatrix(Geometry geometry,
+        Integer elementsNumberValue, Boolean rotateElementsValue,
+        Point centerPointValue, Double angle)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException, CreateGeometryException {
+
+        Geometry[] geometryMatrix = new Geometry[elementsNumberValue];
+
+        for (int i = 0; i < elementsNumberValue; i++) {
+
+            AffineTransform at = new AffineTransform();
+            if (rotateElementsValue) {
+                at = getRotateAffineTransform(centerPointValue, angle * i);
+            } else {
+                at = getRotateAffineTransform(centerPointValue, angle * i);
+                
+                double centerX = geometry.getEnvelope().getCenter(0);
+                double centerY = geometry.getEnvelope().getCenter(1);
+                GeometryManager geometryManager =
+                    GeometryLocator.getGeometryManager();
+                Point geometryCenter =
+                    geometryManager.createPoint(centerX, centerY, GEOM2D);
+                
+                Point geometryCenterCloned = (Point) geometryCenter.cloneGeometry();
+                geometryCenterCloned.transform(at);
+                at = getMoveAffineTransform(geometryCenter, geometryCenterCloned);
+            }
+
+            Geometry clonedGeometry = geometry.cloneGeometry();
+            clonedGeometry.transform(at);
+            geometryMatrix[i] = clonedGeometry;
+        }
+
+        return geometryMatrix;
+    }
+
+    public void stop() throws StopServiceException {
+        values.clear();
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(selection);
+        parameters.add(rotateElements);
+        parameters.add(centerPoint);
+        parameters.add(elementAngle);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter parameter,
+        Object value) throws InvalidEntryException {
+
+        boolean insertedValue = false;
+
+        if (parameter.equals(selection) && value instanceof FeatureSelection) {
+            FeatureSelection featureSelection = (FeatureSelection) value;
+
+            if (featureSelection.getSelectedCount() > 0) {
+                values.put(parameter, featureSelection);
+                insertedValue = true;
+            }
+
+        } else if (parameter.equals(elementsNumber) && value instanceof Double) {
+
+            if (value instanceof Double) {
+                Double number = (Double) value;
+                values.put(parameter, number.intValue());
+                insertedValue = true;
+            }
+
+        } else if (parameter.equals(rotateElements) && value instanceof String) {
+
+            String option = (String) value;
+            I18nManager i18nManager = ToolsLocator.getI18nManager();
+            if (option.equalsIgnoreCase(i18nManager.getTranslation("key_yes"))) {
+                values.put(rotateElements, true);
+                insertedValue = true;
+            } else if (option.equalsIgnoreCase(i18nManager
+                .getTranslation("key_no"))) {
+                values.put(rotateElements, false);
+                insertedValue = true;
+            }
+
+        } else if (parameter.equals(centerPoint) && value instanceof Point) {
+
+            values.put(centerPoint, value);
+            insertedValue = true;
+
+        } else if (parameter.equals(elementAngle)) {
+
+            if (value instanceof Double) {
+
+                values.put(elementAngle, Math.toRadians((Double) value));
+                insertedValue = true;
+
+            } else if (value instanceof Point) {
+                EditingProviderServices editingProviderServices =
+                    (EditingProviderServices) getProviderServices();
+                Point centerPointValue = (Point) values.get(centerPoint);
+                Point valuePoint = (Point) value;
+                try {
+                    double angle =
+                        editingProviderServices.getAngle(centerPointValue,
+                            valuePoint);
+                    values.put(elementAngle, angle);
+                    insertedValue = true;
+                } catch (BaseException e) {
+                    throw new InvalidEntryException(e);
+                }
+            }
+        }
+
+        if (!insertedValue) {
+            throw new InvalidEntryException(null);
+        }
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+
+        final EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        FeatureSelection featureSelection =
+            (FeatureSelection) values.get(selection);
+        final Integer elementsNumberValue =
+            (Integer) values.get(elementsNumber);
+        final Boolean rotateElementsValue =
+            (Boolean) values.get(rotateElements);
+        final Point centerPointValue = (Point) values.get(centerPoint);
+        final Double elementAngleValue = (Double) values.get(elementAngle);
+
+        if (featureSelection != null && elementsNumberValue != null
+            && rotateElementsValue != null && centerPointValue != null
+            && elementAngleValue != null) {
+
+            try {
+                featureSelection.accept(new Visitor() {
+
+                    public void visit(Object obj)
+                        throws VisitCanceledException, BaseException {
+
+                        Feature feature = (Feature) obj;
+                        Geometry geometry = feature.getDefaultGeometry();
+                        Geometry[] matrix =
+                            createPolarMatrix(geometry, elementsNumberValue,
+                                rotateElementsValue, centerPointValue,
+                                elementAngleValue);
+
+                        for (int i = 0; i < matrix.length; i++) {
+                            EditableFeature eFeature =
+                                editingProviderServices
+                                    .getFeatureCopyWithoutPK(featureStore,
+                                        feature);
+                            eFeature.setDefaultGeometry(matrix[i]);
+                            editingProviderServices
+                                .insertFeatureIntoFeatureStore(eFeature,
+                                    featureStore);
+                        }
+                    }
+                });
+            } catch (BaseException e) {
+                throw new FinishServiceException(e);
+            }
+        }
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        values = new HashMap<EditingServiceParameter, Object>();
+        FeatureSelection selected = null;
+        if (featureStore != null && values.get(selection) == null) {
+            try {
+                selected = featureStore.getFeatureSelection();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            }
+            if (selected.getSelectedCount() > 0) {
+                try {
+                    setValue(selected);
+                } catch (InvalidEntryException e) {
+                    throw new InvalidEntryException(e);
+                }
+            }
+        }
+    }
+
+    public String getName() {
+        return PolarMatrixEditingProviderFactory.PROVIDER_NAME;
+    }
+
+    private AffineTransform getMoveAffineTransform(Point p1, Point p2)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+
+        AffineTransform translate =
+            AffineTransform.getTranslateInstance(p2.getX() - p1.getX(),
+                p2.getY() - p1.getY());
+
+        return translate;
+    }
+
+    private AffineTransform getRotateAffineTransform(Point axisP1, Double angle)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+
+        AffineTransform translate =
+            AffineTransform
+                .getTranslateInstance(-axisP1.getX(), -axisP1.getY());
+
+        AffineTransform rotate = AffineTransform.getRotateInstance(angle);
+
+        AffineTransform inverseTranslate =
+            AffineTransform.getTranslateInstance(axisP1.getX(), axisP1.getY());
+        AffineTransform at = new AffineTransform(translate);
+
+        at.preConcatenate(rotate);
+        at.preConcatenate(inverseTranslate);
+        return at;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polarmatrix/src/main/java/org/gvsig/vectorediting/lib/prov/polarmatrix/PolarMatrixEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polarmatrix/src/main/java/org/gvsig/vectorediting/lib/prov/polarmatrix/PolarMatrixEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polarmatrix/src/main/java/org/gvsig/vectorediting/lib/prov/polarmatrix/PolarMatrixEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,92 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.polarmatrix;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+
+/**
+ * @author llmarques
+ *
+ */
+public class PolarMatrixEditingProviderFactory extends AbstractProviderFactory
+    implements EditingProviderFactory {
+
+    public final static String PROVIDER_NAME = "insert-polar-matrix";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Creates a polar matrix of geometries";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, PROVIDER_DESCRIPTION, true, null,
+                new int[] { 
+                    Geometry.TYPES.POINT, Geometry.TYPES.MULTIPOINT,
+                    Geometry.TYPES.CURVE, Geometry.TYPES.LINE, 
+                    Geometry.TYPES.MULTICURVE, Geometry.TYPES.MULTILINE,
+                    Geometry.TYPES.SURFACE, Geometry.TYPES.POLYGON, 
+                    Geometry.TYPES.MULTISURFACE, Geometry.TYPES.MULTIPOLYGON });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new PolarMatrixEditingProvider(parameters,services);
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polarmatrix/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polarmatrix/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polarmatrix/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.polarmatrix</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.polarmatrix</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.polarmatrix
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/SplitLineEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/SplitLineEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/SplitLineEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,89 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.splitline;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+
+/**
+ * @author llmarques
+ *
+ */
+public class SplitLineEditingProviderFactory extends AbstractProviderFactory
+    implements EditingProviderFactory {
+    
+    public final static String PROVIDER_NAME = "modify-split-line";
+
+    public final static String PROVIDER_DESCRIPTION =
+        "Splits provider by a point";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", false, null,
+                new int[] { 
+                    Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, 
+                    Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE 
+                });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new SplitLineEditingProvider(parameters, services);
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+
+        return dynclass;
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/SplitLineEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/SplitLineEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/SplitLineEditingLibrary.java	(revision 1663)
@@ -0,0 +1,88 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.splitline;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.Library;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.prov.splitline.operation.ArcSplitLineOperation;
+import org.gvsig.vectorediting.lib.prov.splitline.operation.CurveSplitLineOperation;
+import org.gvsig.vectorediting.lib.prov.splitline.operation.SplitLineOperationUtils;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * @author llmarques
+ *
+ */
+public class SplitLineEditingLibrary extends AbstractLibrary implements Library {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new SplitLineEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "modify-split-line", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        SplitLineOperationUtils.register(new CurveSplitLineOperation(),
+            Geometry.TYPES.CURVE);
+        //Dejamos que la operacion para los ARC sea la de la CURVE porque
+        //no se puede hacer con ARC transformados (elipses)
+        SplitLineOperationUtils.register(new ArcSplitLineOperation(),
+            Geometry.TYPES.ARC);
+        SplitLineOperationUtils.register(new CurveSplitLineOperation(),
+            Geometry.TYPES.LINE);
+        //FIXME: Comprobar si el comportamiento de la operaci�n SplineSplitLineOperation es el deseado
+        // y si s�, registrarla en lugar de CurveSpliLineOperation para Splines
+        SplitLineOperationUtils.register(new CurveSplitLineOperation(),
+            Geometry.TYPES.SPLINE);
+
+        registerTranslations();
+
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "split-line-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/operation/ArcSplitLineOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/operation/ArcSplitLineOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/operation/ArcSplitLineOperation.java	(revision 1663)
@@ -0,0 +1,80 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.splitline.operation;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+
+/**
+ * @author llmarques
+ *
+ */
+public class ArcSplitLineOperation implements SplitLineOperation {
+
+    public Curve[] split(Geometry geometry, Point projectedPoint)
+        throws CreateGeometryException, GeometryOperationNotSupportedException,
+        GeometryOperationException {
+
+        GeometryManager geoManager = GeometryLocator.getGeometryManager();
+        int subtype = geometry.getGeometryType().getSubType();
+
+        Arc arcToSplit = (Arc) geometry;
+
+        Point center = arcToSplit.getCenterPoint();
+        //Si center es null es porque dos de los puntos coinciden.
+        if(arcToSplit.getInitPoint().equals(arcToSplit.getEndPoint())){
+            //Si son el inicial y el final es porque es una circunferencia completa, tomamos como "center" el centro del Envelope
+            if (center==null){
+                center = geoManager.createPoint(arcToSplit.getEnvelope().getCenter(0), arcToSplit.getEnvelope().getCenter(1), subtype);
+            }
+        }
+
+        Point firstPoint = arcToSplit.getInitPoint();
+        Point endPoint = arcToSplit.getEndPoint();
+
+        double startAngle =
+            SplitLineOperationUtils.getAngle(center, firstPoint);
+        double splitAngle =
+            SplitLineOperationUtils.getAngle(center, projectedPoint);
+        double endAngle = SplitLineOperationUtils.getAngle(center, endPoint);
+        double radius = center.distance(firstPoint);
+
+        Arc arcSplitted1 = (Arc) geoManager.create(Geometry.TYPES.ARC, subtype);
+        Arc arcSplitted2 = (Arc) geoManager.create(Geometry.TYPES.ARC, subtype);
+
+        arcSplitted1.setPointsStartEnd(center, radius, startAngle, splitAngle);
+        arcSplitted2.setPointsStartEnd(center, radius, splitAngle, endAngle);
+
+        return new Curve[] { arcSplitted1, arcSplitted2 };
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/operation/SplineSplitLineOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/operation/SplineSplitLineOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/operation/SplineSplitLineOperation.java	(revision 1663)
@@ -0,0 +1,96 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.splitline.operation;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryException;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Spline;
+import org.gvsig.tools.locator.LocatorException;
+
+
+/**
+ * @author llmarques
+ *
+ */
+public class SplineSplitLineOperation implements SplitLineOperation {
+
+    public Curve[] split(Geometry geometry, Point projectedPoint)
+        throws LocatorException,
+        GeometryOperationNotSupportedException, GeometryOperationException, GeometryException {
+
+        Spline splineToSplit = (Spline) geometry;
+        Line lineToSplit = (Line) ((Spline) geometry).toLines().getPrimitiveAt(0);
+
+        int subtype = geometry.getGeometryType().getSubType();
+
+        GeometryManager geoManager = GeometryLocator.getGeometryManager();
+
+        Spline splittedLine1 =
+            (Spline) GeometryLocator.getGeometryManager().create(Geometry.TYPES.SPLINE, subtype);
+
+        int index = 0;
+        Point originalVertex = splineToSplit.getVertex(index);
+        int pointer = 0;
+        for (; pointer < lineToSplit.getNumVertices() - 1; pointer++) {
+
+            Point vertex = lineToSplit.getVertex(pointer);
+            if(vertex.equals(originalVertex)){
+                splittedLine1.addVertex(vertex);
+                index++;
+                originalVertex = splineToSplit.getVertex(index);
+            }
+
+            Curve segment = geoManager.createLine(subtype);
+            segment.setPoints(lineToSplit.getVertex(pointer),
+                lineToSplit.getVertex(pointer + 1));
+
+            if (SplitLineOperationUtils.intersects(segment, projectedPoint)) {
+                splittedLine1.addVertex(projectedPoint);
+                pointer++;
+                break;
+            }
+        }
+
+        Spline splittedLine2 =
+            (Spline) GeometryLocator.getGeometryManager().create(Geometry.TYPES.SPLINE, subtype);
+        splittedLine2.addVertex(projectedPoint);
+
+        for (; index < splineToSplit.getNumVertices(); index++) {
+            splittedLine2.addVertex(splineToSplit.getVertex(index));
+        }
+
+        return new Curve[] { splittedLine1, splittedLine2 };
+
+
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/operation/SplitLineOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/operation/SplitLineOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/operation/SplitLineOperation.java	(revision 1663)
@@ -0,0 +1,46 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.splitline.operation;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryException;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.tools.locator.LocatorException;
+
+
+/**
+ * @author llmarques
+ *
+ */
+public interface SplitLineOperation {
+
+    public Curve[] split(Geometry geometry, Point projectedPoint)
+        throws CreateGeometryException, LocatorException,
+        GeometryOperationNotSupportedException, GeometryOperationException, GeometryException;
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/operation/SplitLineOperationUtils.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/operation/SplitLineOperationUtils.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/operation/SplitLineOperationUtils.java	(revision 1663)
@@ -0,0 +1,221 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.splitline.operation;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.gvsig.fmap.geom.Geometry.TYPES;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+
+/**
+ * @author llmarques
+ *
+ */
+public class SplitLineOperationUtils {
+
+    private static Map<Integer, SplitLineOperation> operations =
+        new HashMap<Integer, SplitLineOperation>();
+
+    public SplitLineOperationUtils() {
+    }
+
+    public static void register(SplitLineOperation operation, int geometryType) {
+        operations.put(geometryType, operation);
+    }
+
+    public static SplitLineOperation getOperation(Primitive geom) {
+        Integer type = geom.getGeometryType().getType();
+
+        SplitLineOperation operation = operations.get(type);
+
+        return operation;
+    }
+
+    public static boolean intersects(Curve curve, Point projectedPoint)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+
+        double tolerance = 1;
+
+        return curve.buffer(tolerance).intersects(projectedPoint);
+    }
+
+    // FIXME: Deletes method when geometry manager has this utility methods.
+    public static Point[] getPerpendicular(Double m, Double b, Point perp,
+        int subtype) throws CreateGeometryException {
+        if (m == Double.POSITIVE_INFINITY) {
+            Point[] res = new Point[2];
+            res[0] = createPoint(0, perp.getY(), subtype);
+            res[1] = createPoint(1, perp.getY(), subtype);
+            return res;
+        } else if (m == Double.NEGATIVE_INFINITY) {
+            Point[] res = new Point[2];
+            res[0] = createPoint(1, perp.getY(), subtype);
+            res[1] = createPoint(0, perp.getY(), subtype);
+            return res;
+        } else {
+            // Pendiente de la recta perpendicular
+            Double m1 = -1 / m;
+
+            // b de la funcion de la recta perpendicular
+            Double b1 = perp.getY() - (m1 * perp.getX());
+
+            // Obtenemos un par de puntos
+            Point[] res = new Point[2];
+
+            if (Double.isInfinite(m1)) {
+                res[0] = createPoint(perp.getX(), 0.0, subtype);
+                res[1] = createPoint(perp.getX(), perp.getY(), subtype);
+            } else {
+                res[0] = createPoint(0, 0.0 + b1, subtype);
+                res[1] =
+                    createPoint(perp.getX(), (m1 * perp.getX()) + b1, subtype);
+            }
+
+            return res;
+        }
+    }
+
+    // FIXME: Deletes method when geometry manager has this utility method.
+    public static double getAngle(Point start, Point end)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+        double angle =
+            Math.acos((end.getX() - start.getX()) / start.distance(end));
+
+        if (start.getY() > end.getY()) {
+            angle = -angle;
+        }
+
+        if (angle < 0) {
+            angle += (2 * Math.PI);
+        }
+
+        return angle;
+    }
+
+    // FIXME: Deletes method when geometry manager has this utility method.
+    public static Point getMidPoint(Point a, Point b, int subtype)
+        throws CreateGeometryException {
+        double x = (a.getX() + b.getX()) / 2;
+        double y = (a.getY() + b.getY()) / 2;
+        return createPoint(x, y, subtype);
+    }
+
+    // FIXME: Deletes method when geometry manager has this utility method.
+    public static Point createPoint(double x, double y, int subtype)
+        throws CreateGeometryException {
+        Point point = null;
+        point =
+            (Point) GeometryLocator.getGeometryManager().create(TYPES.POINT,
+                subtype);
+        point.setX(x);
+        point.setY(y);
+        return point;
+    }
+
+    // FIXME: Deletes method when geometry manager has this utility method.
+    public static Double[] getLineParams(Point point, Point nextPoint) {
+        Double[] lineParams = new Double[2];
+        double denom = nextPoint.getX() - point.getX();
+        if (denom != 0) {
+            lineParams[0] = (nextPoint.getY() - point.getY()) / denom;
+            lineParams[1] = point.getY() - (lineParams[0] * point.getX());
+        } else {
+            if (nextPoint.getY() >= point.getY()) {
+                lineParams[0] = Double.POSITIVE_INFINITY;
+                lineParams[1] = Double.NEGATIVE_INFINITY;
+                if (point.getX() == 0) {
+                    lineParams[1] = 0.0;
+                }
+            } else {
+                lineParams[0] = Double.NEGATIVE_INFINITY;
+                lineParams[1] = Double.POSITIVE_INFINITY;
+                if (point.getX() == 0) {
+                    lineParams[1] = 0.0;
+                }
+            }
+        }
+        return lineParams;
+    }
+
+    // FIXME: Deletes method when geometry manager has this utility method.
+    public static Point getIntersection(Point[] lineA, Point[] lineB, int subtype)
+        throws CreateGeometryException {
+        Point p1 = lineA[0];
+        Point p2 = lineA[1];
+        Point p3 = lineB[0];
+        Point p4 = lineB[1];
+
+        double m1 = Double.POSITIVE_INFINITY;
+
+        if ((p2.getX() - p1.getX()) != 0) {
+            m1 = (p2.getY() - p1.getY()) / (p2.getX() - p1.getX());
+        }
+
+        double m2 = Double.POSITIVE_INFINITY;
+
+        if ((p4.getX() - p3.getX()) != 0) {
+            m2 = (p4.getY() - p3.getY()) / (p4.getX() - p3.getX());
+        }
+
+        if ((m1 == Double.POSITIVE_INFINITY)
+            && (m2 == Double.POSITIVE_INFINITY)) {
+            return null;
+        }
+
+        double b1 = p2.getY() - (m1 * p2.getX());
+
+        double b2 = p4.getY() - (m2 * p4.getX());
+
+        if ((m1 != Double.POSITIVE_INFINITY)
+            && (m2 != Double.POSITIVE_INFINITY)) {
+            if (m1 == m2) {
+                return null;
+            }
+
+            double x = (b2 - b1) / (m1 - m2);
+
+            return createPoint(x, (m1 * x) + b1, subtype);
+        } else if (m1 == Double.POSITIVE_INFINITY) {
+            double x = p1.getX();
+
+            return createPoint(x, (m2 * x) + b2, subtype);
+        } else if (m2 == Double.POSITIVE_INFINITY) {
+            double x = p3.getX();
+
+            return createPoint(x, (m1 * x) + b1, subtype);
+        }
+
+        return null;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/operation/CurveSplitLineOperation.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/operation/CurveSplitLineOperation.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/operation/CurveSplitLineOperation.java	(revision 1663)
@@ -0,0 +1,90 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.splitline.operation;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryException;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.tools.locator.LocatorException;
+
+
+/**
+ * @author llmarques
+ *
+ */
+public class CurveSplitLineOperation implements SplitLineOperation {
+
+    public Curve[] split(Geometry geometry, Point projectedPoint)
+        throws LocatorException,
+        GeometryOperationNotSupportedException, GeometryOperationException, GeometryException {
+
+        Curve lineToSplit = (Curve) geometry;
+        if(!(lineToSplit instanceof Line)){
+            lineToSplit = (Curve) lineToSplit.toLines().getPrimitiveAt(0);
+        }
+
+        int subtype = geometry.getGeometryType().getSubType();
+
+        GeometryManager geoManager = GeometryLocator.getGeometryManager();
+
+        Curve splittedLine1 =
+            GeometryLocator.getGeometryManager().createLine(subtype);
+
+        int pointer = 0;
+        for (; pointer < lineToSplit.getNumVertices() - 1; pointer++) {
+
+            splittedLine1.addVertex(lineToSplit.getVertex(pointer));
+
+            Curve segment = geoManager.createLine(subtype);
+            segment.setPoints(lineToSplit.getVertex(pointer),
+                lineToSplit.getVertex(pointer + 1));
+
+            if (SplitLineOperationUtils.intersects(segment, projectedPoint)) {
+                splittedLine1.addVertex(projectedPoint);
+                pointer++;
+                break;
+            }
+        }
+
+        Curve splittedLine2 =
+            GeometryLocator.getGeometryManager().createLine(subtype);
+        splittedLine2.addVertex(projectedPoint);
+
+        for (; pointer < lineToSplit.getNumVertices(); pointer++) {
+            splittedLine2.addVertex(lineToSplit.getVertex(pointer));
+        }
+
+        return new Curve[] { splittedLine1, splittedLine2 };
+
+
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/SplitLineEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/SplitLineEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/SplitLineEditingProvider.java	(revision 1663)
@@ -0,0 +1,477 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.splitline;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryException;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Primitive;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.locator.LocatorException;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.tools.visitor.VisitCanceledException;
+import org.gvsig.tools.visitor.Visitor;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.prov.splitline.operation.SplitLineOperation;
+import org.gvsig.vectorediting.lib.prov.splitline.operation.SplitLineOperationUtils;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author llmarques
+ *
+ */
+public class SplitLineEditingProvider extends AbstractEditingProvider implements
+    EditingProvider {
+
+    private EditingServiceParameter selection;
+
+    private EditingServiceParameter point;
+
+    private FeatureStore featureStore;
+
+    private Map<EditingServiceParameter, Object> values;
+
+    /**
+     * Default constructor.
+     *
+     * @param providerServices
+     *            available services for this provider
+     * @param parameters
+     *            of this provider
+     */
+    public SplitLineEditingProvider(DynObject parameters,
+        ProviderServices services) {
+        super(services);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.selection =
+            new DefaultEditingServiceParameter("selection", "selection",
+                TYPE.SELECTION);
+
+        this.point =
+            new DefaultEditingServiceParameter("indicate_new_point",
+                "indicate_new_point", TYPE.POSITION);
+    }
+
+    public EditingServiceParameter next() {
+
+        if (values.get(selection) == null) {
+            return selection;
+        } else if (values.get(point) == null) {
+            return point;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        if (values != null) {
+            DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+            EditingProviderManager editingProviderManager =
+                EditingProviderLocator.getProviderManager();
+            ISymbol auxiliaryPointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+            ISymbol auxiliaryLineSymbolEditing = editingProviderManager.getSymbol("auxiliary-line-symbol-editing");
+
+            FeatureSelection featureSelection =
+                (FeatureSelection) values.get(selection);
+
+            DisposableIterator it = null;
+            try {
+
+                EditingProviderServices editingProviderService =
+                    (EditingProviderServices) getProviderServices();
+
+                int subtype = editingProviderService.getSubType(featureStore);
+
+                it = featureSelection.fastIterator();
+                while (it.hasNext()) {
+
+                    Feature feature = (Feature) it.next();
+
+                    Geometry lineToSplit =
+                        getLineToSplit(feature.getDefaultGeometry());
+
+                    Point projectedPoint =
+                        getNearestPoint(lineToSplit, mousePosition);
+
+                    Line line =
+                        editingProviderService.createLine(mousePosition,
+                            projectedPoint, subtype);
+                    drawingStatus.addStatus(projectedPoint, auxiliaryPointSymbolEditing, "");
+                    drawingStatus.addStatus(line, auxiliaryLineSymbolEditing, "");
+                }
+            } catch (Exception e) {
+                throw new DrawServiceException(e);
+            } finally {
+                it.dispose();
+            }
+            return drawingStatus;
+        }
+        return null;
+    }
+
+    private Geometry getLineToSplit(Geometry geometry) {
+        Geometry line = null;
+        GeometryType geoType = geometry.getGeometryType();
+        if (geoType.isTypeOf(Geometry.TYPES.CURVE)) {
+            line = (Curve) geometry;
+        } else if (geoType.isTypeOf(Geometry.TYPES.MULTICURVE)) {
+            line = (MultiCurve) geometry;
+        }
+        return line;
+    }
+
+    private Point getNearestPoint(Geometry lineToSplit, Point point)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+
+        return (Point) lineToSplit.closestPoints(point)[0];
+    }
+
+    public void stop() throws StopServiceException {
+        if (values != null) {
+            values.clear();
+        }
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(selection);
+        parameters.add(point);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter parameter,
+        final Object value) throws InvalidEntryException {
+
+        if (values != null && value != null) {
+
+            if (value instanceof FeatureSelection) {
+
+                FeatureSelection feautureSelection = (FeatureSelection) value;
+                if (feautureSelection.getSelectedCount() == 1) {
+
+                    try {
+                        feautureSelection.accept(new Visitor() {
+
+                            public void visit(Object obj)
+                                throws VisitCanceledException, BaseException {
+                                Feature feature = (Feature) obj;
+                                Geometry geometry =
+                                    feature.getDefaultGeometry();
+                                GeometryType geoType =
+                                    geometry.getGeometryType();
+
+                                if (geoType.isTypeOf(Geometry.TYPES.CURVE)) {
+
+                                    if (isAnArcClosed((Curve) geometry)) {
+                                        throw new InvalidEntryException(null);
+                                    } else {
+                                        values.put(selection, value);
+                                        return;
+                                    }
+
+                                } else if (geoType
+                                    .isTypeOf(Geometry.TYPES.MULTICURVE)) {
+
+                                    MultiCurve multiCurve =
+                                        (MultiCurve) geometry;
+
+                                    for (int i = 0; i < multiCurve
+                                        .getPrimitivesNumber(); i++) {
+                                        if (isAnArcClosed((Curve) multiCurve
+                                            .getPrimitiveAt(i))) {
+                                            throw new InvalidEntryException(
+                                                null);
+                                        }
+                                    }
+                                    values.put(selection, value);
+                                    return;
+                                }
+                            }
+                        });
+                        return;
+                    } catch (BaseException e) {
+                        throw new InvalidEntryException(e);
+                    }
+                }
+            } else if (value instanceof Point) {
+                values.put(parameter, value);
+                return;
+            }
+        }
+        throw new InvalidEntryException(null);
+    }
+
+    private boolean isAnArcClosed(Curve curve) {
+
+        if( curve instanceof Arc){
+            Point firstPoint = curve.getVertex(0);
+            Point lastPoint = curve.getVertex(curve.getNumVertices() - 1);
+
+            if (firstPoint.equals(lastPoint)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        return null;
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+
+        if (values != null) {
+
+            final EditingProviderServices editingProviderService =
+                (EditingProviderServices) getProviderServices();
+
+            FeatureSelection featureSelection =
+                (FeatureSelection) values.get(selection);
+            ToolsLocator.getDisposableManager().bind(featureSelection);
+
+            final Point pointValue = (Point) values.get(point);
+
+            try {
+                featureSelection.accept(new Visitor() {
+
+                    public void visit(Object obj)
+                        throws VisitCanceledException, BaseException {
+                        Feature feature = (Feature) obj;
+
+                        Geometry lineToSplit =
+                            getLineToSplit(feature.getDefaultGeometry());
+                        GeometryType geomType = lineToSplit.getGeometryType();
+
+                        Point projectedPoint =
+                            getNearestPoint(lineToSplit, pointValue);
+
+                        if (geomType.isTypeOf(Geometry.TYPES.CURVE)) {
+
+                            Curve[] splittedCurves =
+                                splitCurve((Curve) lineToSplit, projectedPoint);
+
+                            // Deletes old feature
+                            editingProviderService
+                                .deleteFeatureFromFeatureStore(feature,
+                                    featureStore);
+
+                            // Copy alfanumeric data and insert new feature
+                            EditableFeature eFeature =
+                                editingProviderService.getFeatureCopyWithoutPK(
+                                    featureStore, feature);
+                            eFeature.setDefaultGeometry(splittedCurves[0]);
+                            editingProviderService
+                                .insertFeatureIntoFeatureStore(eFeature,
+                                    featureStore);
+
+                            eFeature =
+                                editingProviderService.getFeatureCopyWithoutPK(
+                                    featureStore, feature);
+                            eFeature.setDefaultGeometry(splittedCurves[1]);
+                            editingProviderService
+                                .insertFeatureIntoFeatureStore(eFeature,
+                                    featureStore);
+
+                        } else if (geomType.isTypeOf(Geometry.TYPES.MULTICURVE)) {
+
+                            MultiCurve multiCurve = (MultiCurve) lineToSplit;
+
+                            List<Geometry> result = splitMultiCurve(multiCurve, projectedPoint);
+
+                            if (result != null && result.size() > 0) {
+
+                                // Deletes old feature
+                                editingProviderService
+                                    .deleteFeatureFromFeatureStore(feature,
+                                        featureStore);
+
+                                for (Geometry geometry : result) {
+                                    // Copy alfanumeric data and insert new feature
+                                    EditableFeature eFeature =
+                                        editingProviderService.getFeatureCopyWithoutPK(
+                                            featureStore, feature);
+
+                                    eFeature.setDefaultGeometry(geometry);
+                                    editingProviderService
+                                        .insertFeatureIntoFeatureStore(eFeature,
+                                            featureStore);
+                                }
+                            }
+                        }
+                    }
+                });
+
+                featureStore.getFeatureSelection().deselectAll();
+                featureSelection.dispose();
+
+            } catch (BaseException e) {
+                throw new FinishServiceException(e);
+            }
+        }
+    }
+
+    private List<Geometry> splitMultiCurve(MultiCurve multiCurveToSplit,
+        Point projectedPoint) throws GeometryOperationNotSupportedException,
+        GeometryOperationException, LocatorException,
+        DataException, GeometryException {
+
+        List<Geometry> result = new ArrayList<Geometry>();
+
+        Curve curveToSplit = null;
+
+        for (int i = 0; i < multiCurveToSplit.getPrimitivesNumber(); i++) {
+
+            if (intersects(multiCurveToSplit.getCurveAt(i), projectedPoint)) {
+                curveToSplit = multiCurveToSplit.getCurveAt(i);
+            }
+        }
+
+        Curve[] splitedCurves = splitCurve(curveToSplit, projectedPoint);
+
+        for(int i = 0; i < splitedCurves.length; i++){
+            result.add(splitedCurves[i]);
+        }
+
+        EditingProviderServices editingProviderService =
+            (EditingProviderServices) getProviderServices();
+        int subtype = editingProviderService.getSubType(featureStore);
+        MultiCurve multiCurve =
+            GeometryLocator.getGeometryManager().createMultiCurve(subtype);
+
+        for (int i = 0; i < multiCurveToSplit.getPrimitivesNumber(); i++) {
+
+            if (!intersects(multiCurveToSplit.getCurveAt(i), projectedPoint)) {
+                multiCurve.addCurve(multiCurveToSplit.getCurveAt(i));
+            }
+        }
+
+        if(multiCurve.getPrimitivesNumber() > 0){
+            result.add(multiCurve);
+        }
+
+        return result;
+    }
+
+    private Curve[] splitCurve(Curve curveToSplit, Point projectedPoint)
+        throws DataException, LocatorException,
+        GeometryOperationNotSupportedException, GeometryOperationException, GeometryException {
+
+        SplitLineOperation operation =
+            SplitLineOperationUtils.getOperation((Primitive) curveToSplit);
+
+        if (operation != null) {
+            return operation.split(curveToSplit, projectedPoint);
+        }
+        return null;
+    }
+
+    /**
+     * Method use to know what segment intersect with projected point. Due to
+     * accuracy of doubles it is necessary to create a buffer of line to know if
+     * it intersects.
+     *
+     * @param curve
+     *            segment of line
+     * @param projectedPoint
+     *            of line
+     * @return true if segment intersects with projected point, else false.
+     */
+    private boolean intersects(Curve curve, Point projectedPoint)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException {
+
+        double tolerance = 1;
+
+        return curve.buffer(tolerance).intersects(projectedPoint);
+    }
+
+    public void start() throws StartServiceException, InvalidEntryException {
+        values = new HashMap<EditingServiceParameter, Object>();
+        FeatureSelection selected = null;
+        if (featureStore != null) {
+            try {
+                selected = featureStore.getFeatureSelection();
+            } catch (DataException e) {
+                throw new StartServiceException(e);
+            }
+            if (selected.getSelectedCount() > 0) {
+                setValue(selected);
+            }
+        }
+    }
+
+    public String getName() {
+        return SplitLineEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.splitline.SplitLineEditingLibrary
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/resources/images/vectorediting-tools/modify-split-line.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/resources/images/vectorediting-tools/modify-split-line.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.splitline</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.splitline</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/test/resources/cartography/provincias_andalucia.shp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/test/resources/cartography/provincias_andalucia.shp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/test/resources/cartography/provincias_andalucia.dbf
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/test/resources/cartography/provincias_andalucia.dbf
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/test/resources/cartography/provincias_andalucia.shx
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/test/resources/cartography/provincias_andalucia.shx
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/test/java/org/gvsig/vectorediting/lib/prov/circle3p/Circle3PIt.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/test/java/org/gvsig/vectorediting/lib/prov/circle3p/Circle3PIt.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/test/java/org/gvsig/vectorediting/lib/prov/circle3p/Circle3PIt.java	(revision 1663)
@@ -0,0 +1,599 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.circle3p;
+
+
+import java.io.File;
+import java.net.URL;
+import java.util.List;
+
+import org.gvsig.fmap.crs.CRSFactory;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.primitive.Circle;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Surface;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.DrawingStatus.Status;
+import org.gvsig.vectorediting.lib.api.EditingManager;
+import org.gvsig.vectorediting.lib.api.EditingService;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.VectorEditingException;
+import org.gvsig.vectorediting.lib.impl.DefaultEditingManager;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+
+/**
+ * Circle CR provider test.
+ *
+ * This test uses src/test/resources/cartography
+ *
+ * @author llmarques
+ *
+ */
+public class Circle3PIt extends AbstractLibraryAutoInitTestCase {
+
+    GeometryManager geoManager;
+    DataManager dataManager;
+    EditingManager editingManager;
+    EditingService service;
+    FeatureStore featureStoreTest;
+    MapContext mapContextTest;
+
+    @Override
+    protected void doSetUp() throws Exception {
+
+        editingManager = new DefaultEditingManager();
+
+        geoManager = GeometryLocator.getGeometryManager();
+
+        try {
+            featureStoreTest = openFeatureStoretest("provincias_andalucia.shp");
+        } catch (Exception e) {
+            fail("Unexpected exception opening test feature store: "
+                + e.getMessage());
+        }
+
+        mapContextTest =
+            new MapContext(new ViewPort(featureStoreTest
+                .getDefaultFeatureType().getDefaultSRS()));
+
+        service =
+            editingManager.getEditingService(
+                Circle3PEditingProviderFactory.PROVIDER_NAME, featureStoreTest,
+                mapContextTest);
+
+        service.start();
+
+    }
+
+    public void testFinish() {
+
+        // Try to finish without values.
+        try {
+
+            service.finish();
+            fail("No exception has been thrown");
+
+        } catch (NullPointerException e) {
+            // Test OK, got expected exception
+        } catch (FinishServiceException e) {
+            // Test OK, got expected exception
+        }
+
+        // Try to finish only with firsPoint value
+        Point firstPoint = null;
+        try {
+            firstPoint = geoManager.createPoint(-10, 0, Geometry.SUBTYPES.GEOM2D);
+
+            service.setValue(firstPoint);
+
+            service.finish();
+            fail("No exception has been thrown");
+
+        } catch (NullPointerException e) {
+            // Test OK, got expected exception
+        } catch (Exception e) {
+            // Test OK, got expected exception
+        }
+
+        // Restart service
+        try {
+            service.stop();
+            service.start();
+        } catch (Exception e) {
+            fail("Unexpected exception restarting service: " + e.getMessage());
+        }
+
+        // Try to finish only with two point value
+        Point secondPoint = null;
+        try {
+            secondPoint = geoManager.createPoint(0, 10, Geometry.SUBTYPES.GEOM2D);
+
+            service.setValue(firstPoint);
+            service.setValue(secondPoint);
+
+            service.finish();
+            fail("No exception has been thrown");
+
+        } catch (NullPointerException e) {
+            // Test OK, got expected exception
+        } catch (Exception e) {
+            // Test OK, got expected exception
+        }
+
+        // Restart service
+        try {
+            service.stop();
+            service.start();
+        } catch (Exception e) {
+            fail("Unexpected exception restarting service: " + e.getMessage());
+        }
+        // Try to finish with valid points
+        Point thirdPoint = null;
+        try {
+            thirdPoint = geoManager.createPoint(10, 0, Geometry.SUBTYPES.GEOM2D);
+
+            service.setValue(firstPoint);
+            service.setValue(secondPoint);
+            service.setValue(thirdPoint);
+
+            Geometry geom = service.finish();
+
+            assertNotNull("geometry is null", geom);
+            assertEquals("geometry type != MULTISURFACE", geom.getType(),
+                Geometry.TYPES.MULTISURFACE);
+
+            Surface surface = ((MultiSurface) geom).getSurfaceAt(0);
+            assertTrue(surface instanceof Circle);
+            assertTrue(((Circle) surface).getCenter().getX() == 0);
+            assertTrue(((Circle) surface).getCenter().getY() == 0);
+            assertTrue(((Circle) surface).getRadious() == 10.0);
+
+        } catch (Exception e) {
+            fail("Unexpected exception ending service. " + e.getMessage());
+        }
+
+        // Try to finish with null featureStore
+        try {
+
+            service =
+                editingManager.getEditingService(
+                    Circle3PEditingProviderFactory.PROVIDER_NAME, null,
+                    mapContextTest);
+
+            service.start();
+
+            firstPoint = geoManager.createPoint(-10, 0, Geometry.SUBTYPES.GEOM2D);
+            secondPoint = geoManager.createPoint(0, 10, Geometry.SUBTYPES.GEOM2D);
+            thirdPoint = geoManager.createPoint(10, 0, Geometry.SUBTYPES.GEOM2D);
+
+            service.setValue(firstPoint);
+            service.setValue(secondPoint);
+            service.setValue(thirdPoint);
+
+            service.finish();
+            fail("No exception has been thrown");
+        } catch (FinishServiceException e) {
+            // Test OK, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception finishing with null feature store: "
+                + e.getMessage());
+        }
+
+    }
+
+    public void testfinishAndStore() {
+
+        // Try to finish and store without values
+        try {
+
+            service.finishAndStore();
+            fail("No exception has been thrown");
+
+        } catch (NullPointerException e) {
+            // Test OK, got expected exception
+        } catch (FinishServiceException e) {
+            // Test OK, got expected exception
+        }
+
+        // Try to finish and store only with center value
+        Point firstPoint = null;
+        try {
+
+            firstPoint = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+
+            service.finishAndStore();
+            fail("No exception has been thrown");
+
+        } catch (NullPointerException e) {
+            // Test OK, got expected exception
+        } catch (Exception e) {
+            // Test OK, got expected exception
+        }
+
+        // Try to finish and store with null featureStore
+        Point secondPoint = null;
+        try {
+
+            service =
+                editingManager.getEditingService(
+                    Circle3PEditingProviderFactory.PROVIDER_NAME, null,
+                    mapContextTest);
+
+            service.start();
+
+            firstPoint = geoManager.createPoint(0, 0, Geometry.SUBTYPES.GEOM2D);
+            secondPoint = geoManager.createPoint(0, 10, Geometry.SUBTYPES.GEOM2D);
+
+            service.setValue(firstPoint);
+            service.setValue(secondPoint);
+
+            service.finishAndStore();
+            fail("No exception has been thrown");
+        } catch (FinishServiceException e) {
+            // Test OK, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception ending and storing service: "
+                + e.getMessage());
+        }
+
+        // Try to finish and store with valid values
+        Point thirdPoint = null;
+
+        try {
+
+            service =
+                editingManager.getEditingService(
+                    Circle3PEditingProviderFactory.PROVIDER_NAME,
+                    featureStoreTest, mapContextTest);
+
+            service.start();
+
+            firstPoint = geoManager.createPoint(-10, 0, Geometry.SUBTYPES.GEOM2D);
+            secondPoint = geoManager.createPoint(0, 10, Geometry.SUBTYPES.GEOM2D);
+            thirdPoint = geoManager.createPoint(10, 0, Geometry.SUBTYPES.GEOM2D);
+
+            service.setValue(firstPoint);
+            service.setValue(secondPoint);
+            service.setValue(thirdPoint);
+
+            featureStoreTest.edit();
+            service.finishAndStore();
+            featureStoreTest.finishEditing();
+
+        } catch (Exception e) {
+            fail("Unexpected exception ending service. " + e.getMessage());
+        }
+
+    }
+
+    public void testgetDrawingStatus() {
+
+        // Try to get drawing status without values
+        Point mousePosition = null;
+        DrawingStatus dws;
+        try {
+            mousePosition =
+                geoManager.createPoint(-10, 0, Geometry.SUBTYPES.GEOM2D);
+            dws = service.getDrawingStatus(mousePosition);
+            assertTrue(dws.getStatus().size() == 0);
+        } catch (Exception e) {
+            fail("Unexpected exception get drawing status. " + e.getMessage());
+        }
+
+        // Try to get drawing status with valid firstPoint value
+        Point firstPoint;
+        try {
+            firstPoint = geoManager.createPoint(-10, 0, Geometry.SUBTYPES.GEOM2D);
+            mousePosition =
+                geoManager.createPoint(0, 10, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(firstPoint);
+            dws = service.getDrawingStatus(mousePosition);
+
+            assertNotNull(dws);
+            List<Status> status = dws.getStatus();
+            assertTrue(status.size() == 3);
+            assertNotNull(status.get(0));
+            assertNotNull(status.get(0).getGeometry());
+            assertNotNull(status.get(1));
+            assertNotNull(status.get(1).getGeometry());
+            assertNotNull(status.get(2));
+            assertNotNull(status.get(2).getGeometry());
+
+        } catch (Exception e) {
+            fail("Unexpected exception get drawing status. " + e.getMessage());
+        }
+
+        // Try to get drawing status with valid first and second points values
+        Point secondPoint;
+        try {
+            secondPoint = geoManager.createPoint(0, 10, Geometry.SUBTYPES.GEOM2D);
+            mousePosition =
+                geoManager.createPoint(10, 0, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(secondPoint);
+            dws = service.getDrawingStatus(mousePosition);
+
+            assertNotNull(dws);
+            List<Status> status = dws.getStatus();
+            assertTrue(status.size() == 7);
+            assertNotNull(status.get(0));
+            assertNotNull(status.get(0).getGeometry());
+            assertNotNull(status.get(1));
+            assertNotNull(status.get(1).getGeometry());
+            assertNotNull(status.get(2));
+            assertNotNull(status.get(2).getGeometry());
+            assertNotNull(status.get(3));
+            assertNotNull(status.get(3).getGeometry());
+            assertNotNull(status.get(4));
+            assertNotNull(status.get(4).getGeometry());
+            assertNotNull(status.get(5));
+            assertNotNull(status.get(5).getGeometry());
+            assertNotNull(status.get(6));
+            assertNotNull(status.get(6).getGeometry());
+        } catch (Exception e) {
+            fail("Unexpected exception get drawing status. " + e.getMessage());
+        }
+
+        // Try to get drawing status with valid first and second, third points values
+        Point thirdPoint;
+        try {
+            thirdPoint = geoManager.createPoint(10, 0, Geometry.SUBTYPES.GEOM2D);
+            mousePosition =
+                geoManager.createPoint(0, -10, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(thirdPoint);
+            dws = service.getDrawingStatus(mousePosition);
+
+            assertNotNull(dws);
+            List<Status> status = dws.getStatus();
+            assertTrue(status.size() == 0);
+        } catch (Exception e) {
+            fail("Unexpected exception get drawing status. " + e.getMessage());
+        }
+
+    }
+
+    public void testgetName() {
+
+        assertEquals(Circle3PEditingProviderFactory.PROVIDER_NAME,
+            service.getName());
+
+    }
+
+    public void testgetParameters() {
+        List<EditingServiceParameter> parameters = service.getParameters();
+
+        assertNotNull(parameters);
+        assertTrue(parameters.size() == 3);
+
+        EditingServiceParameter parameter = parameters.get(0);
+        assertTrue(parameter.getTypes().size() == 1);
+        assertTrue(parameter.getTypes().iterator().next() == EditingServiceParameter.TYPE.POSITION);
+
+        parameter = parameters.get(1);
+        assertTrue(parameter.getTypes().size() == 1);
+        assertTrue(parameter.getTypes().iterator().next() == EditingServiceParameter.TYPE.POSITION);
+
+        parameter = parameters.get(2);
+        assertTrue(parameter.getTypes().size() == 1);
+        assertTrue(parameter.getTypes().iterator().next() == EditingServiceParameter.TYPE.POSITION);
+    }
+
+    public void testNext() {
+
+        // Try to set values in correct order
+        assertNotNull(service.next());
+
+        List<EditingServiceParameter> parameters = service.getParameters();
+        EditingServiceParameter firstPointParameter = parameters.get(0);
+        EditingServiceParameter secondPointParameter = parameters.get(1);
+        EditingServiceParameter thirdPointParameter = parameters.get(2);
+
+        assertEquals(firstPointParameter, service.next());
+
+        Point firstPoint;
+        try {
+            firstPoint = geoManager.createPoint(-10, 0, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(firstPoint);
+        } catch (Exception e) {
+            fail("Unexpected exception getting next parameter: "
+                + e.getMessage());
+        }
+
+        assertNotNull(service.next());
+
+        assertEquals(secondPointParameter, service.next());
+
+        Point secondPoint;
+        try {
+            secondPoint = geoManager.createPoint(0, 10, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(secondPoint);
+        } catch (Exception e) {
+            fail("Unexpected exception getting next parameter: "
+                + e.getMessage());
+        }
+
+        assertNotNull(service.next());
+
+        assertEquals(thirdPointParameter, service.next());
+
+        Point thirdPoint;
+        try {
+            thirdPoint = geoManager.createPoint(10, 0, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(thirdPoint);
+        } catch (Exception e) {
+            fail("Unexpected exception getting next parameter: "
+                + e.getMessage());
+        }
+
+        assertNull(service.next());
+
+        // Try to set a no valid value.
+        try{
+            service.stop();
+            service.start();
+        } catch (Exception e) {
+            fail();
+        }
+
+        assertNotNull(service.next());
+        assertEquals(firstPointParameter, service.next());
+
+        try {
+            service.setValue(10.0);
+        } catch (InvalidEntryException e) {
+            // Got expected value when radius is instance of Double. If radius
+            // is a string point, service will set that value like center.
+        }
+
+        // Check service.next() returns center
+        assertEquals(firstPointParameter, service.next());
+
+    }
+
+    public void testsetValue() {
+
+        // Try to set invalid firstPoint
+        Point firstPoint = null;
+        try {
+            service.setValue(firstPoint);
+        } catch (InvalidEntryException e1) {
+            // Test ok, got expected exception
+        }
+
+        // Try to set radius = 0
+        double radius = 0;
+        try {
+            service.setValue(radius);
+        } catch (InvalidEntryException e1) {
+            // Test ok, got expected exception
+        } catch (Exception e) {
+            fail("Unexpected exception setting an invalid value(0): " + e.getMessage());
+        }
+
+        // Try to set valid firstPoint
+        try {
+            firstPoint = geoManager.createPoint(-10, 0, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(firstPoint);
+        } catch (Exception e) {
+            fail("Unexpected exception setting valid first point: " + e.getMessage());
+        }
+
+        // Check firstPoint has been set
+        assertTrue(service.next().getTypes().size() == 1);
+        assertTrue(service.next().getTypes()
+            .contains(EditingServiceParameter.TYPE.POSITION));
+
+
+        // Try to set valid secondPoint
+        Point secondPoint = null;
+        try {
+            secondPoint = geoManager.createPoint(0, 10, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(secondPoint);
+        } catch (Exception e) {
+            fail("Unexpected exception setting valid first point: " + e.getMessage());
+        }
+
+        // Check firstPoint has been set
+        assertTrue(service.next().getTypes().size() == 1);
+        assertTrue(service.next().getTypes()
+            .contains(EditingServiceParameter.TYPE.POSITION));
+
+        // Try to set valid thirdPoint
+        Point thirdPoint = null;
+        try {
+            thirdPoint = geoManager.createPoint(10, 0, Geometry.SUBTYPES.GEOM2D);
+            service.setValue(thirdPoint);
+        } catch (Exception e) {
+            fail("Unexpected exception setting valid first point: " + e.getMessage());
+        }
+
+        assertNull(service.next());
+    }
+
+    public void testStart() {
+        service =
+            editingManager.getEditingService(
+                Circle3PEditingProviderFactory.PROVIDER_NAME, featureStoreTest,
+                mapContextTest);
+
+        try {
+            service.start();
+        } catch (VectorEditingException e) {
+            fail("Unexpected exception starting service: " + e.getMessage());
+        }
+    }
+
+    public void testStop() {
+        service =
+            editingManager.getEditingService(
+                Circle3PEditingProviderFactory.PROVIDER_NAME, featureStoreTest,
+                mapContextTest);
+
+        try {
+            service.start();
+            service.stop();
+        } catch (VectorEditingException e) {
+            fail("Unexpected exception starting or stopping service: "
+                + e.getMessage());
+        }
+    }
+
+    private FeatureStore openFeatureStoretest(String resourceName)
+        throws Exception {
+
+        URL shapeURL =
+            this.getClass().getResource("/cartography/" + resourceName);
+        if (shapeURL == null) {
+            throw new IllegalStateException("Can't locate cartography resource");
+        }
+        File shapeFile = new File(shapeURL.getFile());
+        if (!shapeFile.exists()) {
+            throw new IllegalStateException("cartography resource not exists");
+        }
+
+        dataManager = DALLocator.getDataManager();
+
+        DataStoreParameters params = dataManager.createStoreParameters("Shape");
+
+        params.setDynValue("shpfile", shapeFile);
+        params.setDynValue("CRS", CRSFactory.getCRS("EPSG:23030"));
+        params.setDynValue("useNullGeometry", false);
+        params.validate();
+
+        return (FeatureStore) dataManager.openStore("Shape", params);
+
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.circle3p.Circle3PEditingLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/resources/images/vectorediting-tools/insert-circle-3p.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/resources/images/vectorediting-tools/insert-circle-3p.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/resources/images/vectorediting-tools/insert-circumference-3p.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/resources/images/vectorediting-tools/insert-circumference-3p.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/java/org/gvsig/vectorediting/lib/prov/circle3p/Circumference3PEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/java/org/gvsig/vectorediting/lib/prov/circle3p/Circumference3PEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/java/org/gvsig/vectorediting/lib/prov/circle3p/Circumference3PEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,82 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.circle3p;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+public class Circumference3PEditingProviderFactory extends
+AbstractProviderFactory implements EditingProviderFactory {
+
+    public static final String PROVIDER_NAME = "insert-circumference-3p";
+
+    private final static String PROVIDER_DESCRIPTION =
+        "Creates circumferences from three points";
+
+    public void initialize() {
+
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", true, null,
+                new int[] { Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new Circumference3PEditingProvider(services, parameters);
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+        return dynclass;
+
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/java/org/gvsig/vectorediting/lib/prov/circle3p/Circle3PEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/java/org/gvsig/vectorediting/lib/prov/circle3p/Circle3PEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/java/org/gvsig/vectorediting/lib/prov/circle3p/Circle3PEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,86 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.circle3p;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+public class Circle3PEditingProviderFactory extends AbstractProviderFactory
+implements EditingProviderFactory {
+
+    public static final String PROVIDER_NAME = "insert-circle-3p";
+
+    private final static String PROVIDER_DESCRIPTION =
+        "Creates circles from three points";
+
+    public void initialize() {
+
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(
+                PROVIDER_NAME,
+                "",
+                true,
+                null,
+                new int[] { Geometry.TYPES.POLYGON, Geometry.TYPES.MULTIPOLYGON, Geometry.TYPES.SURFACE, Geometry.TYPES.MULTISURFACE });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new Circle3PEditingProvider(services, parameters);
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+        return dynclass;
+
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/java/org/gvsig/vectorediting/lib/prov/circle3p/Circumference3PEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/java/org/gvsig/vectorediting/lib/prov/circle3p/Circumference3PEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/java/org/gvsig/vectorediting/lib/prov/circle3p/Circumference3PEditingProvider.java	(revision 1663)
@@ -0,0 +1,118 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.circle3p;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.primitive.Circumference;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+public class Circumference3PEditingProvider extends Circle3PEditingProvider
+    implements EditingProvider {
+
+    public Circumference3PEditingProvider(ProviderServices providerServices,
+        DynObject parameters) {
+        super(providerServices, parameters);
+    }
+
+    @Override
+    public Geometry finish() throws FinishServiceException {
+
+        GeometryManager geomManager = GeometryLocator.getGeometryManager();
+
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        Point firstPointValue = (Point) values.get(firstPoint);
+        Point secondPointValue = (Point) values.get(secondPoint);
+        Point thirdPointValue = (Point) values.get(thirdPoint);
+
+        try {
+            int subtype = editingProviderServices.getSubType(featureStore);
+
+            Point center =
+                editingProviderServices.getCenter(firstPointValue,
+                    secondPointValue, thirdPointValue, subtype);
+            double radius = center.distance(firstPointValue);
+
+            Circumference circumference = (Circumference)geomManager.create(CIRCUMFERENCE, subtype);
+            circumference.setPoints(center, radius);
+
+            GeometryType geomType =
+                editingProviderServices.getGeomType(featureStore);
+
+            if (geomType.isTypeOf(MULTICURVE)) {
+                MultiCurve multicurve;
+                multicurve =
+                    GeometryLocator.getGeometryManager().createMultiCurve(
+                        geomType.getSubType());
+                multicurve.addCurve((Circumference) circumference);
+                return multicurve;
+            }
+
+            return circumference;
+        } catch (Exception e) {
+            throw new FinishServiceException(e);
+        }
+    }
+
+    @Override
+    public String getName() {
+        return Circumference3PEditingProviderFactory.PROVIDER_NAME;
+    }
+
+
+    /**
+     * @param drawingStatus
+     * @param subtype
+     * @param center
+     * @param radius
+     * @throws CreateGeometryException
+     */
+    protected void addTemporaryGeometryToDrawingStatus(DefaultDrawingStatus drawingStatus, int subtype, Point center, double radius)
+        throws CreateGeometryException {
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol lineSymbolEditing = editingProviderManager.getSymbol("line-symbol-editing");
+        GeometryManager geomManager = GeometryLocator.getGeometryManager();
+        Circumference circumference = (Circumference)geomManager.create(Geometry.TYPES.CIRCUMFERENCE, subtype);
+        circumference.setPoints(center, radius);
+        drawingStatus.addStatus(circumference, lineSymbolEditing, "");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/java/org/gvsig/vectorediting/lib/prov/circle3p/Circle3PEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/java/org/gvsig/vectorediting/lib/prov/circle3p/Circle3PEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/java/org/gvsig/vectorediting/lib/prov/circle3p/Circle3PEditingLibrary.java	(revision 1663)
@@ -0,0 +1,68 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.circle3p;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+public class Circle3PEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new Circle3PEditingProviderFactory());
+        manager.addProviderFactory(new Circumference3PEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "insert-circle-3p", this
+            .getClass().getClassLoader(), this.getClass().getName());
+        manager.registerIcon("vectorediting-tools", "insert-circumference-3p",
+            this.getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "circle-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/java/org/gvsig/vectorediting/lib/prov/circle3p/Circle3PEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/java/org/gvsig/vectorediting/lib/prov/circle3p/Circle3PEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/src/main/java/org/gvsig/vectorediting/lib/prov/circle3p/Circle3PEditingProvider.java	(revision 1663)
@@ -0,0 +1,311 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.circle3p;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.aggregate.MultiSurface;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.primitive.Circle;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+public class Circle3PEditingProvider extends AbstractEditingProvider implements
+    EditingProvider {
+
+    protected FeatureStore featureStore;
+
+    protected EditingServiceParameter firstPoint;
+
+    protected EditingServiceParameter secondPoint;
+
+    protected EditingServiceParameter thirdPoint;
+
+    protected Map<EditingServiceParameter, Object> values;
+
+    /**
+     * Default constructor.
+     *
+     * @param services
+     *            available services to this provider
+     * @param parameters
+     *            to create this provider
+     */
+    public Circle3PEditingProvider(ProviderServices services,
+        DynObject parameters) {
+        super(services);
+
+        this.featureStore =
+            (FeatureStore) parameters
+                .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.firstPoint =
+            new DefaultEditingServiceParameter("first_point", "first_point",
+                TYPE.POSITION);
+
+        this.secondPoint =
+            new DefaultEditingServiceParameter("second_point", "second_point",
+                TYPE.POSITION);
+
+        this.thirdPoint =
+            new DefaultEditingServiceParameter("third_point", "third_point",
+                TYPE.POSITION);
+    }
+
+    public EditingServiceParameter next() {
+        if (values != null) {
+
+            if (values.get(firstPoint) == null) {
+                return firstPoint;
+            } else if (values.get(secondPoint) == null) {
+                return secondPoint;
+            } else if (values.get(thirdPoint) == null) {
+                return thirdPoint;
+            }
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+
+        DefaultDrawingStatus drawingStatus = new DefaultDrawingStatus();
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol polygonSymbolEditing = editingProviderManager.getSymbol("polygon-symbol-editing");
+        ISymbol auxiliaryLineSymbolEditing = editingProviderManager.getSymbol("auxiliary-line-symbol-editing");
+        ISymbol auxiliaryPointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+
+        if (values != null) {
+
+            Point firstPointValue = (Point) values.get(firstPoint);
+            Point secondPointValue = (Point) values.get(secondPoint);
+            Point thirdPointValue = (Point) values.get(thirdPoint);
+
+            EditingProviderServices editingProviderServices =
+                (EditingProviderServices) getProviderServices();
+
+            if (firstPointValue != null && secondPointValue == null) {
+
+                try {
+
+                    int subtype =
+                        editingProviderServices.getSubType(featureStore);
+                    drawingStatus.addStatus(firstPointValue, auxiliaryPointSymbolEditing, "");
+                    drawingStatus.addStatus(mousePosition, auxiliaryPointSymbolEditing, "");
+
+                    Curve line =
+                        editingProviderServices.createLine(firstPointValue,
+                            mousePosition, subtype);
+                    drawingStatus.addStatus(line, auxiliaryLineSymbolEditing, "");
+
+                } catch (Exception e) {
+                    throw new DrawServiceException(e);
+                }
+
+            } else if (firstPointValue != null && secondPointValue != null && thirdPointValue == null) {
+
+                try {
+
+                    int subtype =
+                        editingProviderServices.getSubType(featureStore);
+
+                    Curve line1 =
+                        editingProviderServices.createLine(firstPointValue,
+                            secondPointValue, subtype);
+                    drawingStatus.addStatus(line1, auxiliaryLineSymbolEditing, "");
+
+                    Curve line2 =
+                        editingProviderServices.createLine(secondPointValue,
+                            mousePosition, subtype);
+                    drawingStatus.addStatus(line2, auxiliaryLineSymbolEditing, "");
+                    drawingStatus.addStatus(firstPointValue, auxiliaryPointSymbolEditing, "");
+                    drawingStatus.addStatus(secondPointValue, auxiliaryPointSymbolEditing, "");
+                    drawingStatus.addStatus(mousePosition, auxiliaryPointSymbolEditing, "");
+
+                    Point center =
+                        editingProviderServices.getCenter(firstPointValue,
+                            secondPointValue, mousePosition, subtype);
+                    double radius = center.distance(firstPointValue);
+
+                    addTemporaryGeometryToDrawingStatus(drawingStatus, subtype, center, radius);
+                    drawingStatus.addStatus(center, auxiliaryPointSymbolEditing, "");
+
+                } catch (Exception e) {
+                    throw new DrawServiceException(e);
+                }
+            }
+        }
+        return drawingStatus;
+    }
+
+    /**
+     * @param drawingStatus
+     * @param subtype
+     * @param center
+     * @param radius
+     * @throws CreateGeometryException
+     */
+    protected void addTemporaryGeometryToDrawingStatus(DefaultDrawingStatus drawingStatus, int subtype, Point center, double radius)
+        throws CreateGeometryException {
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol polygonSymbolEditing = editingProviderManager.getSymbol("polygon-symbol-editing");
+        GeometryManager geomManager = GeometryLocator.getGeometryManager();
+        Circle circle = (Circle)geomManager.create(Geometry.TYPES.CIRCLE, subtype);
+        circle.setPoints(center, radius);
+        drawingStatus.addStatus(circle, polygonSymbolEditing, "");
+    }
+
+    public void stop() throws StopServiceException {
+        if (values != null) {
+            values.clear();
+        }
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(firstPoint);
+        parameters.add(secondPoint);
+        parameters.add(thirdPoint);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter parameter = next();
+        validateAndInsertValue(parameter, value);
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter parameter,
+        Object value) throws InvalidEntryException {
+        if (parameter == firstPoint) {
+            if (value instanceof Point) {
+                values.put(parameter, value);
+                return;
+            }
+        } else if (parameter == secondPoint) {
+            if (value instanceof Point) {
+                values.put(parameter, value);
+                return;
+            }
+        } else if (parameter == thirdPoint) {
+            if (value instanceof Point) {
+                values.put(parameter, value);
+                return;
+            }
+        }
+        throw new InvalidEntryException(null);
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        if (values != null) {
+
+            Point firstPointValue = (Point) values.get(firstPoint);
+            Point secondPointValue = (Point) values.get(secondPoint);
+            Point thirdPointValue = (Point) values.get(thirdPoint);
+
+            EditingProviderServices editingProviderServices =
+                (EditingProviderServices) getProviderServices();
+
+            try {
+
+                int subtype = editingProviderServices.getSubType(featureStore);
+
+                Point center =
+                    editingProviderServices.getCenter(firstPointValue,
+                        secondPointValue, thirdPointValue, subtype);
+                double radius = center.distance(firstPointValue);
+
+                Circle circle =
+                    editingProviderServices.createCircle(center, radius,
+                        subtype);
+
+                GeometryType geomType =
+                    editingProviderServices.getGeomType(featureStore);
+
+                if (geomType.isTypeOf(MULTISURFACE)) {
+
+                    MultiSurface multiSurface;
+                    multiSurface =
+                        GeometryLocator.getGeometryManager()
+                            .createMultiSurface(geomType.getSubType());
+                    multiSurface.addSurface(circle);
+                    return multiSurface;
+                }
+
+                return circle;
+            } catch (Exception e) {
+                throw new FinishServiceException(e);
+            }
+        }
+        throw new FinishServiceException(null);
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+        Geometry circle = finish();
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+        editingProviderServices.insertGeometryIntoFeatureStore(circle,
+            featureStore);
+    }
+
+    public void start() throws StartServiceException {
+        values = new HashMap<EditingServiceParameter, Object>();
+
+    }
+
+    public String getName() {
+        return Circle3PEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.circle3p</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.circle3p</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.circle3p
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.prov.arc.ArcEditingLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc/src/main/resources/images/vectorediting-tools/insert-arc.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc/src/main/resources/images/vectorediting-tools/insert-arc.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc/src/main/java/org/gvsig/vectorediting/lib/prov/arc/ArcEditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc/src/main/java/org/gvsig/vectorediting/lib/prov/arc/ArcEditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc/src/main/java/org/gvsig/vectorediting/lib/prov/arc/ArcEditingLibrary.java	(revision 1663)
@@ -0,0 +1,91 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.prov.arc;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+
+/**
+ * @author llmarques
+ *
+ */
+public class ArcEditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingProviderManager manager =
+            EditingProviderLocator.getProviderManager();
+
+        manager.addProviderFactory(new ArcEditingProviderFactory());
+
+        manager.registerIcon("vectorediting-tools", "insert-arc", this
+            .getClass().getClassLoader(), this.getClass().getName());
+
+        registerTranslations();
+    }
+
+    private void registerTranslations() {
+        I18nManager manager = ToolsLocator.getI18nManager();
+        manager.addResourceFamily("i18n/text",
+            this.getClass().getClassLoader(), "insert-arc-editing");
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc/src/main/java/org/gvsig/vectorediting/lib/prov/arc/ArcEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc/src/main/java/org/gvsig/vectorediting/lib/prov/arc/ArcEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc/src/main/java/org/gvsig/vectorediting/lib/prov/arc/ArcEditingProvider.java	(revision 1663)
@@ -0,0 +1,284 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.arc;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.aggregate.MultiCurve;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Curve;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.spi.AbstractEditingProvider;
+import org.gvsig.vectorediting.lib.spi.DefaultDrawingStatus;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProvider;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.lib.spi.EditingProviderManager;
+import org.gvsig.vectorediting.lib.spi.EditingProviderServices;
+
+/**
+ * @author llmarques
+ *
+ */
+public class ArcEditingProvider extends AbstractEditingProvider implements
+EditingProvider {
+
+    private EditingServiceParameter startPoint;
+
+    private EditingServiceParameter endPoint;
+
+    private EditingServiceParameter middlePoint;
+
+    private Map<EditingServiceParameter, Object> values;
+
+    private FeatureStore featureStore;
+
+    /**
+     * Default constructor.
+     *
+     * @param providerServices
+     *            available services for this provider
+     * @param parameters
+     *            of this provider
+     */
+    public ArcEditingProvider(ProviderServices providerServices,
+        DynObject parameters) {
+        super(providerServices);
+
+        this.featureStore =
+            (FeatureStore) parameters
+            .getDynValue(EditingProviderFactory.FEATURE_STORE_FIELD);
+
+        this.startPoint =
+            new DefaultEditingServiceParameter("start_point", "start_point",
+                TYPE.POSITION);
+
+        this.endPoint =
+            new DefaultEditingServiceParameter("end_point", "end_point",
+                TYPE.POSITION);
+
+        this.middlePoint =
+            new DefaultEditingServiceParameter("middle_point", "middle_point",
+                TYPE.POSITION);
+    }
+
+    public EditingServiceParameter next() {
+        if (values.get(startPoint) == null) {
+            return this.startPoint;
+        } else if (values.get(endPoint) == null) {
+            return this.endPoint;
+        } else if (values.get(middlePoint) == null) {
+            return this.middlePoint;
+        }
+        return null;
+    }
+
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException {
+        DefaultDrawingStatus geometries = new DefaultDrawingStatus();
+
+        EditingProviderManager editingProviderManager =
+            EditingProviderLocator.getProviderManager();
+        ISymbol lineSymbolEditing = editingProviderManager.getSymbol("auxiliary-line-symbol-editing");
+        ISymbol auxiliaryLineSymbolEditing = editingProviderManager.getSymbol("auxiliary-line-symbol-editing");
+        ISymbol auxiliaryPointSymbolEditing = editingProviderManager.getSymbol("auxiliary-point-symbol-editing");
+
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        if ((values != null) && (values.get(startPoint) != null)) {
+
+            Point startPointValue = (Point) values.get(startPoint);
+            geometries.addStatus(startPointValue, auxiliaryPointSymbolEditing, "");
+
+            if (values.get(endPoint) == null) {
+
+                try {
+                    int subtype =
+                        editingProviderServices.getSubType(featureStore);
+                    Curve line =
+                        editingProviderServices.createLine(startPointValue,
+                            mousePosition, subtype);
+                    geometries.addStatus(line, auxiliaryLineSymbolEditing, "");
+
+
+                } catch (Exception e) {
+                    throw new DrawServiceException(e);
+                }
+
+                return geometries;
+
+            } else {
+
+                Point endPointValue = (Point) values.get(endPoint);
+                geometries.addStatus(endPointValue, auxiliaryPointSymbolEditing, "");
+
+                try {
+                    int subtype =
+                        editingProviderServices.getSubType(featureStore);
+                    Curve line1 =
+                        editingProviderServices.createLine(startPointValue,mousePosition, subtype);
+                    geometries.addStatus(line1, auxiliaryLineSymbolEditing, "");
+                    Curve line2 =
+                        editingProviderServices.createLine(endPointValue,mousePosition, subtype);
+                    geometries.addStatus(line2, auxiliaryLineSymbolEditing, "");
+
+                    Point center =
+                        editingProviderServices.getCenter(startPointValue,
+                            mousePosition, endPointValue, subtype);
+                    geometries.addStatus(center, auxiliaryPointSymbolEditing, "");
+
+                    Curve arc =
+                        editingProviderServices.createArc(startPointValue,
+                            mousePosition, endPointValue, subtype);
+                    geometries.addStatus(arc, lineSymbolEditing, "");
+
+                } catch (Exception e) {
+                    throw new DrawServiceException(e);
+                }
+
+                return geometries;
+            }
+        }
+        return null;
+    }
+
+    public void stop() throws StopServiceException {
+        values.clear();
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        List<EditingServiceParameter> parameters =
+            new ArrayList<EditingServiceParameter>();
+        parameters.add(startPoint);
+        parameters.add(endPoint);
+        parameters.add(middlePoint);
+        return parameters;
+    }
+
+    public void setValue(Object value) throws InvalidEntryException {
+        EditingServiceParameter param = next();
+        validateAndInsertValue(param, value);
+    }
+
+    private void validateAndInsertValue(EditingServiceParameter param,
+        Object value) throws InvalidEntryException {
+        if (param == startPoint) {
+            if (value instanceof Point) {
+                values.put(param, value);
+                return;
+            }
+        } else if (param == endPoint) {
+            if (value instanceof Point) {
+                if(((Point)value).equals((Point)values.get(startPoint))){
+                    throw new InvalidEntryException(null);
+                }
+                values.put(param, value);
+                return;
+            }
+        } else if (param == middlePoint) {
+            if (value instanceof Point) {
+                if(((Point)value).equals((Point)values.get(startPoint)) || ((Point)value).equals((Point)values.get(endPoint))){
+                    throw new InvalidEntryException(null);
+                }
+                values.put(param, value);
+                return;
+            }
+        }
+        throw new InvalidEntryException(null);
+    }
+
+    public Geometry finish() throws FinishServiceException {
+        Point startPointValue = (Point) values.get(startPoint);
+        Point middlePointValue = (Point) values.get(middlePoint);
+        Point endPointValue = (Point) values.get(endPoint);
+
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+
+        try {
+
+            int subtype =
+                editingProviderServices.getSubType(featureStore);
+
+            Curve arc =
+                editingProviderServices.createArc(startPointValue,
+                    middlePointValue, endPointValue, subtype);
+
+            GeometryType geomType =
+                editingProviderServices.getGeomType(featureStore);
+
+            if (geomType.isTypeOf(MULTICURVE)) {
+
+                MultiCurve multiCurve;
+                multiCurve =
+                    GeometryLocator.getGeometryManager().createMultiCurve(
+                        geomType.getSubType());
+                multiCurve.addCurve(arc);
+                return multiCurve;
+            }
+
+            return arc;
+        } catch (Exception e) {
+            throw new FinishServiceException(e);
+        }
+    }
+
+    public void finishAndStore() throws FinishServiceException {
+        Geometry geometry = finish();
+        EditingProviderServices editingProviderServices =
+            (EditingProviderServices) getProviderServices();
+        editingProviderServices.insertGeometryIntoFeatureStore(geometry,
+            featureStore);
+    }
+
+    public void start() throws StartServiceException {
+        values = new HashMap<EditingServiceParameter, Object>();
+    }
+
+    public String getName() {
+        return ArcEditingProviderFactory.PROVIDER_NAME;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc/src/main/java/org/gvsig/vectorediting/lib/prov/arc/ArcEditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc/src/main/java/org/gvsig/vectorediting/lib/prov/arc/ArcEditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc/src/main/java/org/gvsig/vectorediting/lib/prov/arc/ArcEditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,85 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.prov.arc;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.service.spi.AbstractProviderFactory;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.tools.service.spi.ProviderServices;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.spi.DefaultEditingServiceinfo;
+import org.gvsig.vectorediting.lib.spi.EditingProviderFactory;
+
+/**
+ * @author llmarques
+ *
+ */
+public class ArcEditingProviderFactory extends AbstractProviderFactory
+implements EditingProviderFactory {
+
+    public static final String PROVIDER_NAME = "insert-arc";
+
+    private final static String PROVIDER_DESCRIPTION =
+        "Creates arcs with three points";
+
+    public void initialize() {
+    }
+
+    public EditingServiceInfo getServiceInfo() {
+        EditingServiceInfo serviceInfo =
+            new DefaultEditingServiceinfo(PROVIDER_NAME, "", true, null,
+                new int[] { Geometry.TYPES.LINE, Geometry.TYPES.MULTILINE, Geometry.TYPES.CURVE, Geometry.TYPES.MULTICURVE });
+
+        return serviceInfo;
+    }
+
+    @Override
+    protected Provider doCreate(DynObject parameters, ProviderServices services) {
+        return new ArcEditingProvider(services, parameters);
+    }
+
+    @Override
+    public DynObject createParameters() {
+        DynObject parameters = super.createParameters();
+        parameters.setDynValue(PROVIDER_NAME_FIELD, PROVIDER_NAME);
+        return parameters;
+    }
+
+    @Override
+    protected DynClass createParametersDynClass() {
+        DynClass dynclass =
+            ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME,
+                PROVIDER_DESCRIPTION);
+
+        dynclass.addDynFieldString(PROVIDER_NAME_FIELD);
+        dynclass.addDynFieldObject(FEATURE_STORE_FIELD);
+        dynclass.addDynFieldObject(MAPCONTEXT_FIELD);
+        return dynclass;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc/pom.xml	(revision 1663)
@@ -0,0 +1,10 @@
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.gvsig</groupId>
+    <artifactId>org.gvsig.vectorediting.lib.prov</artifactId>
+    <version>1.0.92</version>
+  </parent>
+  <artifactId>org.gvsig.vectorediting.lib.prov.arc</artifactId>
+  <name>org.gvsig.vectorediting.lib.prov.arc</name>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc
___________________________________________________________________
Added: svn:ignore
   + target



Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov
___________________________________________________________________
Added: svn:ignore
   + .directory


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.api.EditingLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/EditingManager.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/EditingManager.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/EditingManager.java	(revision 1663)
@@ -0,0 +1,73 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api;
+
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.tools.service.Manager;
+import org.gvsig.vectorediting.lib.api.exceptions.ServiceInformationException;
+
+/**
+ * Main class that defines the available Editing services.
+ * 
+ * @author llmarques
+ * @version $Id$
+ */
+public interface EditingManager extends Manager {
+
+    /**
+     * Gets read only information about a service such as if service creates new
+     * geometries, name, description, supported types, mouse icon, parameters
+     * and information about its parameters.
+     *
+     * @param serviceName
+     *            service name to get the service information
+     * @return An <code>EditingServiceInfo</code> object that contains the
+     *         information. {@link EditingServiceInfo}.
+     * @throws ServiceInformationException
+     *             if there is an error getting
+     *             information of service.
+     */
+    public EditingServiceInfo getServiceInfo(String serviceName)
+        throws ServiceInformationException;
+
+    /**
+     * Gets a new instance of service as of name and featureStore. Check
+     * names to know what names are accepted.
+     *
+     * @param name
+     *            Service name necessary to create an instance linked with the
+     *            appropriate provider.
+     * @param featureStore
+     *            FeatureStore associated with this service necessary to
+     *            create, update and remove geometries.
+     * @param mapContext
+     *            of layer in editing mode
+     * @return An <code> EditingService </code> object. See
+     *         {@link EditingService} .
+     */
+    public EditingService getEditingService(String name,
+        FeatureStore featureStore, MapContext mapContext);
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/DrawingStatus.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/DrawingStatus.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/DrawingStatus.java	(revision 1663)
@@ -0,0 +1,82 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.lib.api;
+
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+
+/**
+ * Drawing status represents the status when an user are drawing geometries.
+ * This status includes geometries and information. It is used to show a preview
+ * of the service result.
+ *
+ * List of geometries of this drawing status can be different from final
+ * geometries created by service. Sometimes, some auxiliary geometries are added
+ * to help users. For example, when user draws a circle, the radius is also
+ * showed.
+ *
+ * Information contains data about parameters of geometries. For example, when
+ * an user is drawing a line, it is interesting to show values like angle, slope
+ * or y-intercept.
+ *
+ * @author gvSIG team.
+ * @version $Id$
+ */
+public interface DrawingStatus {
+
+    interface Status{
+        public Geometry getGeometry();
+
+        public ISymbol getSymbol();
+
+        public String getText();
+
+    }
+
+    /**
+     * Gets list of geometries to be drawn.
+     *
+     * @return
+     */
+    public List<Geometry> getGeometries();
+
+
+    /**
+     * Gets list of status to be drawn.
+     *
+     * @return
+     */
+    public List<Status> getStatus();
+
+    /**
+     * Gets information about position of geometries, angles, distances among
+     * geometries...
+     *
+     * @return
+     */
+    public String getInfo();
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/EditingServiceInfo.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/EditingServiceInfo.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/EditingServiceInfo.java	(revision 1663)
@@ -0,0 +1,113 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api;
+
+import java.awt.Image;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry.TYPES;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.vectorediting.lib.api.exceptions.ServiceInformationException;
+
+/**
+ * <p>
+ * Editing service represents the available read-only information about a
+ * service. This information is composed by type (creates geometries or not),
+ * mouse icon, list of parameters, supported geometries, description, name,
+ * information of parameters, and compatibility with {@link GeometryType}.
+ * </p>
+
+ * @author gvSIG team.
+ * @version $Id$
+ */
+public interface EditingServiceInfo {
+
+    /**
+     * Returns if service creates new geometries.
+     *
+     * @return true if service creates new geometries otherwise false.
+     */
+    public boolean createsNewGeometries();
+
+    /**
+     * Get mouse icon associated to service.
+     *
+     * @return Image that represents mouse icon.
+     */
+    public Image getMouseIcon();
+
+    /**
+     * Gets a <code>List</code> with all parameters of service. Each parameter
+     * has name, description and types. See {@link EditingServiceParameter}.
+     *
+     * @return A list of {@link EditingServiceParameter} objects.
+     */
+    public List<EditingServiceParameter> getParameters();
+
+    /**
+     * Gets supported primitive geometry types of service. Primitive types must
+     * be {@link TYPES}.
+     *
+     * @return An array whit primitive type supported
+     */
+    public int[] getSupportedPrimitiveGeometryTypes();
+
+    /**
+     * Gets description of service.
+     *
+     * @return Description of service.
+     */
+    public String getDescription();
+
+    /**
+     * Gets name of service. The name of service is the same name of linked
+     * provider name.
+     *
+     * @return service name.
+     */
+    public String getName();
+
+    /**
+     * Gets read only information about a parameter of this service. See
+     * {@link EditingServiceParameter}.
+     *
+     * @param name
+     *            Name of parameter.
+     * @return An {@link EditingServiceParameter} object of parameter.
+     */
+    public EditingServiceParameter getParameterInfo(String name);
+
+    /**
+     * Returns if service is compatible with the geometry type received as
+     * parameter.
+     *
+     * @param geotype
+     *            see {@link GeometryType}
+     * @return True if service is compatible otherwise false.
+     */
+    public boolean isCompatibleWith(GeometryType geoType)
+        throws ServiceInformationException;
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/DrawServiceException.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/DrawServiceException.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/DrawServiceException.java	(revision 1663)
@@ -0,0 +1,43 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api.exceptions;
+
+public class DrawServiceException extends EditingServiceException {
+
+    private static final long serialVersionUID = -305271540045091091L;
+
+    private static final String MESSAGE =
+        "An error has been produced drawing geometries.";
+
+    private static final String KEY = "_DrawServiceException";
+
+    public DrawServiceException(Throwable ex) {
+        super(MESSAGE, ex, KEY, serialVersionUID);
+    }
+
+    public DrawServiceException(String msg, Throwable ex) {
+        super(msg, ex, KEY, serialVersionUID);
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/StartServiceException.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/StartServiceException.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/StartServiceException.java	(revision 1663)
@@ -0,0 +1,40 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api.exceptions;
+
+public class StartServiceException extends EditingServiceException {
+
+    private static final long serialVersionUID = -1368352148381697338L;
+
+    private static final String MESSAGE =
+        "An error has been produced starting the service.";
+
+    private static final String KEY = "_StartServiceException";
+
+    public StartServiceException(Throwable ex) {
+        super(MESSAGE, ex, KEY, serialVersionUID);
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/FinishServiceException.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/FinishServiceException.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/FinishServiceException.java	(revision 1663)
@@ -0,0 +1,43 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api.exceptions;
+
+public class FinishServiceException extends EditingServiceException {
+
+    private static final long serialVersionUID = -1289186566439942967L;
+
+    private static final String MESSAGE =
+        "An error has been produced finishing service.";
+
+    private static final String KEY = "_FinishServiceException";
+
+    public FinishServiceException(Throwable ex) {
+        super(MESSAGE, ex, KEY, serialVersionUID);
+    }
+
+    public FinishServiceException(String message, Throwable ex) {
+        super(message, ex, KEY, serialVersionUID);
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/StartEditingException.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/StartEditingException.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/StartEditingException.java	(revision 1663)
@@ -0,0 +1,44 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api.exceptions;
+
+public class StartEditingException extends VectorEditingException {
+
+    private static final long serialVersionUID = 3223155291885793084L;
+
+    private static final String MESSAGE =
+        "An error has been produced starting edition.";
+
+    private static final String KEY = "_StartEditionException";
+
+    public StartEditingException(Throwable ex) {
+        super(MESSAGE, ex, KEY, serialVersionUID);
+    }
+
+    public StartEditingException(String message, Throwable ex) {
+        super(message, ex, KEY, serialVersionUID);
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/EditingServiceException.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/EditingServiceException.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/EditingServiceException.java	(revision 1663)
@@ -0,0 +1,88 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api.exceptions;
+
+public class EditingServiceException extends VectorEditingException {
+
+    private static final long serialVersionUID = 3053840379042307445L;
+
+    private static final String MESSAGE =
+        "An error has been produced in the VectorEditing library";
+
+    private static final String KEY = "_EditingServiceException";
+
+    /**
+     * Constructor to be used in rare cases, usually you must create a new child
+     * exception class for each case.
+     * <strong>Don't use this constructor in child classes.</strong>
+     */
+    public EditingServiceException() {
+        super(MESSAGE, KEY, serialVersionUID);
+    }
+
+    /**
+     * Constructor to be used in rare cases, usually you must create a new child
+     * exception class for each case.
+     * <p>
+     * <strong>Don't use this constructor in child classes.</strong>
+     * </p>
+     *
+     * @param cause
+     *            the original cause of the exception
+     */
+    public EditingServiceException(Exception cause) {
+        super(MESSAGE, cause, KEY, serialVersionUID);
+    }
+
+    /**
+     * @see BaseException#BaseException(String, String, long).
+     * @param message
+     *            the default messageFormat to describe the exception
+     * @param key
+     *            the key to use to search a localized messageFormnata
+     * @param code
+     *            the unique code to identify the exception
+     */
+    protected EditingServiceException(String message, String key, long code) {
+        super(message, key, code);
+    }
+
+    /**
+     * @see BaseException#BaseException(String, Throwable, String, long).
+     * @param message
+     *            the default messageFormat to describe the exception
+     * @param cause
+     *            the original cause of the exception
+     * @param key
+     *            the key to use to search a localized messageFormnata
+     * @param code
+     *            the unique code to identify the exception
+     */
+    protected EditingServiceException(String message, Throwable cause,
+        String key, long code) {
+        super(message, cause, key, code);
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/ParsePointException.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/ParsePointException.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/ParsePointException.java	(revision 1663)
@@ -0,0 +1,40 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api.exceptions;
+
+public class ParsePointException extends ParseException {
+
+    private static final long serialVersionUID = 6461347009855377979L;
+
+    private static final String MESSAGE =
+        "An error has been produced parsing point inserted. Please check format";
+
+    private static final String KEY = "_ParsePointException";
+
+    public ParsePointException(Throwable ex) {
+        super(MESSAGE, ex, KEY, serialVersionUID);
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/ChangeCurrentLayerException.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/ChangeCurrentLayerException.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/ChangeCurrentLayerException.java	(revision 1663)
@@ -0,0 +1,42 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api.exceptions;
+
+public class ChangeCurrentLayerException extends VectorEditingException {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = 8313545531034322640L;
+
+    private static final String MESSAGE =
+        "An error has been changing current layer.";
+
+    private static final String KEY = "_ChangeCurrentLayerException";
+
+    public ChangeCurrentLayerException(Throwable ex) {
+        super(MESSAGE, ex, KEY, serialVersionUID);
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/ServiceInformationException.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/ServiceInformationException.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/ServiceInformationException.java	(revision 1663)
@@ -0,0 +1,43 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api.exceptions;
+
+public class ServiceInformationException extends VectorEditingException {
+
+    private static final long serialVersionUID = 8313545531034322640L;
+
+    private static final String MESSAGE =
+        "An error has been getting service information.";
+
+    private static final String KEY = "_ServiceInformationException";
+
+    public ServiceInformationException(Throwable ex) {
+        super(MESSAGE, ex, KEY, serialVersionUID);
+    }
+
+    public ServiceInformationException(String message, Throwable ex) {
+        super(message, ex, KEY, serialVersionUID);
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/StopServiceException.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/StopServiceException.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/StopServiceException.java	(revision 1663)
@@ -0,0 +1,40 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api.exceptions;
+
+public class StopServiceException extends EditingServiceException {
+
+    private static final long serialVersionUID = -4063545494462367961L;
+
+    private static final String MESSAGE =
+        "An error has been produced stopping the service.";
+
+    private static final String KEY = "_StopServiceException";
+
+    public StopServiceException(Throwable ex) {
+        super(MESSAGE, ex, KEY, serialVersionUID);
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/VectorEditingException.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/VectorEditingException.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/VectorEditingException.java	(revision 1663)
@@ -0,0 +1,95 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api.exceptions;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ *
+ * @author gvSIG team.
+ *
+ */
+public class VectorEditingException extends BaseException {
+
+    private static final long serialVersionUID = -3224623603201641463L;
+
+    private static final String MESSAGE =
+        "An error has been produced in the VectorEditing library";
+
+    private static final String KEY = "_WasteException";
+
+    /**
+     * Constructor to be used in rare cases, usually you must create a new child
+     * exception class for each case.
+     * <strong>Don't use this constructor in child classes.</strong>
+     */
+    public VectorEditingException() {
+        super(MESSAGE, KEY, serialVersionUID);
+    }
+
+    /**
+     * Constructor to be used in rare cases, usually you must create a new child
+     * exception class for each case.
+     * <p>
+     * <strong>Don't use this constructor in child classes.</strong>
+     * </p>
+     *
+     * @param cause
+     *            the original cause of the exception
+     */
+    public VectorEditingException(Exception cause) {
+        super(MESSAGE, cause, KEY, serialVersionUID);
+    }
+
+    /**
+     * @see BaseException#BaseException(String, String, long).
+     * @param message
+     *            the default messageFormat to describe the exception
+     * @param key
+     *            the key to use to search a localized messageFormnata
+     * @param code
+     *            the unique code to identify the exception
+     */
+    protected VectorEditingException(String message, String key, long code) {
+        super(message, key, code);
+    }
+
+    /**
+     * @see BaseException#BaseException(String, Throwable, String, long).
+     * @param message
+     *            the default messageFormat to describe the exception
+     * @param cause
+     *            the original cause of the exception
+     * @param key
+     *            the key to use to search a localized messageFormnata
+     * @param code
+     *            the unique code to identify the exception
+     */
+    protected VectorEditingException(String message, Throwable cause,
+        String key, long code) {
+        super(message, cause, key, code);
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/CreateEditingBehaviorException.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/CreateEditingBehaviorException.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/CreateEditingBehaviorException.java	(revision 1663)
@@ -0,0 +1,39 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api.exceptions;
+
+public class CreateEditingBehaviorException extends VectorEditingException {
+
+    private static final long serialVersionUID = 1941515520264405144L;
+
+    private static final String MESSAGE =
+        "An error has been creating the editing behavior.";
+
+    private static final String KEY = "_ChangeCurrentLayerException";
+
+    public CreateEditingBehaviorException(Throwable ex) {
+        super(MESSAGE, ex, KEY, serialVersionUID);
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/ParseValueException.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/ParseValueException.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/ParseValueException.java	(revision 1663)
@@ -0,0 +1,39 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api.exceptions;
+
+public class ParseValueException extends ParseException {
+
+    private static final long serialVersionUID = 416446081762001139L;
+
+    private static final String MESSAGE =
+        "An error has been produced parsing value inserted. Please, check value format";
+
+    private static final String KEY = "_InvalidOptionException";
+
+    public ParseValueException(Throwable ex) {
+        super(MESSAGE, ex, KEY, serialVersionUID);
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/InvalidEntryException.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/InvalidEntryException.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/InvalidEntryException.java	(revision 1663)
@@ -0,0 +1,40 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api.exceptions;
+
+public class InvalidEntryException extends EditingServiceException {
+
+    private static final long serialVersionUID = 2515764199505996338L;
+
+    private static final String MESSAGE =
+        "An error has been produced validating entry inserted. Please, check entry format or possible entries";
+
+    private static final String KEY = "_InvalidValueException";
+
+    public InvalidEntryException(Throwable ex) {
+        super(MESSAGE, ex, KEY, serialVersionUID);
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/EndEditingException.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/EndEditingException.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/EndEditingException.java	(revision 1663)
@@ -0,0 +1,44 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api.exceptions;
+
+public class EndEditingException extends VectorEditingException {
+
+    private static final long serialVersionUID = 2150082352618473147L;
+
+    private static final String MESSAGE =
+        "An error has been produced ending edition.";
+
+    private static final String KEY = "_EndEditionException";
+
+    public EndEditingException(Throwable ex) {
+        super(MESSAGE, ex, KEY, serialVersionUID);
+    }
+
+    public EndEditingException(String message, Throwable ex) {
+        super(message, ex, KEY, serialVersionUID);
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/ParseException.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/ParseException.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/exceptions/ParseException.java	(revision 1663)
@@ -0,0 +1,87 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api.exceptions;
+
+public class ParseException extends VectorEditingException {
+
+    private static final long serialVersionUID = 7934726070832975067L;
+
+    private static final String MESSAGE = "An error has been produced parsing.";
+
+    private static final String KEY = "_ParseException";
+
+    /**
+     * Constructor to be used in rare cases, usually you must create a new child
+     * exception class for each case.
+     * <strong>Don't use this constructor in child classes.</strong>
+     */
+    public ParseException() {
+        super(MESSAGE, KEY, serialVersionUID);
+    }
+
+    /**
+     * Constructor to be used in rare cases, usually you must create a new child
+     * exception class for each case.
+     * <p>
+     * <strong>Don't use this constructor in child classes.</strong>
+     * </p>
+     *
+     * @param cause
+     *            the original cause of the exception
+     */
+    public ParseException(Exception cause) {
+        super(MESSAGE, cause, KEY, serialVersionUID);
+    }
+
+    /**
+     * @see BaseException#BaseException(String, String, long).
+     * @param message
+     *            the default messageFormat to describe the exception
+     * @param key
+     *            the key to use to search a localized messageFormnata
+     * @param code
+     *            the unique code to identify the exception
+     */
+    protected ParseException(String message, String key, long code) {
+        super(message, key, code);
+    }
+
+    /**
+     * @see BaseException#BaseException(String, Throwable, String, long).
+     * @param message
+     *            the default messageFormat to describe the exception
+     * @param cause
+     *            the original cause of the exception
+     * @param key
+     *            the key to use to search a localized messageFormnata
+     * @param code
+     *            the unique code to identify the exception
+     */
+    protected ParseException(String message, Throwable cause, String key,
+        long code) {
+        super(message, cause, key, code);
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/EditingService.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/EditingService.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/EditingService.java	(revision 1663)
@@ -0,0 +1,149 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api;
+
+import java.util.List;
+
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.tools.service.Service;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+
+/**
+ * <p>
+ * This service is used to interact with Editing providers. Each instance of
+ * this has linked an Editing provider. At this moment services delegate all
+ * functionality to providers. To get an instance of this use
+ * {@link EditingManager#getEditingService(String, org.gvsig.fmap.dal.feature.FeatureStore)}
+ * </p>
+ * 
+ * @author gvSIG team.
+ * @version $Id$
+ */
+public interface EditingService extends Service {
+
+    /**
+     * Gets state of drawing. If this service has sufficient values with mouse
+     * position to create geometries returns a {@link DrawingStatus}. List of
+     * geometries of drawing status object can be different from final
+     * geometries. Use this method to get a draft status information while user
+     * is drawing.
+     *
+     * @param mousePosition
+     *            Mouse position to draw geometries.
+     * @return A {@link DrawingStatus} object with a list of geometries and
+     *         information.
+     * @throws DrawServiceException
+     *             if there are some error creating geometries.
+     */
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException;
+
+    /**
+     * Gets a <code>List</code> with all parameters of service. Each parameter
+     * has name, description and types. See {@link EditingServiceParameter}.
+     *
+     * @return A list of {@link EditingServiceParameter} objects.
+     */
+    public List<EditingServiceParameter> getParameters();
+
+    /**
+     * Gets next parameter needed by service. The parameter has information
+     * about its name, description and types. Returns <code>null</code> if all
+     * parameters have values.
+     *
+     * @return An {@link EditingServiceParameter} object that represents the
+     *         next parameter.
+     */
+    public EditingServiceParameter next();
+
+    /**
+     * Sets value to service. The value will be put in the next parameter need
+     * by this service.
+     *
+     * @param value
+     *            Object to be set to next {@link EditingServiceParameter}
+     * @throws InvalidEntryException
+     *             If the next parameter needed does not accept this value.
+     */
+    public void setValue(Object value) throws InvalidEntryException;
+
+    /**
+     * Stops service. Use this method to stop and clean values of service.
+     *
+     * @throws StopServiceException
+     *             Stops service initializing necessary parameters of service.
+     *             This method is called when user cancels service.
+     */
+    public void stop() throws StopServiceException;
+
+    /**
+     * Finalizes service. Use this method to get the result of service without
+     * store it to {@link FeatureStore}. Make sure that service has all required
+     * values.
+     *
+     * @return Geometry created or modified from added values.
+     * @throws FinishServiceException
+     *             if there are some error getting values,
+     *             creating geometries.
+     */
+    public Geometry finish() throws FinishServiceException;
+
+    /**
+     * Finalizes service and stores the result to {@link FeatureStore} of this
+     * service. Use this method to store the result of this service. Make sure
+     * that service has all required values.
+     *
+     * @throws FinishServiceException
+     *             if there are some error getting values,
+     *             creating geometries or inserting/updating/removing geometries
+     *             from feature store.
+     */
+    public void finishAndStore() throws FinishServiceException;
+
+    /**
+     * Starts service. Use this method before add values.
+     *
+     * @throws StartServiceException
+     *             if there are some error starting service.
+     * @throws InvalidEntryException
+     *             if the entry of provider is not valid
+     */
+    public void start() throws StartServiceException, InvalidEntryException;
+
+    /**
+     * Gets service name. The name of service is the same name of linked
+     * provider.
+     *
+     * @return Name of service.
+     */
+    public String getName();
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/EditingServiceParameter.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/EditingServiceParameter.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/EditingServiceParameter.java	(revision 1663)
@@ -0,0 +1,133 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.gvsig.fmap.geom.Geometry;
+
+/**
+ * <p>
+ * EditingServiceParameter represents values needed by services to work.
+ * This parameters can be several type at the same type. For example, if
+ * services needs the radius of a circle, that value can be a position of map or
+ * a double value.
+ * </p>
+ *
+ * @author gvSIG team.
+ * @version $Id$
+ *
+ */
+public interface EditingServiceParameter {
+
+    /**
+     * TYPE represents the available type of parameters. A parameter can be of
+     * several types at the same type. The types of parameters are:
+     *
+     * - Position: this kind of parameter expects a position in map.
+     *
+     * - List of positions this kind of parameter expects a position in map.
+     *
+     * - Option: this kind of parameter expects an option. Options is used to
+     * change functionality of providers or to do actions. For example, an
+     * option of Regular polygon can be "sides" that indicates side number of
+     * regular polygon.
+     *
+     * - Value: this kind of parameter expects an value.
+     *
+     * - Selection: this kind of parameters expects a selection.
+     *
+     * - Geometry: this kind of parameters expects a selection. See
+     * {@link EditingServiceParameter#getGeometryType()} to know the type of
+     * geometry is expected
+     *
+     * @author llmarques
+     *
+     */
+    public enum TYPE {
+        POSITION, LIST_POSITIONS, OPTION, VALUE, SELECTION, GEOMETRY
+    }
+
+    /**
+     * Gets types of this parameter.
+     *
+     * @return A <code> Set </code> of parameter types.
+     */
+    public Set<TYPE> getTypes();
+
+    /**
+     * Gets a name of parameter.
+     *
+     * @return Parameter name
+     */
+    public String getName();
+
+    /**
+     * Gets a description of parameter. Description is used to show a message on
+     * console.
+     *
+     * @return Description parameter.
+     */
+    public String getDescription();
+
+    /**
+     * Gets the default value of this parameter. If this parameter doesn't have
+     * default value, it will return null.
+     *
+     * @return Default value of this parameter. Null if this parameter doesn't
+     *         have default value.
+     */
+    public Object getDefaultValue();
+
+    /**
+     * Sets the default value of this parameter.
+     */
+    public void setDefaultValue(Object value);
+
+
+    /**
+     * If parameter is of type Geometry returns the type of geometry
+     * required by this parameter. Else return <code>NULL</code> geometry type.
+     * See {@link Geometry.TYPES}
+     *
+     * @return Type of geometry required by this parameters. If parameter does
+     *         not require any geometry return null.
+     */
+    public int getGeometryType();
+
+    /**
+     * If parameter is of type Options, returns a <code>Map</code> with valid
+     * options. The map is composed by identifiers and values.
+     *
+     * The identifiers are used to check if an option is valid when provider
+     * receives an option. For example, an identifier of the option "Arc mode"
+     * could be "A".
+     *
+     * @return Map with identifiers and values of valid options.
+     */
+    public Map<String, String> getOptions();
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/EditingLocator.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/EditingLocator.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/EditingLocator.java	(revision 1663)
@@ -0,0 +1,113 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api;
+
+import org.gvsig.tools.locator.BaseLocator;
+import org.gvsig.tools.locator.Locator;
+import org.gvsig.tools.locator.LocatorException;
+
+/**
+ * This locator is the entry point for the Editing library, providing
+ * access to all Editing services through the {@link EditingManager}
+ * 
+ * @author llmarques
+ * @version $Id$
+ */
+public class EditingLocator extends BaseLocator {
+
+    /**
+     * Editing locator name
+     */
+    private static final String LOCATOR_NAME = "EditingLocator";
+
+    /**
+     * Editing manager name
+     */
+    public static final String MANAGER_NAME = "VectorEditing.manager";
+
+    /**
+     * Editing manager description
+     */
+    private static final String MANAGER_DESCRIPTION =
+        "Editing Manager of gvSIG";
+    
+    /**
+     * Unique instance
+     */
+    private static final EditingLocator instance = new EditingLocator();
+
+    /**
+     * Returns the singleton instance.
+     *
+     * @return the singleton instance
+     */
+    public static EditingLocator getInstance() {
+        return instance;
+    }
+
+    /**
+     * Returns the Locator's name
+     * 
+     * @return a String with the Locator's name
+     */
+    @Override
+    public String getLocatorName() {
+        return LOCATOR_NAME;
+    }
+
+    /**
+     * Return a reference to EditingManager.
+     *
+     * @return a reference to EditingManager
+     * @throws LocatorException
+     *             if there is no access to the class or the class
+     *             cannot be instantiated
+     * @see Locator#get(String)
+     */
+    public static EditingManager getManager() throws LocatorException {
+        return (EditingManager) getInstance().get(MANAGER_NAME);
+    }
+
+    /**
+     * Registers the Class implementing the EditingLocator interface.
+     *
+     * @param clazz
+     *            implementing the EditingManager interface
+     */
+    public static void registerManager(Class clazz) {
+        getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
+    }
+
+    /**
+     * Registers the default Class implementing the EditingLocator interface
+     * 
+     * @param clazz
+     *            implementing the EditingManager interface
+     */
+    public static void registerDefaultManager(Class clazz) {
+        getInstance().registerDefault(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/EditingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/EditingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/src/main/java/org/gvsig/vectorediting/lib/api/EditingLibrary.java	(revision 1663)
@@ -0,0 +1,63 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.api;
+
+import org.gvsig.fmap.dal.DALLibrary;
+import org.gvsig.fmap.geom.GeometryLibrary;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.tools.locator.ReferenceNotRegisteredException;
+
+/**
+ * Library for API initialization and configuration.
+ *
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class EditingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsAPI(EditingLibrary.class);
+        require(DALLibrary.class);
+        require(GeometryLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+        // Do nothing
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        // Validate there is any implementation registered.
+        EditingManager manager = EditingLocator.getManager();
+        if (manager == null) {
+            throw new ReferenceNotRegisteredException(
+                EditingLocator.MANAGER_NAME, EditingLocator.getInstance());
+        }
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api/pom.xml	(revision 1663)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-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/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.vectorediting.lib.api</artifactId>
+	<packaging>jar</packaging>
+	<name>org.gvsig.vectorediting.lib.api</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.vectorediting.lib</artifactId>
+		<version>1.0.92</version>
+	</parent>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<configuration>
+				</configuration>
+				<executions>
+					<!-- Generates a jar file only with the test classes -->
+					<execution>
+						<goals>
+							<goal>test-jar</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+	<dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.fmap.control</artifactId>
+		</dependency>
+	</dependencies>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.api
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.lib.spi.EditingProviderLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProviderFactory.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProviderFactory.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProviderFactory.java	(revision 1663)
@@ -0,0 +1,65 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.spi;
+
+import org.gvsig.tools.service.spi.ProviderFactory;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+
+/**
+ * EditingProviderFactory represents the entity that creates providers and
+ * parameters.
+ * 
+ * @author gvSIG team.
+ * @version $Id$
+ */
+public interface EditingProviderFactory extends ProviderFactory {
+
+    /**
+     * Name of feature store field
+     */
+    public static final String FEATURE_STORE_FIELD = "featureStore";
+
+    /**
+     * Name of provider name field
+     */
+    public static final String PROVIDER_NAME_FIELD = "providerName";
+    
+    /**
+     * Name of MapContext field
+     */
+    public static final String MAPCONTEXT_FIELD = "mapContext";
+
+    /**
+     * Gets read only information about a service such as if creates new
+     * geometries, name, description, supported types, mouse icon, parameters
+     * and information about its parameters.
+     *
+     * @param serviceName
+     *            service name to get the service information
+     * @return An <code>EditingServiceInfo</code> object that contains the
+     *         information. {@link EditingServiceInfo}.
+     */
+    public EditingServiceInfo getServiceInfo();
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProviderManager.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProviderManager.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProviderManager.java	(revision 1663)
@@ -0,0 +1,111 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.spi;
+
+import java.util.Map;
+
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.service.spi.ProviderManager;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.api.exceptions.ServiceInformationException;
+
+/**
+ *
+ * Manager the registration of {@link EditingProviderFactory} objects and the
+ * creation of Providers. Moreover, offers service info about services and
+ * utility methods.
+ *
+ * @author llmarques
+ * @version $Id$
+ */
+public interface EditingProviderManager extends ProviderManager {
+
+    /**
+     * Gets read only information about a service such as if creates new
+     * geometries, name, description, supported types, mouse icon, parameters
+     * and
+     * information about its parameters.
+     *
+     * @param serviceName
+     *            service name to get the service information
+     * @return An <code>EditingServiceInfo</code> object that contains the
+     *         information. {@link EditingServiceInfo}.
+     * @throws ServiceInformationException
+     *             if there is an error getting
+     *             information of service.
+     */
+    public EditingServiceInfo getServiceInfo(String name)
+        throws ServiceInformationException;
+
+    /**
+     * Utility method used by providers to register icons. Use png files.
+     *
+     * @param group
+     *            of icon. Use vectorediting-tools.
+     * @param name
+     *            of icon.
+     * @param loader
+     *            classloader of provider.
+     * @param provider
+     *            of icon
+     */
+    public void registerIcon(String group, String name, ClassLoader loader,
+        String provider);
+
+    /**
+    * Register a symbol in a symbol's map with name as key
+    *
+    * @param name
+    * @param symbol
+    */
+   public void registerSymbol(String name, ISymbol symbol);
+
+   /**
+   *
+   * @param name
+   * @param symbol
+   */
+  public ISymbol getSymbol(String name);
+
+  /**
+  *
+  * @param name
+  * @param values
+  */
+  public void registerDefaultValues(String provider, Map values);
+
+  /**
+  *
+  * @param name
+  * @param loader
+  */
+  public void registerDefaultValues(String name, ClassLoader loader);
+
+  /**
+  *
+  * @param name
+  */
+  public Map<String, String> getDefaultValues(String name);
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/DefaultEditingServiceParameter.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/DefaultEditingServiceParameter.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/DefaultEditingServiceParameter.java	(revision 1663)
@@ -0,0 +1,182 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.spi;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+
+public class DefaultEditingServiceParameter implements EditingServiceParameter {
+
+    private String name;
+
+    private String description;
+
+    private Set<TYPE> types;
+
+    private int geometryType;
+
+    private Map<String, String> options;
+
+    private Object defaultValue;
+
+    public DefaultEditingServiceParameter(String theName,
+        String theDescription, TYPE... theTypes) {
+
+        this.name = theName;
+        this.description = theDescription;
+        this.geometryType = Geometry.TYPES.NULL;
+        this.types = new HashSet<EditingServiceParameter.TYPE>();
+        this.types.addAll(Arrays.asList(theTypes));
+
+    }
+
+    public DefaultEditingServiceParameter(String theName,
+        Object theDefaultValue, String theDescription, TYPE... theTypes) {
+
+        this.name = theName;
+        this.description = theDescription;
+        this.geometryType = Geometry.TYPES.NULL;
+        this.types = new HashSet<EditingServiceParameter.TYPE>();
+        this.types.addAll(Arrays.asList(theTypes));
+        this.defaultValue = theDefaultValue;
+    }
+
+    public DefaultEditingServiceParameter(String theName,
+        String theDescription, int theGeometryType, TYPE... theTypes) {
+
+        this.name = theName;
+        this.description = theDescription;
+        this.geometryType = theGeometryType;
+        this.types = new HashSet<EditingServiceParameter.TYPE>();
+        this.types.addAll(Arrays.asList(theTypes));
+
+    }
+
+    public DefaultEditingServiceParameter(String theName,
+        String theDescription, Object theDefaultValue, int theGeometryType,
+        TYPE... theTypes) {
+
+        this.name = theName;
+        this.description = theDescription;
+        this.geometryType = theGeometryType;
+        this.types = new HashSet<EditingServiceParameter.TYPE>();
+        this.types.addAll(Arrays.asList(theTypes));
+        this.defaultValue = theDefaultValue;
+
+    }
+
+    public DefaultEditingServiceParameter(String theName,
+        String theDescription, Map<String, String> theOptions, TYPE... theTypes) {
+
+        this.name = theName;
+        this.description = theDescription;
+
+        this.types = new HashSet<EditingServiceParameter.TYPE>();
+        this.types.addAll(Arrays.asList(theTypes));
+
+        this.options = theOptions;
+    }
+
+    public DefaultEditingServiceParameter(String theName,
+        String theDescription, Map<String, String> theOptions, Object theDefaultValue, TYPE... theTypes) {
+
+        this.name = theName;
+        this.description = theDescription;
+
+        this.types = new HashSet<EditingServiceParameter.TYPE>();
+        this.types.addAll(Arrays.asList(theTypes));
+
+        this.options = theOptions;
+        this.defaultValue = theDefaultValue;
+    }
+
+    public DefaultEditingServiceParameter(String theName,
+        String theDescription, int theGeometryType,
+        Map<String, String> theOptions, TYPE... theTypes) {
+
+        this.name = theName;
+        this.description = theDescription;
+        this.geometryType = theGeometryType;
+
+        this.types = new HashSet<EditingServiceParameter.TYPE>();
+        this.types.addAll(Arrays.asList(theTypes));
+
+        this.options = theOptions;
+
+    }
+
+    public DefaultEditingServiceParameter(String theName,
+        String theDescription, int theGeometryType,
+        Map<String, String> theOptions, Object theDefaultValue, TYPE... theTypes) {
+
+        this.name = theName;
+        this.description = theDescription;
+        this.geometryType = theGeometryType;
+
+        this.types = new HashSet<EditingServiceParameter.TYPE>();
+        this.types.addAll(Arrays.asList(theTypes));
+
+        this.options = theOptions;
+        this.defaultValue = theDefaultValue;
+    }
+
+    public Set<TYPE> getTypes() {
+        return types;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String newDescription) {
+        this.description = newDescription;
+    }
+
+    public int getGeometryType() {
+        return this.geometryType;
+    }
+
+    public Map<String, String> getOptions() {
+        return this.options;
+    }
+
+    public Object getDefaultValue() {
+        return this.defaultValue;
+    }
+
+    public void setDefaultValue(Object value) {
+        this.defaultValue = value;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProvider.java	(revision 1663)
@@ -0,0 +1,144 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.spi;
+
+import java.util.List;
+
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.tools.service.spi.Provider;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.exceptions.DrawServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.FinishServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+
+/**
+ * EditingProvider provides functionalities to services.
+ * 
+ * @author gvSIG team.
+ * @version $Id$
+ */
+public interface EditingProvider extends Provider {
+
+    /**
+     * Gets next parameter needed by provider. The parameter has information
+     * about its name, description and types. Returns <code>null</code> if all
+     * parameters have values.
+     *
+     * @return An {@link EditingServiceParameter} object that represents the
+     *         next parameter.
+     */
+    public EditingServiceParameter next();
+
+    /**
+     * Gets state of drawing. If this provider has sufficient values with mouse
+     * position to create geometries returns a {@link DrawingStatus}. List of
+     * geometries of drawing status object can be different from final
+     * geometries. Use this method to get a draft status information while user
+     * is drawing.
+     *
+     * @param mousePosition
+     *            Mouse position to draw geometries.
+     * @return A {@link DrawingStatus} object with a list of geometries and
+     *         information.
+     * @throws DrawServiceException
+     *             if there are some error creating geometries.
+     */
+    public DrawingStatus getDrawingStatus(Point mousePosition)
+        throws DrawServiceException;
+
+    /**
+     * Stops provider. Use this method to stop and clean values of provider.
+     *
+     * @throws StopServiceException
+     *             Stops provider initializing necessary parameters of provider.
+     *             This method is called when user cancels provider.
+     */
+    public void stop() throws StopServiceException;
+
+    /**
+     * Gets a <code>List</code> with all parameters of provider. Each parameter
+     * has name, description and types. See {@link EditingServiceParameter}.
+     *
+     * @return A list of {@link EditingServiceParameter} objects.
+     */
+    public List<EditingServiceParameter> getParameters();
+
+    /**
+     * Sets value to provider. The value will be put in the next parameter need
+     * by this provider.
+     *
+     * @param value
+     *            Object to be set to next {@link EditingServiceParameter}
+     * @throws InvalidEntryException
+     *             If the next parameter needed does not accept this value.
+     */
+    public void setValue(Object value) throws InvalidEntryException;
+
+    /**
+     * Finalizes provider. Use this method to get the result of provider without
+     * store it to {@link FeatureStore}. Make sure that provider has all required
+     * values.
+     *
+     * @return Geometry created or modified from added values.
+     * @throws FinishServiceException
+     *             if there are some error getting values,
+     *             creating geometries.
+     */
+    public Geometry finish() throws FinishServiceException;
+
+    /**
+     * Finalizes provider and stores the result to {@link FeatureStore} of this
+     * provider. Use this method to store the result of this service. Make sure
+     * that service has all required values.
+     *
+     * @throws FinishServiceException
+     *             if there are some error getting values,
+     *             creating geometries or inserting/updating/removing geometries
+     *             from feature store.
+     */
+    public void finishAndStore() throws FinishServiceException;
+
+    /**
+     * Starts provider. Use this method before add values.
+     *
+     * @throws StartServiceException
+     *             if there are some error starting service.
+     * @throws InvalidEntryException
+     *             if the entry of provider is not valid 
+     */
+    public void start() throws StartServiceException, InvalidEntryException;
+
+    /**
+     * Gets provider name. 
+     *
+     * @return Name of provider.
+     */
+    public String getName();
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/AbstractEditingProvider.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/AbstractEditingProvider.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/AbstractEditingProvider.java	(revision 1663)
@@ -0,0 +1,38 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.spi;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.tools.service.spi.AbstractProvider;
+import org.gvsig.tools.service.spi.ProviderServices;
+
+public abstract class AbstractEditingProvider extends AbstractProvider
+implements EditingProvider, Geometry.TYPES, Geometry.SUBTYPES {
+
+    public AbstractEditingProvider(ProviderServices providerServices) {
+        super(providerServices);
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProviderLocator.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProviderLocator.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProviderLocator.java	(revision 1663)
@@ -0,0 +1,104 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.spi;
+
+import org.gvsig.tools.locator.BaseLocator;
+import org.gvsig.tools.locator.LocatorException;
+/**
+ * 
+ * @author llmarques
+ * @version $Id$
+ */
+public class EditingProviderLocator extends BaseLocator {
+    
+    /**
+     * Locator name
+     */
+    private static final String LOCATOR_NAME = "Editing.provider.locator";
+    
+    /**
+     * Provider manager name
+     */
+    public static final String PROVIDER_MANAGER_NAME =
+        "Editing.provider.manager";
+    
+    /**
+     * Provider manager description
+     */
+    public static final String PROVIDER_MANAGER_DESCRIPTION = "Editing Manager";
+
+    /**
+     * Unique instance.
+     */
+    private static final EditingProviderLocator instance =
+        new EditingProviderLocator();
+
+    /**
+     * Return the singleton instance.
+     *
+     * @return the singleton instance
+     */
+    public static EditingProviderLocator getInstance() {
+        return instance;
+    }
+
+    /**
+     * Return the Locator's name
+     *
+     * @return a String with the Locator's name
+     */
+    @Override
+    public String getLocatorName() {
+        return LOCATOR_NAME;
+    }
+
+    /**
+     * Return a reference to EditingProviderManager.
+     *
+     * @return a reference to EditingProviderManager
+     * @throws LocatorException
+     *             if there is no access to the class or the class
+     *             cannot be instantiated
+     * @see Locator#get(String)
+     */
+    public static EditingProviderManager getProviderManager()
+        throws LocatorException {
+        return (EditingProviderManager) getInstance()
+            .get(PROVIDER_MANAGER_NAME);
+    }
+
+    /**
+     * Registers the Class implementing the EditingProviderManager interface.
+     *
+     * @param clazz
+     *            implementing the EditingProviderManager interface
+     */
+    public static void registerEditingProviderManager(
+        Class<? extends EditingProviderManager> clazz) {
+        getInstance().register(PROVIDER_MANAGER_NAME,
+            PROVIDER_MANAGER_DESCRIPTION, clazz);
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProviderServices.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProviderServices.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProviderServices.java	(revision 1663)
@@ -0,0 +1,404 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.spi;
+
+import java.util.List;
+import java.util.Map;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSet;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.exception.CreateGeometryException;
+import org.gvsig.fmap.geom.operation.GeometryOperationException;
+import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
+import org.gvsig.fmap.geom.primitive.Arc;
+import org.gvsig.fmap.geom.primitive.Circle;
+import org.gvsig.fmap.geom.primitive.Ellipse;
+import org.gvsig.fmap.geom.primitive.Line;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Spline;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.service.spi.ProviderServices;
+
+/**
+ * EditingProviderServices provides services to provides.
+ *
+ * @author gvSIG team.
+ * @version $Id$
+ */
+public interface EditingProviderServices extends ProviderServices {
+
+    /**
+     * Makes a console message. Parameters must be i18n keys. If you don't want
+     * any text before options use null. The format of console message returned
+     * is:
+     * "preText". ["keyOption1"]valueOption1 ["keyOption2"]valueOption2...
+     *
+     * @param preText
+     *            i18n key of first part of message.
+     * @param options
+     *            Map with accepted options. Keys of map should be first letter
+     *            of option and value of map should be an i18n key. For example,
+     *            a valid map could be <"A","arc_mode">, <"C","close_polyline">
+     * @return console message created
+     */
+    public String makeConsoleMessage(String preText, Map<String, String> options);
+
+    /**
+     * Inserts the feature into feature store.
+     *
+     * @param feature
+     *            to be insert
+     * @param featureStore
+     *            where feature will be insert
+     */
+    public void insertFeatureIntoFeatureStore(Feature feature,
+        FeatureStore featureStore);
+
+    /**
+     * Inserts the geometry into feature store.
+     *
+     * @param geometry
+     *            to be insert
+     * @param featureStore
+     *            where geometry will be insert
+     */
+    public void insertGeometryIntoFeatureStore(Geometry geometry,
+        FeatureStore featureStore);
+
+    /**
+     * Deletes the feature from feature store.
+     *
+     * @param feature
+     * @param featureStore
+     */
+    public void deleteFeatureFromFeatureStore(Feature feature,
+        FeatureStore featureStore);
+
+    /**
+     * Deletes the feature from feature set.
+     *
+     * @param feature
+     * @param featureStore
+     * @param featureSet
+     */
+    public void deleteFeatureFromFeatureSet(Feature feature,
+        FeatureStore featureStore, FeatureSet featureSet);
+
+    /**
+     * Updates the feature received as parameter in feature store.
+     *
+     * @param feature
+     *            to be updated
+     * @param featureStore
+     *            where feature will be updated
+     */
+    public void updateFeatureInFeatureStore(Feature feature,
+        FeatureStore featureStore);
+
+    /**
+     * Creates a circle as of center and radius.
+     *
+     * @param center
+     *            of new circle
+     * @param radius
+     *            of new circle
+     * @param subtype
+     *            subtype of circle. See {@link Geometry.SUBTYPES}
+     * @return The circle created with center and radius
+     */
+    public Circle createCircle(Point center, double radius, int subtype)
+        throws CreateGeometryException;
+
+    /**
+     * Creates a circle from three points.
+     *
+     * @param firstPoint
+     *            of circle
+     * @param secondPoint
+     *            of circle
+     * @param thridPoint
+     *            of circle
+     * @param subtype
+     *            subtype of circle. See {@link Geometry.SUBTYPES}
+     * @return The circle created from three points received as parameters.
+     */
+    public Circle createCircle(Point firstPoint, Point secondPoint,
+        Point thridPoint, int subtype) throws CreateGeometryException;
+
+    /**
+     * Creates an arc as of center, radius, start angle and extension angle.
+     *
+     * @param center
+     *            center of arc.
+     * @param radius
+     *            of arc.
+     * @param startAngle
+     *            of arc in radians
+     * @param angleExt
+     *            of arc in radians
+     * @param subtype
+     *            subtype of arc. See {@link Geometry.SUBTYPES}
+     * @return The arc created with center, radius, start angle and extension
+     *         angle.
+     */
+    public Arc createArc(Point center, double radius, double startAngle,
+        double angleExt, int subtype) throws CreateGeometryException;
+
+    /**
+     * Creates an arc as of three points.
+     *
+     * @param start
+     *            point of arc
+     * @param middle
+     *            point of arc. It can be any point of arc.
+     * @param end
+     *            point of arc
+     * @param subtype
+     *            of arc. See {@link Geometry.SUBTYPES}
+     * @return The arc created that it start at start point, cross middle
+     *         point and end at end point.
+     */
+    public Arc createArc(Point start, Point middle, Point end, int subtype)
+        throws BaseException;
+
+    /**
+     * Creates an ellipse from start and end point of A axis and half length
+     * of B axis.
+     *
+     * @param firstPointAxisA
+     *            first point of A axis
+     * @param secondPointAxisA
+     *            second point of B axis
+     * @param halfLengthAxisB
+     *            half length of B axis
+     * @param subtype
+     *            of ellipse See {@link Geometry.SUBTYPES}
+     * @return The ellipse created
+     */
+    public Arc createEllipse(Point firstPointAxisA,
+        Point secondPointAxisA, double halfLengthAxisB, int subtype)
+        throws CreateGeometryException;
+
+    /**
+     * Creates a filled ellipse from start and end point of A axis and half length
+     * of B axis.
+     *
+     * @param firstPointAxisA
+     *            first point of A axis
+     * @param secondPointAxisA
+     *            second point of B axis
+     * @param halfLengthAxisB
+     *            half length of B axis
+     * @param subtype
+     *            of ellipse See {@link Geometry.SUBTYPES}
+     * @return The ellipse created
+     */
+    public Ellipse createFilledEllipse(Point firstPointAxisA,
+        Point secondPointAxisA, double halfLengthAxisB, int subtype)
+        throws CreateGeometryException;
+
+
+    /**
+     * Creates point with x and y values.
+     *
+     * @param x
+     *            The X coordinate
+     * @param y
+     *            The y coordinate
+     * @param subtype
+     *            of point. See {@link Geometry.SUBTYPES}
+     * @return The Point created.
+     */
+    public Point createPoint(double x, double y, int subtype)
+        throws CreateGeometryException;
+
+    /**
+     * Creates line as of two point coordinates.
+     *
+     * @param x1
+     *            The X1 coordinate
+     * @param y1
+     *            The y1 coordinate
+     * @param x2
+     *            The X2 coordinate
+     * @param y2
+     *            The y2 coordinate
+     * @param subtype
+     *            of line. See {@link Geometry.SUBTYPES}
+     * @return The Line created.
+     */
+    public Line createLine(double x1, double y1, double x2, double y2,
+        int subtype) throws CreateGeometryException;
+
+    /**
+     * Creates line as of two point objects.
+     *
+     * @param p1
+     *            First point
+     * @param p2
+     *            Second point
+     * @param subtype
+     *            of line. See {@link Geometry.SUBTYPES}
+     * @return The Line created.
+     */
+    public Line createLine(Point p1, Point p2, int subtype)
+        throws CreateGeometryException;
+
+    /**
+     *
+     * @param points
+     * @param subtype
+     * @return
+     */
+    public Spline createSpline(List<Point> points, int subtype)
+        throws CreateGeometryException;
+
+    /**
+     * Gets {@link SUBTYPES} of the feature store received as parameter.
+     *
+     * @return the subtype of the default geometry.
+     * @throws DataException
+     *             if there some problem getting subtype.
+     */
+    public int getSubType(FeatureStore featureStore) throws DataException;
+
+    /**
+     * Gets {@link GeometryType} of the feature store received as parameter.
+     *
+     * @return the GeometryType of the default geometry.
+     * @throws DataException
+     *             if there some problem getting subtype.
+     */
+    public GeometryType getGeomType(FeatureStore featureStore)
+        throws DataException;
+
+    /**
+     * Returns a copy of a feature without primary keys data
+     *
+     * @return the copy of a feature without primary keys data
+     * @throws DataException
+     *             if there some problem getting subtype.
+     */
+    public EditableFeature getFeatureCopyWithoutPK(FeatureStore featureStore,
+        Feature feature) throws DataException;
+
+    /**
+     * Gets center point of three points.
+     *
+     * @param a
+     *            Point one
+     * @param b
+     *            Point two
+     * @param c
+     *            Point three
+     * @param subtype
+     *            of point created. See {@link Geometry.SUBTYPES}
+     * @return Point center.
+     */
+    public Point getCenter(Point a, Point b, Point c, int subtype)
+        throws CreateGeometryException;
+
+    /**
+     * Gets midpoint of two points
+     *
+     * @param a
+     *            Point one
+     * @param b
+     *            Point two
+     * @param subtype
+     *            of point created. See {@link Geometry.SUBTYPES}
+     * @return Mid point of points.
+     */
+    public Point getMidPoint(Point a, Point b, int subtype)
+        throws CreateGeometryException;
+
+    /**
+     * Gets the slope of the line created by points received.
+     *
+     * @param point
+     *            of line
+     * @param nextPoint
+     *            of line
+     * @return An array with two valors. First is slope of line and second is
+     *         y-intercept
+     */
+    public Double[] getLineParams(Point point, Point nextPoint);
+
+    /**
+     * Gets perpendicular of line formed by slope and y-intercept received as
+     * parameters. The perpendicular cross the point received as parameter.
+     *
+     * @param m
+     *            slope of line
+     * @param b
+     *            y-intercep of line
+     * @param perp
+     *            Point crossed by perpendicular
+     * @param subtype
+     *            of perpendicular points. See {@link Geometry.SUBTYPES}
+     * @return Line perpendicular to line received as parameter. The
+     *         perpendicular cross point received as parameter.
+     */
+    public Point[] getPerpendicular(Double m, Double b, Point perp, int subtype)
+        throws CreateGeometryException;
+
+    /**
+     * Gets intersection point of two lines. If lines are parallels return null.
+     *
+     * @param lineA
+     * @param lineB
+     * @param subtype
+     *            of intersection point. See {@link Geometry.SUBTYPES}
+     * @return Point of intersection. If lines are parallels return null.
+     */
+    public Point getIntersection(Point[] lineA, Point[] lineB, int subtype)
+        throws CreateGeometryException;
+
+    /**
+     * Gets angle between two points.
+     *
+     * @param start
+     * @param end
+     * @return Angle between two points.
+     */
+    public double getAngle(Point start, Point end)
+        throws GeometryOperationNotSupportedException,
+        GeometryOperationException;
+
+    /**
+     * Gets distance between two angles.
+     *
+     * @param angle1
+     * @param angle2
+     * @return Distance of angles
+     */
+    public double angleDistance(double angle1, double angle2);
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProviderLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProviderLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/EditingProviderLibrary.java	(revision 1663)
@@ -0,0 +1,62 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.spi;
+
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.tools.locator.ReferenceNotRegisteredException;
+import org.gvsig.vectorediting.lib.api.EditingLibrary;
+/**
+ * Library for API initialization and configuration.
+ * 
+ * @author llmarques
+ * @version $Id$
+ */
+public class EditingProviderLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsServiceOf(EditingLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        // Validate there is any implementation registered.
+        EditingProviderManager providerManager =
+            EditingProviderLocator.getProviderManager();
+        if (providerManager == null) {
+            throw new ReferenceNotRegisteredException(
+                EditingProviderLocator.PROVIDER_MANAGER_NAME,
+                EditingProviderLocator.getInstance());
+        }
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/DefaultDrawingStatus.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/DefaultDrawingStatus.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/DefaultDrawingStatus.java	(revision 1663)
@@ -0,0 +1,108 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.spi;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+
+public class DefaultDrawingStatus implements DrawingStatus {
+
+    private List<Geometry> geometries;
+    private List<Status> status;
+    private String info;
+
+    private static class DefaultStatus implements Status{
+        private Geometry geometry;
+        private ISymbol symbol;
+        private String text;
+
+        DefaultStatus(Geometry geometry, ISymbol symbol, String text){
+            this.geometry = geometry;
+            this.symbol = symbol;
+            this.text = text;
+        }
+
+        public Geometry getGeometry() {
+            return geometry;
+        }
+
+        public ISymbol getSymbol() {
+            return symbol;
+        }
+
+        public String getText() {
+            return text;
+        }
+
+    }
+
+    public DefaultDrawingStatus() {
+        geometries = new ArrayList<Geometry>();
+        status = new ArrayList<DrawingStatus.Status>();
+
+        info = null;
+    }
+
+//    public DefaultDrawingStatus(List<Geometry> geometries, String info) {
+//        this.geometries = new ArrayList<Geometry>();
+//        this.geometries.addAll(geometries);
+//        this.info = info;
+//    }
+
+//    public void setGeometries(List<Geometry> geometries) {
+//        this.geometries.addAll(geometries);
+//    }
+
+    public List<Geometry> getGeometries() {
+        return this.geometries;
+    }
+
+    public List<Status> getStatus() {
+        return this.status;
+    }
+
+    public void setInfo(String info) {
+        this.info = info;
+    }
+
+    public String getInfo() {
+        return this.info;
+    }
+
+    public void addGeometry(Geometry geometry) {
+        geometries.add(geometry);
+        status.add(new DefaultStatus(geometry,null,null));
+    }
+
+    public void addStatus(Geometry geometry, ISymbol symbol, String text) {
+        geometries.add(geometry);
+        status.add(new DefaultStatus(geometry,symbol,text));
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/DefaultEditingServiceinfo.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/DefaultEditingServiceinfo.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/src/main/java/org/gvsig/vectorediting/lib/spi/DefaultEditingServiceinfo.java	(revision 1663)
@@ -0,0 +1,131 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.lib.spi;
+
+import java.awt.Image;
+import java.util.List;
+
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.vectorediting.lib.api.EditingLocator;
+import org.gvsig.vectorediting.lib.api.EditingManager;
+import org.gvsig.vectorediting.lib.api.EditingService;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.exceptions.ServiceInformationException;
+
+public class DefaultEditingServiceinfo implements EditingServiceInfo {
+
+    private String name;
+
+    private String description;
+
+    private boolean createsNewGeometries;
+
+    private Image mouseCursor;
+
+    private List<EditingServiceParameter> parameters;
+
+    private int[] supportedPrimitiveGeometryType;
+
+    public DefaultEditingServiceinfo(String name, String description,
+        boolean createsNewGeometries, Image mouseCursor,
+        int[] supportedPrimitiveGeometryType) {
+        super();
+        this.name = name;
+        this.description = description;
+        this.createsNewGeometries = createsNewGeometries;
+        this.mouseCursor = mouseCursor;
+        this.supportedPrimitiveGeometryType = supportedPrimitiveGeometryType;
+    }
+
+    public boolean createsNewGeometries() {
+        return this.createsNewGeometries;
+    }
+
+    public String getDescription() {
+        return this.description;
+    }
+
+    public Image getMouseIcon() {
+        return this.mouseCursor;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public List<EditingServiceParameter> getParameters() {
+        return this.parameters;
+    }
+
+    public int[] getSupportedPrimitiveGeometryTypes() {
+        return this.supportedPrimitiveGeometryType;
+    }
+
+    public EditingServiceParameter getParameterInfo(String parameterName) {
+        if (this.parameters == null) {
+            EditingManager manager = EditingLocator.getManager();
+            EditingService editingService =
+                manager.getEditingService(this.name, null, null);
+            this.parameters = editingService.getParameters();
+        }
+
+        for (EditingServiceParameter editingServiceParameter : parameters) {
+            if (editingServiceParameter.getName().equalsIgnoreCase(
+                parameterName)) {
+                return editingServiceParameter;
+            }
+        }
+
+        return null;
+    }
+
+    public boolean isCompatibleWith(GeometryType geoType)
+        throws ServiceInformationException {
+        int[] supportedTypes = getSupportedPrimitiveGeometryTypes();
+        GeometryType supportedGeomType;
+
+        for (int i = 0; i < supportedTypes.length; i++) {
+
+            try {
+                supportedGeomType =
+                    GeometryLocator.getGeometryManager().getGeometryType(
+                        supportedTypes[i], geoType.getSubType());
+            } catch (Exception e) {
+                throw new ServiceInformationException(
+                    "Can't get geometry type with type " + supportedTypes[i]
+                        + " and subtype " + geoType.getSubType(), e);
+            }
+
+            if (supportedGeomType.isTypeOf(geoType)) {
+                return true;
+            }
+
+        }
+        return false;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi/pom.xml	(revision 1663)
@@ -0,0 +1,16 @@
+<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">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.vectorediting.lib</artifactId>
+		<version>1.0.92</version>
+	</parent>
+	<artifactId>org.gvsig.vectorediting.lib.spi</artifactId>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.vectorediting.lib.api</artifactId>
+		</dependency>
+	</dependencies>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.spi
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.lib/pom.xml	(revision 1663)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="ISO-8859-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">
+
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.vectorediting.lib</artifactId>
+	<packaging>pom</packaging>
+	<name>org.gvsig.vectorediting.lib</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.vectorediting</artifactId>
+		<version>1.0.92</version>
+	</parent>
+	<modules>
+		<module>org.gvsig.vectorediting.lib.api</module>
+		<module>org.gvsig.vectorediting.lib.impl</module>
+		<module>org.gvsig.vectorediting.lib.spi</module>
+		<module>org.gvsig.vectorediting.lib.prov</module>
+	</modules>
+</project>
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.swing.api.EditingSwingLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/EditingSwingLocator.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/EditingSwingLocator.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/EditingSwingLocator.java	(revision 1663)
@@ -0,0 +1,88 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.api;
+
+import org.gvsig.tools.locator.BaseLocator;
+import org.gvsig.tools.locator.Locator;
+import org.gvsig.tools.locator.LocatorException;
+
+public class EditingSwingLocator extends BaseLocator {
+
+    private static final String LOCATOR_NAME = "EditingSwingLocator";
+
+    public static final String MANAGER_NAME = "VectorEditingSwing.manager";
+
+    private static final String MANAGER_DESCRIPTION =
+        "Editing Swing Manager of gvSIG";
+
+    private static final EditingSwingLocator instance =
+        new EditingSwingLocator();
+
+    private EditingSwingLocator() {
+
+    }
+
+    /**
+     * Return the singleton instance.
+     *
+     * @return the singleton instance
+     */
+    public static EditingSwingLocator getInstance() {
+        return instance;
+    }
+
+    @Override
+    public String getLocatorName() {
+        return LOCATOR_NAME;
+    }
+
+    /**
+     * Return a reference to EditingSwingManager.
+     *
+     * @return a reference to EditingSwingManager
+     * @throws LocatorException
+     *             if there is no access to the class or the class
+     *             cannot be instantiated
+     * @see Locator#get(String)
+     */
+    public static EditingSwingManager getSwingManager() throws LocatorException {
+        return (EditingSwingManager) getInstance().get(MANAGER_NAME);
+    }
+
+    /**
+     * Registers the Class implementing the EditingSwingLocator interface.
+     *
+     * @param clazz
+     *            implementing the EeditingSwingManager interface
+     */
+    public static void registerManager(Class clazz) {
+        getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
+    }
+
+    public static void registerDefaultManager(Class clazz) {
+        getInstance().registerDefault(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/EditingSwingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/EditingSwingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/EditingSwingLibrary.java	(revision 1663)
@@ -0,0 +1,59 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.api;
+
+import org.gvsig.fmap.dal.DALLibrary;
+import org.gvsig.fmap.geom.GeometryLibrary;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.tools.locator.ReferenceNotRegisteredException;
+
+public class EditingSwingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsAPI(EditingSwingLibrary.class);
+        require(DALLibrary.class);
+        require(GeometryLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        EditingSwingManager manager = EditingSwingLocator.getSwingManager();
+        if (manager == null) {
+            throw new ReferenceNotRegisteredException(
+                EditingSwingLocator.MANAGER_NAME,
+                EditingSwingLocator.getInstance());
+        }
+
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/console/EditingConsole.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/console/EditingConsole.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/console/EditingConsole.java	(revision 1663)
@@ -0,0 +1,77 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.api.console;
+
+import org.gvsig.utils.console.ResponseListener;
+
+
+/**
+ * 
+ * @author llmarques
+ *
+ */
+public interface EditingConsole {
+    
+    /**
+     * Gets response text typed by user
+     * 
+     * @return
+     */
+    public String getResponseText();
+    
+    /**
+     * Clears console
+     */
+    public void clear();
+    
+    /**
+     * Adds text to console
+     * 
+     * @param text
+     */
+    public void addText(String text);
+    
+    /**
+     * Add text that is taken like text typed by user
+     * 
+     * @param responseText
+     */
+    public void addResponseText(String responseText);
+    
+    /**
+     * Adds the listener
+     * 
+     * @param listener
+     */
+    public void addResponseListener(ResponseListener listener);
+    
+    /**
+     * Removes the listener
+     * 
+     * @param listener
+     */
+    public void removeResponseListener(ResponseListener listener);
+    
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/EditingSwingManager.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/EditingSwingManager.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/EditingSwingManager.java	(revision 1663)
@@ -0,0 +1,103 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.api;
+
+import java.awt.Component;
+import java.util.List;
+
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.tools.service.Manager;
+import org.gvsig.utils.console.ResponseListener;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.swing.api.console.EditingConsole;
+import org.gvsig.vectorediting.swing.api.contextmenu.AcceptValueListener;
+import org.gvsig.vectorediting.swing.api.contextmenu.EditingContextMenu;
+
+/**
+ * @author gvSIG team.
+ */
+public interface EditingSwingManager extends Manager {
+
+    /**
+     * @param mapControl
+     * @return
+     */
+    EditingContext getEditingContext(MapControl mapControl);
+
+    /**
+     *
+     * @param mapControl
+     */
+    public void registerEditingContext(MapControl mapControl);
+
+    /**
+     *
+     * @param layerName
+     * @return
+     */
+    int showPanelExportOrDiscard(MapControl parent, String layerName);
+
+    /**
+     *
+     * @param layerName
+     * @return
+     */
+    int showPanelSaveOrDiscard(MapControl parent, String layerName);
+
+    /**
+     * Gets an instance of current parameter contextual menu. To show it, invoke
+     * {@link EditingContextMenu#show(java.awt.Component, int, int)}.
+     *
+     * @param parent
+     *            of contextual menu
+     * @param parameter
+     *            to build contextual menu according to it types.
+     * @return contextual menu of parameter
+     */
+    EditingContextMenu getContextualMenu(Component parent,
+        AcceptValueListener listener, EditingServiceParameter parameter);
+
+    /**
+     * Gets and instance of {@link EditingConsole}.
+     * The response listener will receive the response typed
+     * by user when ENTER key is pressed.
+     * 
+     * @param listener
+     *            Object that will received the response
+     * @return An instance of {@link EditingConsole}
+     */
+    EditingConsole getEditingConsole(ResponseListener listener);
+
+    /**
+     * Gets and instance of {@link EditingConsole}.
+     * Response listener list will receive the response
+     * typed by user when ENTER key is pressed.
+     * 
+     * @param listener
+     *            Object that will received the response
+     * @return An instance of {@link EditingConsole}
+     */
+    EditingConsole getEditingConsole(List<ResponseListener> liteners);
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/EditingContext.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/EditingContext.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/EditingContext.java	(revision 1663)
@@ -0,0 +1,101 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.api;
+
+import java.lang.ref.WeakReference;
+
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.tools.observer.Observable;
+
+public interface EditingContext extends Observable {
+
+    static final int CANCEL = 0;
+    static final int DISCARD_CHANGES = 1;
+    static final int EXPORT_LAYER = 2;
+    static final int SAVE_CHANGES = 3;
+    static final String DEFAULT_TOOL = "default_tool";
+
+    static final String CHANGE_SELECTED_TOOL_NOTIFICATION = "EditingContext.changeSelectedTool";
+    static final String REFRESH_TOOLS_NOTIFICATION = "EditingContext.refreshTools";
+    static final String EXPORT_LAYER_NOTIFICATION = "EditingContext.exportLayer";
+    /**
+     * Activates service as of name and {@link MapControl}
+     *
+     * @param name
+     *            of service
+     * @param mapControl
+     *            of
+     */
+    public void activateService(String name);
+
+    /**
+      * @deprecated Use {@link EditingContext#beginEdition(FLyrVect)}
+     */
+    public void beginEdition(FLyrVect layer, Behavior[] additionalBehaviors);
+    
+    /**
+     * Begins edition of a layer
+     *
+     * @param layer
+     *            to begin edition
+     */
+    public void beginEdition(FLyrVect layer);
+
+    /**
+     * Ends edition of a layer 
+     *
+     * @param layer
+     *            to end edition
+     */
+    public void endEdition(FLyrVect layer);
+
+    /**
+     * Gets mapControl object. It is referenced by {@link WeakReference}.
+     *
+     * @return
+     */
+    public MapControl getMapControl();
+
+    /**
+     *
+     * @param name
+     * @return
+     */
+    public boolean isServiceCompatible(String name);
+
+    /**
+     * Updates the weak reference at editing context.
+     *
+     * @param mapControl
+     */
+    public void setMapControl(MapControl mapControl);
+
+
+    public Behavior[] getDefaultBehaviors();
+
+    public void setDefaultBehaviors(Behavior[] defaultBehaviors);
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/contextmenu/EditingContextMenu.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/contextmenu/EditingContextMenu.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/contextmenu/EditingContextMenu.java	(revision 1663)
@@ -0,0 +1,42 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.api.contextmenu;
+
+import java.awt.Component;
+
+/**
+ * @author llmarques
+ *
+ */
+public interface EditingContextMenu {
+
+    /**
+     * @param mapControl
+     * @param x
+     * @param y
+     */
+    public void show(Component mapControl, int x, int y);
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/contextmenu/AcceptValueListener.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/contextmenu/AcceptValueListener.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/src/main/java/org/gvsig/vectorediting/swing/api/contextmenu/AcceptValueListener.java	(revision 1663)
@@ -0,0 +1,57 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.swing.api.contextmenu;
+
+/**
+ * @author llmarques
+ *
+ */
+public interface AcceptValueListener {
+
+    public void acceptValue(Object value);
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api/pom.xml	(revision 1663)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-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/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.vectorediting.swing.api</artifactId>
+	<packaging>jar</packaging>
+	<name>org.gvsig.vectorediting.swing.api</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.vectorediting.swing</artifactId>
+		<version>1.0.92</version>
+	</parent>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<configuration>
+				</configuration>
+				<executions>
+					<!-- Generates a jar file only with the test classes -->
+					<execution>
+						<goals>
+							<goal>test-jar</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+	<dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.vectorediting.lib.api</artifactId>
+		</dependency>
+	</dependencies>
+</project>
\ No newline at end of file

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.api
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/pom.xml	(revision 1663)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="ISO-8859-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">
+
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.vectorediting.swing</artifactId>
+	<packaging>pom</packaging>
+	<name>org.gvsig.vectorediting.swing</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.vectorediting</artifactId>
+		<version>1.0.92</version>
+	</parent>
+
+
+	<modules>
+		<module>org.gvsig.vectorediting.swing.api</module>
+		<module>org.gvsig.vectorediting.swing.impl</module>
+	</modules>
+</project>
+
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/pom.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/pom.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/pom.xml	(revision 1663)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="ISO-8859-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/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.gvsig.vectorediting.swing.impl</artifactId>
+    <packaging>jar</packaging>
+    <name>org.gvsig.vectorediting.swing.impl</name>
+    <parent>
+        <groupId>org.gvsig</groupId>
+        <artifactId>org.gvsig.vectorediting.swing</artifactId>
+        <version>1.0.92</version>
+    </parent>
+    <dependencies>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.vectorediting.swing.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.vectorediting.lib.spi</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.jgoodies</groupId>
+            <artifactId>jgoodies-forms</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.temporarystorage.lib.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/test/resources/README.txt
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/test/resources/README.txt	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/test/resources/README.txt	(revision 1663)
@@ -0,0 +1,32 @@
+====
+    gvSIG. Desktop Geographic Information System.
+
+    Copyright (C) 2007-2012 gvSIG Association.
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA  02110-1301, USA.
+
+    For any additional information, do not hesitate to contact us
+    at info AT gvsig.com, or visit our website www.gvsig.com.
+====
+
+Put into this folder the resources needed by your test classes.
+
+This folder is added to the Tests classpath, so you can load any resources 
+through the ClassLoader.
+
+By default, in this folder you can find an example of log4j configuration,
+prepared to log messages through the console, so logging works when you
+run your tests classes.
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/test/resources/log4j.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/test/resources/log4j.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/test/resources/log4j.xml	(revision 1663)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+
+    gvSIG. Desktop Geographic Information System.
+
+    Copyright (C) 2007-2012 gvSIG Association.
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+    MA  02110-1301, USA.
+
+    For any additional information, do not hesitate to contact us
+    at info AT gvsig.com, or visit our website www.gvsig.com.
+
+-->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- 
+Log4J configuration file for unit tests execution.
+ -->
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+	<!-- Appender configuration to show logging messages through the console -->
+	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+		<layout class="org.apache.log4j.PatternLayout">
+			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
+		</layout>
+	</appender>
+
+	<!-- 
+	Activate logging messages of DEBUG level of higher only for the
+	org.gvsig.tools packages.
+	You can put full classes names or packages instead, to configure
+	logging for all the classes and subpackages of the package.
+	-->
+	<category name="org.gvsig.tools">
+		<priority value="DEBUG" />
+	</category>
+	<category name="org.gvsig.vectorediting">
+		<priority value="DEBUG" />
+	</category>
+
+	<!-- 
+	By default, show only logging messages of INFO level or higher, 
+	through the previously configured CONSOLE appender. 
+	-->
+	<root>
+		<priority value="INFO" />
+		<appender-ref ref="CONSOLE" />
+	</root>
+</log4j:configuration>
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 1663)
@@ -0,0 +1 @@
+org.gvsig.vectorediting.swing.impl.DefaultEditingSwingLibrary
\ No newline at end of file
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultEditingContext.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultEditingContext.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultEditingContext.java	(revision 1663)
@@ -0,0 +1,1215 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.impl;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.lang.ref.WeakReference;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Set;
+import java.util.Stack;
+import java.util.logging.Level;
+import java.util.prefs.PreferenceChangeEvent;
+import java.util.prefs.PreferenceChangeListener;
+import java.util.prefs.Preferences;
+
+import javax.swing.JComponent;
+import javax.swing.JOptionPane;
+import javax.swing.SwingUtilities;
+
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.FeatureSelection;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.layers.CancelationException;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.fmap.mapcontext.layers.LayerCollectionEvent;
+import org.gvsig.fmap.mapcontext.layers.LayerCollectionListener;
+import org.gvsig.fmap.mapcontext.layers.LayerEvent;
+import org.gvsig.fmap.mapcontext.layers.LayerListener;
+import org.gvsig.fmap.mapcontext.layers.LayerPositionEvent;
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.CompoundBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.observer.BaseNotification;
+import org.gvsig.tools.observer.Notification;
+import org.gvsig.tools.observer.ObservableHelper;
+import org.gvsig.tools.observer.Observer;
+import org.gvsig.utils.console.JDockPanel;
+import org.gvsig.utils.console.ResponseListener;
+import org.gvsig.vectorediting.lib.api.EditingLocator;
+import org.gvsig.vectorediting.lib.api.EditingManager;
+import org.gvsig.vectorediting.lib.api.EditingService;
+import org.gvsig.vectorediting.lib.api.EditingServiceInfo;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.CreateEditingBehaviorException;
+import org.gvsig.vectorediting.lib.api.exceptions.EndEditingException;
+import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
+import org.gvsig.vectorediting.lib.api.exceptions.ParsePointException;
+import org.gvsig.vectorediting.lib.api.exceptions.ParseValueException;
+import org.gvsig.vectorediting.lib.api.exceptions.ServiceInformationException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartEditingException;
+import org.gvsig.vectorediting.lib.api.exceptions.StartServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.StopServiceException;
+import org.gvsig.vectorediting.lib.api.exceptions.VectorEditingException;
+import org.gvsig.vectorediting.swing.api.EditingContext;
+import org.gvsig.vectorediting.swing.api.EditingSwingLocator;
+import org.gvsig.vectorediting.swing.api.EditingSwingManager;
+import org.gvsig.vectorediting.swing.api.console.EditingConsole;
+import org.gvsig.vectorediting.swing.impl.console.DefaultEditingConsole;
+
+import org.apache.commons.lang3.StringUtils;
+
+import org.gvsig.fmap.dal.EditingNotification;
+import org.gvsig.fmap.dal.EditingNotificationManager;
+import org.gvsig.fmap.dal.swing.DALSwingLocator;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DefaultEditingContext implements EditingContext {
+
+    private static final Logger logger = LoggerFactory
+        .getLogger(EditingManager.class);
+
+    private WeakReference<MapControl> mapControlReference;
+
+    private WeakReference<MapContext> mapContextReference;
+
+    private EditingCompoundBehavior editingCompoundBehavior;
+
+    private Behavior[] lastAdditionalBehaviors;
+
+    private ObservableHelper observableHelper;
+
+    private EditingConsole console;
+
+    private JDockPanel dockConsole = null;
+
+    private boolean isShowConsole = false;
+
+    private Stack<EditingService> serviceStack;
+
+    private FLyrVect currentLayer;
+
+    private EditingServiceParameter currentParam;
+
+    private Behavior[] defaultBehaviors;
+
+    private LayerListener layerListener = new LayerListener() {
+
+        @Override
+        public void activationChanged(final LayerEvent e) {
+            if( !SwingUtilities.isEventDispatchThread() ) {
+                SwingUtilities.invokeLater(new Runnable() {
+
+                    @Override
+                    public void run() {
+                        activationChanged(e);
+                    }
+                });
+                return;
+            }
+
+            FLayer layer = e.getSource();
+
+            FLayer[] activeLayers =
+                layer.getMapContext().getLayers().getActives();
+
+            if ((activeLayers.length == 1) && (layer instanceof FLyrVect)) {
+                if (layer.isActive() && layer.isEditing()) {
+                    getMapControl().setTool("VectorEditing");
+                    setCurrentLayer((FLyrVect) layer);
+                    showConsole();
+                    return;
+                }
+            }
+
+            hideConsole();
+            if ((getMapControl().getCurrentTool() != null)
+                && getMapControl().getCurrentTool().equals("VectorEditing")) {
+                getMapControl().setPrevTool();
+            }
+        }
+
+        public void drawValueChanged(LayerEvent e) {
+        }
+
+        @Override
+        public void editionChanged(final LayerEvent e) {
+            if( !SwingUtilities.isEventDispatchThread() ) {
+                SwingUtilities.invokeLater(new Runnable() {
+
+                    @Override
+                    public void run() {
+                        editionChanged(e);
+                    }
+                });
+                return;
+            }
+            FLayer layer = e.getSource();
+
+            if (layer instanceof FLyrVect) {
+                if (layer.isEditing()) {
+                    synchronized (DefaultEditingContext.this) {
+                        beginEdition((FLyrVect) layer);
+                        showConsole();
+                    }
+                } else {
+                    hideConsole();
+                }
+            }
+
+        }
+
+        public void nameChanged(LayerEvent e) {
+        }
+
+        public void visibilityChanged(LayerEvent e) {
+        }
+    };
+
+    private PreferenceChangeListener preferenceChangeListener =
+        new PreferenceChangeListener() {
+
+            public void preferenceChange(PreferenceChangeEvent evt) {
+                String key = evt.getKey();
+                if (key.equalsIgnoreCase("apply-snappers")) {
+                    boolean newValue = Boolean.parseBoolean(evt.getNewValue());
+                    getMapControl().setRefentEnabled(newValue);
+                }
+            }
+        };
+
+    public DefaultEditingContext(MapControl mapControl) {
+
+        this.mapControlReference = new WeakReference<MapControl>(mapControl);
+        this.mapContextReference =
+            new WeakReference<MapContext>(mapControl.getMapContext());
+        this.observableHelper = new ObservableHelper();
+
+        this.serviceStack = new Stack<EditingService>();
+
+        addLayerListeners();
+        addPreferenceListener();
+    }
+
+    private void addPreferenceListener() {
+        Preferences prefs = Preferences.userRoot().node("snappers");
+        prefs.addPreferenceChangeListener(preferenceChangeListener);
+    }
+
+    public void activateService(String name) {
+
+        if ((getMapControl() != null)
+            && getMapControl().hasTool("VectorEditing")) {
+
+            CompoundBehavior editingCompoundBehavior =
+                getEditingCompoundBehavior();
+            getMapControl().setTool("VectorEditing");
+            editingCompoundBehavior.setDrawnBehavior(
+                EditingCompoundBehavior.EDITING_INDEX, true);
+
+            EditingManager manager = EditingLocator.getManager();
+
+            if (currentLayer != null) {
+
+                EditingService service =
+                    manager.getEditingService(name,
+                        currentLayer.getFeatureStore(),
+                        mapContextReference.get());
+
+                if (service != null) {
+
+                    this.enableSelection(false);
+
+                    try {
+                        service.start();
+                    } catch (StartServiceException e) {
+
+                        logger.info(String.format(
+                            "Can't start the service %1$s", service.getName()),
+                            e);
+                        cleanEditingContext();
+                        return;
+
+                    } catch (InvalidEntryException e) {
+
+                        I18nManager i18nManager = ToolsLocator.getI18nManager();
+                        showConsoleMessage("\n"
+                            + i18nManager.getTranslation("invalid_option"));
+                    }
+
+                    if (!serviceStack.isEmpty()
+                        && !getActiveService().next().getTypes()
+                            .contains(TYPE.GEOMETRY)) {
+                        serviceStack.pop();
+                    }
+
+                    setActiveService(service);
+
+                    getNextParameter();
+                }
+            }
+        }
+    }
+
+    private void addBehaviors(Behavior[] additionalBehavior)
+        throws CreateEditingBehaviorException {
+
+        DefaultEditingBehavior editingBehavior;
+        EditingCompoundBehavior editingCompoundBehavior;
+
+        if (!getMapControl().hasTool("VectorEditing")) {
+
+            editingBehavior = new DefaultEditingBehavior(this);
+            editingCompoundBehavior =
+                new EditingCompoundBehavior(editingBehavior);
+            setCompoundBehavior(editingCompoundBehavior);
+
+            if (additionalBehavior != null) {
+
+                Behavior[] behaviors =
+                    new Behavior[additionalBehavior.length + 1];
+                behaviors[0] = editingCompoundBehavior;
+
+                for (int i = 0; i < additionalBehavior.length; i++) {
+                    behaviors[i + 1] = additionalBehavior[i];
+                }
+
+                getMapControl().addBehavior("VectorEditing", behaviors);
+
+                lastAdditionalBehaviors = additionalBehavior;
+
+            } else {
+                getMapControl().addBehavior("VectorEditing",
+                    editingCompoundBehavior);
+            }
+
+        } else {
+            editingCompoundBehavior = getEditingCompoundBehavior();
+            editingBehavior =
+                (DefaultEditingBehavior) editingCompoundBehavior
+                    .getBehavior(EditingCompoundBehavior.EDITING_INDEX);
+            setCompoundBehavior(editingCompoundBehavior);
+            cleanEditingContext();
+        }
+
+    }
+
+    private void addLayerListeners() {
+
+        FLayers layers = mapContextReference.get().getLayers();
+
+        layers.addLayerListener(layerListener);
+
+        layers.addLayerCollectionListener(new LayerCollectionListener() {
+
+            public void addLayer(FLayer layer) {
+                if (layer instanceof FLayers) {
+                    FLayers layers = (FLayers) layer;
+                    for (int i = 0; i < layers.getLayersCount(); i++) {
+                        addLayer(layers.getLayer(i));
+                    }
+                } else if (layer instanceof FLyrVect) {
+                    ((FLyrVect) layer).addLayerListener(layerListener);
+                }
+            }
+
+            public void layerAdded(LayerCollectionEvent e) {
+                addLayer(e.getLayers());
+            }
+
+            public void layerAdding(LayerCollectionEvent e)
+                throws CancelationException {
+            }
+
+            public void layerMoved(LayerPositionEvent e) {
+            }
+
+            public void layerMoving(LayerPositionEvent e)
+                throws CancelationException {
+            }
+
+            public void removeLayer(FLayer layer) {
+                if (layer instanceof FLayers) {
+                    FLayers layers = (FLayers) layer;
+                    for (int i = 0; i < layers.getLayersCount(); i++) {
+                        addLayer(layers.getLayer(i));
+                    }
+                } else if (layer instanceof FLyrVect) {
+                    ((FLyrVect) layer).removeLayerListener(layerListener);
+                }
+            }
+
+            public void layerRemoved(LayerCollectionEvent e) {
+                removeLayer(e.getLayers());
+            }
+
+            public void layerRemoving(LayerCollectionEvent e)
+                throws CancelationException {
+            }
+
+            public void visibilityChanged(LayerCollectionEvent e)
+                throws CancelationException {
+            }
+        });
+    }
+
+    public void addObserver(Observer o) {
+        this.observableHelper.addObserver(o);
+    }
+
+    private void askQuestion(EditingServiceParameter param) {
+        I18nManager i18nManager = ToolsLocator.getI18nManager();
+        String translation = i18nManager.getTranslation(param.getDescription());
+        String activeServiceName =
+            i18nManager.getTranslation(getActiveService().getName());
+
+        Object defaultValue = param.getDefaultValue();
+        String strDefaultValue;
+
+        if (defaultValue != null) {
+            if (defaultValue instanceof String) {
+                strDefaultValue = (String) defaultValue;
+                strDefaultValue =
+                    i18nManager.getTranslation((String) defaultValue);
+            } else {
+                if(defaultValue instanceof Point){
+                    Point point = (Point)defaultValue;
+                    StringBuilder builder = new StringBuilder();
+                    for(int i=0; i<point.getDimension(); i++){
+                        builder.append(point.getCoordinateAt(i));
+                        if(i < point.getDimension()-1){
+                            builder.append(" , ");
+                        }
+                    }
+                    strDefaultValue = builder.toString();
+                } else {
+                    strDefaultValue = defaultValue.toString();
+                }
+            }
+            showConsoleMessage("\n" + activeServiceName + "# " + translation
+                + "<" + strDefaultValue + "> : ");
+        } else {
+            showConsoleMessage("\n" + activeServiceName + "# " + translation
+                + " : ");
+        }
+    }
+
+    public synchronized void beginEdition(FLyrVect layer,
+        Behavior[] additionalBehaviors) {
+
+        try{
+            throw new Exception("Deprecated method");
+        } catch (Exception e){
+            logger.info("Deprecated method", e);
+        }
+
+        beginEdition(layer);
+        try {
+            addBehaviors(additionalBehaviors);
+        } catch (CreateEditingBehaviorException e1) {
+            logger.info("Problems adding behaviors to editing context", e1);
+            getMapControl().setTool("pan");
+            return;
+        }
+    }
+
+    public synchronized void beginEdition(FLyrVect layer) {
+
+        EditingNotificationManager editingNotificationManager =
+            DALSwingLocator.getEditingNotificationManager();
+
+        EditingNotification notification =
+            editingNotificationManager.notifyObservers(this,
+                EditingNotification.BEFORE_ENTER_EDITING_STORE, null, layer,layer.getFeatureStore());
+
+        if (notification.isCanceled()) {
+            String msg =
+                String.format("Edit layer %1$s canceled by somme observer.",
+                    layer.getName());
+            logger.info(msg, new StartEditingException(msg, null));
+            return;
+        }
+
+        setCurrentLayer(layer);
+
+        FeatureStore featureStore = layer.getFeatureStore();
+        if (!featureStore.isEditing()) {
+            try {
+                featureStore.edit();
+            } catch (Exception e) {
+                String msg =
+                    String.format("Can't set %1$s in edit mode",
+                        featureStore.getName());
+                logger.info(msg, new VectorEditingException(e));
+                cleanEditingContext();
+                return;
+            }
+        }
+
+        featureStore.addObserver(getMapControl());
+
+        editingNotificationManager.notifyObservers(this,
+            EditingNotification.AFTER_ENTER_EDITING_STORE, null, layer, layer.getFeatureStore());
+
+        enableSnapping();
+    }
+
+    @SuppressWarnings({ "rawtypes", "unchecked" })
+    private void enableSnapping() {
+        Preferences prefs = Preferences.userRoot().node("snappers");
+         getMapControl().setRefentEnabled(prefs.getBoolean("apply-snappers", false));
+         if (currentLayer != null) {
+            ArrayList layersToSnap =
+                getMapControl().getMapContext().getLayersToSnap();
+            if (!layersToSnap.contains(currentLayer)) {
+                layersToSnap.add(currentLayer);
+            }
+        }
+    }
+
+    @SuppressWarnings("rawtypes")
+    private void disableSnapping() {
+        ArrayList layersToSnap =
+            getMapControl().getMapContext().getLayersToSnap();
+        if (layersToSnap.contains(currentLayer)) {
+            layersToSnap.remove(currentLayer);
+        }
+    }
+
+    private void changeSelectedTool(String name) {
+        if (name.equalsIgnoreCase(DEFAULT_TOOL)) {
+            name = "selection-simple-select-view";
+            this.getMapControl().setTool("pointSelection");
+        }
+        Notification notification =
+            new BaseNotification(
+                EditingContext.CHANGE_SELECTED_TOOL_NOTIFICATION,
+                new Object[] { name });
+        this.observableHelper.notifyObservers(this, notification);
+    }
+
+    private void cleanEditingContext() {
+        serviceStack.clear();
+        currentParam = null;
+        this.enableSelection(false);
+        refreshMenusAndToolBars();
+
+        I18nManager i18nManager = ToolsLocator.getI18nManager();
+        showConsoleMessage("\n" + i18nManager.getTranslation("select_new_tool")
+            + "\n");
+    }
+
+    public void deleteObserver(Observer o) {
+        this.observableHelper.deleteObserver(o);
+    }
+
+    public void deleteObservers() {
+        this.observableHelper.deleteObservers();
+    }
+
+    private void discardChanges(FLyrVect layer) throws EndEditingException {
+        FeatureStore featureStore = layer.getFeatureStore();
+        try {
+            featureStore.cancelEditing();
+        } catch (Exception e) {
+            throw new EndEditingException(e);
+        }
+    }
+
+    private void doAction(FLyrVect layer, int option) {
+        ThreadSafeDialogsManager dialogs = ToolsSwingLocator.getThreadSafeDialogsManager();
+        I18nManager i18n = ToolsLocator.getI18nManager();
+        
+        switch (option) {
+        case SAVE_CHANGES:
+            try {
+                saveChanges(layer);
+            } catch (VectorEditingException e) {
+                String msg =
+                    String.format("Changes can not be saved in %1$s",
+                        layer.getName());
+                logger.info(msg, e);
+                dialogs.messageDialog(                   
+                    i18n.getTranslation("_There_are_problems_saving_changes")+"\n\n"+
+                    i18n.getTranslation("_See_error_log_for_more_information"), 
+                    null, 
+                    i18n.getTranslation("_Warning"), 
+                    JOptionPane.WARNING_MESSAGE, 
+                    "Vectorediting_cant_save_changes"
+                );
+                return;
+            }
+            break;
+
+        case DISCARD_CHANGES:
+            try {
+                discardChanges(layer);
+            } catch (VectorEditingException e) {
+                String msg =
+                    String.format("Changes can not be discared in %1$s",
+                        layer.getName());
+                logger.info(msg, e);
+                dialogs.messageDialog(                   
+                    i18n.getTranslation("_There_are_problems_discarding_changes")+"\n"+
+//                    i18n.getTranslation("_The_layer_is_marked_as_temporary_to_avoid_possible_problems_when_trying_to_save_the_project")+"\n"+
+                    "\n" + i18n.getTranslation("_See_error_log_for_more_information"), 
+                    null, 
+                    i18n.getTranslation("_Warning"), 
+                    JOptionPane.WARNING_MESSAGE, 
+                    "Vectorediting_cant_discard_changes"
+                );
+                return;
+            }
+            break;
+
+        case EXPORT_LAYER:
+            try {
+                exportLayer(layer);
+            } catch (VectorEditingException e) {
+                String msg =
+                    String.format("Changes of %1$s can not be exported",
+                        layer.getName());
+                logger.info(msg, e);
+                dialogs.messageDialog(                   
+                    i18n.getTranslation("_There_are_problems_exporting_changes")+"\n\n"+
+                    i18n.getTranslation("_See_error_log_for_more_information"), 
+                    null, 
+                    i18n.getTranslation("_Warning"), 
+                    JOptionPane.WARNING_MESSAGE, 
+                    "Vectorediting_cant_export_changes"
+                );
+                return;
+            }
+            break;
+
+        case CANCEL:
+            return;
+        }
+
+        cleanEditingContext();
+        hideConsole();
+        disableSnapping();
+        changeSelectedTool(DEFAULT_TOOL);
+
+        FeatureStore featureStore = layer.getFeatureStore();
+        featureStore.deleteObserver(getMapControl());
+
+    }
+
+    private void enableSelection(boolean enableSelection) {
+        this.editingCompoundBehavior.setDrawnBehavior(
+            EditingCompoundBehavior.SELECTION_INDEX, enableSelection);
+    }
+
+    public void endEdition(FLyrVect layer) {
+        if (layer.isEditing()) {
+            EditingNotificationManager editingNotificationManager =
+                DALSwingLocator.getEditingNotificationManager();
+
+            EditingNotification notification =
+                editingNotificationManager.notifyObservers(this,
+                    EditingNotification.BEFORE_EXIT_EDITING_STORE, null, layer, layer.getFeatureStore());
+
+            if (notification.isCanceled()) {
+                String msg =
+                    String.format(
+                        "Stop edit layer %1$s canceled by somme observer.",
+                        layer.getName());
+                logger.info(msg, new EndEditingException(msg, null));
+
+            }
+
+            getMapControl().getCanceldraw().setCanceled(true);
+            int option;
+            EditingSwingManager swingManager =
+                EditingSwingLocator.getSwingManager();
+
+
+            if (layer.isWritable() && getMapControl().getProjection().equals(layer.getProjection()) ) {
+                option =
+                    swingManager.showPanelSaveOrDiscard(getMapControl(),
+                        layer.getName());
+            } else {
+                option =
+                    swingManager.showPanelExportOrDiscard(getMapControl(),
+                        layer.getName());
+            }
+
+            doAction(layer, option);
+
+            editingNotificationManager.notifyObservers(this,
+                EditingNotification.AFTER_EXIT_EDITING_STORE, null, layer, layer.getFeatureStore());
+
+        }
+
+    }
+
+    private void exportLayer(FLyrVect layer) throws EndEditingException {
+        Notification notification = new BaseNotification(EditingContext.EXPORT_LAYER_NOTIFICATION,1);
+        notification.setValue(layer);
+        this.observableHelper.notifyObservers(this, notification);
+    }
+
+    protected void finishService() {
+        EditingService lastService = serviceStack.pop();
+        try {
+
+            if (!serviceStack.isEmpty()
+                && getActiveService().next().getTypes().contains(TYPE.GEOMETRY)) {
+                Geometry geometry = lastService.finish();
+                if (geometry != null) {
+                    getActiveService().setValue(geometry);
+                }
+            } else {
+                lastService.finishAndStore();
+                getMapControl().rePaintDirtyLayers();
+
+                I18nManager i18nManager = ToolsLocator.getI18nManager();
+                showConsoleMessage("\n"
+                    + i18nManager.getTranslation(lastService.getName()) + "# "
+                    + i18nManager.getTranslation("finished") + "\n");
+                lastService.stop();
+                setActiveService(lastService);
+                lastService.start();
+                changeSelectedTool(getActiveService().getName());
+            }
+
+        } catch (InvalidEntryException ex) {
+            I18nManager i18nManager = ToolsLocator.getI18nManager();
+            showConsoleMessage("\n"
+                + i18nManager.getTranslation("invalid_option"));
+            changeSelectedTool(getActiveService().getName());
+        } catch (VectorEditingException ex) {
+            logger.info("Can't finish " + lastService.getName(), ex);
+            cleanEditingContext();
+            return;
+        }
+
+        getNextParameter();
+    }
+
+    protected EditingService getActiveService() {
+        if (!serviceStack.isEmpty()) {
+            return serviceStack.peek();
+        }
+        return null;
+    }
+
+    private EditingConsole getConsolePanel() {
+        if (console == null) {
+            console = new DefaultEditingConsole(new ResponseListener() {
+
+                public void acceptResponse(String response) {
+                    textEntered(response);
+                }
+            });
+        }
+        return console;
+    }
+
+    protected FLyrVect getCurrentLayer() {
+        return this.currentLayer;
+    }
+
+    protected EditingServiceParameter getCurrentParam() {
+        return this.currentParam;
+    }
+
+    private Component getDockConsole() {
+        if (dockConsole == null) {
+            dockConsole = new JDockPanel((JComponent) getConsolePanel());
+        }
+        return dockConsole;
+    }
+
+    private DefaultEditingBehavior getEditingBehavior() {
+        if (editingCompoundBehavior != null) {
+            return (DefaultEditingBehavior) editingCompoundBehavior
+                .getBehavior(EditingCompoundBehavior.EDITING_INDEX);
+        }
+        return null;
+    }
+
+    private EditingCompoundBehavior getEditingCompoundBehavior() {
+        if (editingCompoundBehavior != null) {
+            return editingCompoundBehavior;
+        } else {
+            EditingCompoundBehavior editingCompoundBehavior;
+
+            CompoundBehavior compoundBehavior =
+                (CompoundBehavior) getMapControl().getMapTool("VectorEditing");
+
+            if (compoundBehavior instanceof EditingCompoundBehavior) {
+                editingCompoundBehavior =
+                    (EditingCompoundBehavior) compoundBehavior;
+            } else {
+                editingCompoundBehavior =
+                    (EditingCompoundBehavior) compoundBehavior.getBehavior(0);
+            }
+
+            setCompoundBehavior(editingCompoundBehavior);
+            return editingCompoundBehavior;
+        }
+    }
+
+    public MapControl getMapControl() {
+        return mapControlReference.get();
+    }
+
+    protected void getNextParameter() {
+        if ((getMapControl().getCurrentTool() != null)
+            && !getMapControl().getCurrentTool().equals("VectorEditing")) {
+            getMapControl().setTool("VectorEditing");
+        }
+        currentParam = getActiveService().next();
+
+        if (currentParam == null) {
+            finishService();
+        } else {
+            askQuestion(currentParam);
+            if (currentParam.getTypes().contains(TYPE.SELECTION)) {
+                enableSelection(true);
+            } else if (currentParam.getTypes().contains(TYPE.GEOMETRY)) {
+                refreshMenusAndToolBars();
+            }
+        }
+    }
+
+    protected Stack<EditingService> getServiceStack() {
+        return this.serviceStack;
+    }
+
+    private void hideConsole() {
+        isShowConsole = false;
+        if( !SwingUtilities.isEventDispatchThread() ) {
+            try {
+                SwingUtilities.invokeAndWait(new Runnable() {
+
+                    @Override
+                    public void run() {
+                        hideConsole();
+                    }
+                });
+                return;
+            } catch (InterruptedException | InvocationTargetException ex) {
+                logger.warn("Can't hide editing console.",ex);
+            }
+            return;
+        }
+        getDockConsole().setVisible(false);
+    }
+
+    public boolean isServiceCompatible(String name) {
+        DefaultEditingBehavior editingBehavior = getEditingBehavior();
+
+        if (editingBehavior != null) {
+
+            try {
+                EditingManager manager = EditingLocator.getManager();
+                EditingServiceInfo serviceInfo = manager.getServiceInfo(name);
+                GeometryType geoType = null;
+
+                for (EditingService editingService : getServiceStack()) {
+                    EditingServiceParameter parameter = editingService.next();
+                    if (parameter != null
+                        && parameter.getTypes().contains(TYPE.GEOMETRY)) {
+
+                        int geometryType = parameter.getGeometryType();
+                        int subType = -1;
+
+                        try {
+                            subType =
+                                getCurrentLayer().getFeatureStore()
+                                    .getDefaultFeatureType()
+                                    .getDefaultGeometryAttribute()
+                                    .getGeomType().getSubType();
+
+                            geoType =
+                                GeometryLocator.getGeometryManager()
+                                    .getGeometryType(geometryType, subType);
+                        } catch (Exception e) {
+
+                            String msg =
+                                String.format(
+                                    "Problems getting default feature"
+                                        + " type of %1$s or getting geometry"
+                                        + " type of %2$s %3$s",
+                                    getCurrentLayer().getName(), geometryType,
+                                    subType);
+
+                            throw new ServiceInformationException(msg, e);
+                        }
+
+                        return serviceInfo.isCompatibleWith(geoType)
+                            && serviceInfo.createsNewGeometries();
+                    }
+                }
+
+                if (getCurrentLayer() != null) {
+                    try {
+                        geoType =
+                            getCurrentLayer().getFeatureStore()
+                                .getDefaultFeatureType()
+                                .getDefaultGeometryAttribute().getGeomType();
+                    } catch (DataException e) {
+                        String msg =
+                            String.format("Problems getting default "
+                                + "feature type of %1$s", getCurrentLayer()
+                                .getName());
+                        throw new ServiceInformationException(msg, e);
+                    }
+
+                    return serviceInfo.isCompatibleWith(geoType);
+                }
+
+                return false;
+            } catch (ServiceInformationException e) {
+                logger.warn(
+                    "Problems getting if editing context is compatible with "
+                        + name, e);
+            }
+        }
+        return false;
+    }
+
+    private Point parsePoint(String response) throws ParsePointException {
+        String[] numbers = new String[1];
+        numbers[0] = response;
+        numbers = response.split(",");
+        int dimension = numbers.length;
+        if (dimension >= 2 && dimension <= 4) {
+
+            if (numbers[0].startsWith("(") && numbers[dimension-1].endsWith(")\n")) { // CCS
+                numbers[0] = numbers[0].replace("(", "");
+                numbers[dimension-1] = numbers[dimension-1].replace(")\n", "");
+            }
+
+            Point point;
+            try {
+                GeometryManager geomManager =
+                    GeometryLocator.getGeometryManager();
+                int subType;
+                switch (dimension) {
+                case 3:
+                    subType = Geometry.SUBTYPES.GEOM3D;
+                    break;
+                case 4:
+                    subType = Geometry.SUBTYPES.GEOM3DM;
+                    break;
+                default:
+                    subType = Geometry.SUBTYPES.GEOM2D;
+                    break;
+                }
+                point = (Point) geomManager.create(geomManager.getGeometryType(Geometry.TYPES.POINT, subType));
+                for (int i = 0; i < dimension; i++) {
+                    point.setCoordinateAt(i, Double.parseDouble(numbers[i]));
+                }
+
+            } catch (Exception e) {
+                throw new ParsePointException(e);
+            }
+            return point;
+        } else {
+            throw new ParsePointException(null);
+        }
+    }
+
+    private Double parseValue(String response) throws ParseValueException {
+        try {
+            return Double.valueOf(response);
+        } catch (Exception e) {
+            throw new ParseValueException(e);
+        }
+
+    }
+
+    protected void refreshMenusAndToolBars() {
+        if (!SwingUtilities.isEventDispatchThread()) {
+            SwingUtilities.invokeLater(new Runnable() {
+
+                @Override
+                public void run() {
+                    refreshMenusAndToolBars();
+                }
+            });
+            return;
+        }
+        Notification notification = new BaseNotification(
+                EditingContext.REFRESH_TOOLS_NOTIFICATION,
+                null
+        );
+        this.observableHelper.notifyObservers(this, notification);
+    }
+
+    private void saveChanges(FLyrVect layer) throws EndEditingException {
+        FeatureStore featureStore = layer.getFeatureStore();
+        try {
+            featureStore.finishEditing();
+        } catch (Exception e) {
+            throw new EndEditingException(e);
+        }
+    }
+
+    private void setActiveService(EditingService service) {
+        serviceStack.add(service);
+    }
+
+    private void setCompoundBehavior(EditingCompoundBehavior compoundBehavior) {
+        this.editingCompoundBehavior = compoundBehavior;
+    }
+
+    private void setCurrentLayer(FLyrVect layer) {
+
+        if (this.currentLayer != layer) {
+            this.currentLayer = layer;
+            cleanEditingContext();
+        }
+
+    }
+
+    public void setMapControl(MapControl mapControl) {
+
+        this.mapControlReference = new WeakReference<MapControl>(mapControl);
+        this.mapContextReference =
+            new WeakReference<MapContext>(mapControl.getMapContext());
+
+        // When mapControl is updated we have to add older additional behaviors
+        // to new mapControl
+        if (lastAdditionalBehaviors != null) {
+            try {
+                addBehaviors(lastAdditionalBehaviors);
+            } catch (CreateEditingBehaviorException e1) {
+                logger.info("Problems adding behaviors to editing context", e1);
+                getMapControl().setTool("pan");
+                return;
+            }
+        }
+    }
+
+    private void showConsole() {
+        if (isShowConsole) {
+            return;
+        }
+        if( !SwingUtilities.isEventDispatchThread() ) {
+            try {
+                SwingUtilities.invokeAndWait(new Runnable() {
+
+                    @Override
+                    public void run() {
+                        showConsole();
+                    }
+                });
+                return;
+            } catch (InterruptedException | InvocationTargetException ex) {
+                logger.warn("Can't show editing console.",ex);
+            }
+            return;
+        }
+        isShowConsole = true;
+        getMapControl().remove(getDockConsole());
+        getMapControl().setLayout(new BorderLayout());
+        getMapControl().add(getDockConsole(), BorderLayout.SOUTH);
+        getDockConsole().setVisible(true);
+    }
+
+    protected void showConsoleMessage(final String text) {
+        if (!SwingUtilities.isEventDispatchThread()) {
+            SwingUtilities.invokeLater(new Runnable() {
+
+                @Override
+                public void run() {
+                    showConsoleMessage(text);
+                }
+            });
+            return;
+        }
+        getConsolePanel().addText(text);
+    }
+
+    protected void textEntered(String response) {
+        FeatureStore featureStore = getCurrentLayer().getFeatureStore();
+        EditingService activeService = getActiveService();
+        if (response == null) {
+            if (activeService != null) {
+                try {
+                    activeService.stop();
+                    serviceStack.pop();
+                    if (serviceStack.isEmpty()) {
+                        featureStore
+                            .getFeatureSelection().deselectAll();
+                        changeSelectedTool(DEFAULT_TOOL);
+                    } else {
+                        changeSelectedTool(activeService.getName());
+                    }
+
+                    refreshMenusAndToolBars();
+                    activeService = getActiveService();
+                    if (activeService != null) {
+                        getNextParameter();
+                    } else {
+                        cleanEditingContext();
+                    }
+
+                } catch (StopServiceException e) {
+                    logger
+                        .info("Can't stop " + activeService.getName(), e);
+                    return;
+                } catch (DataException e) {
+                    logger.info("Can't get selection of "
+                        + featureStore.getFullName(), e);
+                    return;
+                }
+            }
+        } else {
+
+            if (getCurrentParam() != null) {
+                Set<TYPE> types = getCurrentParam().getTypes();
+                Point point = null;
+                Double value = null;
+                Point defaultPoint = null;
+                Object defaultValue = getCurrentParam().getDefaultValue();
+//                int dimension = 2;
+//                if(defaultValue != null && defaultValue instanceof Point){
+                    defaultPoint = (Point)defaultValue;
+//                    dimension = defaultPoint.getDimension();
+//                }
+
+                boolean insertedValue = false;
+                if ((!insertedValue && types.contains(TYPE.POSITION))
+                    || types.contains(TYPE.LIST_POSITIONS)) {
+
+                    try {
+                        if(StringUtils.isEmpty(response.replace("\n", ""))){
+                            point = defaultPoint;
+                        } else {
+                            point = parsePoint(response);
+                        }
+
+                        if (point != null) {
+                            activeService.setValue(point);
+                            insertedValue = true;
+                        }
+
+                    } catch (VectorEditingException e) {
+                        // Do nothing to try other types
+                    }
+                }
+                if (!insertedValue && types.contains(TYPE.VALUE)) {
+
+                    try {
+
+                        value = parseValue(response);
+                        if (value != null) {
+                            activeService.setValue(value);
+                            insertedValue = true;
+                        }
+
+                    } catch (VectorEditingException e) {
+                        // Do nothing to try other types
+                    }
+
+                }
+                if (!insertedValue && types.contains(TYPE.OPTION)) {
+
+                    try {
+
+                        response = response.replace("\n", "");
+                        if (response != null) {
+                            activeService.setValue(response);
+                            insertedValue = true;
+                        }
+
+                    } catch (VectorEditingException e) {
+                        // Do nothing to try other types
+                    }
+                }
+                if (!insertedValue && types.contains(TYPE.SELECTION)) {
+                    if (response.equalsIgnoreCase("\n")) {
+                        enableSelection(false);
+                        insertedValue = true;
+
+                        try {
+
+                            FeatureSelection clonedSelection = (FeatureSelection)featureStore
+                                .getFeatureSelection().clone();
+                            if(clonedSelection.isEmpty()){
+                               throw new InvalidEntryException(null);
+                            }
+                            activeService.setValue(
+                                clonedSelection);
+
+                        } catch (InvalidEntryException e) {
+                            I18nManager i18nManager =
+                                ToolsLocator.getI18nManager();
+                            showConsoleMessage("\n"
+                                + i18nManager.getTranslation("invalid_option"));
+                        } catch (Exception e) {
+                            logger.info("Can't access to selection.", e);
+                            cleanEditingContext();
+                            return;
+                        }
+                    }
+                }
+                if (!insertedValue) {
+                    I18nManager i18nManager = ToolsLocator.getI18nManager();
+                    showConsoleMessage("\n"
+                        + i18nManager.getTranslation("invalid_option"));
+                }
+                getNextParameter();
+            }
+        }
+    }
+
+    public void setDefaultBehaviors(Behavior[] defaultBehaviors) {
+        this.defaultBehaviors = defaultBehaviors;
+        try {
+            addBehaviors(defaultBehaviors);
+        } catch (CreateEditingBehaviorException e1) {
+            logger.info("Problems adding behaviors to editing context", e1);
+            getMapControl().setTool("pan");
+            return;
+        }
+    }
+
+    public Behavior[] getDefaultBehaviors() {
+        return this.defaultBehaviors;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultMapCreationListener.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultMapCreationListener.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultMapCreationListener.java	(revision 1663)
@@ -0,0 +1,44 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.impl;
+
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.MapControlCreationListener;
+import org.gvsig.vectorediting.swing.api.EditingSwingLocator;
+import org.gvsig.vectorediting.swing.api.EditingSwingManager;
+
+public class DefaultMapCreationListener implements MapControlCreationListener {
+
+    public MapControl mapControlCreated(MapControl mapControl) {
+
+        EditingSwingManager swingManager =
+            EditingSwingLocator.getSwingManager();
+
+        swingManager.registerEditingContext(mapControl);
+
+        return mapControl;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/console/DefaultEditingConsoleView.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/console/DefaultEditingConsoleView.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/console/DefaultEditingConsoleView.java	(revision 1663)
@@ -0,0 +1,70 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.impl.console;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.Font;
+
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+
+/**
+ * Default view implementation of EditingConsole
+ * 
+ * @author llmarques
+ */
+public class DefaultEditingConsoleView extends JPanel {
+
+    private static final long serialVersionUID = -843733609032093530L;
+
+    private JTextArea textArea;
+
+    public DefaultEditingConsoleView() {
+        this.textArea = new JTextArea();
+        this.textArea.setLineWrap(true);
+        this.textArea.setWrapStyleWord(true);
+        this.textArea.setFont(new Font("Monospaced", Font.PLAIN, 14));
+
+        JScrollPane scroll = new JScrollPane(textArea);
+        scroll
+            .setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
+
+        initialize(scroll);
+    }
+
+    private void initialize(JScrollPane scroll) {
+        this.setLayout(new BorderLayout());
+        this.setSize(300, 150);
+        this.setPreferredSize(new Dimension(300, 150));
+        this.add(scroll, java.awt.BorderLayout.CENTER);
+    }
+
+    protected JTextArea getTextArea() {
+        return textArea;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/console/DefaultEditingConsole.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/console/DefaultEditingConsole.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/console/DefaultEditingConsole.java	(revision 1663)
@@ -0,0 +1,186 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.impl.console;
+
+import java.awt.event.ActionEvent;
+import java.util.List;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.KeyStroke;
+import javax.swing.event.AncestorEvent;
+import javax.swing.event.AncestorListener;
+
+import org.gvsig.utils.console.ResponseListener;
+import org.gvsig.utils.console.ResponseListenerSupport;
+import org.gvsig.vectorediting.swing.api.console.EditingConsole;
+
+/**
+ * Default implementation of EditingConsole
+ *
+ * @author llmarques
+ */
+public class DefaultEditingConsole extends DefaultEditingConsoleView implements
+    EditingConsole {
+
+    private static final long serialVersionUID = -1068129558465010049L;
+
+    private ResponseListenerSupport responseListenerSupport;
+    private int startingCaretPosition = 0;
+
+    public DefaultEditingConsole(ResponseListener listener) {
+        super();
+
+        // Add ancestor listener to request focus when an ancestor becomes
+        // visible
+        addAncestorListenerToSetCaretPosition();
+
+        this.responseListenerSupport = new ResponseListenerSupport();
+        this.responseListenerSupport.addResponseListener(listener);
+
+        getTextArea().setNavigationFilter(
+            new DefaultEditingNavigationFilter(startingCaretPosition));
+
+        addKeyBindings();
+    }
+
+    public DefaultEditingConsole(List<ResponseListener> listeners) {
+        super();
+
+        // Add ancestor listener to request focus when an ancestor becomes
+        // visible
+        addAncestorListenerToSetCaretPosition();
+
+        this.responseListenerSupport = new ResponseListenerSupport();
+        for (ResponseListener responseListener : listeners) {
+            this.responseListenerSupport.addResponseListener(responseListener);
+        }
+
+        // Add navigation filter to control caret position
+        getTextArea().setNavigationFilter(
+            new DefaultEditingNavigationFilter(startingCaretPosition));
+
+        addKeyBindings();
+    }
+
+    private void addAncestorListenerToSetCaretPosition() {
+        this.addAncestorListener(new AncestorListener() {
+
+            public void ancestorRemoved(AncestorEvent event) {
+            }
+
+            public void ancestorMoved(AncestorEvent event) {
+            }
+
+            public void ancestorAdded(AncestorEvent event) {
+                getTextArea().requestFocusInWindow();
+                getTextArea().setCaretPosition(startingCaretPosition);
+            }
+        });
+    }
+
+    private void addKeyBindings() {
+
+        // Enter binding
+        getTextArea().getInputMap().put(KeyStroke.getKeyStroke("ENTER"),
+            "enterAction");
+        getTextArea().getActionMap().put("enterAction", enterAction);
+
+        // Esc binding
+        getTextArea().getInputMap().put(KeyStroke.getKeyStroke("ESCAPE"),
+            "escAction");
+        getTextArea().getActionMap().put("escAction", escAction);
+
+        // BackSpace binding
+        getTextArea().getInputMap().put(KeyStroke.getKeyStroke("BACK_SPACE"),
+            "backSpaceAction");
+        getTextArea().getActionMap().put("backSpaceAction", backSpaceAction);
+        // Del binding
+        getTextArea().getInputMap().put(KeyStroke.getKeyStroke("DELETE"), "none");
+    }
+
+    public String getResponseText() {
+        return getTextArea().getText().substring(startingCaretPosition,
+            getTextArea().getText().length());
+    }
+
+    public void addText(String text) {
+        getTextArea().setText(getTextArea().getText() + text);
+        getTextArea().setCaretPosition(getTextArea().getText().length());
+        startingCaretPosition = getTextArea().getText().length();
+        getTextArea().setNavigationFilter(
+            new DefaultEditingNavigationFilter(startingCaretPosition));
+    }
+
+    public void addResponseText(String responseText) {
+        getTextArea().setText(getTextArea().getText() + responseText);
+        getTextArea().setCaretPosition(getTextArea().getText().length());
+    }
+
+    public void addResponseListener(ResponseListener listener) {
+        this.responseListenerSupport.addResponseListener(listener);
+    }
+
+    public void removeResponseListener(ResponseListener listener) {
+        this.responseListenerSupport.removeResponseListener(listener);
+    }
+
+    private void callResponseListener(String response) {
+        this.responseListenerSupport.callAcceptResponse(response);
+    }
+
+    public void clear() {
+        getTextArea().setText(null);
+    }
+
+    @SuppressWarnings("serial")
+    private Action enterAction = new AbstractAction() {
+
+        public void actionPerformed(ActionEvent e) {
+            callResponseListener(getResponseText() + "\n");
+        }
+    };
+
+    @SuppressWarnings("serial")
+    private Action escAction = new AbstractAction() {
+
+        public void actionPerformed(ActionEvent e) {
+            callResponseListener(null);
+        }
+    };
+
+    @SuppressWarnings("serial")
+    private Action backSpaceAction = new AbstractAction() {
+
+        public void actionPerformed(ActionEvent e) {
+            if (getTextArea().getCaretPosition() > startingCaretPosition) {
+                StringBuilder stb = new StringBuilder(getTextArea().getText());
+                stb.deleteCharAt(getTextArea().getText().length() - 1);
+                getTextArea().setText(stb.toString());
+            }
+        }
+    };
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/console/DefaultEditingNavigationFilter.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/console/DefaultEditingNavigationFilter.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/console/DefaultEditingNavigationFilter.java	(revision 1663)
@@ -0,0 +1,62 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2015 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.impl.console;
+
+import javax.swing.text.NavigationFilter;
+import javax.swing.text.Position.Bias;
+
+/**
+ * Default implementation of Navigation filter. This implementation doesn't let
+ * caret to move behind of a determinate position.
+ * 
+ * @author llmarques
+ *
+ */
+public class DefaultEditingNavigationFilter extends NavigationFilter {
+
+    private int startCaretPosition;
+
+    public DefaultEditingNavigationFilter(int theStartPosition) {
+        startCaretPosition = theStartPosition;
+    }
+
+    @Override
+    public void setDot(FilterBypass fb, int dot, Bias bias) {
+        if (dot > startCaretPosition) {
+            fb.setDot(dot, bias);
+        } else {
+            fb.setDot(startCaretPosition, bias);
+        }
+    }
+
+    @Override
+    public void moveDot(FilterBypass fb, int dot, Bias bias) {
+        if (dot > startCaretPosition) {
+            fb.moveDot(dot, bias);
+        } else {
+            fb.moveDot(startCaretPosition, bias);
+        }
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultEditingSwingLibrary.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultEditingSwingLibrary.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultEditingSwingLibrary.java	(revision 1663)
@@ -0,0 +1,61 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.impl;
+
+import org.gvsig.fmap.dal.DALLibrary;
+import org.gvsig.fmap.geom.GeometryLibrary;
+import org.gvsig.fmap.mapcontrol.MapControlLibrary;
+import org.gvsig.fmap.mapcontrol.MapControlLocator;
+import org.gvsig.fmap.mapcontrol.MapControlManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.vectorediting.swing.api.EditingSwingLibrary;
+import org.gvsig.vectorediting.swing.api.EditingSwingLocator;
+
+public class DefaultEditingSwingLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsImplementationOf(EditingSwingLibrary.class);
+        require(DALLibrary.class);
+        require(MapControlLibrary.class);
+        require(GeometryLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+        EditingSwingLocator.registerManager(DefaultEditingSwingManager.class);
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        MapControlManager mapControlManager =
+            MapControlLocator.getMapControlManager();
+
+        mapControlManager
+        .addMapControlCreationListener(new DefaultMapCreationListener());
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/SelectionBehavior.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/SelectionBehavior.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/SelectionBehavior.java	(revision 1663)
@@ -0,0 +1,96 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.impl;
+
+import java.awt.event.InputEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseWheelEvent;
+
+import org.gvsig.fmap.mapcontrol.tools.BehaviorException;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener;
+
+public class SelectionBehavior extends Behavior {
+
+    @Override
+    public ToolListener getListener() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public void mouseClicked(MouseEvent e) throws BehaviorException {
+        int clickWithShiftDown =
+            InputEvent.SHIFT_DOWN_MASK | InputEvent.BUTTON1_DOWN_MASK;
+        int ctrlDown = InputEvent.CTRL_DOWN_MASK;
+        if ((e.getModifiersEx() & (clickWithShiftDown | ctrlDown)) == clickWithShiftDown) {
+
+        }
+
+    }
+
+    @Override
+    public void mouseEntered(MouseEvent e) throws BehaviorException {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void mouseExited(MouseEvent e) throws BehaviorException {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void mousePressed(MouseEvent e) throws BehaviorException {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void mouseReleased(MouseEvent e) throws BehaviorException {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void mouseDragged(MouseEvent e) throws BehaviorException {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void mouseMoved(MouseEvent e) throws BehaviorException {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void mouseWheelMoved(MouseWheelEvent e) throws BehaviorException {
+        // TODO Auto-generated method stub
+
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultEditingBehavior.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultEditingBehavior.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultEditingBehavior.java	(revision 1663)
@@ -0,0 +1,235 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.impl;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.event.MouseEvent;
+import java.awt.geom.Point2D;
+import java.awt.image.BufferedImage;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.swing.SwingUtilities;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol;
+import org.gvsig.fmap.mapcontrol.MapControlDrawer;
+import org.gvsig.fmap.mapcontrol.MapControlLocator;
+import org.gvsig.fmap.mapcontrol.tools.BehaviorException;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.vectorediting.lib.api.DrawingStatus;
+import org.gvsig.vectorediting.lib.api.DrawingStatus.Status;
+import org.gvsig.vectorediting.lib.api.EditingService;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.lib.api.exceptions.CreateEditingBehaviorException;
+import org.gvsig.vectorediting.lib.api.exceptions.VectorEditingException;
+import org.gvsig.vectorediting.swing.api.EditingSwingLocator;
+import org.gvsig.vectorediting.swing.api.EditingSwingManager;
+import org.gvsig.vectorediting.swing.api.contextmenu.AcceptValueListener;
+import org.gvsig.vectorediting.swing.api.contextmenu.EditingContextMenu;
+
+public class DefaultEditingBehavior extends Behavior {
+
+    private static final Logger logger = LoggerFactory
+        .getLogger(DefaultEditingBehavior.class);
+
+    private DefaultEditingContext editingContext;
+
+    private Point adjustedPoint;
+
+    private static final Image imageCursor = new BufferedImage(32, 32,
+        BufferedImage.TYPE_INT_ARGB);
+    static {
+        Graphics g = imageCursor.getGraphics();
+        int size1 = 15;
+        int x = 16;
+        int y = 16;
+        g.setColor(Color.MAGENTA);
+        g.drawLine((x - size1), (y), (x + size1), (y));
+        g.drawLine((x), (y - size1), (x), (y + size1));
+        g.drawRect((x - 6), (y - 6), 12, 12);
+        g.drawRect((x - 3), (y - 3), 6, 6);
+    }
+
+    public DefaultEditingBehavior(DefaultEditingContext editingContext)
+        throws CreateEditingBehaviorException {
+
+        if (editingContext.getMapControl() != null) {
+            this.editingContext = editingContext;
+            setMapControl(editingContext.getMapControl());
+        }
+    }
+
+    @Override
+    public ToolListener getListener() {
+        return new ToolListener() {
+
+            public boolean cancelDrawing() {
+                return false;
+            }
+
+            public Image getImageCursor() {
+                return imageCursor;
+            }
+        };
+    }
+
+    @Override
+    public void mouseClicked(MouseEvent e) {
+        ViewPort vp = editingContext.getMapControl().getViewPort();
+        EditingServiceParameter currentParam = editingContext.getCurrentParam();
+        EditingService activeService = editingContext.getActiveService();
+
+        if ((activeService != null) && (currentParam != null)) {
+
+            if (SwingUtilities.isLeftMouseButton(e)) {
+
+                Set<TYPE> typesOfParam = currentParam.getTypes();
+
+                if (typesOfParam.contains(TYPE.LIST_POSITIONS)) {
+                    if (e.getClickCount() == 2) {
+                        editingContext.finishService();
+                        return;
+                    }
+                }
+
+                Point point = null;
+                Point2D point2D = getMapControl().getMapAdjustedPoint();
+                if (point2D == null) {
+                    point2D = getMapControl().getAdjustedPoint();
+                    point = vp.convertToMapPoint(point2D);
+                } else {
+                    try {
+                        point =
+                            GeometryLocator.getGeometryManager().createPoint(
+                                point2D.getX(), point2D.getY(),
+                                Geometry.SUBTYPES.GEOM2D);
+                    } catch (BaseException ex) {
+                        logger.warn("Can't create point geometry from "
+                            + point2D.toString());
+                    }
+                }
+
+                try {
+                    editingContext.getActiveService().setValue(point);
+                } catch (VectorEditingException ex) {
+                    I18nManager i18nManager = ToolsLocator.getI18nManager();
+                    editingContext.showConsoleMessage(i18nManager
+                        .getTranslation("invalid_option"));
+                }
+
+                editingContext.getNextParameter();
+
+            } else if (SwingUtilities.isRightMouseButton(e)) {
+
+                EditingSwingManager swingManager =
+                    EditingSwingLocator.getSwingManager();
+
+                EditingContextMenu contextMenu =
+                    swingManager.getContextualMenu(getMapControl(),
+                        new AcceptValueListener() {
+
+                            public void acceptValue(Object value) {
+                                editingContext.textEntered((String) value);
+
+                            }
+                        }, currentParam);
+
+                contextMenu.show(getMapControl(), e.getX(), e.getY());
+            }
+        }
+    }
+
+    @Override
+    public void mouseEntered(MouseEvent e) throws BehaviorException {
+    }
+
+    @Override
+    public void mouseMoved(MouseEvent e) throws BehaviorException {
+        ViewPort vp = editingContext.getMapControl().getViewPort();
+        adjustedPoint = vp.convertToMapPoint(e.getX(), e.getY());
+    }
+
+    @Override
+    public void mousePressed(MouseEvent e) throws BehaviorException {
+    }
+
+    @Override
+    public void mouseReleased(MouseEvent e) throws BehaviorException {
+    }
+
+    @Override
+    @SuppressWarnings("rawtypes")
+    public void paintComponent(MapControlDrawer mapControlDrawer) {
+        super.paintComponent(mapControlDrawer);
+
+        if ((editingContext.getActiveService() == null)
+            || (adjustedPoint == null)) {
+            return;
+        }
+
+        DrawingStatus helperGeo = null;
+
+        try {
+            helperGeo =
+                editingContext.getActiveService().getDrawingStatus(
+                    adjustedPoint);
+        } catch (VectorEditingException e) {
+            logger.info("An error ocurred when draw service geometries", e);
+        }
+
+        if (helperGeo != null) {
+            for (Iterator iterator = helperGeo.getStatus().iterator(); iterator
+                .hasNext();) {
+                Status status = (Status) iterator.next();
+                ISymbol symbol = status.getSymbol();
+                if (symbol == null) {
+                    symbol =
+                        MapControlLocator.getMapControlManager()
+                            .getAxisReferenceSymbol();
+                }
+                if (symbol instanceof ITextSymbol) {
+                    ((ITextSymbol) symbol).setText(status.getText());
+                }
+                editingContext.getMapControl().getMapControlDrawer()
+                    .draw(status.getGeometry(), symbol);
+            }
+        }
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/EditingCompoundBehavior.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/EditingCompoundBehavior.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/EditingCompoundBehavior.java	(revision 1663)
@@ -0,0 +1,288 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.impl;
+
+import java.awt.Image;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseWheelEvent;
+
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.MapControlDrawer;
+import org.gvsig.fmap.mapcontrol.tools.BehaviorException;
+import org.gvsig.fmap.mapcontrol.tools.CompoundBehavior;
+import org.gvsig.fmap.mapcontrol.tools.PointSelectionListener;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.IBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseWheelBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.PointBehavior;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener;
+
+public class EditingCompoundBehavior extends CompoundBehavior {
+
+    private enum Mode {
+        EDITING, SELECTION
+    };
+
+    private Mode mode = Mode.EDITING;
+    private IBehavior editing;
+    private IBehavior selection;
+
+    public final static int EDITING_INDEX = 0;
+    public final static int SELECTION_INDEX = 1;
+
+    public EditingCompoundBehavior(IBehavior editing) {
+        super(new Behavior[0]);
+        this.editing = editing;
+
+        this.selection = null;
+    }
+
+    @Override
+    public void addMapBehavior(Behavior mt, boolean draw) {
+        if (mt instanceof MouseWheelBehavior) {
+            return;
+        }
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void removeMapBehavior(Behavior mt) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean containsBehavior(Behavior mt) {
+        return ((mt == this.editing) || (mt == this.selection));
+    }
+
+    @Override
+    public Behavior getBehavior(int index) {
+        switch (index) {
+        case EDITING_INDEX:
+            return (Behavior) this.editing;
+        case SELECTION_INDEX:
+            return (Behavior) this.selection;
+        default:
+            throw new IndexOutOfBoundsException();
+        }
+    }
+
+    @Override
+    public boolean isDrawnBehavior(int index) {
+        switch (mode) {
+        case EDITING:
+            return index == EDITING_INDEX;
+        case SELECTION:
+            return index == SELECTION_INDEX;
+        default:
+            return false;
+        }
+    }
+
+    @Override
+    public void setDrawnBehavior(int index, boolean draw) {
+        switch (index) {
+        case EDITING_INDEX:
+            if (draw) {
+                mode = Mode.EDITING;
+            } else {
+                mode = Mode.SELECTION;
+            }
+            break;
+        case SELECTION_INDEX:
+            if (draw) {
+                mode = Mode.SELECTION;
+            } else {
+                mode = Mode.EDITING;
+            }
+            break;
+        default:
+            throw new IndexOutOfBoundsException();
+        }
+    }
+
+    @Override
+    public int size() {
+        return 2;
+    }
+
+    @Override
+    public Image getImageCursor() {
+        switch (mode) {
+        default:
+        case EDITING:
+            return this.editing.getImageCursor();
+        case SELECTION:
+            return this.selection.getImageCursor();
+        }
+    }
+
+    @Override
+    public void mouseClicked(MouseEvent e) throws BehaviorException {
+        switch (mode) {
+        default:
+        case EDITING:
+            this.editing.mouseClicked(e);
+            break;
+        case SELECTION:
+            this.selection.mouseClicked(e);
+        }
+    }
+
+    @Override
+    public void mouseDragged(MouseEvent e) throws BehaviorException {
+        switch (mode) {
+        default:
+        case EDITING:
+            this.editing.mouseDragged(e);
+            break;
+        case SELECTION:
+            this.selection.mouseDragged(e);
+        }
+    }
+
+    @Override
+    public void mouseEntered(MouseEvent e) throws BehaviorException {
+        switch (mode) {
+        default:
+        case EDITING:
+            this.editing.mouseEntered(e);
+            break;
+        case SELECTION:
+            this.selection.mouseEntered(e);
+        }
+    }
+
+    @Override
+    public void mouseExited(MouseEvent e) throws BehaviorException {
+        switch (mode) {
+        default:
+        case EDITING:
+            this.editing.mouseExited(e);
+            break;
+        case SELECTION:
+            this.selection.mouseExited(e);
+        }
+    }
+
+    @Override
+    public void mouseMoved(MouseEvent e) throws BehaviorException {
+        switch (mode) {
+        default:
+        case EDITING:
+            this.editing.mouseMoved(e);
+            break;
+        case SELECTION:
+            this.selection.mouseMoved(e);
+        }
+    }
+
+    @Override
+    public void mousePressed(MouseEvent e) throws BehaviorException {
+        switch (mode) {
+        default:
+        case EDITING:
+            this.editing.mousePressed(e);
+            break;
+        case SELECTION:
+            this.selection.mousePressed(e);
+        }
+    }
+
+    @Override
+    public void mouseReleased(MouseEvent e) throws BehaviorException {
+        switch (mode) {
+        default:
+        case EDITING:
+            this.editing.mouseReleased(e);
+            break;
+        case SELECTION:
+            this.selection.mouseReleased(e);
+        }
+    }
+
+    @Override
+    public void mouseWheelMoved(MouseWheelEvent e) throws BehaviorException {
+        switch (mode) {
+        default:
+        case EDITING:
+            this.editing.mouseWheelMoved(e);
+            break;
+        case SELECTION:
+            this.selection.mouseWheelMoved(e);
+        }
+    }
+
+
+    public void paintComponent(MapControlDrawer renderer, boolean clean) {
+        if(clean){
+            clean(renderer);
+        }
+        paintComponent(renderer);
+    }
+
+    @Override
+    public void paintComponent(MapControlDrawer renderer) {
+        switch (mode) {
+        default:
+        case EDITING:
+            this.editing.paintComponent(renderer);
+            break;
+        case SELECTION:
+            this.selection.paintComponent(renderer);
+        }
+    }
+
+    @Override
+    public void setListener(ToolListener listener) {
+        if (listener != null) {
+            throw new UnsupportedOperationException(
+                "CompoundBehavior does not have listeners");
+        }
+    }
+
+    @Override
+    public ToolListener getListener() {
+        return null;
+    }
+
+    @Override
+    public void setMapControl(MapControl mc) {
+        this.editing.setMapControl(mc);
+
+        if (this.selection == null) {
+            if (mc != null) {
+                PointSelectionListener psl = new PointSelectionListener(mc);
+                this.selection =
+                    new CompoundBehavior(
+                        new Behavior[] { new PointBehavior(psl) });
+                this.selection.setMapControl(mc);
+            }
+        } else {
+            this.selection.setMapControl(mc);
+        }
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DefaultDynamicEditingPointPanel.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DefaultDynamicEditingPointPanel.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DefaultDynamicEditingPointPanel.java	(revision 1663)
@@ -0,0 +1,287 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.swing.impl.contextmenu;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.util.Objects;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JComponent;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.tuple.Pair;
+import org.gvsig.expressionevaluator.swing.CalculatorController;
+import org.gvsig.expressionevaluator.swing.ExpressionEvaluatorSwingLocator;
+import org.gvsig.expressionevaluator.swing.ExpressionEvaluatorSwingManager;
+import org.gvsig.fmap.dal.DataTypes;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.geom.GeometryLocator;
+
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.geom.type.GeometryTypeNotSupportedException;
+import org.gvsig.fmap.geom.type.GeometryTypeNotValidException;
+import org.gvsig.temporarystorage.TemporaryStorageGroup;
+import org.gvsig.temporarystorage.TemporaryStorageLocator;
+import org.gvsig.tools.locator.LocatorException;
+import org.gvsig.tools.swing.api.ListElement;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+import org.gvsig.tools.swing.api.ToolsSwingManager;
+
+/**
+ * @author fdiaz
+ *
+ */
+public class DefaultDynamicEditingPointPanel extends DynamicEditingPointPanelView {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = 2398169399771503091L;
+    private final Point defaultPoint;
+    private final CalculatorController pickers[];
+    private CalculatorController pickerX;
+    private CalculatorController pickerY;
+    private CalculatorController pickerZ;
+    private CalculatorController pickerM;
+    private final GeometryType geomType;
+
+    /**
+     * @param geomType
+     * @param point
+     */
+    public DefaultDynamicEditingPointPanel(GeometryType geomType, Point point)  {
+        super();
+        this.defaultPoint = point;
+        if( geomType==null ) {
+            if( this.defaultPoint==null ) {
+                try {
+                    this.geomType = GeometryLocator.getGeometryManager().getGeometryType(
+                            Geometry.TYPES.POINT,
+                            Geometry.SUBTYPES.GEOM2D
+                    );
+                } catch (GeometryTypeNotSupportedException | GeometryTypeNotValidException | LocatorException ex) {
+                    throw new IllegalArgumentException("Can't create the geometry type, and params are null.");
+                }
+            } else {
+                this.geomType = this.defaultPoint.getGeometryType();
+            }
+        } else {
+            this.geomType = geomType;
+        }
+        this.pickers = new CalculatorController[this.geomType.getDimension()];
+        this.initComponents();
+    }
+
+    private void initComponents() {
+        ToolsSwingManager toolsSwingManager = ToolsSwingLocator.getToolsSwingManager();
+        ExpressionEvaluatorSwingManager evaluatorManager = ExpressionEvaluatorSwingLocator.getManager();
+
+        toolsSwingManager.translate(this.rdbEnterTheCoordinatesManually);
+        toolsSwingManager.translate(this.rdbUseAPointPreviouslyCaptured);
+
+        toolsSwingManager.addClearButton(this.txtX);
+        toolsSwingManager.addClearButton(this.txtY);
+        toolsSwingManager.addClearButton(this.txtZ);
+        toolsSwingManager.addClearButton(this.txtM);
+
+        toolsSwingManager.setDefaultPopupMenu(this.txtX);
+        toolsSwingManager.setDefaultPopupMenu(this.txtY);
+        toolsSwingManager.setDefaultPopupMenu(this.txtZ);
+        toolsSwingManager.setDefaultPopupMenu(this.txtM);
+
+        this.pickerX = evaluatorManager.createCalculatorController(
+                this.txtX, DataTypes.DOUBLE
+        );
+        this.pickerY = evaluatorManager.createCalculatorController(
+                this.txtY, DataTypes.DOUBLE
+        );
+        this.pickerZ = evaluatorManager.createCalculatorController(
+                this.txtZ, DataTypes.DOUBLE
+        );
+        this.pickerM = evaluatorManager.createCalculatorController(
+                this.txtM, DataTypes.DOUBLE
+        );
+        this.pickers[0] = this.pickerX;
+        this.pickers[1] = this.pickerY;
+        if( this.geomType.hasZ() && this.geomType.hasM() ) {
+            this.pickers[2] = this.pickerZ;
+            this.pickers[3] = this.pickerM;                
+        } else if( this.geomType.hasZ() ) {
+            this.pickers[2] = this.pickerZ;
+        } else if( this.geomType.hasM() ) {
+            this.pickers[2] = this.pickerM;
+        }
+        
+        addHierarchyChanged();
+        
+        TemporaryStorageGroup points = TemporaryStorageLocator.getTemporaryStorageManager()
+                .create("Points",Point.class);
+        
+        DefaultComboBoxModel model = new DefaultComboBoxModel();
+        model.addElement(new ListElement("", null));
+        for (Pair<String, Object> pair : points.asList()) {
+            model.addElement(new ListElement(pair.getKey(), (Point)(pair.getValue())));
+        }
+        this.cboCapturedPoints.setModel(model);
+        this.cboCapturedPoints.addItemListener(new ItemListener() {
+            @Override
+            public void itemStateChanged(ItemEvent e) {
+                if( e.getStateChange()==ItemEvent.SELECTED ) {
+                    setPoint(((ListElement<Point>)e.getItem()).getValue());
+                }
+            }
+        });
+        this.rdbEnterTheCoordinatesManually.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                updateEnabledState();
+            }
+        });
+        this.rdbUseAPointPreviouslyCaptured.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                updateEnabledState();
+            }
+        });
+        this.rdbEnterTheCoordinatesManually.setSelected(true);
+        this.updateEnabledState();
+    }
+    
+    private void updateEnabledState() {
+        
+        if( this.rdbEnterTheCoordinatesManually.isSelected()) {
+            this.cboCapturedPoints.setEnabled(false);
+            
+            this.txtX.setEnabled(true);
+            this.txtY.setEnabled(true);
+            this.txtZ.setEnabled(false);
+            this.txtM.setEnabled(false);
+
+            this.lblX.setEnabled(true);
+            this.lblY.setEnabled(true);
+            this.lblZ.setEnabled(false);
+            this.lblM.setEnabled(false);
+            if( geomType.hasZ() && geomType.hasM() ) {
+                this.txtZ.setEnabled(true);
+                this.lblZ.setEnabled(true);
+                this.txtM.setEnabled(true);
+                this.lblM.setEnabled(true);
+            } else if( geomType.hasZ() ) {
+                this.txtZ.setEnabled(true);
+                this.lblZ.setEnabled(true);
+            } else if( geomType.hasM() ) {
+                this.txtM.setEnabled(true);
+                this.lblM.setEnabled(true);
+            }
+        }
+        if( this.rdbUseAPointPreviouslyCaptured.isSelected()) {
+            this.cboCapturedPoints.setEnabled(true);
+            
+            this.txtX.setEnabled(false);
+            this.txtY.setEnabled(false);
+            this.txtZ.setEnabled(false);
+            this.txtM.setEnabled(false);
+
+            this.lblX.setEnabled(false);
+            this.lblY.setEnabled(false);
+            this.lblZ.setEnabled(false);
+            this.lblM.setEnabled(false);
+        }
+    }
+
+    public void setPoint(Point point) {
+        if( point == null ) {
+            this.pickerX.set(null);
+            this.pickerY.set(null);
+            this.pickerZ.set(null);
+            this.pickerM.set(null);
+            return;
+        }
+        this.pickerX.set( point.getX() );
+        this.pickerY.set( point.getY() );
+        GeometryType theGeomType = point.getGeometryType();
+        if( theGeomType.hasZ() ) {
+            this.pickerZ.set(point.getCoordinateAt(Geometry.DIMENSIONS.Z));
+        } 
+        if( theGeomType.hasM() ) {
+            this.pickerM.set(point.getCoordinateAt(point.getDimension()-1));
+        }
+    }
+    
+    private void addHierarchyChanged() {
+        this.txtX.addHierarchyListener(new DefaultHierarchyListener());
+    }
+
+    /**
+     * @return this as JComponent
+     */
+    public JComponent asJComponent() {
+        return this;
+    }
+
+    /**
+     * @param i
+     * @return String value of coordinate i
+     */
+    public String getValue(int i) {
+        return Objects.toString(this.pickers[i].get(),"");
+    }
+
+    /**
+     * @param i
+     * @param value
+     */
+    public void setValue(int i, String value) {
+        if( StringUtils.isBlank(value) ) {
+            this.pickers[i].set(null);
+            return;
+        } 
+        this.pickers[i].coerceAndSet(value);
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/EditingContextMenuView.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/EditingContextMenuView.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/EditingContextMenuView.java	(revision 1663)
@@ -0,0 +1,43 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.impl.contextmenu;
+
+import javax.swing.JPopupMenu;
+
+/**
+ * @author llmarques
+ *
+ */
+public class EditingContextMenuView extends JPopupMenu {
+
+    private static final long serialVersionUID = 3514644532820732815L;
+
+    /**
+     *
+     */
+    public EditingContextMenuView() {
+        super();
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/EditingPointPanelView.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/EditingPointPanelView.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/EditingPointPanelView.java	(revision 1663)
@@ -0,0 +1,143 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.impl.contextmenu;
+
+import java.awt.Component;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+/**
+ * @author llmarques
+ *
+ */
+public class EditingPointPanelView extends JPanel {
+
+    private static final long serialVersionUID = 941157096517987833L;
+
+    private JTextField yTextfield;
+
+    private JLabel yLabel;
+
+    private JTextField xTextField;
+
+    private JLabel xLabel;
+
+    public EditingPointPanelView() {
+        super();
+
+        initialize();
+
+//        addHierarchyChanged();
+    }
+
+//    /**
+//     * Adds an hierarchy listener to value text field. The purpose of this is
+//     * request focus when texfield ancestor gains focus.
+//     */
+//    private void addHierarchyChanged() {
+//        getXTextField().addHierarchyListener(new DefaultHierarchyListener());
+//    }
+
+    private void initialize() {
+        setLayout(new GridBagLayout());
+
+        GridBagConstraints constrains = new GridBagConstraints();
+        constrains.gridx = GridBagConstraints.RELATIVE;
+        constrains.gridy = 1;
+        constrains.weightx = 0;
+        constrains.weighty = 0;
+        constrains.insets = new Insets(5, 5, 5, 5);
+        constrains.anchor = GridBagConstraints.WEST;
+
+        add(getXLabel(), constrains);
+
+        constrains = new GridBagConstraints();
+        constrains.gridx = GridBagConstraints.RELATIVE;
+        constrains.gridy = 1;
+        constrains.weightx = 1;
+        constrains.weighty = 0;
+        constrains.fill = GridBagConstraints.HORIZONTAL;
+        constrains.insets = new Insets(5, 5, 5, 5);
+        constrains.anchor = GridBagConstraints.EAST;
+
+        add(getXTextField(), constrains);
+
+        constrains = new GridBagConstraints();
+        constrains.gridx = GridBagConstraints.RELATIVE;
+        constrains.gridy = 2;
+        constrains.weightx = 0;
+        constrains.weighty = 0;
+        constrains.insets = new Insets(5, 5, 5, 5);
+        constrains.anchor = GridBagConstraints.WEST;
+
+        add(getYLabel(), constrains);
+
+        constrains = new GridBagConstraints();
+        constrains.gridx = GridBagConstraints.RELATIVE;
+        constrains.gridy = 2;
+        constrains.weightx = 1;
+        constrains.weighty = 0;
+        constrains.fill = GridBagConstraints.HORIZONTAL;
+        constrains.insets = new Insets(5, 5, 5, 5);
+        constrains.anchor = GridBagConstraints.EAST;
+
+        add(getYTextField(), constrains);
+
+    }
+
+    protected JTextField getYTextField() {
+        if (yTextfield == null) {
+            yTextfield = new JTextField();
+        }
+        return yTextfield;
+    }
+
+    private JLabel getYLabel() {
+        if (yLabel == null) {
+            yLabel = new JLabel("Y");
+        }
+        return yLabel;
+    }
+
+    protected JTextField getXTextField() {
+        if (xTextField == null) {
+            xTextField = new JTextField();
+        }
+        return xTextField;
+    }
+
+    private Component getXLabel() {
+        if (xLabel == null) {
+            xLabel = new JLabel("X");
+        }
+        return xLabel;
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DefaultHierarchyListener.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DefaultHierarchyListener.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DefaultHierarchyListener.java	(revision 1663)
@@ -0,0 +1,67 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.impl.contextmenu;
+
+import java.awt.Component;
+import java.awt.Window;
+import java.awt.event.HierarchyEvent;
+import java.awt.event.HierarchyListener;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowFocusListener;
+
+import javax.swing.JOptionPane;
+import javax.swing.SwingUtilities;
+
+/**
+ * Default implementation of {@link HierarchyListener}. Add this listener using
+ * Component's addHierarchyListener method when a component inside
+ * {@link JOptionPane} requires the focus of application.
+ * 
+ * @author llmarques
+ *
+ */
+public class DefaultHierarchyListener implements HierarchyListener {
+
+    public void hierarchyChanged(HierarchyEvent e) {
+
+        final Component component = e.getComponent();
+        if (component.isShowing()
+            && (e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
+
+            final Window toplevel = SwingUtilities.getWindowAncestor(component);
+            toplevel.addWindowFocusListener(new WindowFocusListener() {
+
+                public void windowLostFocus(WindowEvent e) {
+                }
+
+                public void windowGainedFocus(WindowEvent e) {
+                    component.requestFocus();
+                    toplevel.removeWindowFocusListener(this);
+                }
+            });
+            component.removeHierarchyListener(this);
+        }
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/EditingValuePanelView.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/EditingValuePanelView.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/EditingValuePanelView.java	(revision 1663)
@@ -0,0 +1,104 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.impl.contextmenu;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+
+public class EditingValuePanelView extends JPanel {
+
+    private static final long serialVersionUID = 6493491322115653701L;
+
+    private JTextField valueTextField;
+
+    private JLabel valueLabel;
+
+    public EditingValuePanelView() {
+        super();
+
+        initialize();
+
+        addAncestorListener();
+    }
+
+    /**
+     * Adds an hierarchy listener to value text field. The purpose of this is
+     * request focus when texfield ancestor gains focus.
+     */
+    private void addAncestorListener() {
+        getValueTextField()
+            .addHierarchyListener(new DefaultHierarchyListener());
+    }
+
+    private void initialize() {
+        setLayout(new GridBagLayout());
+
+        GridBagConstraints constrains = new GridBagConstraints();
+        constrains.gridx = GridBagConstraints.RELATIVE;
+        constrains.gridy = 0;
+        constrains.weightx = 0;
+        constrains.weighty = 0;
+        constrains.fill = GridBagConstraints.HORIZONTAL;
+        constrains.insets = new Insets(5, 5, 5, 5);
+        constrains.anchor = GridBagConstraints.WEST;
+
+        add(getValueLabel(), constrains);
+
+        constrains = new GridBagConstraints();
+        constrains.gridx = GridBagConstraints.RELATIVE;
+        constrains.gridy = 0;
+        constrains.weightx = 1;
+        constrains.weighty = 0;
+        constrains.fill = GridBagConstraints.HORIZONTAL;
+        constrains.insets = new Insets(5, 5, 5, 5);
+        constrains.anchor = GridBagConstraints.EAST;
+
+        add(getValueTextField(), constrains);
+
+    }
+
+    protected JTextField getValueTextField() {
+        if (valueTextField == null) {
+            valueTextField = new JTextField();
+        }
+        return valueTextField;
+    }
+
+    private JLabel getValueLabel() {
+        if (valueLabel == null) {
+            I18nManager i18nManager = ToolsLocator.getI18nManager();
+            valueLabel = new JLabel(i18nManager.getTranslation("value"));
+        }
+        return valueLabel;
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DynamicEditingPointPanelView.xml
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DynamicEditingPointPanelView.xml	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DynamicEditingPointPanelView.xml	(revision 1663)
@@ -0,0 +1,795 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<object classname="com.jeta.forms.store.memento.FormPackage">
+ <at name="fileversion">
+  <object classname="com.jeta.forms.store.memento.FormsVersion2">
+   <at name="major">2</at>
+   <at name="minor">0</at>
+   <at name="sub">0</at>
+  </object>
+ </at>
+ <at name="form">
+  <object classname="com.jeta.forms.store.memento.FormMemento">
+   <super classname="com.jeta.forms.store.memento.ComponentMemento">
+    <at name="cellconstraints">
+     <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
+      <at name="column">1</at>
+      <at name="row">1</at>
+      <at name="colspan">1</at>
+      <at name="rowspan">1</at>
+      <at name="halign">default</at>
+      <at name="valign">default</at>
+      <at name="insets" object="insets">0,0,0,0</at>
+     </object>
+    </at>
+    <at name="componentclass">com.jeta.forms.gui.form.FormComponent</at>
+   </super>
+   <at name="id">/home/jjdelcerro/datos/devel/org.gvsig.vectorediting/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DynamicEditingPointPanelView.xml</at>
+   <at name="path">datos/devel/org.gvsig.vectorediting/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DynamicEditingPointPanelView.xml</at>
+   <at name="rowspecs">CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE</at>
+   <at name="colspecs">FILL:4DLU:NONE,FILL:8DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE</at>
+   <at name="components">
+    <object classname="java.util.LinkedList">
+     <item >
+      <at name="value">
+       <object classname="com.jeta.forms.store.memento.BeanMemento">
+        <super classname="com.jeta.forms.store.memento.ComponentMemento">
+         <at name="cellconstraints">
+          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
+           <at name="column">2</at>
+           <at name="row">2</at>
+           <at name="colspan">4</at>
+           <at name="rowspan">1</at>
+           <at name="halign">default</at>
+           <at name="valign">default</at>
+           <at name="insets" object="insets">0,0,0,0</at>
+          </object>
+         </at>
+         <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
+        </super>
+        <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
+        <at name="beanclass">javax.swing.JRadioButton</at>
+        <at name="beanproperties">
+         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
+          <at name="classname">javax.swing.JRadioButton</at>
+          <at name="properties">
+           <object classname="com.jeta.forms.store.support.PropertyMap">
+            <at name="border">
+             <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
+              <super classname="com.jeta.forms.store.properties.BorderProperty">
+               <at name="name">border</at>
+              </super>
+              <at name="borders">
+               <object classname="java.util.LinkedList">
+                <item >
+                 <at name="value">
+                  <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
+                   <super classname="com.jeta.forms.store.properties.BorderProperty">
+                    <at name="name">border</at>
+                   </super>
+                  </object>
+                 </at>
+                </item>
+               </object>
+              </at>
+             </object>
+            </at>
+            <at name="actionCommand">_Use_a_point_previously_captured</at>
+            <at name="buttonGroup">
+             <object classname="com.jeta.forms.store.properties.ButtonGroupProperty">
+              <at name="name">buttonGroup</at>
+              <at name="groupname">1</at>
+             </object>
+            </at>
+            <at name="name">rdbUseAPointPreviouslyCaptured</at>
+            <at name="width">713</at>
+            <at name="text">_Use_a_point_previously_captured</at>
+            <at name="height">16</at>
+           </object>
+          </at>
+         </object>
+        </at>
+       </object>
+      </at>
+     </item>
+     <item >
+      <at name="value">
+       <object classname="com.jeta.forms.store.memento.BeanMemento">
+        <super classname="com.jeta.forms.store.memento.ComponentMemento">
+         <at name="cellconstraints">
+          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
+           <at name="column">3</at>
+           <at name="row">4</at>
+           <at name="colspan">3</at>
+           <at name="rowspan">1</at>
+           <at name="halign">default</at>
+           <at name="valign">default</at>
+           <at name="insets" object="insets">0,0,0,0</at>
+          </object>
+         </at>
+         <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
+        </super>
+        <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
+        <at name="beanclass">javax.swing.JComboBox</at>
+        <at name="beanproperties">
+         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
+          <at name="classname">javax.swing.JComboBox</at>
+          <at name="properties">
+           <object classname="com.jeta.forms.store.support.PropertyMap">
+            <at name="border">
+             <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
+              <super classname="com.jeta.forms.store.properties.BorderProperty">
+               <at name="name">border</at>
+              </super>
+              <at name="borders">
+               <object classname="java.util.LinkedList">
+                <item >
+                 <at name="value">
+                  <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
+                   <super classname="com.jeta.forms.store.properties.BorderProperty">
+                    <at name="name">border</at>
+                   </super>
+                  </object>
+                 </at>
+                </item>
+               </object>
+              </at>
+             </object>
+            </at>
+            <at name="name">cboCapturedPoints</at>
+            <at name="width">699</at>
+            <at name="items">
+             <object classname="com.jeta.forms.store.properties.ItemsProperty">
+              <at name="name">items</at>
+             </object>
+            </at>
+            <at name="height">20</at>
+           </object>
+          </at>
+         </object>
+        </at>
+       </object>
+      </at>
+     </item>
+     <item >
+      <at name="value">
+       <object classname="com.jeta.forms.store.memento.BeanMemento">
+        <super classname="com.jeta.forms.store.memento.ComponentMemento">
+         <at name="cellconstraints">
+          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
+           <at name="column">2</at>
+           <at name="row">6</at>
+           <at name="colspan">4</at>
+           <at name="rowspan">1</at>
+           <at name="halign">default</at>
+           <at name="valign">default</at>
+           <at name="insets" object="insets">0,0,0,0</at>
+          </object>
+         </at>
+         <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
+        </super>
+        <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
+        <at name="beanclass">javax.swing.JRadioButton</at>
+        <at name="beanproperties">
+         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
+          <at name="classname">javax.swing.JRadioButton</at>
+          <at name="properties">
+           <object classname="com.jeta.forms.store.support.PropertyMap">
+            <at name="border">
+             <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
+              <super classname="com.jeta.forms.store.properties.BorderProperty">
+               <at name="name">border</at>
+              </super>
+              <at name="borders">
+               <object classname="java.util.LinkedList">
+                <item >
+                 <at name="value">
+                  <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
+                   <super classname="com.jeta.forms.store.properties.BorderProperty">
+                    <at name="name">border</at>
+                   </super>
+                  </object>
+                 </at>
+                </item>
+               </object>
+              </at>
+             </object>
+            </at>
+            <at name="actionCommand">_Enter_the_coordinates_manually</at>
+            <at name="buttonGroup">
+             <object classname="com.jeta.forms.store.properties.ButtonGroupProperty">
+              <at name="name">buttonGroup</at>
+              <at name="groupname">1</at>
+             </object>
+            </at>
+            <at name="name">rdbEnterTheCoordinatesManually</at>
+            <at name="width">713</at>
+            <at name="text">_Enter_the_coordinates_manually</at>
+            <at name="height">16</at>
+           </object>
+          </at>
+         </object>
+        </at>
+       </object>
+      </at>
+     </item>
+     <item >
+      <at name="value">
+       <object classname="com.jeta.forms.store.memento.BeanMemento">
+        <super classname="com.jeta.forms.store.memento.ComponentMemento">
+         <at name="cellconstraints">
+          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
+           <at name="column">3</at>
+           <at name="row">8</at>
+           <at name="colspan">1</at>
+           <at name="rowspan">1</at>
+           <at name="halign">default</at>
+           <at name="valign">default</at>
+           <at name="insets" object="insets">0,0,0,0</at>
+          </object>
+         </at>
+         <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
+        </super>
+        <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
+        <at name="beanclass">com.jeta.forms.components.label.JETALabel</at>
+        <at name="beanproperties">
+         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
+          <at name="classname">com.jeta.forms.components.label.JETALabel</at>
+          <at name="properties">
+           <object classname="com.jeta.forms.store.support.PropertyMap">
+            <at name="border">
+             <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
+              <super classname="com.jeta.forms.store.properties.BorderProperty">
+               <at name="name">border</at>
+              </super>
+              <at name="borders">
+               <object classname="java.util.LinkedList">
+                <item >
+                 <at name="value">
+                  <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
+                   <super classname="com.jeta.forms.store.properties.BorderProperty">
+                    <at name="name">border</at>
+                   </super>
+                  </object>
+                 </at>
+                </item>
+               </object>
+              </at>
+             </object>
+            </at>
+            <at name="name">lblX</at>
+            <at name="width">12</at>
+            <at name="text">X</at>
+            <at name="fill">
+             <object classname="com.jeta.forms.store.properties.effects.PaintProperty">
+              <at name="name">fill</at>
+             </object>
+            </at>
+            <at name="height">14</at>
+           </object>
+          </at>
+         </object>
+        </at>
+       </object>
+      </at>
+     </item>
+     <item >
+      <at name="value">
+       <object classname="com.jeta.forms.store.memento.BeanMemento">
+        <super classname="com.jeta.forms.store.memento.ComponentMemento">
+         <at name="cellconstraints">
+          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
+           <at name="column">3</at>
+           <at name="row">10</at>
+           <at name="colspan">1</at>
+           <at name="rowspan">1</at>
+           <at name="halign">default</at>
+           <at name="valign">default</at>
+           <at name="insets" object="insets">0,0,0,0</at>
+          </object>
+         </at>
+         <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
+        </super>
+        <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
+        <at name="beanclass">com.jeta.forms.components.label.JETALabel</at>
+        <at name="beanproperties">
+         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
+          <at name="classname">com.jeta.forms.components.label.JETALabel</at>
+          <at name="properties">
+           <object classname="com.jeta.forms.store.support.PropertyMap">
+            <at name="border">
+             <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
+              <super classname="com.jeta.forms.store.properties.BorderProperty">
+               <at name="name">border</at>
+              </super>
+              <at name="borders">
+               <object classname="java.util.LinkedList">
+                <item >
+                 <at name="value">
+                  <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
+                   <super classname="com.jeta.forms.store.properties.BorderProperty">
+                    <at name="name">border</at>
+                   </super>
+                  </object>
+                 </at>
+                </item>
+               </object>
+              </at>
+             </object>
+            </at>
+            <at name="name">lblY</at>
+            <at name="width">12</at>
+            <at name="text">Y</at>
+            <at name="fill">
+             <object classname="com.jeta.forms.store.properties.effects.PaintProperty">
+              <at name="name">fill</at>
+             </object>
+            </at>
+            <at name="height">14</at>
+           </object>
+          </at>
+         </object>
+        </at>
+       </object>
+      </at>
+     </item>
+     <item >
+      <at name="value">
+       <object classname="com.jeta.forms.store.memento.BeanMemento">
+        <super classname="com.jeta.forms.store.memento.ComponentMemento">
+         <at name="cellconstraints">
+          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
+           <at name="column">5</at>
+           <at name="row">8</at>
+           <at name="colspan">1</at>
+           <at name="rowspan">1</at>
+           <at name="halign">default</at>
+           <at name="valign">default</at>
+           <at name="insets" object="insets">0,0,0,0</at>
+          </object>
+         </at>
+         <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
+        </super>
+        <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
+        <at name="beanclass">javax.swing.JTextField</at>
+        <at name="beanproperties">
+         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
+          <at name="classname">javax.swing.JTextField</at>
+          <at name="properties">
+           <object classname="com.jeta.forms.store.support.PropertyMap">
+            <at name="border">
+             <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
+              <super classname="com.jeta.forms.store.properties.BorderProperty">
+               <at name="name">border</at>
+              </super>
+              <at name="borders">
+               <object classname="java.util.LinkedList">
+                <item >
+                 <at name="value">
+                  <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
+                   <super classname="com.jeta.forms.store.properties.BorderProperty">
+                    <at name="name">border</at>
+                   </super>
+                  </object>
+                 </at>
+                </item>
+               </object>
+              </at>
+             </object>
+            </at>
+            <at name="name">txtX</at>
+            <at name="width">676</at>
+            <at name="height">20</at>
+           </object>
+          </at>
+         </object>
+        </at>
+       </object>
+      </at>
+     </item>
+     <item >
+      <at name="value">
+       <object classname="com.jeta.forms.store.memento.BeanMemento">
+        <super classname="com.jeta.forms.store.memento.ComponentMemento">
+         <at name="cellconstraints">
+          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
+           <at name="column">5</at>
+           <at name="row">10</at>
+           <at name="colspan">1</at>
+           <at name="rowspan">1</at>
+           <at name="halign">default</at>
+           <at name="valign">default</at>
+           <at name="insets" object="insets">0,0,0,0</at>
+          </object>
+         </at>
+         <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
+        </super>
+        <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
+        <at name="beanclass">javax.swing.JTextField</at>
+        <at name="beanproperties">
+         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
+          <at name="classname">javax.swing.JTextField</at>
+          <at name="properties">
+           <object classname="com.jeta.forms.store.support.PropertyMap">
+            <at name="border">
+             <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
+              <super classname="com.jeta.forms.store.properties.BorderProperty">
+               <at name="name">border</at>
+              </super>
+              <at name="borders">
+               <object classname="java.util.LinkedList">
+                <item >
+                 <at name="value">
+                  <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
+                   <super classname="com.jeta.forms.store.properties.BorderProperty">
+                    <at name="name">border</at>
+                   </super>
+                  </object>
+                 </at>
+                </item>
+               </object>
+              </at>
+             </object>
+            </at>
+            <at name="name">txtY</at>
+            <at name="width">676</at>
+            <at name="height">20</at>
+           </object>
+          </at>
+         </object>
+        </at>
+       </object>
+      </at>
+     </item>
+     <item >
+      <at name="value">
+       <object classname="com.jeta.forms.store.memento.BeanMemento">
+        <super classname="com.jeta.forms.store.memento.ComponentMemento">
+         <at name="cellconstraints">
+          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
+           <at name="column">3</at>
+           <at name="row">12</at>
+           <at name="colspan">1</at>
+           <at name="rowspan">1</at>
+           <at name="halign">default</at>
+           <at name="valign">default</at>
+           <at name="insets" object="insets">0,0,0,0</at>
+          </object>
+         </at>
+         <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
+        </super>
+        <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
+        <at name="beanclass">com.jeta.forms.components.label.JETALabel</at>
+        <at name="beanproperties">
+         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
+          <at name="classname">com.jeta.forms.components.label.JETALabel</at>
+          <at name="properties">
+           <object classname="com.jeta.forms.store.support.PropertyMap">
+            <at name="border">
+             <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
+              <super classname="com.jeta.forms.store.properties.BorderProperty">
+               <at name="name">border</at>
+              </super>
+              <at name="borders">
+               <object classname="java.util.LinkedList">
+                <item >
+                 <at name="value">
+                  <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
+                   <super classname="com.jeta.forms.store.properties.BorderProperty">
+                    <at name="name">border</at>
+                   </super>
+                  </object>
+                 </at>
+                </item>
+               </object>
+              </at>
+             </object>
+            </at>
+            <at name="name">lblZ</at>
+            <at name="width">12</at>
+            <at name="text">Z</at>
+            <at name="fill">
+             <object classname="com.jeta.forms.store.properties.effects.PaintProperty">
+              <at name="name">fill</at>
+             </object>
+            </at>
+            <at name="height">14</at>
+           </object>
+          </at>
+         </object>
+        </at>
+       </object>
+      </at>
+     </item>
+     <item >
+      <at name="value">
+       <object classname="com.jeta.forms.store.memento.BeanMemento">
+        <super classname="com.jeta.forms.store.memento.ComponentMemento">
+         <at name="cellconstraints">
+          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
+           <at name="column">3</at>
+           <at name="row">14</at>
+           <at name="colspan">1</at>
+           <at name="rowspan">1</at>
+           <at name="halign">default</at>
+           <at name="valign">default</at>
+           <at name="insets" object="insets">0,0,0,0</at>
+          </object>
+         </at>
+         <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
+        </super>
+        <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
+        <at name="beanclass">com.jeta.forms.components.label.JETALabel</at>
+        <at name="beanproperties">
+         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
+          <at name="classname">com.jeta.forms.components.label.JETALabel</at>
+          <at name="properties">
+           <object classname="com.jeta.forms.store.support.PropertyMap">
+            <at name="border">
+             <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
+              <super classname="com.jeta.forms.store.properties.BorderProperty">
+               <at name="name">border</at>
+              </super>
+              <at name="borders">
+               <object classname="java.util.LinkedList">
+                <item >
+                 <at name="value">
+                  <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
+                   <super classname="com.jeta.forms.store.properties.BorderProperty">
+                    <at name="name">border</at>
+                   </super>
+                  </object>
+                 </at>
+                </item>
+               </object>
+              </at>
+             </object>
+            </at>
+            <at name="name">lblM</at>
+            <at name="width">12</at>
+            <at name="text">M</at>
+            <at name="fill">
+             <object classname="com.jeta.forms.store.properties.effects.PaintProperty">
+              <at name="name">fill</at>
+             </object>
+            </at>
+            <at name="height">14</at>
+           </object>
+          </at>
+         </object>
+        </at>
+       </object>
+      </at>
+     </item>
+     <item >
+      <at name="value">
+       <object classname="com.jeta.forms.store.memento.BeanMemento">
+        <super classname="com.jeta.forms.store.memento.ComponentMemento">
+         <at name="cellconstraints">
+          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
+           <at name="column">5</at>
+           <at name="row">12</at>
+           <at name="colspan">1</at>
+           <at name="rowspan">1</at>
+           <at name="halign">default</at>
+           <at name="valign">default</at>
+           <at name="insets" object="insets">0,0,0,0</at>
+          </object>
+         </at>
+         <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
+        </super>
+        <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
+        <at name="beanclass">javax.swing.JTextField</at>
+        <at name="beanproperties">
+         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
+          <at name="classname">javax.swing.JTextField</at>
+          <at name="properties">
+           <object classname="com.jeta.forms.store.support.PropertyMap">
+            <at name="border">
+             <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
+              <super classname="com.jeta.forms.store.properties.BorderProperty">
+               <at name="name">border</at>
+              </super>
+              <at name="borders">
+               <object classname="java.util.LinkedList">
+                <item >
+                 <at name="value">
+                  <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
+                   <super classname="com.jeta.forms.store.properties.BorderProperty">
+                    <at name="name">border</at>
+                   </super>
+                  </object>
+                 </at>
+                </item>
+               </object>
+              </at>
+             </object>
+            </at>
+            <at name="name">txtZ</at>
+            <at name="width">676</at>
+            <at name="height">20</at>
+           </object>
+          </at>
+         </object>
+        </at>
+       </object>
+      </at>
+     </item>
+     <item >
+      <at name="value">
+       <object classname="com.jeta.forms.store.memento.BeanMemento">
+        <super classname="com.jeta.forms.store.memento.ComponentMemento">
+         <at name="cellconstraints">
+          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
+           <at name="column">5</at>
+           <at name="row">14</at>
+           <at name="colspan">1</at>
+           <at name="rowspan">1</at>
+           <at name="halign">default</at>
+           <at name="valign">default</at>
+           <at name="insets" object="insets">0,0,0,0</at>
+          </object>
+         </at>
+         <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
+        </super>
+        <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
+        <at name="beanclass">javax.swing.JTextField</at>
+        <at name="beanproperties">
+         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
+          <at name="classname">javax.swing.JTextField</at>
+          <at name="properties">
+           <object classname="com.jeta.forms.store.support.PropertyMap">
+            <at name="border">
+             <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
+              <super classname="com.jeta.forms.store.properties.BorderProperty">
+               <at name="name">border</at>
+              </super>
+              <at name="borders">
+               <object classname="java.util.LinkedList">
+                <item >
+                 <at name="value">
+                  <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
+                   <super classname="com.jeta.forms.store.properties.BorderProperty">
+                    <at name="name">border</at>
+                   </super>
+                  </object>
+                 </at>
+                </item>
+               </object>
+              </at>
+             </object>
+            </at>
+            <at name="name">txtM</at>
+            <at name="width">676</at>
+            <at name="height">20</at>
+           </object>
+          </at>
+         </object>
+        </at>
+       </object>
+      </at>
+     </item>
+    </object>
+   </at>
+   <at name="properties">
+    <object classname="com.jeta.forms.store.memento.PropertiesMemento">
+     <at name="classname">com.jeta.forms.gui.form.GridView</at>
+     <at name="properties">
+      <object classname="com.jeta.forms.store.support.PropertyMap">
+       <at name="border">
+        <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
+         <super classname="com.jeta.forms.store.properties.BorderProperty">
+          <at name="name">border</at>
+         </super>
+         <at name="borders">
+          <object classname="java.util.LinkedList"/>
+         </at>
+        </object>
+       </at>
+       <at name="name"></at>
+       <at name="fill">
+        <object classname="com.jeta.forms.store.properties.effects.PaintProperty">
+         <at name="name">fill</at>
+        </object>
+       </at>
+       <at name="scollBars">
+        <object classname="com.jeta.forms.store.properties.ScrollBarsProperty">
+         <at name="name">scollBars</at>
+         <at name="verticalpolicy">21</at>
+         <at name="horizontalpolicy">31</at>
+         <at name="border">
+          <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
+           <super classname="com.jeta.forms.store.properties.BorderProperty">
+            <at name="name">border</at>
+           </super>
+           <at name="borders">
+            <object classname="java.util.LinkedList">
+             <item >
+              <at name="value">
+               <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
+                <super classname="com.jeta.forms.store.properties.BorderProperty">
+                 <at name="name">border</at>
+                </super>
+               </object>
+              </at>
+             </item>
+            </object>
+           </at>
+          </object>
+         </at>
+        </object>
+       </at>
+      </object>
+     </at>
+    </object>
+   </at>
+   <at name="cellpainters">
+    <object classname="com.jeta.forms.store.support.Matrix">
+     <at name="rows">
+      <object classname="[Ljava.lang.Object;" size="15">
+       <at name="item" index="0">
+        <object classname="[Ljava.lang.Object;" size="6"/>
+       </at>
+       <at name="item" index="1">
+        <object classname="[Ljava.lang.Object;" size="6"/>
+       </at>
+       <at name="item" index="2">
+        <object classname="[Ljava.lang.Object;" size="6"/>
+       </at>
+       <at name="item" index="3">
+        <object classname="[Ljava.lang.Object;" size="6"/>
+       </at>
+       <at name="item" index="4">
+        <object classname="[Ljava.lang.Object;" size="6"/>
+       </at>
+       <at name="item" index="5">
+        <object classname="[Ljava.lang.Object;" size="6"/>
+       </at>
+       <at name="item" index="6">
+        <object classname="[Ljava.lang.Object;" size="6"/>
+       </at>
+       <at name="item" index="7">
+        <object classname="[Ljava.lang.Object;" size="6"/>
+       </at>
+       <at name="item" index="8">
+        <object classname="[Ljava.lang.Object;" size="6"/>
+       </at>
+       <at name="item" index="9">
+        <object classname="[Ljava.lang.Object;" size="6"/>
+       </at>
+       <at name="item" index="10">
+        <object classname="[Ljava.lang.Object;" size="6"/>
+       </at>
+       <at name="item" index="11">
+        <object classname="[Ljava.lang.Object;" size="6"/>
+       </at>
+       <at name="item" index="12">
+        <object classname="[Ljava.lang.Object;" size="6"/>
+       </at>
+       <at name="item" index="13">
+        <object classname="[Ljava.lang.Object;" size="6"/>
+       </at>
+       <at name="item" index="14">
+        <object classname="[Ljava.lang.Object;" size="6"/>
+       </at>
+      </object>
+     </at>
+    </object>
+   </at>
+   <at name="rowgroups">
+    <object classname="com.jeta.forms.store.memento.FormGroupSet">
+     <at name="groups">
+      <object classname="java.util.HashMap"/>
+     </at>
+    </object>
+   </at>
+   <at name="colgroups">
+    <object classname="com.jeta.forms.store.memento.FormGroupSet">
+     <at name="groups">
+      <object classname="java.util.HashMap"/>
+     </at>
+    </object>
+   </at>
+  </object>
+ </at>
+</object>
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DynamicEditingPointPanelView.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DynamicEditingPointPanelView.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DynamicEditingPointPanelView.java	(revision 1663)
@@ -0,0 +1,187 @@
+package org.gvsig.vectorediting.swing.impl.contextmenu;
+
+import com.jeta.open.i18n.I18NUtils;
+import com.jgoodies.forms.layout.CellConstraints;
+import com.jgoodies.forms.layout.FormLayout;
+import java.awt.BorderLayout;
+import java.awt.ComponentOrientation;
+import java.awt.Container;
+import java.awt.Dimension;
+import javax.swing.Box;
+import javax.swing.ButtonGroup;
+import javax.swing.ImageIcon;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JTextField;
+
+
+public class DynamicEditingPointPanelView extends JPanel
+{
+   JRadioButton rdbUseAPointPreviouslyCaptured = new JRadioButton();
+   ButtonGroup buttongroup1 = new ButtonGroup();
+   JComboBox cboCapturedPoints = new JComboBox();
+   JRadioButton rdbEnterTheCoordinatesManually = new JRadioButton();
+   JLabel lblX = new JLabel();
+   JLabel lblY = new JLabel();
+   JTextField txtX = new JTextField();
+   JTextField txtY = new JTextField();
+   JLabel lblZ = new JLabel();
+   JLabel lblM = new JLabel();
+   JTextField txtZ = new JTextField();
+   JTextField txtM = new JTextField();
+
+   /**
+    * Default constructor
+    */
+   public DynamicEditingPointPanelView()
+   {
+      initializePanel();
+   }
+
+   /**
+    * Adds fill components to empty cells in the first row and first column of the grid.
+    * This ensures that the grid spacing will be the same as shown in the designer.
+    * @param cols an array of column indices in the first row where fill components should be added.
+    * @param rows an array of row indices in the first column where fill components should be added.
+    */
+   void addFillComponents( Container panel, int[] cols, int[] rows )
+   {
+      Dimension filler = new Dimension(10,10);
+
+      boolean filled_cell_11 = false;
+      CellConstraints cc = new CellConstraints();
+      if ( cols.length > 0 && rows.length > 0 )
+      {
+         if ( cols[0] == 1 && rows[0] == 1 )
+         {
+            /** add a rigid area  */
+            panel.add( Box.createRigidArea( filler ), cc.xy(1,1) );
+            filled_cell_11 = true;
+         }
+      }
+
+      for( int index = 0; index < cols.length; index++ )
+      {
+         if ( cols[index] == 1 && filled_cell_11 )
+         {
+            continue;
+         }
+         panel.add( Box.createRigidArea( filler ), cc.xy(cols[index],1) );
+      }
+
+      for( int index = 0; index < rows.length; index++ )
+      {
+         if ( rows[index] == 1 && filled_cell_11 )
+         {
+            continue;
+         }
+         panel.add( Box.createRigidArea( filler ), cc.xy(1,rows[index]) );
+      }
+
+   }
+
+   /**
+    * Helper method to load an image file from the CLASSPATH
+    * @param imageName the package and name of the file to load relative to the CLASSPATH
+    * @return an ImageIcon instance with the specified image file
+    * @throws IllegalArgumentException if the image resource cannot be loaded.
+    */
+   public ImageIcon loadImage( String imageName )
+   {
+      try
+      {
+         ClassLoader classloader = getClass().getClassLoader();
+         java.net.URL url = classloader.getResource( imageName );
+         if ( url != null )
+         {
+            ImageIcon icon = new ImageIcon( url );
+            return icon;
+         }
+      }
+      catch( Exception e )
+      {
+         e.printStackTrace();
+      }
+      throw new IllegalArgumentException( "Unable to load image: " + imageName );
+   }
+
+   /**
+    * Method for recalculating the component orientation for 
+    * right-to-left Locales.
+    * @param orientation the component orientation to be applied
+    */
+   public void applyComponentOrientation( ComponentOrientation orientation )
+   {
+      // Not yet implemented...
+      // I18NUtils.applyComponentOrientation(this, orientation);
+      super.applyComponentOrientation(orientation);
+   }
+
+   public JPanel createPanel()
+   {
+      JPanel jpanel1 = new JPanel();
+      FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:8DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE");
+      CellConstraints cc = new CellConstraints();
+      jpanel1.setLayout(formlayout1);
+
+      rdbUseAPointPreviouslyCaptured.setActionCommand("_Use_a_point_previously_captured");
+      rdbUseAPointPreviouslyCaptured.setName("rdbUseAPointPreviouslyCaptured");
+      rdbUseAPointPreviouslyCaptured.setText("_Use_a_point_previously_captured");
+      buttongroup1.add(rdbUseAPointPreviouslyCaptured);
+      jpanel1.add(rdbUseAPointPreviouslyCaptured,cc.xywh(2,2,4,1));
+
+      cboCapturedPoints.setName("cboCapturedPoints");
+      jpanel1.add(cboCapturedPoints,cc.xywh(3,4,3,1));
+
+      rdbEnterTheCoordinatesManually.setActionCommand("_Enter_the_coordinates_manually");
+      rdbEnterTheCoordinatesManually.setName("rdbEnterTheCoordinatesManually");
+      rdbEnterTheCoordinatesManually.setText("_Enter_the_coordinates_manually");
+      buttongroup1.add(rdbEnterTheCoordinatesManually);
+      jpanel1.add(rdbEnterTheCoordinatesManually,cc.xywh(2,6,4,1));
+
+      lblX.setName("lblX");
+      lblX.setText("X");
+      jpanel1.add(lblX,cc.xy(3,8));
+
+      lblY.setName("lblY");
+      lblY.setText("Y");
+      jpanel1.add(lblY,cc.xy(3,10));
+
+      txtX.setName("txtX");
+      jpanel1.add(txtX,cc.xy(5,8));
+
+      txtY.setName("txtY");
+      jpanel1.add(txtY,cc.xy(5,10));
+
+      lblZ.setName("lblZ");
+      lblZ.setText("Z");
+      jpanel1.add(lblZ,cc.xy(3,12));
+
+      lblM.setName("lblM");
+      lblM.setText("M");
+      jpanel1.add(lblM,cc.xy(3,14));
+
+      txtZ.setName("txtZ");
+      jpanel1.add(txtZ,cc.xy(5,12));
+
+      txtM.setName("txtM");
+      jpanel1.add(txtM,cc.xy(5,14));
+
+      addFillComponents(jpanel1,new int[]{ 1,2,3,4,5,6 },new int[]{ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 });
+      return jpanel1;
+   }
+
+   /**
+    * Initializer
+    */
+   protected void initializePanel()
+   {
+      setLayout(new BorderLayout());
+      add(createPanel(), BorderLayout.CENTER);
+   }
+
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DefaultEditingContextMenu.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DefaultEditingContextMenu.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DefaultEditingContextMenu.java	(revision 1663)
@@ -0,0 +1,260 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.impl.contextmenu;
+
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.util.Map;
+
+import javax.swing.AbstractAction;
+import javax.swing.JComponent;
+import javax.swing.JOptionPane;
+import javax.swing.JSeparator;
+import javax.swing.SwingConstants;
+import javax.swing.SwingUtilities;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.task.RunnableWithParameters;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter.TYPE;
+import org.gvsig.vectorediting.swing.api.contextmenu.AcceptValueListener;
+import org.gvsig.vectorediting.swing.api.contextmenu.EditingContextMenu;
+
+/**
+ * @author llmarques
+ *
+ */
+public class DefaultEditingContextMenu extends EditingContextMenuView implements
+EditingContextMenu {
+
+    private static Logger logger = LoggerFactory
+        .getLogger(DefaultEditingContextMenu.class);
+
+    private static final long serialVersionUID = -3207749321400180897L;
+
+    private AcceptValueListener listener;
+
+    private Component parent;
+
+    private EditingServiceParameter parameter;
+
+    /**
+     * @param parent
+     * @param listener
+     * @param parameter
+     */
+    public DefaultEditingContextMenu(Component parent,
+        AcceptValueListener listener, EditingServiceParameter parameter) {
+
+        super();
+        this.listener = listener;
+        this.parent = parent;
+        this.parameter = parameter;
+        initActions();
+    }
+
+    @SuppressWarnings("serial")
+    private void initActions() {
+
+        I18nManager i18nManager = ToolsLocator.getI18nManager();
+        AbstractAction action = null;
+
+        for (final TYPE type : parameter.getTypes()) {
+
+            switch (type) {
+            case OPTION:
+                Map<String, String> options = parameter.getOptions();
+                for (String key : options.keySet()) {
+                    String value = i18nManager.getTranslation(options.get(key));
+                    action = new AbstractAction(value) {
+
+                        public void actionPerformed(ActionEvent e) {
+                            String key = (String) this.getValue("key");
+                            listener.acceptValue(key);
+                        }
+                    };
+                    action.putValue("key", key);
+                    this.add(action);
+                }
+                break;
+            case VALUE:
+                String name =
+                i18nManager.getTranslation(parameter.getName()) + " ("
+                    + i18nManager.getTranslation("value") + ")";
+                ;
+                action = new AbstractAction(name) {
+
+                    public void actionPerformed(ActionEvent e) {
+                        String value = showValueDialog(parameter);
+                        if (value != null) {
+                            listener.acceptValue(value);
+                        }
+                    }
+                };
+                this.add(action);
+                break;
+
+            case POSITION:
+            case LIST_POSITIONS:
+                name =
+                i18nManager.getTranslation(parameter.getName()) + " ("
+                    + i18nManager.getTranslation("point") + ")";
+                action = new AbstractAction(name) {
+
+                    public void actionPerformed(ActionEvent e) {
+                        String value = showPointDialog(parameter);
+                        if (value != null) {
+                            listener.acceptValue(value);
+                        }
+                    }
+                };
+                this.add(action);
+                break;
+
+            case SELECTION:
+            case GEOMETRY:
+                break;
+            }
+
+        }
+
+        this.add(new JSeparator(SwingConstants.HORIZONTAL));
+        action = new AbstractAction(i18nManager.getTranslation("cancel")) {
+
+            public void actionPerformed(ActionEvent e) {
+                listener.acceptValue(null);
+//                setVisible(false);
+            }
+        };
+        this.add(action);
+
+        ((JComponent) parent).add(this);
+
+    }
+
+    /**
+     * @return this as JComponent
+     */
+    public JComponent asJComponent() {
+        return this;
+    }
+
+    private String showPointDialog(EditingServiceParameter parameter) {
+
+        int dimension = 2;
+
+        Object defaultValue = parameter.getDefaultValue();
+        Point defaultPoint = null;
+        if (defaultValue != null && defaultValue instanceof Point) {
+            defaultPoint = (Point)defaultValue;
+            dimension = defaultPoint.getDimension();
+        }
+
+        final DefaultDynamicEditingPointPanel pointPanel = new DefaultDynamicEditingPointPanel(null, defaultPoint);
+        if(defaultPoint!=null){
+            for(int i=0; i<dimension; i++){
+                pointPanel.setValue(i, String.valueOf(defaultPoint.getCoordinateAt(i)));
+            }
+        }
+        final String title = ToolsLocator.getI18nManager().getTranslation(parameter.getName());
+
+        RunnableWithParameters runnable = new RunnableWithParameters() {
+
+            public void run() {
+                this.returnValue =
+                    JOptionPane.showConfirmDialog(null, pointPanel, title, JOptionPane.OK_CANCEL_OPTION);
+            }
+        };
+
+        if (SwingUtilities.isEventDispatchThread()) {
+            runnable.run();
+        } else {
+            try {
+                SwingUtilities.invokeAndWait(runnable);
+            } catch (Exception e) {
+                logger.info("Can't show point dialog.", e);
+            }
+        }
+
+            int result = ((Integer) runnable.getReturnValue());
+
+            if (result == JOptionPane.OK_OPTION) {
+                StringBuilder stb = new StringBuilder();
+                for(int i=0; i<dimension; i++){
+                    String value = pointPanel.getValue(i);
+                    stb.append(value);
+                    if(i<dimension-1){
+                        stb.append(",");
+                    }
+                }
+                return stb.toString();
+            }
+
+            return null;
+    }
+
+    private String showValueDialog(EditingServiceParameter parameter) {
+
+        final DefaultEditingValuePanel valuePanel =
+            new DefaultEditingValuePanel();
+
+        final String title =
+            ToolsLocator.getI18nManager().getTranslation(parameter.getName());
+
+        RunnableWithParameters runnable = new RunnableWithParameters() {
+
+            public void run() {
+                this.returnValue =
+                    JOptionPane.showConfirmDialog(null, valuePanel, title,
+                        JOptionPane.OK_CANCEL_OPTION);
+            }
+        };
+
+        if (SwingUtilities.isEventDispatchThread()) {
+            runnable.run();
+        } else {
+            try {
+                SwingUtilities.invokeAndWait(runnable);
+            } catch (Exception e) {
+                logger.info("Can't show value dialog.", e);
+            }
+        }
+
+        int result = ((Integer) runnable.getReturnValue());
+
+        if (result == JOptionPane.OK_OPTION) {
+            return valuePanel.getValue();
+        }
+
+        return null;
+
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DefaultEditingPointPanel.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DefaultEditingPointPanel.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DefaultEditingPointPanel.java	(revision 1663)
@@ -0,0 +1,87 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+/* gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.vectorediting.swing.impl.contextmenu;
+
+import javax.swing.JComponent;
+
+/**
+ * @author llmarques
+ *
+ */
+public class DefaultEditingPointPanel extends EditingPointPanelView {
+
+    private static final long serialVersionUID = 6598180137544454743L;
+
+    public DefaultEditingPointPanel() {
+        super();
+        this.initComponents();
+    }
+
+    public JComponent asJComponent() {
+        return this;
+    }
+
+    private void initComponents() {
+        addHierarchyChanged();
+    }
+
+    /**
+     * Adds an hierarchy listener to value text field. The purpose of this is
+     * request focus when texfield ancestor gains focus.
+     */
+    private void addHierarchyChanged() {
+        getXTextField().addHierarchyListener(new DefaultHierarchyListener());
+    }
+    
+    public String getXValue() {
+        return getXTextField().getText();
+    }
+
+    public String getYValue() {
+        return getYTextField().getText();
+    }
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DefaultEditingValuePanel.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DefaultEditingValuePanel.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/contextmenu/DefaultEditingValuePanel.java	(revision 1663)
@@ -0,0 +1,41 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.impl.contextmenu;
+
+import javax.swing.JComponent;
+
+public class DefaultEditingValuePanel extends EditingValuePanelView {
+
+    private static final long serialVersionUID = -2429230493027567705L;
+
+    public JComponent asJComponent() {
+        return this;
+    }
+
+    public String getValue() {
+        return getValueTextField().getText();
+    }
+
+}
Index: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultEditingSwingManager.java
===================================================================
--- org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultEditingSwingManager.java	(revision 0)
+++ org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultEditingSwingManager.java	(revision 1663)
@@ -0,0 +1,233 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright � 2007-2014 gvSIG Association
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.gvsig.vectorediting.swing.impl;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Font;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.util.List;
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.service.AbstractManager;
+import org.gvsig.tools.service.Service;
+import org.gvsig.tools.service.ServiceException;
+import org.gvsig.utils.console.ResponseListener;
+import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
+import org.gvsig.vectorediting.lib.spi.EditingProviderLocator;
+import org.gvsig.vectorediting.swing.api.EditingContext;
+import org.gvsig.vectorediting.swing.api.EditingSwingManager;
+import org.gvsig.vectorediting.swing.api.console.EditingConsole;
+import org.gvsig.vectorediting.swing.api.contextmenu.AcceptValueListener;
+import org.gvsig.vectorediting.swing.api.contextmenu.EditingContextMenu;
+import org.gvsig.vectorediting.swing.impl.console.DefaultEditingConsole;
+import org.gvsig.vectorediting.swing.impl.contextmenu.DefaultEditingContextMenu;
+
+public class DefaultEditingSwingManager extends AbstractManager implements
+EditingSwingManager {
+
+    Map<MapContext, EditingContext> editingContexts =
+        new WeakHashMap<MapContext, EditingContext>();
+
+    public DefaultEditingSwingManager() {
+        super(EditingProviderLocator.getProviderManager());
+    }
+
+    public EditingContext getEditingContext(MapControl mapControl) {
+        MapContext mapContext = mapControl.getMapContext();
+
+        if (editingContexts.containsKey(mapContext)) {
+            EditingContext editingContext = editingContexts.get(mapContext);
+
+            if (editingContext.getMapControl() != null) {
+                return editingContext;
+            } else {
+                editingContexts.remove(mapContext);
+            }
+
+        }
+        return null;
+    }
+
+    private JPanel getExplanationPanel(String question, String action,
+        String description) {
+
+        I18nManager i18nManager = ToolsLocator.getI18nManager();
+
+        JPanel resp = new JPanel(new BorderLayout(10, 10));
+
+        JLabel topLabel = new JLabel(question);
+
+        JPanel mainPanel = new JPanel(new GridBagLayout());
+        GridBagConstraints cc = new GridBagConstraints();
+
+        cc.gridx = 0;
+        cc.gridy = 0;
+        cc.anchor = GridBagConstraints.WEST;
+
+        cc.insets = new Insets(3, 6, 3, 6);
+
+        Font boldf = mainPanel.getFont().deriveFont(Font.BOLD);
+
+        JLabel lbl = new JLabel(action);
+        lbl.setFont(boldf);
+        mainPanel.add(lbl, cc);
+        cc.gridx = 1;
+        mainPanel.add(new JLabel(description), cc);
+
+        cc.gridx = 0;
+        cc.gridy = 1;
+        lbl = new JLabel(i18nManager.getTranslation("discard"));
+        lbl.setFont(boldf);
+        mainPanel.add(lbl, cc);
+        cc.gridx = 1;
+        mainPanel
+        .add(
+            new JLabel(i18nManager
+                .getTranslation("discard_and_loose_changes")), cc);
+
+        cc.gridx = 0;
+        cc.gridy = 2;
+        lbl = new JLabel(i18nManager.getTranslation("continue"));
+        lbl.setFont(boldf);
+        mainPanel.add(lbl, cc);
+        cc.gridx = 1;
+        mainPanel.add(
+            new JLabel(i18nManager
+                .getTranslation("do_not_save_yet_stay_in_editing_mode")), cc);
+
+        resp.add(mainPanel, BorderLayout.CENTER);
+        resp.add(topLabel, BorderLayout.NORTH);
+        return resp;
+    }
+
+    public Service getService(DynObject parameters) throws ServiceException {
+        return null;
+    }
+
+    public void registerEditingContext(MapControl mapControl) {
+        MapContext mapContext = mapControl.getMapContext();
+        if (!editingContexts.containsKey(mapContext)) {
+            EditingContext editingContext =
+                new DefaultEditingContext(mapControl);
+            editingContexts.put(mapContext, editingContext);
+        } else {
+            // MapContext registered. Update mapControl reference of editing
+            // context
+            EditingContext editingContext = editingContexts.get(mapContext);
+            editingContext.setMapControl(mapControl);
+        }
+    }
+
+    public int showPanelExportOrDiscard(MapControl parent, String name) {
+
+        I18nManager i18nManager = ToolsLocator.getI18nManager();
+
+        Object[] options =
+        { i18nManager.getTranslation("export"),
+            "       " + i18nManager.getTranslation("discard") + "       ",
+            i18nManager.getTranslation("continue") };
+
+        String question = i18nManager.getTranslation("can_not_write_layer");
+        String firstLabel = i18nManager.getTranslation("export");
+        String firstDesc =
+            i18nManager.getTranslation("export_to_another_format");
+
+        JPanel explanation_panel =
+            getExplanationPanel(question, firstLabel, firstDesc);
+
+        int resp =
+            JOptionPane.showOptionDialog(parent, explanation_panel,
+                i18nManager.getTranslation("end_editing"),
+                JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE,
+                null, options, options[2]);
+
+        if (resp == JOptionPane.NO_OPTION) {
+            return EditingContext.DISCARD_CHANGES;
+        } else if (resp == JOptionPane.YES_OPTION) {
+            return EditingContext.EXPORT_LAYER;
+        }
+        return EditingContext.CANCEL;
+    }
+
+    public int showPanelSaveOrDiscard(MapControl parent, String name) {
+
+        I18nManager i18nManager = ToolsLocator.getI18nManager();
+
+        Object[] options =
+        { i18nManager.getTranslation("save"),
+            "       " + i18nManager.getTranslation("discard") + "       ",
+            i18nManager.getTranslation("continue") };
+
+        String question = i18nManager.getTranslation("ask_save_layer");
+        question = question + " '" + name + "'?";
+        String firstLabel = i18nManager.getTranslation("save");
+        String firstDesc = i18nManager.getTranslation("save_changes_performed");
+        JPanel explanation_panel =
+            getExplanationPanel(question, firstLabel, firstDesc);
+
+        int resp =
+            JOptionPane.showOptionDialog(parent, explanation_panel,
+                i18nManager.getTranslation("end_editing"),
+                JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE,
+                null, options, options[2]);
+
+        if (resp == JOptionPane.YES_OPTION) {
+            return EditingContext.SAVE_CHANGES;
+        } else if (resp == JOptionPane.NO_OPTION) {
+            return EditingContext.DISCARD_CHANGES;
+        }
+        return EditingContext.CANCEL;
+    }
+
+    public EditingContextMenu getContextualMenu(Component parent,
+        AcceptValueListener listener, EditingServiceParameter parameter) {
+
+        EditingContextMenu contextMenu =
+            new DefaultEditingContextMenu(parent, listener, parameter);
+
+        return contextMenu;
+    }
+
+    public EditingConsole getEditingConsole(ResponseListener listener) {
+        return new DefaultEditingConsole(listener);
+    }
+
+    public EditingConsole getEditingConsole(List<ResponseListener> listeners) {
+        return new DefaultEditingConsole(listeners);
+    }
+}

Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl
___________________________________________________________________
Added: svn:ignore
   + target



Property changes on: org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.92
___________________________________________________________________
Added: svn:ignore
   + .directory


