Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/pom.xml
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/pom.xml	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/pom.xml	(revision 831)
@@ -0,0 +1,13 @@
+<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.derivedgeometries</artifactId>
+    <version>1.0.156</version>
+  </parent>
+  <artifactId>org.gvsig.derivedgeometries.app</artifactId>
+  <packaging>pom</packaging>
+  <modules>
+  	<module>org.gvsig.derivedgeometries.app.mainplugin</module>
+  </modules>
+</project>
\ No newline at end of file
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/i18n/text.properties
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/i18n/text.properties	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/i18n/text.properties	(revision 831)
@@ -0,0 +1,46 @@
+_derived_geometries = Geometr\u00edas derivadas
+_shape_file= Archivo shape
+_cancel = Cancelar
+_next = Siguiente
+_features = Features
+_new_features = Nuevos elementos 
+_add_all_button_tooltip = A\u00f1adir todas las features
+_add_selected_button_tooltip = A\u00f1adir features seleccionadas
+_remove_all_button_tooltip = Quitar todas las features
+_remove_selected_button_tooltip = Quitar features seleccionadas
+_move_up_button_tooltip = Subir features seleccionadas
+_move_down_button_tooltip = Bajar features seleccionadas
+_output_layer = Capa destino
+_source_layer = Capa fuente
+_layers = Capas
+_select_path = Seleccione ruta
+_name = Nombre
+_path = Ruta
+_layer = Capa
+_options = Opciones
+_path_where_create_the_new_layer_files = Ruta donde se crear\u00e1n los archivos de la nuevas capas
+_destination_layer_type = Tipo de capa destino
+_type = Tipo
+_process_type = Tipo de proceso
+_creation_derivative_geometry_layer_process = Proceso de creaci\u00f3n de geometr\u00edas derivadas
+_ongoing_process_please_wait = Proceso en ejecici\u00f3n, por favor espere.
+_output_layer_name = Nombre de la capa destino
+_warning_adding_features = \u00a1Advertencia!
+_warning_there_are_features_with_more_than_one_geometry_or_without_geometry = Hay features con m\u00e1s de una geometr\u00eda o sin geometr\u00eda. Dichas features no se a\u00f1adir\u00e1n.  
+_cant_process_this_layer_type = Este tipo de capas no se pueden procesar
+_cant_process_layer = No se puede procesar esta capa
+_no_valid_data = Datos inv\u00e1lidos
+_no_valid_data_make_sure_data_are_valid = Por favor, aseg\u00farese de que los datos son v\u00e1lidos.
+_no_valid_source_layer = Capa fuente no v\u00e1lida
+_cant_process_this_type_of_layer = No es posible procesar este tipo de capa.
+_information = Informaci\u00f3n
+_process_finished_successfully = Proceso finalizado correctamente
+_file_already_exist = El archivo ya existe
+_file_already_exist_override_it = El archivo ya existe. \u00bfDesea sobreescribirlo?
+_process_error = Error en la ejecuci\u00f3n del proceso. Revise el log para m\u00e1s informaci\u00f3n.
+_error = Error
+_finish = Finalizar
+_generate = Generar
+_points_to_line=Puntos a l\u00ednea
+_points_to_polygon=Puntos a pol\u00edgono
+_lines_to_closed_polyline=L\u00edneas a polil\u00ednea cerrada
\ No newline at end of file
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties	(revision 831)
@@ -0,0 +1,46 @@
+_derived_geometries = Derived geometries
+_shape_file = Shape file
+_cancel = Cancel
+_next = Next
+_features = Features
+_new_features = New features
+_add_all_button_tooltip = Add all features
+_add_selected_button_tooltip = Add selected features
+_remove_all_button_tooltip = Remove all features
+_remove_selected_button_tooltip = Remove selected features
+_move_up_button_tooltip = Move up selected features
+_move_down_button_tooltip = Move down selected features
+_output_layer = Output layer
+_source_layer = Source layer
+_layers = Layers
+_select_path = Select path
+_name = Name
+_path = Path
+_layer = Layer
+_options = Options
+_path_where_create_the_new_layer_files = Path where create the new layer files
+_destination_layer_type = Output layer type
+_type = Type
+_process_type = Process type
+_creation_derived_geometry_layer_process = Creation derived geometry layer process
+_ongoing_process_please_wait = Ongoing process, please wait. 
+_output_layer_name = Output layer name
+_warning_adding_features = Error adding selected features
+_warning_there_are_features_with_more_than_one_geometry_or_without_geometry= There are features with more than one geometry or without geometry. These features will no be added.
+_cant_process_this_layer_type = Can not process this layer type
+_cant_process_layer = Can not process layer
+_no_valid_data = Invalid data
+_no_valid_data_make_sure_data_are_valid = Please, make sure data are valid.
+_no_valid_source_layer = Source layer is not valid
+_cant_process_this_type_of_layer = It is not possible to process source layer.
+_information = Information
+_process_finished_successfully = Process finished successfully
+_file_already_exist = File already exists
+_file_already_exist_override_it = File already exists. Overwrite it?
+_process_error = Error in execution of process. See log to more information.
+_error = Error
+_finish = Finish
+_generate = Generate
+_points_to_line=Points to line
+_points_to_polygon=Points to polygon
+_lines_to_closed_polyline=Lines to closed polyline
\ No newline at end of file
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/config.xml
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/config.xml	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/config.xml	(revision 831)
@@ -0,0 +1,35 @@
+<?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.derivedgeometries.app.mainplugin.DerivedGeometriesExtension"
+			description="" active="true" priority="1">
+
+			<action name="derived-geometries" label="_derived_geometries"
+				tooltip="_derived_geometries" position="601300000" action-command="derived-geometries"
+				icon="create-derivative-geometry-icon" accelerator="" />
+
+			<menu text="Layer/_derived_geometries" name="derived-geometries" />
+
+			<tool-bar name="derived-geometries" position="5000">
+				<action-tool name="derived-geometries" />
+			</tool-bar>
+
+		</extension>
+	</extensions>
+</plugin-config>
\ No newline at end of file
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/images/create-derivative-geometry-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/images/create-derivative-geometry-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/images/control-panel/remove-all-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/images/control-panel/remove-all-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/images/control-panel/remove-selected-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/images/control-panel/remove-selected-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/images/control-panel/up-arrow-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/images/control-panel/up-arrow-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/images/control-panel/add-all-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/images/control-panel/add-all-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/images/control-panel/add-selected-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/images/control-panel/add-selected-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/images/control-panel/down-arrow-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/resources-plugin/images/control-panel/down-arrow-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml	(revision 831)
@@ -0,0 +1,51 @@
+<!-- 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.derivedgeometries.swing.api</include>
+				<include>org.gvsig:org.gvsig.derivedgeometries.swing.impl</include>
+			</includes>
+		</dependencySet>
+	</dependencySets>
+
+</assembly>
+
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/java/org/gvsig/derivedgeometries/app/mainplugin/DerivedGeometriesExtension.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/java/org/gvsig/derivedgeometries/app/mainplugin/DerivedGeometriesExtension.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/src/main/java/org/gvsig/derivedgeometries/app/mainplugin/DerivedGeometriesExtension.java	(revision 831)
@@ -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.derivedgeometries.app.mainplugin;
+
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+import javax.swing.JComponent;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.plugins.Extension;
+import org.gvsig.app.project.documents.view.gui.DefaultViewPanel;
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesLocator;
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesManager;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+import org.gvsig.tools.swing.api.windowmanager.WindowManager;
+import org.gvsig.tools.swing.api.windowmanager.WindowManager.MODE;
+
+/**
+ * Andami extension to show DerivedGeometries in the application.
+ * 
+ * @author gvSIG team
+ *
+ */
+public class DerivedGeometriesExtension extends Extension implements
+        ComponentListener {
+
+    private JComponent panel = null;
+
+    /**
+     * Execute the actions associated to this extension.
+     */
+    public void execute(String actionCommand) {
+
+        if (actionCommand.equals("derived-geometries")) {
+            DefaultViewPanel view = getActiveView();
+            DerivedGeometriesManager manager =
+                DerivedGeometriesLocator.getManager();
+            WindowManager windowManager = ToolsSwingLocator.getWindowManager();
+            panel =
+                manager.getDerivedGeometriesPanel(view.getMapControl())
+                    .asJComponent();
+            panel.addComponentListener(this);
+
+            I18nManager i18nManager = ToolsLocator.getI18nManager();
+            windowManager.showWindow(panel,
+                i18nManager.getTranslation("_derived_geometries"), MODE.WINDOW);
+        }
+    }
+
+    public void initialize() {
+        registerIcons();
+    }
+
+    private void registerIcons() {
+        IconThemeHelper.registerIcon("", "create-derivative-geometry-icon",
+            this);
+
+        IconThemeHelper.registerIcon("control-panel", "add-all-icon", this);
+        IconThemeHelper
+            .registerIcon("control-panel", "add-selected-icon", this);
+        IconThemeHelper.registerIcon("control-panel", "remove-all-icon", this);
+        IconThemeHelper.registerIcon("control-panel", "remove-selected-icon",
+            this);
+        IconThemeHelper.registerIcon("control-panel", "down-arrow-icon", this);
+        IconThemeHelper.registerIcon("control-panel", "up-arrow-icon", this);
+    }
+
+    public boolean isEnabled() {
+        return panel == null;
+    }
+
+    public boolean isVisible() {
+        DefaultViewPanel view = getActiveView();
+        if (view != null) {
+            MapContext mapContex = view.getMapControl().getMapContext();
+            int numLayers = mapContex.getLayers().getLayersCount();
+            if (view != null && numLayers > 0) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private DefaultViewPanel getActiveView() {
+        org.gvsig.andami.ui.mdiManager.IWindow activeWindow =
+            PluginServices.getMDIManager().getActiveWindow();
+
+        if (activeWindow instanceof DefaultViewPanel) {
+            return (DefaultViewPanel) activeWindow;
+        }
+
+        return null;
+    }
+
+    public void componentResized(ComponentEvent ce) {
+    }
+
+    public void componentMoved(ComponentEvent ce) {
+    }
+
+    public void componentShown(ComponentEvent ce) {
+    }
+
+    public void componentHidden(ComponentEvent ce) {
+        panel = null;
+    }
+
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/pom.xml
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/pom.xml	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/pom.xml	(revision 831)
@@ -0,0 +1,43 @@
+<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.derivedgeometries.app</artifactId>
+		<version>1.0.156</version>
+	</parent>
+	<artifactId>org.gvsig.derivedgeometries.app.mainplugin</artifactId>
+	<name>${project.artifactId}</name>
+
+	<properties>
+		<!-- Package info property values -->
+		<!-- Default values in org.gvsig.desktop -->
+		<gvsig.package.info.state>testing</gvsig.package.info.state>
+		<gvsig.package.info.official>true</gvsig.package.info.official>
+		<gvsig.package.info.name>Derived geometries</gvsig.package.info.name>
+		<gvsig.package.info.categories>Geoprocess, Vector</gvsig.package.info.categories>
+		<gvsig.package.info.description>Derived geometries: provides processes to create derived geometries from others.</gvsig.package.info.description>
+		<gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin -ge 2.1.0</gvsig.package.info.dependencies>
+		<gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-derived-geometries/pool/</gvsig.package.info.poolURL>
+	</properties>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.app.mainplugin</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.derivedgeometries.swing.api
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.derivedgeometries.swing.impl
+			</artifactId>
+			<scope>runtime</scope>
+		</dependency>
+	</dependencies>
+</project>
\ No newline at end of file
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/buildNumber.properties
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/buildNumber.properties	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.app/org.gvsig.derivedgeometries.app.mainplugin/buildNumber.properties	(revision 831)
@@ -0,0 +1,2 @@
+#Mon Nov 15 22:21:35 CET 2021
+buildNumber=160
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/pom.xml
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/pom.xml	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/pom.xml	(revision 831)
@@ -0,0 +1,78 @@
+<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.derivedgeometries</artifactId>
+	<version>1.0.156</version>
+	<packaging>pom</packaging>
+	<name>org.gvsig.derivedgeometries</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.desktop</artifactId>
+		<version>2.0.341</version>
+	</parent>
+	<url>http://devel.gvsig.org/sites/org.gvsig.derivedgeometries/${project.version}</url>
+	<scm>
+		<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-derived-geometries/org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156</connection>
+		<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-derived-geometries/org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156</developerConnection>
+		<url>https://devel.gvsig.org/redmine/projects/gvsig-derived-geometries/repository/show/org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156</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-derived-geometries/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-derived-geometries/${project.artifactId}/tags</tagBase>
+					<goal>deploy</goal>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+	<modules>
+		<module>org.gvsig.derivedgeometries.app</module>
+		<module>org.gvsig.derivedgeometries.swing</module>
+		<module>org.gvsig.derivedgeometries.main</module>
+	</modules>
+	<dependencyManagement>
+		<dependencies>
+			<dependency>
+				<groupId>org.gvsig</groupId>
+				<artifactId>
+					org.gvsig.derivedgeometries.swing.api
+				</artifactId>
+				<version>1.0.156</version>
+			</dependency>
+			<dependency>
+				<groupId>org.gvsig</groupId>
+				<artifactId>
+					org.gvsig.derivedgeometries.swing.impl
+				</artifactId>
+				<version>1.0.156</version>
+			</dependency>
+		</dependencies>
+	</dependencyManagement>
+</project>
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/java/org/gvsig/derivedgeometries/main/DummyLayerOrderManager.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/java/org/gvsig/derivedgeometries/main/DummyLayerOrderManager.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/java/org/gvsig/derivedgeometries/main/DummyLayerOrderManager.java	(revision 831)
@@ -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.derivedgeometries.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 DummyLayerOrderManager implements LayerOrderManager{
+
+    public void saveToState(PersistentState state) throws PersistenceException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public void loadFromState(PersistentState state)
+        throws PersistenceException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public int getPosition(FLayers target, FLayer newLayer) {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public String getName() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public String getDescription() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public String getCode() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+    
+    public Object clone() throws CloneNotSupportedException{
+        return new DummyLayerOrderManager();
+    }
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/java/org/gvsig/derivedgeometries/main/Main.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/java/org/gvsig/derivedgeometries/main/Main.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/java/org/gvsig/derivedgeometries/main/Main.java	(revision 831)
@@ -0,0 +1,243 @@
+/* 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.derivedgeometries.main;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.io.File;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JToolBar;
+import javax.swing.WindowConstants;
+
+import org.cresques.cts.IProjection;
+
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesLocator;
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesManager;
+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.mapcontext.MapContextLocator;
+import org.gvsig.fmap.mapcontext.MapContextManager;
+import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+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.Behavior.MoveBehavior;
+import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
+import org.gvsig.tools.swing.api.windowmanager.WindowManager;
+import org.gvsig.tools.swing.api.windowmanager.WindowManager.MODE;
+
+public class Main {
+
+    final String DEFAULT_CRS_CODE = "EPSG:23030";
+
+    private DerivedGeometriesManager derivedGeometriesManager;
+    private MapControlManager mapControlManager;
+    private DataManager dataManager;
+    private MapContextManager mapContextManager;
+    private WindowManager windowManager;
+
+    private MapControl mapControl;
+
+    private JFrame mainFrame;
+
+    // Actions
+    private AbstractAction derivedGeometries;
+
+    private AbstractAction openAddLayerDialog;
+
+    private AbstractAction exit;
+
+    public static void main(String[] args) {
+        new DefaultLibrariesInitializer().fullInitialize();
+        Main main = new Main();
+        main.doMain();
+
+    }
+
+    public Main() {
+        mapControlManager = MapControlLocator.getMapControlManager();
+        derivedGeometriesManager = DerivedGeometriesLocator.getManager();
+        dataManager = DALLocator.getDataManager();
+        mapContextManager = MapContextLocator.getMapContextManager();
+        windowManager = ToolsSwingLocator.getWindowManager();
+        mapContextManager.getSymbolManager().getSymbolPreferences()
+            .setDefaultSymbolFillColorAleatory(true);
+
+        // Register our DummyLayerOrderManger needed to add sample layer
+        MapContextLocator
+            .registerDefaultOrderManager(DummyLayerOrderManager.class);
+    }
+
+    private void doMain() {
+        try {
+            mapControl = mapControlManager.createJMapControlPanel(mapContextManager.createMapContext());
+        } catch (MapControlCreationException e) {
+            // TODO Auto-generated catch block
+        }
+
+        mapControl.addBehavior("pan", new MoveBehavior(new PanListenerImpl(
+            mapControl)));
+
+        mapControl.setTool("pan");
+
+        IProjection defaultProjection = CRSFactory.getCRS(DEFAULT_CRS_CODE);
+        mapControl.getViewPort().setProjection(defaultProjection);
+
+        // 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 actions
+        createActions();
+
+        // Create menu bar
+        createMenu();
+
+        // Create tools bar
+        createToolBar();
+
+        // Display the window.
+        mainFrame.pack();
+        mainFrame.setLocation(500, 0);
+        mainFrame.setVisible(true);
+    }
+
+    private void createToolBar() {
+        JToolBar toolBar = new JToolBar();
+
+        toolBar.add(new JButton(openAddLayerDialog));
+        toolBar.add(new JButton(derivedGeometries));
+
+        mainFrame.add(toolBar, BorderLayout.PAGE_START);
+
+    }
+
+    private void createMenu() {
+        // Create the menu bar.
+        JMenuBar menuBar = new JMenuBar();
+
+        // Build the menu.
+        JMenu menuFile = new JMenu("File");
+        menuFile.add(openAddLayerDialog);
+        menuFile.add(new JMenuItem(exit));
+
+        mainFrame.setJMenuBar(menuBar);
+
+    }
+
+    @SuppressWarnings("serial")
+    private void createActions() {
+
+        derivedGeometries = new AbstractAction("DerivedGeometries") {
+
+            public void actionPerformed(ActionEvent e) {
+                JComponent panel =
+                    derivedGeometriesManager.getDerivedGeometriesPanel(
+                        mapControl).asJComponent();
+
+                windowManager.showWindow(panel, "derived_geometries",
+                    MODE.WINDOW);
+            }
+        };
+
+        openAddLayerDialog = new AbstractAction("Add sample layers") {
+
+            public void actionPerformed(ActionEvent e) {
+                try {
+                    addLayer("src/main/resources/sample-cartography/puertos_andalucia.shp");
+                    addLayer("src/main/resources/sample-cartography/hidro_andalucia.shp");
+                    addLayer("src/main/resources/sample-cartography/Provincias andalucia.shp");
+
+                    ThreadSafeDialogsManager dlgManager =
+                        ToolsSwingLocator.getThreadSafeDialogsManager();
+
+                    StringBuilder stb = new StringBuilder();
+                    stb.append("Layer: Provincias_andalucia Type: multisurface\n");
+                    stb.append("Layer: hidro_andalucia Type: multicurve\n");
+                    stb.append("Layer: puertos_andalucia Type: point\n");
+
+                    dlgManager.messageDialog(stb.toString(),
+                        "Sample layers added succesfully",
+                        JOptionPane.INFORMATION_MESSAGE);
+                } catch (Exception e1) {
+                    // TODO Auto-generated catch block
+                    e1.printStackTrace();
+                }
+            }
+        };
+
+        exit = new AbstractAction("Exit") {
+
+            public void actionPerformed(ActionEvent e) {
+                System.exit(0);
+            }
+        };
+
+    }
+
+    public void addLayer(String shpPath) throws InitializeException,
+        ProviderNotRegisteredException, ValidateDataParametersException,
+        LoadLayerException {
+        DataStoreParameters params;
+        params = dataManager.createStoreParameters("Shape");
+
+        File shpFile = new File(shpPath);
+
+        params.setDynValue("shpFile", shpFile.getPath());
+        params.setDynValue("CRS", CRSFactory.getCRS(DEFAULT_CRS_CODE));
+        params.validate();
+
+        FeatureStore store =
+            (FeatureStore) dataManager.openStore("Shape", params);
+
+        FLayer layer = mapContextManager.createLayer(store.getName(), store);
+
+        mapControl.getMapContext().getLayers().addLayer(layer);
+        mapControl.getMapContext().getLayers().setActive(true);
+        layer.dispose();
+
+    }
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/resources/sample-cartography/hidro_andalucia.shp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/resources/sample-cartography/hidro_andalucia.shp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/resources/sample-cartography/Provincias andalucia.shx
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/resources/sample-cartography/Provincias andalucia.shx
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/resources/sample-cartography/hidro_andalucia.dbf
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/resources/sample-cartography/hidro_andalucia.dbf
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/resources/sample-cartography/puertos_andalucia.shx
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/resources/sample-cartography/puertos_andalucia.shx
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/resources/sample-cartography/hidro_andalucia.shx
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/resources/sample-cartography/hidro_andalucia.shx
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/resources/sample-cartography/Provincias andalucia.shp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/resources/sample-cartography/Provincias andalucia.shp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/resources/sample-cartography/Provincias andalucia.dbf
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/resources/sample-cartography/Provincias andalucia.dbf
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/resources/sample-cartography/puertos_andalucia.shp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/resources/sample-cartography/puertos_andalucia.shp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/resources/sample-cartography/puertos_andalucia.dbf
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/src/main/resources/sample-cartography/puertos_andalucia.dbf
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/pom.xml
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/pom.xml	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.main/pom.xml	(revision 831)
@@ -0,0 +1,134 @@
+<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.derivedgeometries</artifactId>
+		<version>1.0.156</version>
+	</parent>
+	<artifactId>org.gvsig.derivedgeometries.main</artifactId>
+	<name>org.gvsig.derivedgeometries.main</name>
+
+	<dependencies>
+		<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.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.tools.swing.api</artifactId>
+	        <scope>compile</scope>
+        </dependency>
+
+		<!-- runtime dependencies -->
+		<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.derivedgeometries.swing.api
+			</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>
+				org.gvsig.derivedgeometries.swing.impl
+			</artifactId>
+		</dependency>
+		<dependency>
+	        <groupId>org.gvsig</groupId>
+	        <artifactId>org.gvsig.tools.swing.impl</artifactId>
+        <scope>runtime</scope>
+    </dependency>
+	</dependencies>
+</project>
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/DerivedGeometriesPanelView.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/DerivedGeometriesPanelView.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/DerivedGeometriesPanelView.java	(revision 831)
@@ -0,0 +1,121 @@
+/* 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.derivedgeometries.swing.impl.views;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesLocator;
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesManager;
+import org.gvsig.derivedgeometries.swing.api.panels.FeaturesControlPanel;
+import org.gvsig.derivedgeometries.swing.api.panels.LayerAndProcessSelectionPanel;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+
+public class DerivedGeometriesPanelView extends JPanel {
+
+    private static final long serialVersionUID = -5574613054191988321L;
+
+    private LayerAndProcessSelectionPanel layerAndProcessSelectionPanel;
+
+    private FeaturesControlPanel featuresControlPanel;
+
+    private JPanel buttonsPanel;
+
+    private JButton nextButton;
+
+    private JButton cancelButton;
+
+    public DerivedGeometriesPanelView(MapControl theMapControl) {
+
+        DerivedGeometriesManager manager =
+            DerivedGeometriesLocator.getManager();
+
+        this.layerAndProcessSelectionPanel =
+            manager.getLayerAndProcessSelectionPanel(theMapControl);
+        this.featuresControlPanel = manager.getFeaturesControlPanel();
+        
+        initialize();
+    }
+
+    private void initialize() {
+        setLayout(new BorderLayout());
+        
+        add(layerAndProcessSelectionPanel.asJComponent(), BorderLayout.PAGE_START);
+        
+        add(featuresControlPanel.asJComponent(), BorderLayout.CENTER);
+        featuresControlPanel.asJComponent().setVisible(false);
+        
+        add(getButtonsPanel(), BorderLayout.PAGE_END);
+    }
+
+    @Override
+    public Dimension getPreferredSize() {
+        JComponent c1 = layerAndProcessSelectionPanel.asJComponent();
+        JComponent c2 = featuresControlPanel.asJComponent();
+        
+        int with =  (int) Math.max(c1.getPreferredSize().getWidth(), c2.getPreferredSize().getWidth()); 
+        int height =  (int) Math.max(c1.getPreferredSize().getHeight(), c2.getPreferredSize().getHeight()); 
+        return new Dimension(with,height);
+    }
+    
+    private JPanel getButtonsPanel() {
+        if (buttonsPanel == null) {
+            buttonsPanel = new JPanel();
+            buttonsPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
+            buttonsPanel.add(getNextButton());
+            buttonsPanel.add(getCancelButton());
+        }
+        return buttonsPanel;
+    }
+
+    protected JButton getCancelButton() {
+        if (cancelButton == null) {
+            I18nManager i18nManager = ToolsLocator.getI18nManager();
+            cancelButton = new JButton(i18nManager.getTranslation("_cancel"));
+        }
+        return cancelButton;
+    }
+
+    protected JButton getNextButton() {
+        if (nextButton == null) {
+            I18nManager i18nManager = ToolsLocator.getI18nManager();
+            nextButton = new JButton(i18nManager.getTranslation("_next") + " >");
+        }
+        return nextButton;
+    }
+
+    protected LayerAndProcessSelectionPanel getLayerAndProcessSelectionPanel() {
+        return layerAndProcessSelectionPanel;
+    }
+
+    protected FeaturesControlPanel getFeaturesControlPanel() {
+        return featuresControlPanel;
+    }
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/DefaultDerivedGeometriesSelectionModel.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/DefaultDerivedGeometriesSelectionModel.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/DefaultDerivedGeometriesSelectionModel.java	(revision 831)
@@ -0,0 +1,380 @@
+/* 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.derivedgeometries.swing.impl.views;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.event.EventListenerList;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+
+import org.gvsig.derivedgeometries.swing.api.tablemodels.DerivedGeometriesSelectionModel;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureReference;
+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.mapcontrol.dal.feature.swing.SelectionChangeException;
+import org.gvsig.fmap.mapcontrol.dal.feature.swing.table.FeatureTableModel;
+import org.gvsig.tools.dispose.DisposableIterator;
+
+public class DefaultDerivedGeometriesSelectionModel implements
+    DerivedGeometriesSelectionModel {
+
+    protected EventListenerList listenerList = new EventListenerList();
+
+    List<FeatureReference> selectedFeatures;
+
+    FeatureTableModel featureTableModel;
+
+    private int selectionMode = SINGLE_INTERVAL_SELECTION;
+
+    private boolean isAdjusting = false;
+
+    private int anchor = -1;
+
+    private int lead = -1;
+
+    private int currentFirst = -1;
+    private int currentLast = -1;
+
+    public DefaultDerivedGeometriesSelectionModel(
+        FeatureTableModel theFeatureTableModel) {
+
+        this.selectedFeatures = new ArrayList<FeatureReference>();
+        this.featureTableModel = theFeatureTableModel;
+
+    }
+
+    public void addListSelectionListener(ListSelectionListener listener) {
+        listenerList.add(ListSelectionListener.class, listener);
+    }
+
+    public void addSelectionInterval(int index0, int index1) {
+        doWithSelection(new FeatureSelectionOperation() {
+
+            public void doWithSelection(FeatureSelection selection, int first,
+                int last) throws DataException {
+                for (int i = first; i <= last; i++) {
+                    Feature feature = getFeature(i);
+                    if (!selection.isSelected(feature)) {
+                        selection.select(feature);
+
+                        // After add new feature reference, we have to get index
+                        // of new feature selected within
+                        // selectedFeatures to keep feature order
+                        for (int j = 0; j < selectedFeatures.size(); j++) {
+                            int index =
+                                getIndexOfFeatureReference(selectedFeatures.get(j));
+                            if (i < index) {
+                                selectedFeatures.add(j, feature.getReference());
+                                return;
+                            }
+                        }
+
+                        // if new feature has not been added, add it at last
+                        // position
+                        selectedFeatures.add(feature.getReference());
+                    }
+                }
+            }
+
+        }, index0, index1, true);
+    }
+
+    public void clearSelection() {
+        try {
+            getFeatureSelection().deselectAll();
+        } catch (DataException e) {
+            throw new SelectionChangeException(e);
+        }
+        selectedFeatures.clear();
+    }
+
+    public int getAnchorSelectionIndex() {
+        return anchor;
+    }
+
+    private interface FeatureSelectionOperation {
+
+        void doWithSelection(FeatureSelection selection, int first, int last)
+            throws DataException;
+    }
+
+    private void doWithSelection(FeatureSelectionOperation operation,
+        int index0, int index1, boolean select) {
+        // Set the anchor and lead
+        anchor = index0;
+        lead = index1;
+
+        // As index0 <= index1 is no guaranteed, calculate the first and second
+        // values
+        int first = (index0 <= index1) ? index0 : index1;
+        int last = (index0 <= index1) ? index1 : index0;
+
+        // If the new selection is not updated don't continue
+        if ((currentFirst == first) && (currentLast == last)) {
+            return;
+        }
+        currentFirst = first;
+        currentLast = last;
+
+        FeatureSelection selection = getFeatureSelection();
+
+        // Perform the selection operation into a complex notification
+        selection.beginComplexNotification();
+        try {
+            // Is a full select or deselect
+            if (first == 00 && last == featureTableModel.getRowCount() - 1) {
+                if (!select) {
+                    selection.deselectAll();
+                    selectedFeatures.clear();
+                } else {
+                    operation.doWithSelection(selection, first, last);
+                }
+            } else {
+                operation.doWithSelection(selection, first, last);
+            }
+        } catch (DataException e) {
+            throw new SelectionChangeException(e);
+        } finally {
+            selection.endComplexNotification();
+        }
+
+        fireValueChanged(first, last, isAdjusting);
+    }
+
+    protected void fireValueChanged(int firstIndex, int lastIndex,
+        boolean isAdjusting) {
+        Object[] listeners = listenerList.getListenerList();
+        ListSelectionEvent e = null;
+
+        for (int i = listeners.length - 2; i >= 0; i -= 2) {
+            if (listeners[i] == ListSelectionListener.class) {
+                if (e == null) {
+                    e =
+                        new ListSelectionEvent(this, firstIndex, lastIndex,
+                            isAdjusting);
+                }
+                ((ListSelectionListener) listeners[i + 1]).valueChanged(e);
+            }
+        }
+    }
+
+    /**
+     * Returns a Feature by table row position.
+     */
+    private Feature getFeature(int index) {
+        return featureTableModel.getFeatureAt(index);
+    }
+
+    private FeatureSelection getFeatureSelection() {
+        try {
+            return (FeatureSelection) getFeatureStore().getSelection();
+        } catch (DataException ex) {
+            throw new SelectionChangeException(ex);
+        }
+    }
+
+    /**
+     * Returns the FeatureStore.
+     */
+    private FeatureStore getFeatureStore() {
+        return featureTableModel.getFeatureStore();
+    }
+
+    private int getIndexOfFeatureReference(FeatureReference featureReference) {
+
+        for (int i = 0; i < featureTableModel.getRowCount(); i++) {
+
+            Feature tmpFeature = featureTableModel.getFeatureAt(i);
+            FeatureReference tmpFeatureReference = tmpFeature.getReference();
+            if (featureReference.equals(tmpFeatureReference)) {
+                return i;
+            }
+
+        }
+        return -1;
+    }
+
+    public int getLeadSelectionIndex() {
+        return lead;
+    }
+
+    public int getMaxSelectionIndex() {
+        int resp = this.getSelectionIndex(true);
+        return resp;
+    }
+
+    public int getMinSelectionIndex() {
+        int resp = this.getSelectionIndex(false);
+        return resp;
+    }
+
+    private int getSelectionIndex(boolean last) {
+
+        int ind = -1;
+        int resp = -1;
+
+        FeatureSet fs = null;
+        DisposableIterator diter = null;
+
+        try {
+            FeatureSelection selection = getFeatureSelection();
+            if (!selection.isEmpty()) {
+
+                fs = getFeatureStore().getFeatureSet();
+                diter = fs.fastIterator();
+                Feature feat = null;
+                while (diter.hasNext()) {
+                    ind++;
+                    feat = (Feature) diter.next();
+                    if (selection.isSelected(feat)) {
+                        resp = ind;
+                        if (!last) {
+                            break;
+                        }
+                    }
+                }
+
+            }
+        } catch (DataException e) {
+            throw new SelectionChangeException(e);
+        } finally {
+            if (diter != null) {
+                diter.dispose();
+            }
+
+            if (fs != null) {
+                fs.dispose();
+            }
+        }
+        return resp;
+    }
+
+    public int getSelectionMode() {
+        return selectionMode;
+    }
+
+    public boolean getValueIsAdjusting() {
+        return isAdjusting;
+    }
+
+    public void insertIndexInterval(int index, int length, boolean before) {
+        // Nothing to do
+    }
+
+    public boolean isSelectedIndex(int index) {
+        if (index == -1) {
+            return false;
+        }
+        Feature feature = featureTableModel.getFeatureAt(index);
+        return getFeatureSelection().isSelected(feature);
+    }
+
+    public boolean isSelectionEmpty() {
+        try {
+            return getFeatureSelection().isEmpty();
+        } catch (Exception ex) {
+            throw new SelectionChangeException(ex);
+        }
+    }
+
+    public void removeIndexInterval(int index0, int index1) {
+        // Nothing to do
+    }
+
+    public void removeListSelectionListener(ListSelectionListener listener) {
+        listenerList.remove(ListSelectionListener.class, listener);
+    }
+
+    public void removeSelectionInterval(int index0, int index1) {
+        doWithSelection(new FeatureSelectionOperation() {
+
+            public void doWithSelection(FeatureSelection selection, int first,
+                int last) throws DataException {
+                for (int i = first; i <= last; i++) {
+                    Feature feature = getFeature(i);
+                    if (selection.isSelected(feature)) {
+                        selection.deselect(feature);
+                        selectedFeatures.remove(feature.getReference());
+                    }
+                }
+            }
+
+        }, index0, index1, false);
+
+    }
+
+    public void setAnchorSelectionIndex(int index) {
+        this.anchor = index;
+    }
+
+    public void setLeadSelectionIndex(int index) {
+        this.lead = index;
+    }
+
+    public void setSelectionInterval(int index0, int index1) {
+
+        doWithSelection(new FeatureSelectionOperation() {
+
+            public void doWithSelection(FeatureSelection selection, int first,
+                int last) throws DataException {
+                selection.deselectAll();
+                selectedFeatures.clear();
+                for (int i = first; i <= last; i++) {
+                    Feature feature = getFeature(i);
+                    selection.select(feature);
+                    selectedFeatures.add(feature.getReference());
+                }
+            }
+
+        }, index0, index1, true);
+    }
+
+    public void setSelectionMode(int selectionMode) {
+        this.selectionMode = selectionMode;
+    }
+
+    public void setValueIsAdjusting(boolean valueIsAdjusting) {
+        if (this.isAdjusting != valueIsAdjusting) {
+            this.isAdjusting = valueIsAdjusting;
+            if (this.isAdjusting) {
+                getFeatureSelection().beginComplexNotification();
+            } else {
+                getFeatureSelection().endComplexNotification();
+            }
+        }
+    }
+
+    public List<FeatureReference> getSelectedFeatures() {
+        return this.selectedFeatures;
+    }
+
+    public void setSelectedFeatures(List<FeatureReference> list) {
+        this.selectedFeatures = list;
+    }
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/FeaturesControlPanelView.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/FeaturesControlPanelView.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/FeaturesControlPanelView.java	(revision 831)
@@ -0,0 +1,507 @@
+/* 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.derivedgeometries.swing.impl.views;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.BorderFactory;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSplitPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.ListSelectionModel;
+import javax.swing.table.TableModel;
+
+import org.gvsig.derivedgeometries.swing.api.exceptions.FetaureTableModelException;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.FeatureQuery;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.mapcontrol.dal.feature.swing.FeatureTable;
+import org.gvsig.fmap.mapcontrol.dal.feature.swing.table.ConfigurableFeatureTableModel;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+
+public class FeaturesControlPanelView extends JPanel {
+
+    private static final long serialVersionUID = -3899738999699332396L;
+
+    private I18nManager i18nManager = ToolsLocator.getI18nManager();
+
+    private JPanel summaryPanel;
+
+    private JLabel sourceLayerNameLabel;
+
+    private JTextField sourceLayerNameTextField;
+
+    private JLabel destLayerNameLabel;
+
+    private JTextField destLayerNameTextField;
+
+    private JPanel centerPanel;
+
+    private JSplitPane horizontalSplitPane;
+
+    private JPanel featuresPanel;
+
+    private JScrollPane allFeaturesScrollPane;
+
+    private FeatureTable allFeaturesTable;
+
+    private ConfigurableFeatureTableModel allFeaturesTableModel;
+
+    private JPanel newFeatureSelectionPanel;
+
+    private JPanel motionButtonsPanel;
+
+    private JScrollPane selectedFeaturesScrollPane;
+
+    private JTable selectedFeaturesTable;
+
+    private JButton addAllIconButton;
+
+    private JButton removeAllIconButton;
+
+    private JButton addIconButton;
+
+    private JButton removeIconButton;
+
+    private JButton moveUpButton;
+
+    private JButton moveDownButton;
+
+    public FeaturesControlPanelView() {
+        initialize();
+    }
+
+    private void initialize() {
+        setLayout(new BorderLayout());
+        add(getSummaryPanel(), BorderLayout.PAGE_START);
+        add(getCenterPanel(), BorderLayout.CENTER);
+    }
+
+    @Override
+    public Dimension getPreferredSize() {
+        return new Dimension(500, 550);
+    }
+
+    protected JScrollPane getAllFeaturesScrollPane() {
+        if (allFeaturesScrollPane == null) {
+            allFeaturesScrollPane = new JScrollPane();
+            allFeaturesScrollPane
+                .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+        }
+
+        return allFeaturesScrollPane;
+    }
+
+    @SuppressWarnings("serial")
+    protected FeatureTable getAllFeaturesTable(FeatureStore featureStore)
+        throws FetaureTableModelException {
+        if (allFeaturesTable == null) {
+            try {
+                allFeaturesTable =
+                    new FeatureTable(getAllFeaturesTableModel(featureStore)) {
+
+                        public boolean isCellEditable(int row, int column) {
+                            return false;
+                        }
+                    };
+                allFeaturesTable
+                    .setSelectionModel(new DefaultDerivedGeometriesSelectionModel(allFeaturesTableModel));
+            } catch (DataException e) {
+                throw new FetaureTableModelException(e.getMessage(), e);
+            }
+
+            allFeaturesTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
+        }
+        return allFeaturesTable;
+    }
+
+    protected ConfigurableFeatureTableModel getAllFeaturesTableModel(
+        FeatureStore featureStore) throws FetaureTableModelException {
+        if (allFeaturesTableModel == null) {
+            try {
+                FeatureQuery query = featureStore.createFeatureQuery();
+                allFeaturesTableModel =
+                    new ConfigurableFeatureTableModel(featureStore, query);
+            } catch (BaseException e) {
+                throw new FetaureTableModelException(e.getMessage(), e);
+            }
+        }
+
+        return allFeaturesTableModel;
+    }
+
+    private JPanel getCenterPanel() {
+        if (centerPanel == null) {
+            centerPanel = new JPanel();
+            centerPanel.setLayout(new BorderLayout());
+            centerPanel.add(getHorizontalSplitPane(), BorderLayout.CENTER);
+        }
+
+        return centerPanel;
+    }
+
+    private JPanel getFeaturesPanel() {
+        if (featuresPanel == null) {
+            featuresPanel = new JPanel();
+            featuresPanel.setBorder(BorderFactory
+                .createTitledBorder(i18nManager.getTranslation("features")));
+            featuresPanel.setLayout(new BorderLayout());
+            featuresPanel.add(getAllFeaturesScrollPane(), BorderLayout.CENTER);
+        }
+
+        return featuresPanel;
+    }
+
+    private JSplitPane getHorizontalSplitPane() {
+        if (horizontalSplitPane == null) {
+            horizontalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
+            horizontalSplitPane.setPreferredSize(this.getPreferredSize());
+            horizontalSplitPane.setOneTouchExpandable(true);
+
+            horizontalSplitPane.setTopComponent(getFeaturesPanel());
+            horizontalSplitPane.setBottomComponent(getNewFeaturePanel());
+
+            // Sets the split pane's divider to the 40 %
+            horizontalSplitPane.setDividerLocation((int) (horizontalSplitPane
+                .getPreferredSize().getHeight() * 0.40));
+        }
+
+        return horizontalSplitPane;
+    }
+
+    private JPanel getNewFeaturePanel() {
+        if (newFeatureSelectionPanel == null) {
+            newFeatureSelectionPanel = new JPanel();
+            newFeatureSelectionPanel
+                .setBorder(BorderFactory.createTitledBorder(i18nManager
+                    .getTranslation("_new_features")));
+            newFeatureSelectionPanel.setLayout(new BorderLayout());
+
+            // Add all button
+            addAllIconButton = getAddAllButton();
+            // Remove all button
+            removeAllIconButton = getRemoveAllButton();
+            // Add button
+            addIconButton = getAddButton();
+            // Remove button
+            removeIconButton = getRemoveButton();
+
+            // Right panel
+            JPanel rightPanel = new JPanel();
+            rightPanel.add(addIconButton);
+            rightPanel.add(removeIconButton);
+
+            // Left panel
+            JPanel leftPanel = new JPanel();
+            leftPanel.add(addAllIconButton);
+            leftPanel.add(removeAllIconButton);
+
+            // North panel
+            JPanel northPanel = new JPanel();
+            northPanel.setLayout(new BorderLayout());
+            northPanel.add(leftPanel, BorderLayout.LINE_START);
+            northPanel.add(rightPanel, BorderLayout.LINE_END);
+            newFeatureSelectionPanel.add(northPanel, BorderLayout.PAGE_START);
+
+            // South panel
+            JPanel southPanel = new JPanel();
+            southPanel.setLayout(new GridBagLayout());
+
+            GridBagConstraints constraints = new GridBagConstraints();
+            constraints.gridx = GridBagConstraints.RELATIVE;
+            constraints.gridy = 0;
+            constraints.weightx = 1;
+            constraints.weighty = 1;
+            constraints.fill = GridBagConstraints.BOTH;
+            constraints.anchor = GridBagConstraints.WEST;
+
+            southPanel.add(getSelectedFeaturesScrollPane(), constraints);
+
+            constraints = new GridBagConstraints();
+            constraints.gridx = GridBagConstraints.RELATIVE;
+            constraints.gridy = 0;
+            constraints.weightx = 0;
+            constraints.weighty = 0;
+            constraints.fill = GridBagConstraints.BOTH;
+            constraints.anchor = GridBagConstraints.EAST;
+
+            southPanel.add(getMotionButtonsPanel(), constraints);
+
+            newFeatureSelectionPanel.add(southPanel, BorderLayout.CENTER);
+        }
+        return newFeatureSelectionPanel;
+    }
+
+    protected JButton getAddAllButton() {
+        if (addAllIconButton == null) {
+            ImageIcon addAllIcon =
+                ToolsSwingLocator.getIconThemeManager().getCurrent()
+                    .get("add-all-icon");
+            addAllIconButton = new JButton(addAllIcon);
+            addAllIconButton.setToolTipText(i18nManager
+                .getTranslation("_add_all_button_tooltip"));
+        }
+        return addAllIconButton;
+    }
+
+    protected JButton getAddButton() {
+        if (addIconButton == null) {
+            ImageIcon addIcon =
+                ToolsSwingLocator.getIconThemeManager().getCurrent()
+                    .get("add-selected-icon");
+            addIconButton = new JButton(addIcon);
+            addIconButton.setToolTipText(i18nManager
+                .getTranslation("_add_selected_button_tooltip"));
+        }
+        return addIconButton;
+    }
+
+    protected JButton getRemoveAllButton() {
+        if (removeAllIconButton == null) {
+            ImageIcon removeAllIcon =
+                ToolsSwingLocator.getIconThemeManager().getCurrent()
+                    .get("remove-all-icon");
+            removeAllIconButton = new JButton(removeAllIcon);
+            removeAllIconButton.setToolTipText(i18nManager
+                .getTranslation("_remove_all_button_tooltip"));
+        }
+        return removeAllIconButton;
+    }
+
+    protected JButton getRemoveButton() {
+        if (removeIconButton == null) {
+            ImageIcon removeIcon =
+                ToolsSwingLocator.getIconThemeManager().getCurrent()
+                    .get("remove-selected-icon");
+            removeIconButton = new JButton(removeIcon);
+            removeIconButton.setToolTipText(i18nManager
+                .getTranslation("_remove_selected_button_tooltip"));
+        }
+        return removeIconButton;
+    }
+
+    protected JScrollPane getSelectedFeaturesScrollPane() {
+        if (selectedFeaturesScrollPane == null) {
+            selectedFeaturesScrollPane = new JScrollPane();
+            selectedFeaturesScrollPane
+                .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+        }
+
+        return selectedFeaturesScrollPane;
+    }
+
+    @SuppressWarnings("serial")
+    protected JTable getSelectedFeaturesTable() {
+        if (selectedFeaturesTable == null) {
+            selectedFeaturesTable = new JTable() {
+
+                public boolean isCellEditable(int row, int column) {
+                    return false;
+                }
+            };
+
+            selectedFeaturesTable
+                .setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+            selectedFeaturesTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
+        }
+        return selectedFeaturesTable;
+    }
+
+    protected SelectedFeaturesTableModel getSelectedFeaturesTableModel() {
+        TableModel model = getSelectedFeaturesTable().getModel();
+        if (model instanceof SelectedFeaturesTableModel) {
+            return (SelectedFeaturesTableModel) model;
+        }
+        return null;
+    }
+
+    private JPanel getMotionButtonsPanel() {
+        if (motionButtonsPanel == null) {
+            motionButtonsPanel = new JPanel();
+            motionButtonsPanel.setLayout(new GridBagLayout());
+
+            // Move up button
+            moveUpButton = getMoveUpButton();
+
+            JPanel upPanel = new JPanel();
+            upPanel.add(moveUpButton);
+
+            GridBagConstraints constraints = new GridBagConstraints();
+            constraints.gridx = 0;
+            constraints.gridy = GridBagConstraints.RELATIVE;
+            constraints.gridheight = 0;
+            constraints.gridwidth = 0;
+            constraints.weightx = 0;
+            constraints.weighty = 0;
+            constraints.anchor = GridBagConstraints.CENTER;
+            constraints.fill = GridBagConstraints.NONE;
+            constraints.insets = new Insets(4, 4, 4, 0);
+
+            motionButtonsPanel.add(upPanel, constraints);
+
+            // Move down button
+            moveDownButton = getMoveDownButton();
+
+            JPanel downPanel = new JPanel();
+            downPanel.add(moveDownButton);
+            motionButtonsPanel.add(downPanel, constraints);
+        }
+
+        return motionButtonsPanel;
+    }
+
+    protected JButton getMoveUpButton() {
+        if (moveUpButton == null) {
+            ImageIcon moveUpIcon =
+                ToolsSwingLocator.getIconThemeManager().getCurrent()
+                    .get("up-arrow-icon");
+            moveUpButton = new JButton(moveUpIcon);
+            moveUpButton.setToolTipText(i18nManager
+                .getTranslation("_move_up_button_tooltip"));
+
+        }
+
+        return moveUpButton;
+    }
+
+    protected JButton getMoveDownButton() {
+        if (moveDownButton == null) {
+            ImageIcon moveDownIcon =
+                ToolsSwingLocator.getIconThemeManager().getCurrent()
+                    .get("down-arrow-icon");
+            moveDownButton = new JButton(moveDownIcon);
+            moveDownButton.setToolTipText(i18nManager
+                .getTranslation("_move_down_button_tooltip"));
+        }
+        return moveDownButton;
+    }
+
+    private JLabel getOutputLayerNameLabel() {
+        if (destLayerNameLabel == null) {
+            destLayerNameLabel =
+                new JLabel(i18nManager.getTranslation("_output_layer"));
+            destLayerNameLabel.setToolTipText(i18nManager
+                .getTranslation("_output_layer"));
+        }
+
+        return destLayerNameLabel;
+    }
+
+    protected JTextField getOutputLayerNameTextField() {
+        if (destLayerNameTextField == null) {
+            destLayerNameTextField = new JTextField();
+            destLayerNameTextField.setEnabled(false);
+        }
+
+        return destLayerNameTextField;
+    }
+
+    private JLabel getSourceLayerNameLabel() {
+        if (sourceLayerNameLabel == null) {
+            sourceLayerNameLabel =
+                new JLabel(i18nManager.getTranslation("_source_layer"));
+            sourceLayerNameLabel.setToolTipText(i18nManager
+                .getTranslation("_source_layer"));
+        }
+
+        return sourceLayerNameLabel;
+    }
+
+    protected JTextField getSourceLayerNameTextField() {
+        if (sourceLayerNameTextField == null) {
+            sourceLayerNameTextField = new JTextField();
+            sourceLayerNameTextField.setEnabled(false);
+        }
+
+        return sourceLayerNameTextField;
+    }
+
+    private JPanel getSummaryPanel() {
+        if (summaryPanel == null) {
+            summaryPanel = new JPanel();
+            summaryPanel.setLayout(new BorderLayout());
+            summaryPanel.setBorder(BorderFactory.createTitledBorder(i18nManager
+                .getTranslation("_layers")));
+
+            JPanel pageStartPanel = new JPanel();
+            pageStartPanel.setLayout(new GridBagLayout());
+
+            GridBagConstraints constraints = getConstraintsForLabel();
+            pageStartPanel.add(getSourceLayerNameLabel(), constraints);
+
+            constraints = getContraintsForTextField();
+            pageStartPanel.add(getSourceLayerNameTextField(), constraints);
+
+            summaryPanel.add(pageStartPanel, BorderLayout.PAGE_START);
+
+            JPanel pageEndPanel = new JPanel();
+            pageEndPanel.setLayout(new GridBagLayout());
+            constraints = getConstraintsForLabel();
+            pageEndPanel.add(getOutputLayerNameLabel(), constraints);
+
+            constraints = getContraintsForTextField();
+            pageEndPanel.add(getOutputLayerNameTextField(), constraints);
+
+            summaryPanel.add(pageEndPanel, BorderLayout.PAGE_END);
+        }
+
+        return summaryPanel;
+    }
+
+    private GridBagConstraints getConstraintsForLabel() {
+        GridBagConstraints constraints = new GridBagConstraints();
+        constraints.gridx = GridBagConstraints.RELATIVE;
+        constraints.gridy = 0;
+        constraints.gridwidth = 1;
+        constraints.gridheight = 1;
+        constraints.anchor = GridBagConstraints.WEST;
+        constraints.fill = GridBagConstraints.NONE;
+        constraints.insets = new Insets(4, 4, 4, 4);
+        return constraints;
+    }
+
+    private GridBagConstraints getContraintsForTextField() {
+        GridBagConstraints constraints = new GridBagConstraints();
+        constraints.gridx = GridBagConstraints.RELATIVE;
+        constraints.gridy = 0;
+        constraints.gridwidth = 2;
+        constraints.gridheight = 1;
+        constraints.weightx = 1;
+        constraints.anchor = GridBagConstraints.CENTER;
+        constraints.fill = GridBagConstraints.HORIZONTAL;
+        constraints.insets = new Insets(4, 4, 4, 4);
+        return constraints;
+    }
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/SourceLayerComboBoxRenderer.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/SourceLayerComboBoxRenderer.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/SourceLayerComboBoxRenderer.java	(revision 831)
@@ -0,0 +1,75 @@
+/* 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.derivedgeometries.swing.impl.views;
+
+import java.awt.Color;
+import java.awt.Component;
+
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.ImageIcon;
+import javax.swing.JList;
+
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+
+public class SourceLayerComboBoxRenderer extends DefaultListCellRenderer {
+
+    private static final long serialVersionUID = 5975166847058585247L;
+
+    public Component getListCellRendererComponent(JList list, Object value,
+        int index, boolean isSelected, boolean cellHasFocus) {
+
+        super.getListCellRendererComponent(list, value, index, isSelected,
+            cellHasFocus);
+
+        FLyrVect selectedLayer = (FLyrVect) value;
+
+        if (selectedLayer != null) {
+            if (isSelected) {
+                setBackground(Color.LIGHT_GRAY);
+                setForeground(Color.BLACK);
+            } else {
+                setBackground(Color.WHITE);
+                setForeground(Color.BLACK);
+            }
+
+            // Set icon
+            String iconName = selectedLayer.getTocImageIcon();
+            ImageIcon moveUpIcon =
+                ToolsSwingLocator.getIconThemeManager().getCurrent()
+                    .get(iconName);
+            setIcon(moveUpIcon);
+
+            // Set name and icon
+            String layerName = selectedLayer.getName();
+
+            setText(layerName);
+            setFont(list.getFont());
+        } else {
+            setText("");
+            setIcon(null);
+        }
+        return this;
+    }
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/LayerAndProcessSelectionPanelView.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/LayerAndProcessSelectionPanelView.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/LayerAndProcessSelectionPanelView.java	(revision 831)
@@ -0,0 +1,396 @@
+/* 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.derivedgeometries.swing.impl.views;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.utils.swing.JComboBox;
+
+public class LayerAndProcessSelectionPanelView extends JPanel {
+
+    private static final long serialVersionUID = 5814562877542407537L;
+
+    private I18nManager i18nManager = ToolsLocator.getI18nManager();
+
+    private JPanel sourceLayerPanel;
+
+    private JPanel layersPanel;
+
+    private JPanel optionsPanel;
+
+    private JPanel outputProcessPanel;
+
+    private JPanel outputLayerNamePanel;
+
+    private JPanel outputPathPanel;
+
+    private JPanel outputLayerTypePanel;
+
+    private JComboBox layersComboBox;
+
+    private JComboBox outputProcessCombo;
+
+    private JComboBox outputShapeTypeCombo;
+
+    private JLabel layersLabel;
+
+    private JLabel outputProcessLabel;
+
+    private JLabel labelName;
+
+    private JLabel labelPath;
+
+    private JLabel outputShapeTypeLabel;
+
+    private JTextField outputLayerPath;
+
+    private JTextField outputLayerName;
+
+    private JButton selectPathButton;
+
+    public LayerAndProcessSelectionPanelView() {
+        initilize();
+        doLayout();
+        setVisible(true);
+
+        setPreferredSize(new Dimension(500, 360));
+    }
+
+    private GridBagConstraints getConstraintsForCombo() {
+        GridBagConstraints constraints;
+        constraints = new GridBagConstraints();
+        constraints.gridx = GridBagConstraints.RELATIVE;
+        constraints.gridy = 0;
+        constraints.gridwidth = GridBagConstraints.REMAINDER;
+        constraints.gridheight = 1;
+        constraints.weightx = 1;
+        constraints.anchor = GridBagConstraints.CENTER;
+        constraints.fill = GridBagConstraints.HORIZONTAL;
+        constraints.insets = new Insets(4, 4, 4, 4);
+        return constraints;
+    }
+
+    private GridBagConstraints getConstraintsForLabel() {
+        GridBagConstraints constraints = new GridBagConstraints();
+        constraints.gridx = GridBagConstraints.RELATIVE;
+        constraints.gridy = 0;
+        constraints.gridwidth = 1;
+        constraints.gridheight = 1;
+        constraints.anchor = GridBagConstraints.WEST;
+        constraints.fill = GridBagConstraints.NONE;
+        constraints.insets = new Insets(4, 4, 4, 4);
+        return constraints;
+    }
+
+    private GridBagConstraints getContraintsForTextField() {
+        GridBagConstraints constraints = new GridBagConstraints();
+        constraints.gridx = GridBagConstraints.RELATIVE;
+        constraints.gridy = 0;
+        constraints.gridwidth = 2;
+        constraints.gridheight = 1;
+        constraints.weightx = 1;
+        constraints.anchor = GridBagConstraints.CENTER;
+        constraints.fill = GridBagConstraints.HORIZONTAL;
+        constraints.insets = new Insets(4, 4, 4, 4);
+        return constraints;
+    }
+
+    protected JButton getJButtonSelectPath() {
+        if (selectPathButton == null) {
+            selectPathButton = new JButton();
+            selectPathButton.setToolTipText(i18nManager
+                .getTranslation("_select_path"));
+            selectPathButton.setText("...");
+        }
+        return selectPathButton;
+    }
+
+    private JLabel getLabelName() {
+        if (labelName == null) {
+            labelName = new JLabel(i18nManager.getTranslation("_name"));
+            labelName.setToolTipText(i18nManager.getTranslation("name"));
+        }
+
+        return labelName;
+    }
+
+    private JLabel getLabelPath() {
+        if (labelPath == null) {
+            labelPath = new JLabel(i18nManager.getTranslation("_path"));
+            labelPath.setToolTipText(i18nManager.getTranslation("_path"));
+        }
+
+        return labelPath;
+    }
+
+    @SuppressWarnings("unchecked")
+    protected JComboBox getLayersComboBox() {
+        if (layersComboBox == null) {
+            layersComboBox = new JComboBox();
+            layersComboBox.setRenderer(new SourceLayerComboBoxRenderer());
+        }
+        return layersComboBox;
+    }
+
+    private JLabel getLayersLabel() {
+        if (layersLabel == null) {
+            layersLabel = new JLabel(i18nManager.getTranslation("_layer"));
+        }
+
+        return layersLabel;
+    }
+
+    private JPanel getLayersPanel() {
+        if (layersPanel == null) {
+
+            layersPanel = new JPanel(new GridBagLayout());
+
+            GridBagConstraints constraints = getConstraintsForLabel();
+            layersPanel.add(getLayersLabel(), constraints);
+
+            constraints = getConstraintsForCombo();
+
+            layersPanel.add(getLayersComboBox(), constraints);
+        }
+
+        return layersPanel;
+    }
+
+    private JPanel getOptionsPanel() {
+        if (optionsPanel == null) {
+            optionsPanel = new JPanel();
+            optionsPanel.setBorder(BorderFactory.createTitledBorder(i18nManager
+                .getTranslation("_options")));
+            optionsPanel.setLayout(new GridBagLayout());
+
+            GridBagConstraints constraints = getConstraintsForLabel();
+            optionsPanel.add(getProcessLabel(), constraints);
+
+            constraints = getConstraintsForCombo();
+            optionsPanel.add(getProcessCombo(), constraints);
+        }
+
+        return optionsPanel;
+    }
+
+    protected JTextField getOutputLayerName() {
+        if (outputLayerName == null) {
+            outputLayerName = new JTextField();
+            outputLayerName.setEnabled(false);
+            outputLayerName.setBackground(Color.white);
+            outputLayerName.setToolTipText(i18nManager
+                .getTranslation("_output_layer_name"));
+        }
+
+        return outputLayerName;
+    }
+
+    private JPanel getOutputLayerNamePanel() {
+        if (outputLayerNamePanel == null) {
+            outputLayerNamePanel = new JPanel();
+            outputLayerNamePanel.setLayout(new GridBagLayout());
+
+            GridBagConstraints constraints = getConstraintsForLabel();
+            outputLayerNamePanel.add(getLabelName(), constraints);
+
+            constraints = getContraintsForTextField();
+            outputLayerNamePanel.add(getOutputLayerName(), constraints);
+        }
+
+        return outputLayerNamePanel;
+    }
+
+    protected JTextField getOutputLayerPath() {
+        if (outputLayerPath == null) {
+            outputLayerPath = new JTextField();
+            outputLayerPath.setEditable(false);
+            outputLayerPath.setBackground(Color.white);
+            outputLayerPath.setToolTipText(i18nManager
+                .getTranslation("_path_where_create_the_new_layer_files"));
+        }
+
+        return outputLayerPath;
+    }
+
+    private JPanel getOutputLayerTypePanel() {
+        if (outputLayerTypePanel == null) {
+            outputLayerTypePanel = new JPanel(new GridBagLayout());
+
+            GridBagConstraints constraints = getConstraintsForLabel();
+            outputLayerTypePanel.add(getOutputShapeTypeLabel(), constraints);
+
+            constraints = getConstraintsForCombo();
+            outputLayerTypePanel.add(getOutputShapeTypeCombo(), constraints);
+        }
+
+        return outputLayerTypePanel;
+    }
+
+    private JPanel getOutputPathPanel() {
+        if (outputPathPanel == null) {
+            outputPathPanel = new JPanel();
+            outputPathPanel.setLayout(new GridBagLayout());
+
+            GridBagConstraints constraints = getConstraintsForLabel();
+            outputPathPanel.add(getLabelPath(), constraints);
+
+            constraints = getContraintsForTextField();
+            outputPathPanel.add(getOutputLayerPath(), constraints);
+
+            constraints.gridwidth = 1;
+            constraints.weightx = 0;
+            constraints.fill = GridBagConstraints.NONE;
+            outputPathPanel.add(getJButtonSelectPath(), constraints);
+        }
+
+        return outputPathPanel;
+    }
+
+    private JPanel getOutputProcessPanel() {
+        if (outputProcessPanel == null) {
+            outputProcessPanel = new JPanel();
+            outputProcessPanel.setLayout(new GridBagLayout());
+            outputProcessPanel
+                .setBorder(BorderFactory.createTitledBorder(i18nManager
+                    .getTranslation("_output_layer")));
+
+            GridBagConstraints constraints = new GridBagConstraints();
+            constraints.gridx = 0;
+            constraints.gridy = GridBagConstraints.RELATIVE;
+            constraints.gridwidth = 1;
+            constraints.gridheight = 1;
+            constraints.weightx = 1;
+            constraints.weighty = 1;
+            constraints.anchor = GridBagConstraints.CENTER;
+            constraints.fill = GridBagConstraints.BOTH;
+            constraints.insets = new Insets(4, 4, 4, 4);
+
+            outputProcessPanel.add(getOutputLayerNamePanel(), constraints);
+            outputProcessPanel.add(getOutputPathPanel(), constraints);
+            outputProcessPanel.add(getOutputLayerTypePanel(), constraints);
+        }
+
+        return outputProcessPanel;
+    }
+
+    protected JComboBox getOutputShapeTypeCombo() {
+        if (outputShapeTypeCombo == null) {
+            outputShapeTypeCombo = new JComboBox();
+            outputShapeTypeCombo.setToolTipText(i18nManager
+                .getTranslation("_destination_layer_type"));
+        }
+
+        return outputShapeTypeCombo;
+    }
+
+    private JLabel getOutputShapeTypeLabel() {
+        if (outputShapeTypeLabel == null) {
+            outputShapeTypeLabel =
+                new JLabel(i18nManager.getTranslation("_type"));
+            outputShapeTypeLabel.setToolTipText(i18nManager
+                .getTranslation("_type"));
+        }
+
+        return outputShapeTypeLabel;
+    }
+
+    protected JComboBox getProcessCombo() {
+        if (outputProcessCombo == null) {
+            outputProcessCombo = new JComboBox();
+            outputProcessCombo.setToolTipText(i18nManager
+                .getTranslation("_process_type"));
+        }
+        return outputProcessCombo;
+    }
+
+    private JLabel getProcessLabel() {
+        if (outputProcessLabel == null) {
+            outputProcessLabel =
+                new JLabel(i18nManager.getTranslation("_process_type"));
+            outputProcessLabel.setToolTipText(i18nManager
+                .getTranslation("_process_type"));
+        }
+
+        return outputProcessLabel;
+    }
+
+    private JPanel getSourceLayerPanel() {
+        if (sourceLayerPanel == null) {
+            sourceLayerPanel = new JPanel();
+            sourceLayerPanel
+                .setBorder(BorderFactory.createTitledBorder(i18nManager
+                    .getTranslation("_source_layer")));
+            sourceLayerPanel.setLayout(new GridBagLayout());
+
+            GridBagConstraints constraints = new GridBagConstraints();
+            constraints.gridx = 0;
+            constraints.gridy = 0;
+            constraints.gridwidth = GridBagConstraints.REMAINDER;
+            constraints.gridheight = GridBagConstraints.REMAINDER;
+            constraints.weightx = 1;
+            constraints.weighty = 1;
+            constraints.anchor = GridBagConstraints.CENTER;
+            constraints.fill = GridBagConstraints.HORIZONTAL;
+
+            sourceLayerPanel.add(getLayersPanel(), constraints);
+        }
+
+        return sourceLayerPanel;
+    }
+
+    private void initilize() {
+
+        setLayout(new GridBagLayout());
+
+        GridBagConstraints constraints = new GridBagConstraints();
+        constraints.gridx = 0;
+        constraints.gridy = GridBagConstraints.RELATIVE;
+        constraints.gridwidth = 1;
+        constraints.gridheight = 1;
+        constraints.weightx = 1;
+        constraints.weighty = 1;
+        constraints.anchor = GridBagConstraints.CENTER;
+        constraints.fill = GridBagConstraints.BOTH;
+        constraints.insets = new Insets(4, 4, 4, 4);
+
+        add(getSourceLayerPanel(), constraints);
+        add(getOutputProcessPanel(), constraints);
+        add(getOptionsPanel(), constraints);
+
+        setPreferredSize(new Dimension(500, 360));
+
+        setVisible(true);
+    }
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/SelectedFeaturesTableModel.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/SelectedFeaturesTableModel.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/views/SelectedFeaturesTableModel.java	(revision 831)
@@ -0,0 +1,171 @@
+/* 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.derivedgeometries.swing.impl.views;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.swing.table.AbstractTableModel;
+
+import org.gvsig.derivedgeometries.swing.api.exceptions.FormatRowException;
+import org.gvsig.derivedgeometries.swing.api.exceptions.LoadSelectedFeatureDataException;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureReference;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+
+public class SelectedFeaturesTableModel extends AbstractTableModel {
+
+    private static final long serialVersionUID = -3905635376996886077L;
+
+    private List<String[]> data = null;
+
+    private String[] columnNames = null;
+
+    private int rowCount = 0;
+
+    private FeatureStore featureStore;
+
+    // Autoincrement variable
+    private int orderCount = 0;
+
+    public SelectedFeaturesTableModel() {
+        this.featureStore = null;
+    }
+
+    public SelectedFeaturesTableModel(FeatureStore theFeatureStore) {
+        this.featureStore = theFeatureStore;
+    }
+
+    public void loadData(List<FeatureReference> features)
+        throws LoadSelectedFeatureDataException {
+        clear();
+        List<String[]> tmpData = new ArrayList<String[]>();
+        Feature feature = null;
+        for (FeatureReference featureReference : features) {
+
+            try {
+                feature = featureReference.getFeature();
+                tmpData.add(formatRow(feature));
+            } catch (DataException e) {
+                String message =
+                    String.format("Error getting feature through %1 ",
+                        featureReference);
+                throw new LoadSelectedFeatureDataException(message, e);
+            } catch (FormatRowException e) {
+                String message =
+                    String.format("Error formatting data of %1", feature);
+                throw new LoadSelectedFeatureDataException(message, e);
+            }
+
+        }
+
+        data = Collections.unmodifiableList(tmpData);
+        rowCount = data.size();
+
+        try {
+            columnNames =
+                getColumnNamesFromType(featureStore.getDefaultFeatureType());
+        } catch (DataException e) {
+            String message = String.format("Error getting feature type of %1", featureStore);
+            throw new LoadSelectedFeatureDataException(message, e);
+        }
+
+        fireTableStructureChanged();
+    }
+
+    private String[] getColumnNamesFromType(FeatureType featureType) {
+        int count = featureType.size();
+        List<String> names = new ArrayList<String>();
+        I18nManager i18nManager = ToolsLocator.getI18nManager();
+        names.add(i18nManager.getTranslation("_Order"));
+        for (int i = 0; i < count; i++) {
+            names.add(featureType.getAttributeDescriptor(i).getName());
+        }
+        return names.toArray(new String[] {});
+    }
+
+    private String[] formatRow(Feature feature) throws FormatRowException {
+        FeatureType featureType;
+        try {
+            featureType = featureStore.getDefaultFeatureType();
+        } catch (DataException e) {
+            String message =
+                String.format("Error getting feature type of %1",
+                    featureStore.getName());
+            throw new FormatRowException(message, e);
+        }
+        int featureSize = featureType.size();
+        List<String> featureData = null;
+        if (featureSize > 0) {
+            featureData = new ArrayList<String>();
+
+            // Add Order data and autoincrement
+            featureData.add(String.valueOf(orderCount));
+            orderCount++;
+
+            for (int i = 0; i < featureSize; i++) {
+                featureData.add(String.valueOf(feature.get(i)));
+            }
+        }
+        return featureData.toArray(new String[] {});
+    }
+
+    public int getRowCount() {
+        return rowCount;
+    }
+
+    public int getColumnCount() {
+        if (columnNames == null) {
+            return 0;
+        }
+        return columnNames.length;
+    }
+
+    public Object getValueAt(int rowIndex, int columnIndex) {
+        if (data == null) {
+            return "";
+        }
+        return data.get(rowIndex)[columnIndex];
+    }
+
+    @Override
+    public String getColumnName(int column) {
+        if (columnNames == null) {
+            return null;
+        }
+        return columnNames[column];
+    }
+
+    public void clear() {
+        data = null;
+        columnNames = null;
+        rowCount = 0;
+        orderCount = 0;
+        fireTableDataChanged();
+    }
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/DefaultDerivedGeometriesParameters.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/DefaultDerivedGeometriesParameters.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/DefaultDerivedGeometriesParameters.java	(revision 831)
@@ -0,0 +1,145 @@
+/* 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.derivedgeometries.swing.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesParameters;
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesProcess.TYPE;
+import org.gvsig.fmap.dal.feature.FeatureReference;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.fmap.mapcontrol.MapControl;
+
+public class DefaultDerivedGeometriesParameters implements
+    DerivedGeometriesParameters {
+
+    private MapControl mapControl;
+    private FLyrVect sourceLayer;
+    private String outputLayerName;
+    private String outputLayerPath;
+    private int outputLayerType;
+    private TYPE processType;
+    private List<FeatureReference> selectedFeatures;
+    private boolean addLayer;
+    private boolean createNewFeatureStore;
+    private FeatureStore featureStore;
+
+    public DefaultDerivedGeometriesParameters() {
+
+    }
+
+    public DefaultDerivedGeometriesParameters(MapControl mapControl,
+        FLyrVect sourceLayer, String outputLayerName, String outputLayerPath,
+        int outputLayerType, TYPE processType) {
+
+        this.mapControl = mapControl;
+        this.sourceLayer = sourceLayer;
+        this.outputLayerName = outputLayerName;
+        this.outputLayerPath = outputLayerPath;
+        this.outputLayerType = outputLayerType;
+        this.processType = processType;
+        this.selectedFeatures = new ArrayList<FeatureReference>();
+        this.addLayer = true;
+        this.createNewFeatureStore = true;
+    }
+
+    public boolean getAddLayer() {
+        return this.addLayer;
+    }
+
+    public boolean getCreateNewFeatureStore() {
+        return this.createNewFeatureStore;
+    }
+
+    public FeatureStore getFeatureStore() {
+        return this.featureStore;
+    }
+
+    public MapControl getMapControl() {
+        return this.mapControl;
+    }
+
+    public String getOutPutLayerName() {
+        return this.outputLayerName;
+    }
+
+    public String getOutPutLayerPath() {
+        return this.outputLayerPath;
+    }
+
+    public int getOutPutLayerType() {
+        return this.outputLayerType;
+    }
+
+    public TYPE getProcessType() {
+        return this.processType;
+    }
+
+    public List<FeatureReference> getSelectedFeatures() {
+        return selectedFeatures;
+    }
+
+    public FLyrVect getSourceLayer() {
+        return this.sourceLayer;
+    }
+
+    public void setAddLayer(boolean flag) {
+        this.addLayer = flag;
+    }
+
+    public void setCreateNewFeatureStore(boolean createNewFeatureStore) {
+        this.createNewFeatureStore = createNewFeatureStore;
+    }
+
+    public void setFeatureStore(FeatureStore featureStore) {
+        this.featureStore = featureStore;
+    }
+
+    public void setOutPutLayerName(String theName) {
+        this.outputLayerName = theName;
+    }
+
+    public void setOutPutLayerPath(String thePath) {
+        this.outputLayerPath = thePath;
+    }
+
+    public void setOutPutLayerType(int theType) {
+        this.outputLayerType = theType;
+    }
+
+    public void setProcessType(TYPE theProcessType) {
+        this.processType = theProcessType;
+    }
+
+    public void setSelectedFeatures(List<FeatureReference> selectedFeatures) {
+        this.selectedFeatures.clear();
+        this.selectedFeatures.addAll(selectedFeatures);
+    }
+
+    public void setSourceLayer(FLyrVect theSourceLayer) {
+        this.sourceLayer = theSourceLayer;
+    }
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/DefaultDerivedGeometriesLibrary.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/DefaultDerivedGeometriesLibrary.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/DefaultDerivedGeometriesLibrary.java	(revision 831)
@@ -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.derivedgeometries.swing.impl;
+
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesLibrary;
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesLocator;
+import org.gvsig.fmap.dal.DALLibrary;
+import org.gvsig.fmap.geom.GeometryLibrary;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+
+/**
+ * Library for default swing implementation initialization and configuration.
+ *
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class DefaultDerivedGeometriesLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsImplementationOf(DerivedGeometriesLibrary.class);
+        require(DALLibrary.class);
+        require(GeometryLibrary.class);
+    }
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+        DerivedGeometriesLocator
+            .registerManager(DefaultDerivedGeometriesManager.class);
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        // Do nothing
+    }
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/panels/DefaultLayerAndProcessSelectionPanel.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/panels/DefaultLayerAndProcessSelectionPanel.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/panels/DefaultLayerAndProcessSelectionPanel.java	(revision 831)
@@ -0,0 +1,445 @@
+/* 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.derivedgeometries.swing.impl.panels;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.util.Vector;
+
+import javax.swing.JComponent;
+import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
+
+import org.apache.commons.io.FilenameUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesLocator;
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesParameters;
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesProcess.TYPE;
+import org.gvsig.derivedgeometries.swing.api.exceptions.ValidateSourceLayerException;
+import org.gvsig.derivedgeometries.swing.api.panels.LayerAndProcessSelectionPanel;
+import org.gvsig.derivedgeometries.swing.impl.views.LayerAndProcessSelectionPanelView;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataServerExplorer;
+import org.gvsig.fmap.dal.DataServerExplorerParameters;
+import org.gvsig.fmap.dal.DataStoreParameters;
+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.Geometry.TYPES;
+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.LayerPositionEvent;
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
+import org.gvsig.utils.GenericFileFilter;
+
+public class DefaultLayerAndProcessSelectionPanel extends
+    LayerAndProcessSelectionPanelView implements LayerAndProcessSelectionPanel {
+
+    private static final long serialVersionUID = 1032294236575442328L;
+
+    private static final Logger LOG = LoggerFactory
+        .getLogger(DefaultLayerAndProcessSelectionPanel.class);
+
+    private final String[] SHAPE_EXTENSIONS = { "shp", "SHP", "Shp", "sHp",
+        "SHp", "shP", "ShP", "sHP" };
+
+    private MapControl mapControl;
+
+    private DerivedGeometriesParameters parameters;
+
+    public DefaultLayerAndProcessSelectionPanel(MapControl mapControl) {
+        super();
+
+        this.mapControl = mapControl;
+
+        initSourceLayerCombo();
+        initProcessCombo();
+        initSelectPathButton();
+
+        addVectorialLayers();
+
+        initMapControlListeners();
+    }
+
+    @SuppressWarnings("unchecked")
+    private void addVectorialLayers() {
+        getLayersComboBox().removeAllItems();
+        FLayers flayers = mapControl.getMapContext().getLayers();
+        for (FLyrVect layer : getVectorialLayers(flayers)) {
+            getLayersComboBox().addItem(layer);
+        }
+    }
+
+    public JComponent asJComponent() {
+        return this;
+    }
+
+    public void closePanel() {
+        setVisible(false);
+    }
+
+    private void deleteShapeFiles(FLyrVect sourceLayer, String outputLayerPath) {
+        DataManager dataManager = DALLocator.getDataManager();
+
+        try {
+            DataServerExplorerParameters eparams =
+                dataManager
+                    .createServerExplorerParameters("FilesystemExplorer");
+            eparams.setDynValue("initialpath", "/data");
+
+            DataServerExplorer serverExplorer =
+                dataManager.openServerExplorer(eparams.getExplorerName(),
+                    eparams);
+
+            DataStoreParameters dataStoreParams =
+                dataManager.createStoreParameters("Shape");
+
+            dataStoreParams.setDynValue("shpfile", outputLayerPath);
+            dataStoreParams.setDynValue("CRS", sourceLayer.getProjection());
+            dataStoreParams.setDynValue("useNullGeometry", false);
+            dataStoreParams.validate();
+
+            serverExplorer.remove(dataStoreParams);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public void doAccept() {
+        FLyrVect sourceLayer = (FLyrVect) getLayersComboBox().getSelectedItem();
+        String outputLayerName = getOutputLayerName().getText();
+        String outputLayerPath = getOutputLayerPath().getText();
+        String type = (String) getOutputShapeTypeCombo().getSelectedItem();
+
+        File outputLayer = new File(outputLayerPath);
+        // If file exist, it will delete shape files to overwrite shape.
+        if (exist(outputLayer)) {
+            deleteShapeFiles(sourceLayer, outputLayerPath);
+        }
+
+        int outputLayerType = 0;
+        if (type.equalsIgnoreCase("Multicurve")) {
+            outputLayerType = TYPES.MULTICURVE;
+        } else if (type.equalsIgnoreCase("Surface")) {
+            outputLayerType = TYPES.SURFACE;
+        }
+
+        TYPE processType = (TYPE) getProcessCombo().getSelectedItem();
+
+        parameters =
+            DerivedGeometriesLocator.getManager()
+                .createDerivedGeometriesParameters(mapControl, sourceLayer,
+                    outputLayerName, outputLayerPath, outputLayerType,
+                    processType);
+    }
+
+    public void doCancel() {
+        closePanel();
+    }
+
+    public DerivedGeometriesParameters getParameters() {
+        return parameters;
+    }
+
+    private boolean exist(File file) {
+
+        String pathWithoutExtension =
+            FilenameUtils.removeExtension(file.getAbsolutePath());
+
+        for (int i = 0; i < SHAPE_EXTENSIONS.length; i++) {
+            String path = pathWithoutExtension + "." + SHAPE_EXTENSIONS[i];
+            File tmpFile = new File(path);
+            if (tmpFile.exists()) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    private Vector<FLyrVect> getVectorialLayers(FLayers flayers) {
+        Vector<FLyrVect> vectorialLayers = new Vector<FLyrVect>();
+        for (int i = 0; i < flayers.getLayersCount(); i++) {
+            if (flayers.getLayer(i) instanceof FLyrVect) {
+                vectorialLayers.add((FLyrVect) flayers.getLayer(i));
+
+            } else if (flayers.getLayer(i) instanceof FLayers) {
+                FLayers group = ((FLayers) flayers.getLayer(i));
+                vectorialLayers.addAll(getVectorialLayers(group));
+            }
+        }
+
+        return vectorialLayers;
+    }
+
+    private void initMapControlListeners() {
+
+        MapContext context = mapControl.getMapContext();
+        FLayers layers = context.getLayers();
+
+        layers.addLayerCollectionListener(new LayerCollectionListener() {
+
+            public void layerAdded(LayerCollectionEvent e) {
+                FLayer layer = e.getAffectedLayer();
+                if (layer instanceof FLyrVect) {
+                    getLayersComboBox().addItem(layer);
+                }
+            }
+
+            public void layerAdding(LayerCollectionEvent e)
+                throws CancelationException {
+            }
+
+            public void layerMoved(LayerPositionEvent e) {
+            }
+
+            public void layerMoving(LayerPositionEvent e)
+                throws CancelationException {
+            }
+
+            public void layerRemoved(LayerCollectionEvent e) {
+                FLayer layer = e.getAffectedLayer();
+                if (layer instanceof FLyrVect) {
+                    getLayersComboBox().removeItem(layer);
+                }
+            }
+
+            public void layerRemoving(LayerCollectionEvent e)
+                throws CancelationException {
+            }
+
+            public void visibilityChanged(LayerCollectionEvent e)
+                throws CancelationException {
+            }
+        });
+    }
+
+    private void initProcessCombo() {
+        getProcessCombo().addActionListener(new ActionListener() {
+
+            @SuppressWarnings("unchecked")
+            public void actionPerformed(ActionEvent e) {
+                // Update the other comboBox
+                TYPE processType = (TYPE) getProcessCombo().getSelectedItem();
+                if (processType != null) {
+                    switch (processType) {
+                    case POINTS_TO_LINE:
+                        getOutputShapeTypeCombo().removeAllItems();
+                        getOutputShapeTypeCombo().addItem("Multicurve");
+                        break;
+                    case POINTS_TO_POLYGON:
+                        getOutputShapeTypeCombo().removeAllItems();
+                        getOutputShapeTypeCombo().addItem("Surface");
+                        break;
+                    default:
+                        break;
+                    }
+                }
+            }
+        });
+    }
+
+    private void initSelectPathButton() {
+        getJButtonSelectPath().addActionListener(
+            new java.awt.event.ActionListener() {
+
+                public void actionPerformed(java.awt.event.ActionEvent e) {
+                    ThreadSafeDialogsManager dlgManager =
+                        ToolsSwingLocator.getThreadSafeDialogsManager();
+
+                    I18nManager i18nManager = ToolsLocator.getI18nManager();
+
+                    File[] files =
+                        dlgManager.showChooserDialog(
+                            i18nManager
+                                .getTranslation("shape_file"),
+                            JFileChooser.OPEN_DIALOG,
+                            JFileChooser.FILES_ONLY,
+                            false,
+                            new File(System.getProperty("user.home")),
+                            new GenericFileFilter(SHAPE_EXTENSIONS, i18nManager
+                                .getTranslation("shape_file") + " (*.shp)"),
+                            true);
+
+                    if (files == null) {
+                        return;
+                    }
+
+                    if (files.length == 1) {
+                        File file = files[0];
+
+                        String extension =
+                            FilenameUtils.getExtension(file.getAbsolutePath());
+
+                        if (extension == "") {
+                            StringBuilder stb = new StringBuilder();
+                            stb.append(file.getAbsolutePath());
+                            stb.append(".");
+                            stb.append(SHAPE_EXTENSIONS[0]);
+
+                            file = new File(stb.toString());
+                        }
+
+                        if (exist(file)) {
+
+                            String title =
+                                i18nManager
+                                    .getTranslation("_file_already_exist");
+                            String message =
+                                i18nManager
+                                    .getTranslation("_file_already_exist_override_it");
+
+                            int answer =
+                                dlgManager.confirmDialog(message, title,
+                                    JOptionPane.YES_NO_OPTION,
+                                    JOptionPane.INFORMATION_MESSAGE);
+
+                            if (answer == JOptionPane.YES_OPTION) {
+                                getOutputLayerPath().setText(
+                                    file.getAbsolutePath());
+                            } else {
+                                return;
+                            }
+
+                        } else {
+                            getOutputLayerPath()
+                                .setText(file.getAbsolutePath());
+                        }
+                    }
+                }
+            });
+    }
+
+    private void initSourceLayerCombo() {
+        getLayersComboBox().addActionListener(new ActionListener() {
+
+            @SuppressWarnings("unchecked")
+            public void actionPerformed(ActionEvent e) {
+
+                FLyrVect selectedLayer =
+                    (FLyrVect) getLayersComboBox().getSelectedItem();
+                GeometryType featureGeomType = null;
+
+                getOutputShapeTypeCombo().removeAllItems();
+                getProcessCombo().removeAllItems();
+
+                if (selectedLayer != null) {
+                    FeatureStore featureStore = selectedLayer.getFeatureStore();
+                    try {
+                        featureGeomType =
+                            featureStore.getDefaultFeatureType()
+                                .getDefaultGeometryAttribute().getGeomType();
+                    } catch (DataException ex) {
+                        String message =
+                            String.format("Error getting feature type of %1",
+                                featureStore);
+                        LOG.info(message, ex);
+                        return;
+                    }
+
+                    if (featureGeomType.isTypeOf(Geometry.TYPES.POINT)
+                        || featureGeomType.isTypeOf(Geometry.TYPES.MULTIPOINT)) {
+                        setSelectableComponentsEnabled(true);
+                        getOutputShapeTypeCombo().addItem("Multicurve");
+                        getProcessCombo().addItem(TYPE.POINTS_TO_LINE);
+                        getProcessCombo().addItem(TYPE.POINTS_TO_POLYGON);
+
+                    } else if (featureGeomType
+                        .isTypeOf(Geometry.TYPES.MULTICURVE)) {
+                        setSelectableComponentsEnabled(true);
+                        getOutputShapeTypeCombo().addItem("Surface");
+                        getProcessCombo()
+                            .addItem(TYPE.LINES_TO_CLOSED_POLYLINE);
+
+                    } else {
+                        setSelectableComponentsEnabled(false);
+                        getOutputLayerName().setText("");
+                        getOutputLayerPath().setText("");
+                    }
+                }
+            }
+        });
+    }
+
+    public void setMapControl(MapControl mapControl) {
+        this.mapControl = mapControl;
+    }
+
+    private void setSelectableComponentsEnabled(boolean b) {
+        getOutputLayerPath().setEnabled(b);
+        getOutputLayerName().setEnabled(b);
+        getOutputShapeTypeCombo().setEnabled(b);
+        getJButtonSelectPath().setEnabled(b);
+        getProcessCombo().setEnabled(b);
+    }
+
+    public boolean validateFields() {
+        FLyrVect sourceLayer = (FLyrVect) getLayersComboBox().getSelectedItem();
+        String outputLayerName = getOutputLayerName().getText();
+        String outputLayerPath = getOutputLayerPath().getText();
+
+        if (sourceLayer != null && outputLayerName.length() > 0
+            && outputLayerPath.length() > 0) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    public boolean validateSourceLayer() throws ValidateSourceLayerException {
+        FLyrVect sourceLayer = (FLyrVect) getLayersComboBox().getSelectedItem();
+        FeatureStore featureStore = sourceLayer.getFeatureStore();
+        GeometryType featureGeomType;
+        try {
+            featureGeomType =
+                featureStore.getDefaultFeatureType()
+                    .getDefaultGeometryAttribute().getGeomType();
+        } catch (DataException e) {
+            String message =
+                String.format(
+                    "Error validating %1. Can't get feature geometry type",
+                    sourceLayer);
+            throw new ValidateSourceLayerException(message, e);
+        }
+        if (featureGeomType.isTypeOf(Geometry.TYPES.POINT)
+            || featureGeomType.isTypeOf(Geometry.TYPES.MULTIPOINT)
+            || featureGeomType.isTypeOf(Geometry.TYPES.MULTICURVE)) {
+            return true;
+        }
+        return false;
+    }
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/panels/DefaultDerivedGeometriesPanel.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/panels/DefaultDerivedGeometriesPanel.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/panels/DefaultDerivedGeometriesPanel.java	(revision 831)
@@ -0,0 +1,194 @@
+/* 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.derivedgeometries.swing.impl.panels;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JComponent;
+import javax.swing.JOptionPane;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesParameters;
+import org.gvsig.derivedgeometries.swing.api.exceptions.DerivedGeometriesException;
+import org.gvsig.derivedgeometries.swing.api.exceptions.ValidateSourceLayerException;
+import org.gvsig.derivedgeometries.swing.api.panels.DerivedGeometriesPanel;
+import org.gvsig.derivedgeometries.swing.impl.views.DerivedGeometriesPanelView;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
+
+public class DefaultDerivedGeometriesPanel extends DerivedGeometriesPanelView
+    implements DerivedGeometriesPanel {
+
+    private static final long serialVersionUID = -2874430817496441084L;
+
+    private static final Logger LOG = LoggerFactory
+        .getLogger(DefaultDerivedGeometriesPanel.class);
+
+    public DefaultDerivedGeometriesPanel(MapControl theMapControl) {
+        super(theMapControl);
+
+        initNextButton();
+        initCancelButton();
+    }
+
+    public JComponent asJComponent() {
+        return this;
+    }
+
+    private void closeWindow() {
+        setVisible(false);
+    }
+
+    private void initCancelButton() {
+        getCancelButton().addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+
+                DerivedGeometriesParameters parameters = null;
+
+                if (getLayerAndProcessSelectionPanel().asJComponent()
+                    .isVisible()) {
+
+                    parameters =
+                        getLayerAndProcessSelectionPanel().getParameters();
+
+                } else if (getFeaturesControlPanel().asJComponent().isVisible()) {
+
+                    parameters = getFeaturesControlPanel().getParameters();
+                }
+                
+                if(parameters != null){
+                    FeatureStore featureStore = parameters.getFeatureStore();
+                    if (featureStore != null) {
+                        featureStore.dispose();
+                    }
+                }
+
+                closeWindow();
+            }
+        });
+    }
+
+    private void initNextButton() {
+        getNextButton().addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+
+                ThreadSafeDialogsManager dlgManager =
+                    ToolsSwingLocator.getThreadSafeDialogsManager();
+
+                if (getLayerAndProcessSelectionPanel().asJComponent()
+                    .isVisible()) {
+
+                    // If selected source layer is not valid shows a dialog and
+                    // finish method
+                    try {
+                        if (!validateSelectedSourceLayer()) {
+
+                            String title = "_no_valid_source_layer";
+                            String message = "_cant_process_this_type_of_layer";
+                            dlgManager.messageDialog(message, title,
+                                JOptionPane.ERROR_MESSAGE);
+                            return;
+
+                        }
+                    } catch (DerivedGeometriesException ex) {
+                        LOG.warn("Error validating source layer", ex);
+                        return;
+                    }
+
+                    if (validateLayerAndOutputLayerFields()) {
+
+                        getLayerAndProcessSelectionPanel().doAccept();
+
+                        DerivedGeometriesParameters parameters =
+                            getLayerAndProcessSelectionPanel().getParameters();
+
+                        getLayerAndProcessSelectionPanel().asJComponent()
+                            .setVisible(false);
+
+                        getFeaturesControlPanel().setParameters(parameters);
+                        getFeaturesControlPanel().asJComponent().setVisible(
+                            true);
+
+                        I18nManager i18nManager = ToolsLocator.getI18nManager();
+                        getCancelButton().setText(
+                            i18nManager.getTranslation("finish"));
+                        getNextButton().setText(
+                            i18nManager.getTranslation("generate"));
+
+                    } else {
+
+                        // If data fields is no valid shows a dialog and finish
+                        // method
+                        String title = "_no_valid_data";
+                        String message =
+                            "_no_valid_data_make_sure_data_are_valid";
+                        dlgManager.messageDialog(message, title,
+                            JOptionPane.ERROR_MESSAGE);
+                        return;
+
+                    }
+                } else if (getFeaturesControlPanel().asJComponent().isVisible()) {
+
+                    if (validateFeaturesControlPanelFields()) {
+
+                        getFeaturesControlPanel().doAction();
+
+                    } else {
+
+                        // If data fields is no valid shows a dialog and finish
+                        // method
+                        String title = "_no_valid_data";
+                        String message =
+                            "_no_valid_data_make_sure_data_are_valid";
+                        dlgManager.messageDialog(message, title,
+                            JOptionPane.ERROR_MESSAGE);
+                        return;
+
+                    }
+                }
+            }
+        });
+    }
+
+    private boolean validateLayerAndOutputLayerFields() {
+        return getLayerAndProcessSelectionPanel().validateFields();
+    }
+
+    private boolean validateFeaturesControlPanelFields() {
+        return getFeaturesControlPanel().validateFields();
+    }
+
+    private boolean validateSelectedSourceLayer()
+        throws ValidateSourceLayerException {
+        return getLayerAndProcessSelectionPanel().validateSourceLayer();
+    }
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/panels/DefaultFeaturesControlPanel.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/panels/DefaultFeaturesControlPanel.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/panels/DefaultFeaturesControlPanel.java	(revision 831)
@@ -0,0 +1,416 @@
+/* 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.derivedgeometries.swing.impl.panels;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JComponent;
+import javax.swing.JOptionPane;
+import javax.swing.ListSelectionModel;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesLocator;
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesManager;
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesParameters;
+import org.gvsig.derivedgeometries.swing.api.exceptions.DerivedGeometriesException;
+import org.gvsig.derivedgeometries.swing.api.exceptions.FetaureTableModelException;
+import org.gvsig.derivedgeometries.swing.api.panels.FeaturesControlPanel;
+import org.gvsig.derivedgeometries.swing.api.tablemodels.DerivedGeometriesSelectionModel;
+import org.gvsig.derivedgeometries.swing.impl.views.FeaturesControlPanelView;
+import org.gvsig.derivedgeometries.swing.impl.views.SelectedFeaturesTableModel;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureReference;
+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.aggregate.Aggregate;
+import org.gvsig.tools.dispose.DisposableIterator;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
+
+public class DefaultFeaturesControlPanel extends FeaturesControlPanelView
+    implements FeaturesControlPanel {
+
+    private static final long serialVersionUID = -2215258264697623544L;
+
+    private static final Logger LOG = LoggerFactory
+        .getLogger(DefaultFeaturesControlPanel.class);
+
+    private List<FeatureReference> features;
+
+    private DerivedGeometriesParameters parameters;
+
+    public DefaultFeaturesControlPanel() {
+        super();
+        features = new ArrayList<FeatureReference>();
+
+        initAddAllButton();
+        initRemoveAllButton();
+        initAddButton();
+        initRemoveButton();
+        initMoveUpButton();
+        initMoveDownButton();
+    }
+
+    public JComponent asJComponent() {
+        return this;
+    }
+
+    public void doAction() {
+        getParameters().setSelectedFeatures(features);
+
+        DerivedGeometriesManager manager =
+            DerivedGeometriesLocator.getManager();
+
+        manager.startDerivedGeometriesProcess(parameters);
+
+        getSelectedFeaturesTableModel().clear();
+        features.clear();
+    }
+
+    public DerivedGeometriesParameters getParameters() {
+        return this.parameters;
+    }
+
+    private int[] getSelectedIndexs() {
+        if (features == null || features.size() == 0) {
+            return new int[-1];
+        }
+        return getSelectedFeaturesTable().getSelectedRows();
+    }
+
+    private boolean hasMoreThanOneGeometry(Feature feature) {
+        Geometry geom = feature.getDefaultGeometry();
+        if (geom instanceof Aggregate) {
+            if (((Aggregate) geom).getPrimitivesNumber() > 1) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private void initAddAllButton() {
+        getAddAllButton().addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+
+                FeatureStore featureStore =
+                    getParameters().getSourceLayer().getFeatureStore();
+                final List<FeatureReference> tmpFeatures =
+                    new ArrayList<FeatureReference>();
+                boolean showWarningDialog = false;
+                DisposableIterator it = null;
+                FeatureSet featureSet = null;
+
+                try {
+                    featureSet = featureStore.getFeatureSet();
+                    it = featureSet.fastIterator();
+                } catch (DataException ex) {
+                    String message =
+                        String.format(
+                            "Error getting feature set or fast iterator of %1",
+                            featureStore);
+                    LOG.info(message, ex);
+                    return;
+                }
+
+                while (it.hasNext()) {
+                    Feature feature = (Feature) it.next();
+                    if (hasMoreThanOneGeometry(feature)
+                        || feature.getDefaultGeometry() == null) {
+                        showWarningDialog = true;
+                    } else {
+                        tmpFeatures.add(feature.getCopy().getReference());
+                    }
+
+                }
+
+                it.dispose();
+                featureSet.dispose();
+
+                if (showWarningDialog) {
+                    showWarningDialog();
+                }
+
+                features = tmpFeatures;
+
+                try {
+                    getSelectedFeaturesTableModel().loadData(features);
+                } catch (DerivedGeometriesException ex) {
+                    LOG.info("Error loading features", ex);
+                }
+
+            }
+        });
+    }
+
+    private void initAddButton() {
+        getAddButton().addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+                FeatureStore featureStore =
+                    getParameters().getSourceLayer().getFeatureStore();
+                boolean showWarningDialog = false;
+
+                DerivedGeometriesSelectionModel selectionModel = null;
+                try {
+                    selectionModel =
+                        (DerivedGeometriesSelectionModel) getAllFeaturesTable(
+                            featureStore).getSelectionModel();
+                } catch (FetaureTableModelException e1) {
+                    // TODO Auto-generated catch block
+                    e1.printStackTrace();
+                }
+
+                if (showWarningDialog) {
+                    showWarningDialog();
+                }
+
+                features.addAll(selectionModel.getSelectedFeatures());
+                selectionModel.getSelectedFeatures().clear();
+
+                try {
+                    getSelectedFeaturesTableModel().loadData(features);
+                } catch (DerivedGeometriesException ex) {
+                    LOG.info("Error loading features", ex);
+                }
+
+            }
+        });
+
+    }
+
+    private void initMoveDownButton() {
+        getMoveDownButton().addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+                int[] currIndexs = getSelectedIndexs();
+                // If selected is the last row, do nothing
+                if (currIndexs.length <= 0
+                    || currIndexs[currIndexs.length - 1] >= features.size() - 1) {
+                    return; // nothing to do
+                }
+
+                List<FeatureReference> selectedFeatures =
+                    new ArrayList<FeatureReference>();
+                for (int i = 0; i < currIndexs.length; i++) {
+                    FeatureReference selected = null;
+                    selected = features.get(currIndexs[i]);
+                    selectedFeatures.add(selected);
+                }
+                if (!selectedFeatures.isEmpty()) {
+                    features.removeAll(selectedFeatures);
+                    for (int i = 0; i < selectedFeatures.size(); i++) {
+                        FeatureReference selected = selectedFeatures.get(i);
+                        features.add(currIndexs[i] + 1, selected);
+                    }
+
+                    try {
+                        // Reload table
+                        getSelectedFeaturesTableModel().loadData(features);
+                    } catch (DerivedGeometriesException ex) {
+                        LOG.info("Error loading features", ex);
+                        return;
+                    }
+
+                    // Keeps rows selected. We have to add one due to
+                    // displacement.
+                    for (int i = 0; i < currIndexs.length; i++) {
+                        getSelectedFeaturesTable().addRowSelectionInterval(
+                            currIndexs[i] + 1, currIndexs[i] + 1);
+                    }
+                }
+            }
+        });
+
+    }
+
+    private void initMoveUpButton() {
+        getMoveUpButton().addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+                int[] currIndexs = getSelectedIndexs();
+                // If selected is the first row, do nothing
+                if (currIndexs.length <= 0 || currIndexs[0] == 0) {
+                    return;
+                }
+
+                List<FeatureReference> selectedFeatures =
+                    new ArrayList<FeatureReference>();
+                for (int i = 0; i < currIndexs.length; i++) {
+                    FeatureReference selected = null;
+                    try {
+                        selected =
+                            features.get(currIndexs[i]).getFeature()
+                                .getReference();
+                    } catch (DataException ex) {
+                        LOG.info("Error getting feature", ex);
+                        return;
+                    }
+                    selectedFeatures.add(selected);
+                }
+                if (!selectedFeatures.isEmpty()) {
+                    features.removeAll(selectedFeatures);
+                    for (int i = 0; i < selectedFeatures.size(); i++) {
+                        FeatureReference selected = selectedFeatures.get(i);
+                        features.add(currIndexs[i] - 1, selected);
+                    }
+
+                    // Reload table
+                    try {
+                        getSelectedFeaturesTableModel().loadData(features);
+                    } catch (DerivedGeometriesException ex) {
+                        LOG.info("Error loading features", ex);
+                        return;
+                    }
+
+                    // Keeps rows selected. We have to subtract one due to
+                    // displacement.
+                    for (int i = 0; i < currIndexs.length; i++) {
+                        getSelectedFeaturesTable().addRowSelectionInterval(
+                            currIndexs[i] - 1, currIndexs[i] - 1);
+                    }
+                }
+            }
+        });
+
+    }
+
+    private void initRemoveAllButton() {
+        getRemoveAllButton().addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+                if (!features.isEmpty()) {
+                    getSelectedFeaturesTableModel().clear();
+                    features.clear();
+                }
+            }
+        });
+
+    }
+
+    private void initRemoveButton() {
+        getRemoveButton().addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+                int[] selectedRows =
+                    getSelectedFeaturesTable().getSelectedRows();
+
+                for (int i = 0; i < selectedRows.length; i++) {
+                    features.remove(selectedRows[i]);
+                }
+
+                try {
+                    getSelectedFeaturesTableModel().loadData(features);
+                } catch (DerivedGeometriesException ex) {
+                    LOG.info("Error loading features", ex);
+                    return;
+                }
+            }
+        });
+
+    }
+
+    private void initSelectionListener() {
+        ListSelectionModel selectionModel =
+            getSelectedFeaturesTable().getSelectionModel();
+        selectionModel.addListSelectionListener(new ListSelectionListener() {
+
+            public void valueChanged(ListSelectionEvent e) {
+
+                FeatureStore featureStore =
+                    getParameters().getSourceLayer().getFeatureStore();
+                try {
+                    FeatureSelection selection =
+                        (FeatureSelection) featureStore.getSelection();
+                    selection.deselectAll();
+                    int[] selectedRows = getSelectedIndexs();
+                    for (int i = 0; i < selectedRows.length; i++) {
+                        selection.select(features.get(selectedRows[i]));
+                    }
+                } catch (DataException ex) {
+                    LOG.info("Error selecting features", ex);
+                    return;
+                }
+            }
+        });
+    }
+
+    private void refreshDataView(DerivedGeometriesParameters parameters) {
+
+        // Set information of summary panel
+        getSourceLayerNameTextField().setText(
+            parameters.getSourceLayer().getName());
+        getOutputLayerNameTextField().setText(parameters.getOutPutLayerName());
+
+        // Load features table
+        FeatureStore featureStore =
+            parameters.getSourceLayer().getFeatureStore();
+        try {
+            getAllFeaturesScrollPane().setViewportView(
+                getAllFeaturesTable(featureStore));
+        } catch (DerivedGeometriesException e) {
+            LOG.info("Error getting feature table", e);
+            return;
+        }
+
+        getSelectedFeaturesTable().setModel(
+            new SelectedFeaturesTableModel(featureStore));
+        getSelectedFeaturesScrollPane().setViewportView(
+            getSelectedFeaturesTable());
+
+    }
+
+    public void setParameters(DerivedGeometriesParameters theParameters) {
+        this.parameters = theParameters;
+
+        // Refresh view with new data
+        refreshDataView(parameters);
+
+        // Initialize selection listener. We do here because
+        // selectedFeaturesTable needs source layer feature store to be created
+        initSelectionListener();
+    }
+
+    private void showWarningDialog() {
+        String title = "_warning_adding_features";
+        String message =
+            "_warning_there_are_features_with_more_than_one_geometry_or_without_geometry";
+        ThreadSafeDialogsManager dlgManager =
+            ToolsSwingLocator.getThreadSafeDialogsManager();
+        dlgManager.messageDialog(message, title, JOptionPane.WARNING_MESSAGE);
+    }
+
+    public boolean validateFields() {
+        return !features.isEmpty();
+    }
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/DefaultDerivedGeometriesManager.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/DefaultDerivedGeometriesManager.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/DefaultDerivedGeometriesManager.java	(revision 831)
@@ -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.derivedgeometries.swing.impl;
+
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesManager;
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesParameters;
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesProcess;
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesProcess.TYPE;
+import org.gvsig.derivedgeometries.swing.api.panels.DerivedGeometriesPanel;
+import org.gvsig.derivedgeometries.swing.api.panels.FeaturesControlPanel;
+import org.gvsig.derivedgeometries.swing.api.panels.LayerAndProcessSelectionPanel;
+import org.gvsig.derivedgeometries.swing.impl.panels.DefaultDerivedGeometriesPanel;
+import org.gvsig.derivedgeometries.swing.impl.panels.DefaultFeaturesControlPanel;
+import org.gvsig.derivedgeometries.swing.impl.panels.DefaultLayerAndProcessSelectionPanel;
+import org.gvsig.derivedgeometries.swing.impl.processes.LineToClosedPolylineDerivedGeometriesProcess;
+import org.gvsig.derivedgeometries.swing.impl.processes.PointToLineDerivedGeometriesProcess;
+import org.gvsig.derivedgeometries.swing.impl.processes.PointToPolygonDerivedGeometriesProcess;
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.fmap.mapcontrol.MapControl;
+
+public class DefaultDerivedGeometriesManager implements
+    DerivedGeometriesManager {
+
+    public DerivedGeometriesParameters createDerivedGeometriesParameters(
+        MapControl mapControl, FLyrVect sourceLayer, String outputLayerName,
+        String outputLayerPath, int outputLayerType, TYPE processType) {
+
+        return new DefaultDerivedGeometriesParameters(mapControl, sourceLayer,
+            outputLayerName, outputLayerPath, outputLayerType, processType);
+    }
+
+    public DerivedGeometriesParameters createDerivedGeometriesParameters() {
+        return new DefaultDerivedGeometriesParameters();
+    }
+
+    public LayerAndProcessSelectionPanel getLayerAndProcessSelectionPanel(
+        MapControl mapControl) {
+        return new DefaultLayerAndProcessSelectionPanel(mapControl);
+    }
+
+    public FeaturesControlPanel getFeaturesControlPanel() {
+        return new DefaultFeaturesControlPanel();
+    }
+
+    public DerivedGeometriesPanel getDerivedGeometriesPanel(
+        MapControl mapControl) {
+        return new DefaultDerivedGeometriesPanel(mapControl);
+    }
+
+    public void startDerivedGeometriesProcess(
+        DerivedGeometriesParameters parameters) {
+        TYPE processType = parameters.getProcessType();
+        DerivedGeometriesProcess newProcess = null;
+
+        switch (processType) {
+        case POINTS_TO_LINE:
+            newProcess = new PointToLineDerivedGeometriesProcess(parameters);
+            break;
+        case POINTS_TO_POLYGON:
+            newProcess = new PointToPolygonDerivedGeometriesProcess(parameters);
+            break;
+        case LINES_TO_CLOSED_POLYLINE:
+            newProcess =
+                new LineToClosedPolylineDerivedGeometriesProcess(parameters);
+            break;
+        default:
+            break;
+        }
+
+        newProcess.start();
+
+    }
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/processes/PointToLineDerivedGeometriesProcess.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/processes/PointToLineDerivedGeometriesProcess.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/processes/PointToLineDerivedGeometriesProcess.java	(revision 831)
@@ -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.derivedgeometries.swing.impl.processes;
+
+import java.util.List;
+
+import javax.swing.JOptionPane;
+
+import org.cresques.cts.IProjection;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesParameters;
+import org.gvsig.derivedgeometries.swing.impl.AbstractDerivedGeometriesProcess;
+import org.gvsig.fmap.dal.feature.FeatureReference;
+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.GeometryManager;
+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.layers.vectorial.FLyrVect;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
+import org.gvsig.tools.task.SimpleTaskStatus;
+
+public class PointToLineDerivedGeometriesProcess extends
+    AbstractDerivedGeometriesProcess {
+
+    private static final Logger logger = LoggerFactory
+        .getLogger(PointToLineDerivedGeometriesProcess.class);
+
+    public PointToLineDerivedGeometriesProcess(
+        DerivedGeometriesParameters parameters) {
+        super("Point to line process", parameters);
+    }
+
+    public void run() {
+        SimpleTaskStatus status = null;
+
+        try {
+            status = (SimpleTaskStatus) this.getTaskStatus();
+
+            if (status.isCancellationRequested()) {
+
+                status.cancel();
+                return;
+            }
+
+            // Get data process
+            DerivedGeometriesParameters parameters = super.getParameters();
+            String outputLayerName = parameters.getOutPutLayerName();
+            String outputLayerPath = parameters.getOutPutLayerPath();
+            int outputLayerType = parameters.getOutPutLayerType();
+            boolean addLayer = parameters.getAddLayer();
+            boolean createNewFeatureStore =
+                parameters.getCreateNewFeatureStore();
+            FLyrVect sourceLayer = parameters.getSourceLayer();
+            IProjection projection = sourceLayer.getProjection();
+            FeatureType sourceFeatureType =
+                sourceLayer.getFeatureStore().getDefaultFeatureType();
+            List<FeatureReference> selectedFeatures =
+                parameters.getSelectedFeatures();
+
+            GeometryManager geomManager = GeometryLocator.getGeometryManager();
+            GeometryType sourceGeomType =
+                sourceLayer.getFeatureStore().getDefaultFeatureType()
+                    .getDefaultGeometryAttribute().getGeomType();
+            Line line = geomManager.createLine(sourceGeomType.getSubType());
+
+            status.setRangeOfValues(1, selectedFeatures.size());
+
+            // Iterate over features getting geometries to create polygon
+            for (int i = 0; i < selectedFeatures.size(); i++) {
+
+                // Si ha sido solicitada la cancelacion de la tarea
+                // la marcamos como cancelada y salimos del proceso.
+                if (status.isCancellationRequested()) {
+                    status.cancel();
+                    return;
+                }
+
+                // Informamos del progreso de la tarea
+                status.setCurValue(i);
+
+                FeatureReference featureReference = selectedFeatures.get(i);
+                Geometry geom =
+                    featureReference.getFeature().getDefaultGeometry();
+                line.addVertex((Point) geom);
+
+            }
+
+            if (status.isCancellationRequested()) {
+                status.cancel();
+
+                return;
+            }
+
+            if (createNewFeatureStore) {
+                // Creating new feature store
+                createNewFeatureStore(sourceFeatureType, outputLayerType,
+                    outputLayerPath, projection);
+
+                // Set createNewFeatureStore false to avoid create new feature
+                // if process is started again
+                parameters.setCreateNewFeatureStore(false);
+            }
+
+            // Open the new feature store
+            FeatureStore featureStore = parameters.getFeatureStore();
+            if (featureStore == null) {
+                featureStore = getFeatureStore(outputLayerPath, projection);
+            }
+
+            // Set feature store in edit mode
+            setEditingMode(featureStore);
+
+            // Add line
+            insertGeometryIntoFeauteStore(featureStore, line);
+
+            // Save changes and finish editing
+            endEditingMode(featureStore);
+
+            if (status.isCancellationRequested()) {
+                status.cancel();
+
+                return;
+            }
+
+            if (addLayer) {
+                // Dispose feature store to liberate resources
+                featureStore.dispose();
+
+                // Add layer to MapControl
+                featureStore =
+                    addLayerToMapContex(outputLayerName, outputLayerPath,
+                        projection);
+                parameters.setAddLayer(false);
+                parameters.setFeatureStore(featureStore);
+            }
+
+            this.postProcess();
+
+        } catch (Exception e) {
+            ThreadSafeDialogsManager dlgManager =
+                ToolsSwingLocator.getThreadSafeDialogsManager();
+
+            dlgManager.messageDialog("_process_error", "_error",
+                JOptionPane.ERROR_MESSAGE);
+
+            logger.info("Error in point to line process", e);
+            if (status != null) {
+                status.abort();
+            }
+
+        } finally {
+            if (status != null) {
+                // Mark process as terminate if it is running.
+                if (status.isRunning()) {
+                    status.terminate();
+                }
+            }
+        }
+    }
+
+    private void postProcess() {
+
+        ThreadSafeDialogsManager dlgManager =
+            ToolsSwingLocator.getThreadSafeDialogsManager();
+
+        String message = "_process_finished_successfully";
+        String title = "_information";
+        dlgManager.messageDialog(message, title,
+            JOptionPane.INFORMATION_MESSAGE);
+
+        // Repaint mapContext to view new derived geometries added.
+        getParameters().getMapControl().getMapContext().invalidate();
+    }
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/processes/PointToPolygonDerivedGeometriesProcess.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/processes/PointToPolygonDerivedGeometriesProcess.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/processes/PointToPolygonDerivedGeometriesProcess.java	(revision 831)
@@ -0,0 +1,212 @@
+/* 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.derivedgeometries.swing.impl.processes;
+
+import java.util.List;
+
+import javax.swing.JOptionPane;
+
+import org.cresques.cts.IProjection;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesParameters;
+import org.gvsig.derivedgeometries.swing.impl.AbstractDerivedGeometriesProcess;
+import org.gvsig.fmap.dal.feature.FeatureReference;
+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.GeometryManager;
+import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.geom.primitive.Polygon;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
+import org.gvsig.tools.task.SimpleTaskStatus;
+
+public class PointToPolygonDerivedGeometriesProcess extends
+    AbstractDerivedGeometriesProcess {
+
+    private static final Logger logger = LoggerFactory
+        .getLogger(PointToPolygonDerivedGeometriesProcess.class);
+
+    public PointToPolygonDerivedGeometriesProcess(
+        DerivedGeometriesParameters parameters) {
+        super("Point to polygon process", parameters);
+    }
+
+    public void run() {
+        SimpleTaskStatus status = null;
+
+        try {
+            status = (SimpleTaskStatus) this.getTaskStatus();
+
+            if (status.isCancellationRequested()) {
+
+                status.cancel();
+                return;
+            }
+
+            // Get data process
+            DerivedGeometriesParameters parameters = super.getParameters();
+            String outputLayerName = parameters.getOutPutLayerName();
+            String outputLayerPath = parameters.getOutPutLayerPath();
+            int outputLayerType = parameters.getOutPutLayerType();
+            boolean addLayer = parameters.getAddLayer();
+            boolean createNewFeatureStore =
+                parameters.getCreateNewFeatureStore();
+            FLyrVect sourceLayer = parameters.getSourceLayer();
+            IProjection projection = sourceLayer.getProjection();
+            FeatureType sourceFeatureType =
+                sourceLayer.getFeatureStore().getDefaultFeatureType();
+            List<FeatureReference> selectedFeatures =
+                parameters.getSelectedFeatures();
+
+            GeometryManager geomManager = GeometryLocator.getGeometryManager();
+            GeometryType sourceGeomType =
+                sourceLayer.getFeatureStore().getDefaultFeatureType()
+                    .getDefaultGeometryAttribute().getGeomType();
+            Polygon polygon =
+                geomManager.createPolygon(sourceGeomType.getSubType());
+            Point vertexAnt = null;
+
+            status.setRangeOfValues(1, selectedFeatures.size());
+
+            // Iterate over features getting geometries to create polygon
+            for (int i = 0; i < selectedFeatures.size(); i++) {
+
+                // Si ha sido solicitada la cancelacion de la tarea
+                // la marcamos como cancelada y salimos del proceso.
+                if (status.isCancellationRequested()) {
+
+                    status.cancel();
+                    return;
+                }
+
+                // Informamos del progreso de la tarea
+                status.setCurValue(i);
+
+                FeatureReference featureReference = selectedFeatures.get(i);
+                Geometry point =
+                    featureReference.getFeature().getDefaultGeometry();
+
+                if (vertexAnt == null || !vertexAnt.equals(point)) {
+                    polygon.addVertex((Point) point);
+                    vertexAnt = (Point) point;
+
+                }
+
+            }
+
+            // Close polygon if it is necessary
+            closeSurfaceIfNecessary(polygon);
+
+            if (status.isCancellationRequested()) {
+                status.cancel();
+
+                return;
+            }
+
+            if (createNewFeatureStore) {
+                // Creating new feature store
+                createNewFeatureStore(sourceFeatureType, outputLayerType,
+                    outputLayerPath, projection);
+
+                // Set createNewFeatureStore false to avoid create new feature
+                // if process is started again
+                parameters.setCreateNewFeatureStore(false);
+            }
+
+            // Open the new feature store
+            FeatureStore featureStore = parameters.getFeatureStore();
+            if (featureStore == null) {
+                featureStore = getFeatureStore(outputLayerPath, projection);
+            }
+
+            // Set feature store in edit mode
+            setEditingMode(featureStore);
+
+            // Add line
+            insertGeometryIntoFeauteStore(featureStore, polygon);
+
+            // Save changes and finish editing
+            endEditingMode(featureStore);
+
+            if (status.isCancellationRequested()) {
+                status.cancel();
+
+                return;
+            }
+
+            if (addLayer) {
+                // Dispose feature store to liberate resources
+                featureStore.dispose();
+
+                // Add layer to MapControl
+                featureStore =
+                    addLayerToMapContex(outputLayerName, outputLayerPath,
+                        projection);
+                parameters.setAddLayer(false);
+                parameters.setFeatureStore(featureStore);
+            }
+
+            this.postProcess();
+
+        } catch (Exception e) {
+            ThreadSafeDialogsManager dlgManager =
+                ToolsSwingLocator.getThreadSafeDialogsManager();
+
+            dlgManager.messageDialog("_process_error", "_error",
+                JOptionPane.ERROR_MESSAGE);
+
+            logger.info("Error in point to polygon process", e);
+            if (status != null) {
+                status.abort();
+            }
+
+        } finally {
+            if (status != null) {
+                // Mark process as terminate if it is running.
+                if (status.isRunning()) {
+                    status.terminate();
+                }
+            }
+        }
+    }
+
+    private void postProcess() {
+
+        ThreadSafeDialogsManager dlgManager =
+            ToolsSwingLocator.getThreadSafeDialogsManager();
+
+        String message = "_process_finished_successfully";
+        String title = "_information";
+        dlgManager.messageDialog(message, title,
+            JOptionPane.INFORMATION_MESSAGE);
+
+        // Repaint mapContext to view new derived geometries added.
+        getParameters().getMapControl().getMapContext().invalidate();
+    }
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/processes/LineToClosedPolylineDerivedGeometriesProcess.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/processes/LineToClosedPolylineDerivedGeometriesProcess.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/processes/LineToClosedPolylineDerivedGeometriesProcess.java	(revision 831)
@@ -0,0 +1,217 @@
+/* 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.derivedgeometries.swing.impl.processes;
+
+import java.util.List;
+
+import javax.swing.JOptionPane;
+
+import org.cresques.cts.IProjection;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesParameters;
+import org.gvsig.derivedgeometries.swing.impl.AbstractDerivedGeometriesProcess;
+import org.gvsig.fmap.dal.feature.FeatureReference;
+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.GeometryManager;
+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.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.tools.swing.api.ToolsSwingLocator;
+import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
+import org.gvsig.tools.task.SimpleTaskStatus;
+
+public class LineToClosedPolylineDerivedGeometriesProcess extends
+    AbstractDerivedGeometriesProcess {
+
+    private static final Logger logger = LoggerFactory
+        .getLogger(LineToClosedPolylineDerivedGeometriesProcess.class);
+
+    public LineToClosedPolylineDerivedGeometriesProcess(
+        DerivedGeometriesParameters parameters) {
+        super("Line to polyline process", parameters);
+    }
+
+    public void run() {
+        SimpleTaskStatus status = null;
+
+        try {
+            status = (SimpleTaskStatus) this.getTaskStatus();
+
+            if (status.isCancellationRequested()) {
+
+                status.cancel();
+                return;
+            }
+
+            // Get data process
+            DerivedGeometriesParameters parameters = super.getParameters();
+            String outputLayerName = parameters.getOutPutLayerName();
+            String outputLayerPath = parameters.getOutPutLayerPath();
+            int outputLayerType = parameters.getOutPutLayerType();
+            boolean addLayer = parameters.getAddLayer();
+            boolean createNewFeatureStore =
+                parameters.getCreateNewFeatureStore();
+            FLyrVect sourceLayer = parameters.getSourceLayer();
+            IProjection projection = sourceLayer.getProjection();
+            FeatureType sourceFeatureType =
+                sourceLayer.getFeatureStore().getDefaultFeatureType();
+            List<FeatureReference> selectedFeatures =
+                parameters.getSelectedFeatures();
+
+            GeometryManager geomManager = GeometryLocator.getGeometryManager();
+            GeometryType sourceGeomType =
+                sourceLayer.getFeatureStore().getDefaultFeatureType()
+                    .getDefaultGeometryAttribute().getGeomType();
+            Polygon polygon =
+                geomManager.createPolygon(sourceGeomType.getSubType());
+            Point vertexAnt = null;
+
+            status.setRangeOfValues(1, selectedFeatures.size());
+
+            // Iterate over features getting geometries to create polygon
+            for (int i = 0; i < selectedFeatures.size(); i++) {
+
+                // Si ha sido solicitada la cancelacion de la tarea
+                // la marcamos como cancelada y salimos del proceso.
+                if (status.isCancellationRequested()) {
+
+                    status.cancel();
+                    return;
+                }
+
+                // Informamos del progreso de la tarea
+                status.setCurValue(i);
+
+                FeatureReference featureReference = selectedFeatures.get(i);
+                Geometry geom =
+                    featureReference.getFeature().getDefaultGeometry();
+                for (int j = 0; j < ((Curve) geom).getNumVertices(); j++) {
+                    Point point = ((Curve) geom).getVertex(j);
+
+                    if (vertexAnt == null || !vertexAnt.equals(point)) {
+                        polygon.addVertex(point);
+                        vertexAnt = point;
+                    }
+
+                }
+
+            }
+
+            // Close polygon if it is necessary
+            closeSurfaceIfNecessary(polygon);
+
+            if (status.isCancellationRequested()) {
+                status.cancel();
+
+                return;
+            }
+
+            if (createNewFeatureStore) {
+                // Creating new feature store
+                createNewFeatureStore(sourceFeatureType, outputLayerType,
+                    outputLayerPath, projection);
+
+                // Set createNewFeatureStore false to avoid create new feature
+                // if process is started again
+                parameters.setCreateNewFeatureStore(false);
+            }
+
+            // Open the new feature store
+            FeatureStore featureStore = parameters.getFeatureStore();
+            if (featureStore == null) {
+                featureStore = getFeatureStore(outputLayerPath, projection);
+            }
+
+            // Set feature store in edit mode
+            setEditingMode(featureStore);
+
+            // Add line
+            insertGeometryIntoFeauteStore(featureStore, polygon);
+
+            // Save changes and finish editing
+            endEditingMode(featureStore);
+
+            if (status.isCancellationRequested()) {
+                status.cancel();
+
+                return;
+            }
+
+            if (addLayer) {
+                // Dispose feature store to liberate resources
+                featureStore.dispose();
+
+                // Add layer to MapControl
+                featureStore =
+                    addLayerToMapContex(outputLayerName, outputLayerPath,
+                        projection);
+                parameters.setAddLayer(false);
+                parameters.setFeatureStore(featureStore);
+            }
+
+            this.postProcess();
+
+        } catch (Exception e) {
+            ThreadSafeDialogsManager dlgManager =
+                ToolsSwingLocator.getThreadSafeDialogsManager();
+
+            dlgManager.messageDialog("_process_error", "_error",
+                JOptionPane.ERROR_MESSAGE);
+
+            logger.info("Error in line to closed process", e);
+            if (status != null) {
+                status.abort();
+            }
+
+        } finally {
+            if (status != null) {
+                // Mark process as terminate if it is running.
+                if (status.isRunning()) {
+                    status.terminate();
+                }
+            }
+        }
+    }
+
+    private void postProcess() {
+
+        ThreadSafeDialogsManager dlgManager =
+            ToolsSwingLocator.getThreadSafeDialogsManager();
+
+        String message = "_process_finished_successfully";
+        String title = "_information";
+        dlgManager.messageDialog(message, title,
+            JOptionPane.INFORMATION_MESSAGE);
+
+        // Repaint mapContext to view new derived geometries added.
+        getParameters().getMapControl().getMapContext().invalidate();
+    }
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/AbstractDerivedGeometriesProcess.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/AbstractDerivedGeometriesProcess.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/java/org/gvsig/derivedgeometries/swing/impl/AbstractDerivedGeometriesProcess.java	(revision 831)
@@ -0,0 +1,266 @@
+/* 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.derivedgeometries.swing.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.cresques.cts.IProjection;
+
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesParameters;
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesProcess;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataServerExplorer;
+import org.gvsig.fmap.dal.DataServerExplorerParameters;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.EditingNotification;
+import org.gvsig.fmap.dal.EditingNotificationManager;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor;
+import org.gvsig.fmap.dal.feature.EditableFeatureType;
+import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
+import org.gvsig.fmap.dal.feature.FeatureReference;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
+import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters;
+import org.gvsig.fmap.dal.swing.DALSwingLocator;
+import org.gvsig.fmap.geom.DataTypes;
+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.primitive.Surface;
+import org.gvsig.fmap.geom.type.GeometryType;
+import org.gvsig.fmap.mapcontext.MapContextLocator;
+import org.gvsig.fmap.mapcontext.MapContextManager;
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.fmap.mapcontrol.MapControlLocator;
+import org.gvsig.tools.task.AbstractMonitorableTask;
+
+public abstract class AbstractDerivedGeometriesProcess extends
+    AbstractMonitorableTask implements DerivedGeometriesProcess {
+
+    private DerivedGeometriesParameters parameters;
+
+    public AbstractDerivedGeometriesProcess(String name,
+        DerivedGeometriesParameters parameters) {
+        super(name);
+        this.parameters = parameters;
+    }
+
+    protected FeatureStore addLayerToMapContex(String name, String path,
+        IProjection projection) throws Exception {
+        DataManager dataManager = DALLocator.getDataManager();
+        MapContextManager mapContextManager =
+            MapContextLocator.getMapContextManager();
+        DataStoreParameters dataStoreParams =
+            dataManager.createStoreParameters("Shape");
+        dataStoreParams.setDynValue("shpfile", path);
+        dataStoreParams.setDynValue("CRS", projection);
+        dataStoreParams.setDynValue("useNullGeometry", false);
+        dataStoreParams.validate();
+
+        FLyrVect newLayer =
+            (FLyrVect) mapContextManager.createLayer(name, dataStoreParams);
+        getParameters().getMapControl().getMapContext().getLayers()
+            .addLayer(newLayer);
+
+        return newLayer.getFeatureStore();
+    }
+
+    protected Surface closeSurfaceIfNecessary(Surface surface) {
+        if (!isClosed(surface) && surface != null) {
+            Point firstp = surface.getVertex(0);
+            firstp = (Point) firstp.cloneGeometry();
+            surface.addVertex(firstp);
+        }
+        return surface;
+    }
+
+    protected void createNewFeatureStore(FeatureType sourceFeatureType,
+        int outputLayerType, String outputLayerPath, IProjection projection)
+        throws Exception {
+
+        DataManager dataManager = DALLocator.getDataManager();
+        DataServerExplorerParameters eparams =
+            dataManager.createServerExplorerParameters("FilesystemExplorer");
+        eparams.setDynValue("initialpath", "/data");
+        DataServerExplorer serverExplorer =
+            dataManager.openServerExplorer(eparams.getExplorerName(), eparams);
+
+        NewFeatureStoreParameters sparams =
+            (NewFeatureStoreParameters) serverExplorer
+                .getAddParameters("Shape");
+
+        EditableFeatureType newEditableFeatureType =
+            (EditableFeatureType) sparams.getDefaultFeatureType();
+
+        // Iterate over feature type. Don't add geometry fields.
+        for (int i = 0; i < sourceFeatureType.size(); i++) {
+            String fieldName =
+                sourceFeatureType.getAttributeDescriptor(i).getName();
+            int fieldType =
+                sourceFeatureType.getAttributeDescriptor(i).getType();
+            if (fieldType != DataTypes.GEOMETRY) {
+                newEditableFeatureType.add(fieldName, fieldType);
+            }
+        }
+
+        // Add new geometry field with new geometry type
+        FeatureAttributeDescriptor geometryAttribute =
+            (FeatureAttributeDescriptor) sourceFeatureType
+                .get(sourceFeatureType.getDefaultGeometryAttributeName());
+        EditableFeatureAttributeDescriptor newGeometryAttribute =
+            newEditableFeatureType.add(geometryAttribute.getName(),
+                geometryAttribute.getType(), geometryAttribute.getSize());
+
+        GeometryManager geoManager = GeometryLocator.getGeometryManager();
+        GeometryType sourceLayerGeomType =
+            sourceFeatureType.getDefaultGeometryAttribute().getGeomType();
+        GeometryType outputLayerGeomType =
+            geoManager.getGeometryType(outputLayerType,
+                sourceLayerGeomType.getSubType());
+
+        newGeometryAttribute.setGeometryType(outputLayerGeomType);
+        newGeometryAttribute.setPrecision(geometryAttribute.getPrecision());
+        newGeometryAttribute.setDefaultValue(geometryAttribute
+            .getDefaultValue());
+
+        newEditableFeatureType
+            .setDefaultGeometryAttributeName(geometryAttribute.getName());
+
+        sparams.setDynValue("geometryType", null);
+        sparams.setDynValue("shpfile", outputLayerPath);
+        sparams.setDynValue("CRS", projection);
+        sparams.setDynValue("useNullGeometry", false);
+        sparams.setDefaultFeatureType(newEditableFeatureType);
+        sparams.validate();
+
+        serverExplorer.add("Shape", sparams, true);
+    }
+
+    protected void endEditingMode(FeatureStore featureStore) throws Exception {
+
+        EditingNotificationManager editingNotificationManager =
+            DALSwingLocator.getEditingNotificationManager();
+
+        EditingNotification notification =
+            editingNotificationManager.notifyObservers(this,
+                EditingNotification.BEFORE_EXIT_EDITING_STORE, null,
+                featureStore);
+
+        if (notification.isCanceled()) {
+            String message =
+                String.format(
+                    "FinishEditing of %1 has been canceled by some observer",
+                    featureStore.getName());
+            throw new InterruptedException(message);
+        }
+
+        getParameters().getMapControl().getCanceldraw().setCanceled(true);
+
+        featureStore.finishEditing();
+        featureStore.deleteObserver(parameters.getMapControl());
+
+        editingNotificationManager.notifyObservers(this,
+            EditingNotification.AFTER_EXIT_EDITING_STORE, null, featureStore);
+    }
+
+    protected FeatureStore getFeatureStore(String outputLayerPath,
+        IProjection projection) throws Exception {
+
+        DataManager dataManager = DALLocator.getDataManager();
+        DataStoreParameters dataStoreParams =
+            dataManager.createStoreParameters("Shape");
+        dataStoreParams.setDynValue("shpfile", outputLayerPath);
+        dataStoreParams.setDynValue("CRS", projection);
+        dataStoreParams.setDynValue("useNullGeometry", false);
+        dataStoreParams.validate();
+
+        return (FeatureStore) dataManager.openStore("Shape", dataStoreParams);
+    }
+
+    protected List<Geometry> getGeometries(
+        List<FeatureReference> selectedFeatures) throws Exception {
+        List<Geometry> geometries = new ArrayList<Geometry>();
+        for (FeatureReference featureReference : selectedFeatures) {
+            Geometry geom = featureReference.getFeature().getDefaultGeometry();
+            geometries.add(geom);
+        }
+        return geometries;
+    }
+
+    public DerivedGeometriesParameters getParameters() {
+        return this.parameters;
+    }
+
+    protected void insertGeometryIntoFeauteStore(FeatureStore newFeatureStore,
+        Geometry geometry) throws Exception {
+        EditableFeature eFeature = newFeatureStore.createNewFeature(true);
+        eFeature.setGeometry(newFeatureStore.getDefaultFeatureType()
+            .getDefaultGeometryAttributeName(), geometry);
+        newFeatureStore.insert(eFeature);
+
+    }
+
+    private boolean isClosed(Surface surface) {
+
+        if (surface != null) {
+            Point firstPoint = surface.getVertex(0);
+            Point lastPoint = surface.getVertex(surface.getNumVertices() - 1);
+            if (firstPoint.equals(lastPoint)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    protected void setEditingMode(FeatureStore featureStore) throws Exception {
+        EditingNotificationManager editingNotificationManager =
+            DALSwingLocator.getEditingNotificationManager();
+
+        EditingNotification notification =
+            editingNotificationManager.notifyObservers(this,
+                EditingNotification.BEFORE_ENTER_EDITING_STORE, null,
+                featureStore);
+
+        if (notification.isCanceled()) {
+            String message =
+                String.format("Edit of %1 has been canceled by some observer",
+                    featureStore.getName());
+            throw new InterruptedException(message);
+        }
+
+        featureStore.edit();
+
+        featureStore.addObserver(parameters.getMapControl());
+
+        editingNotificationManager.notifyObservers(this,
+            EditingNotification.AFTER_ENTER_EDITING_STORE, null, featureStore);
+    }
+
+    public void setParameters(DerivedGeometriesParameters theParameters) {
+        this.parameters = theParameters;
+    }
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 831)
@@ -0,0 +1 @@
+org.gvsig.derivedgeometries.swing.impl.DefaultDerivedGeometriesLibrary
\ No newline at end of file
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/pom.xml
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/pom.xml	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.impl/pom.xml	(revision 831)
@@ -0,0 +1,51 @@
+<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.derivedgeometries.swing</artifactId>
+    <version>1.0.156</version>
+  </parent>
+  <artifactId>org.gvsig.derivedgeometries.swing.impl</artifactId>
+  <name>org.gvsig.derivedgeometries.swing.impl</name>
+  <dependencies>
+  	<dependency>
+  		<groupId>org.gvsig</groupId>
+  		<artifactId>org.gvsig.tools.swing.api</artifactId>
+  		<scope>compile</scope>
+  	</dependency>
+  	<dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>org.gvsig.tools.swing.impl</artifactId>
+        <scope>runtime</scope>
+    </dependency>
+  	<dependency>
+        <groupId>org.gvsig</groupId>
+        <artifactId>org.gvsig.derivedgeometries.swing.api</artifactId>
+    </dependency>
+  	<dependency>
+  		<groupId>org.gvsig</groupId>
+  		<artifactId>org.gvsig.fmap.dal.api</artifactId>
+  	</dependency>
+  	<dependency>
+  		<groupId>org.gvsig</groupId>
+  		<artifactId>org.gvsig.fmap.dal.swing.api</artifactId>
+  	</dependency>
+  	<dependency>
+  		<groupId>org.gvsig</groupId>
+  		<artifactId>org.gvsig.fmap.dal.file.shp</artifactId>
+  	</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.file.dbf</artifactId>
+  	</dependency>
+  	<dependency>
+  		<groupId>org.gvsig</groupId>
+  		<artifactId>org.gvsig.fmap.dal.file.lib</artifactId>
+  	</dependency>
+  </dependencies>
+</project>
\ No newline at end of file
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/pom.xml
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/pom.xml	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/pom.xml	(revision 831)
@@ -0,0 +1,24 @@
+<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.derivedgeometries.swing</artifactId>
+    <version>1.0.156</version>
+  </parent>
+  <artifactId>org.gvsig.derivedgeometries.swing.api</artifactId>
+  <name>org.gvsig.derivedgeometries.swing.api</name>
+  <dependencies>
+  	<dependency>
+  		<groupId>org.gvsig</groupId>
+  		<artifactId>org.gvsig.tools.lib</artifactId>
+  	</dependency>
+  	<dependency>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.fmap.dal.api</artifactId>
+    </dependency>
+  	<dependency>
+  		<groupId>org.gvsig</groupId>
+  		<artifactId>org.gvsig.fmap.control</artifactId>
+  	</dependency>
+  </dependencies>
+</project>
\ No newline at end of file
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 831)
@@ -0,0 +1 @@
+org.gvsig.derivedgeometries.swing.api.DerivedGeometriesLibrary
\ No newline at end of file
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/panels/LayerAndProcessSelectionPanel.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/panels/LayerAndProcessSelectionPanel.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/panels/LayerAndProcessSelectionPanel.java	(revision 831)
@@ -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.derivedgeometries.swing.api.panels;
+
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesParameters;
+import org.gvsig.derivedgeometries.swing.api.exceptions.ValidateSourceLayerException;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.tools.swing.api.Component;
+
+/**
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ *
+ */
+public interface LayerAndProcessSelectionPanel extends Component {
+
+    /**
+     * 
+     * @return
+     */
+    public DerivedGeometriesParameters getParameters();
+
+    /**
+     * 
+     * @param mapControl
+     */
+    public void setMapControl(MapControl mapControl);
+
+    /**
+     * 
+     */
+    public void doAccept();
+
+    /**
+     * 
+     */
+    public void doCancel();
+
+    /**
+     * 
+     * @return
+     */
+    public boolean validateFields();
+
+    /**
+     * 
+     * @return
+     * @throws ValidateSourceLayerException
+     */
+    public boolean validateSourceLayer() throws ValidateSourceLayerException;
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/panels/DerivedGeometriesPanel.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/panels/DerivedGeometriesPanel.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/panels/DerivedGeometriesPanel.java	(revision 831)
@@ -0,0 +1,37 @@
+/* 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.derivedgeometries.swing.api.panels;
+
+import org.gvsig.tools.swing.api.Component;
+
+/**
+ * Panel that contains {@link LayerAndProcessSelectionPanel} and
+ * {@link FeaturesControlPanel}
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ * 
+ */
+public interface DerivedGeometriesPanel extends Component {
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/panels/FeaturesControlPanel.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/panels/FeaturesControlPanel.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/panels/FeaturesControlPanel.java	(revision 831)
@@ -0,0 +1,66 @@
+/* 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.derivedgeometries.swing.api.panels;
+
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesParameters;
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesProcess;
+import org.gvsig.tools.swing.api.Component;
+
+/**
+ * Features control panel contains three panels. First panel shows information
+ * about source layer and output layer. Second panel shows information of source
+ * layer features and the last panel permits users to add, remove and order
+ * selected features to create derived geometries.
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ *
+ */
+public interface FeaturesControlPanel extends Component {
+
+    /**
+     * Sets parameters to show information and initialize actions.
+     * 
+     * @param parameters
+     */
+    public void setParameters(DerivedGeometriesParameters parameters);
+
+    /**
+     * @return parameters of panel.
+     */
+    public DerivedGeometriesParameters getParameters();
+
+    /**
+     * Does action panel. Gets selected features, closes panel and starts
+     * {@link DerivedGeometriesProcess}
+     * 
+     */
+    public void doAction();
+
+    /**
+     * Validate if data of third panel is correct.
+     * 
+     * @return True if it is valid otherwise false.
+     */
+    public boolean validateFields();
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesProcess.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesProcess.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesProcess.java	(revision 831)
@@ -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.derivedgeometries.swing.api;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.gvsig.tools.task.MonitorableTask;
+
+/**
+ * Process definition to create derived geometries.
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ */
+public interface DerivedGeometriesProcess extends MonitorableTask {
+
+    /**
+     * Type of process.
+     */
+    public enum TYPE {
+        POINTS_TO_LINE("_points_to_line"), 
+        POINTS_TO_POLYGON("_points_to_polygon"), 
+        LINES_TO_CLOSED_POLYLINE("_lines_to_closed_polyline");
+
+        private String value;
+
+        TYPE(String value) {
+            this.value = value;
+        }
+
+        public String toString() {
+            I18nManager i18n = ToolsLocator.getI18nManager();
+            return i18n.getTranslation(value);
+        }
+    }
+
+    /**
+     * @return parameters of process.
+     */
+    public DerivedGeometriesParameters getParameters();
+
+    /**
+     * Starts process.
+     */
+    public void start();
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesLocator.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesLocator.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesLocator.java	(revision 831)
@@ -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.derivedgeometries.swing.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 DerivedGeometries library, providing
+ * access to all DerivedGeometries services through the
+ * {@link DerivedGeometriesManager} .
+ *
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class DerivedGeometriesLocator extends BaseLocator {
+
+    private static final String LOCATOR_NAME = "DerivedGeometriesLocator";
+
+    public static final String MANAGER_NAME = "DerivedGeometriesSwing.manager";
+
+    private static final String MANAGER_DESCRIPTION =
+        "Derived Geometries Swing Manager";
+
+    private static final DerivedGeometriesLocator instance =
+        new DerivedGeometriesLocator();
+
+    /**
+     * Return the singleton instance.
+     * 
+     * @return the singleton instance
+     */
+    public static DerivedGeometriesLocator getInstance() {
+        return instance;
+    }
+
+    public String getLocatorName() {
+        return LOCATOR_NAME;
+    }
+
+    /**
+     * Return a reference to DerivedGeometriesManager.
+     * 
+     * @return a reference to DerivedGeometriesManager
+     * @throws LocatorException
+     *             if there is no access to the class or the class
+     *             cannot be instantiated
+     * @see Locator#get(String)
+     */
+    public static DerivedGeometriesManager getManager() throws LocatorException {
+        return (DerivedGeometriesManager) getInstance().get(MANAGER_NAME);
+    }
+
+    /**
+     * Registers the Class implementing the DerivedGeometriesLocator interface.
+     * 
+     * @param clazz
+     *            implementing the DerivedGeometriesgManager 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.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesParameters.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesParameters.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesParameters.java	(revision 831)
@@ -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.derivedgeometries.swing.api;
+
+import java.util.List;
+
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesProcess.TYPE;
+import org.gvsig.fmap.dal.feature.FeatureReference;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.fmap.mapcontrol.MapControl;
+
+/**
+ * 
+ * Definition of derived geometries parameters.
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ *
+ */
+public interface DerivedGeometriesParameters {
+
+    /**
+     * @return Gets if process has to add layer to map context.
+     */
+    public boolean getAddLayer();
+
+    /**
+     * @return Gets if process has to create new feature store
+     */
+    public boolean getCreateNewFeatureStore();
+
+    /**
+     * @return Gets feature store to edit
+     */
+    public FeatureStore getFeatureStore();
+
+    /**
+     * @return mapControl of source layer and output layer
+     */
+    public MapControl getMapControl();
+
+    /**
+     * @return name of output layer.
+     */
+    public String getOutPutLayerName();
+
+    /**
+     * @return path of output layer.
+     */
+    public String getOutPutLayerPath();
+
+    /**
+     * @return type of output layer. See {@link Geometry.TYPES}
+     */
+    public int getOutPutLayerType();
+
+    /**
+     * @return process type. See {@link DerivedGeometriesProcess.TYPE}
+     */
+    public TYPE getProcessType();
+
+    /**
+     * @return an ordered list of selected features.
+     */
+    public List<FeatureReference> getSelectedFeatures();
+
+    /**
+     * @return source layer.
+     */
+    public FLyrVect getSourceLayer();
+
+    /**
+     * @param b
+     *            Sets if process has to add output layer to mapContext or not.
+     */
+    public void setAddLayer(boolean b);
+
+    /**
+     * @param createNewFeatureStore
+     *            Sets if process has to create new feature store o not.
+     */
+    public void setCreateNewFeatureStore(boolean createNewFeatureStore);
+
+    /**
+     * @param featureStore
+     *            Sets feature store to edit
+     */
+    public void setFeatureStore(FeatureStore featureStore);
+
+    /**
+     * Sets name of output layer
+     * 
+     * @param name
+     */
+    public void setOutPutLayerName(String name);
+
+    /**
+     * Sets path of output layer
+     * 
+     * @param path
+     */
+    public void setOutPutLayerPath(String path);
+
+    /**
+     * Sets type of output layer. See {@link Geometry.TYPES}
+     * 
+     * @param type
+     */
+    public void setOutPutLayerType(int type);
+
+    /**
+     * Sets type of {@link DerivedGeometriesProcess} process.
+     * 
+     * @param type
+     */
+    public void setProcessType(TYPE type);
+
+    /**
+     * Sets selected features to create derived geometries.
+     * 
+     * @param theFeatures
+     *            ordered list.
+     */
+    public void setSelectedFeatures(List<FeatureReference> theFeatures);
+
+    /**
+     * Sets source layer.
+     * 
+     * @param sourceLayer
+     */
+    public void setSourceLayer(FLyrVect sourceLayer);
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesLibrary.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesLibrary.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesLibrary.java	(revision 831)
@@ -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.derivedgeometries.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;
+
+/**
+ * 
+ * Library for API initialization and configuration.
+ *
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class DerivedGeometriesLibrary extends AbstractLibrary {
+
+    @Override
+    public void doRegistration() {
+        registerAsAPI(DerivedGeometriesLibrary.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.
+        DerivedGeometriesManager manager =
+            DerivedGeometriesLocator.getManager();
+        if (manager == null) {
+            throw new ReferenceNotRegisteredException(
+                DerivedGeometriesLocator.MANAGER_NAME,
+                DerivedGeometriesLocator.getInstance());
+        }
+
+    }
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/tablemodels/DerivedGeometriesSelectionModel.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/tablemodels/DerivedGeometriesSelectionModel.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/tablemodels/DerivedGeometriesSelectionModel.java	(revision 831)
@@ -0,0 +1,45 @@
+/* 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.derivedgeometries.swing.api.tablemodels;
+
+import java.util.List;
+
+import javax.swing.ListSelectionModel;
+
+import org.gvsig.fmap.dal.feature.FeatureReference;
+
+public interface DerivedGeometriesSelectionModel extends ListSelectionModel {
+
+    /**
+     * 
+     * @return
+     */
+    public List<FeatureReference> getSelectedFeatures();
+
+    /**
+     * 
+     * @param list
+     */
+    public void setSelectedFeatures(List<FeatureReference> list);
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesManager.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesManager.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/DerivedGeometriesManager.java	(revision 831)
@@ -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.derivedgeometries.swing.api;
+
+import org.gvsig.derivedgeometries.swing.api.DerivedGeometriesProcess.TYPE;
+import org.gvsig.derivedgeometries.swing.api.panels.DerivedGeometriesPanel;
+import org.gvsig.derivedgeometries.swing.api.panels.FeaturesControlPanel;
+import org.gvsig.derivedgeometries.swing.api.panels.LayerAndProcessSelectionPanel;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
+import org.gvsig.fmap.mapcontrol.MapControl;
+
+/**
+ * Main class to manage DerivedGeometries functionalities
+ *
+ * @author gvSIG team
+ * @version $Id$
+ */
+public interface DerivedGeometriesManager {
+
+    /**
+     * Creates an empty {@link DerivedGeometriesParameters}
+     * 
+     * @return
+     */
+    public DerivedGeometriesParameters createDerivedGeometriesParameters();
+
+    /**
+     * Creates a {@link DerivedGeometriesParameters}.
+     * 
+     * @param mapControl
+     * @param sourceLayer
+     * @param outputLayerName
+     *            Name of output layer.
+     * @param outputLayerPath
+     *            Path of output layer.
+     * @param outputLayerType
+     *            Type of output layer. See {@link Geometry.TYPES}
+     * @param processType
+     *            Type of process. See {@link DerivedGeometriesProcess.TYPE}
+     * @return
+     */
+    public DerivedGeometriesParameters createDerivedGeometriesParameters(
+        MapControl mapControl, FLyrVect sourceLayer, String outputLayerName,
+        String outputLayerPath, int outputLayerType, TYPE processType);
+
+    /**
+     * @return a new {@link FeaturesControlPanel}.
+     */
+    public FeaturesControlPanel getFeaturesControlPanel();
+
+    /**
+     * @param mapControl
+     *            to get vectorial layers, adds listeners...
+     * @return a new {@link DerivedGeometriesPanel}.
+     */
+    public DerivedGeometriesPanel getDerivedGeometriesPanel(
+        MapControl mapControl);
+
+    /**
+     * @param mapControl
+     *            mapControl to get vectorial layers, adds listeners...
+     * @return a new {@link LayerAndProcessSelectionPanel}
+     */
+    public LayerAndProcessSelectionPanel getLayerAndProcessSelectionPanel(
+        MapControl mapControl);
+
+    /**
+     * Given {@link DerivedGeometriesParameters}, starts a new
+     * {@link DerivedGeometriesProcess}.
+     * 
+     * @param parameters
+     */
+    public void startDerivedGeometriesProcess(
+        DerivedGeometriesParameters parameters);
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/LoadSelectedFeatureDataException.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/LoadSelectedFeatureDataException.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/LoadSelectedFeatureDataException.java	(revision 831)
@@ -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.derivedgeometries.swing.api.exceptions;
+
+public class LoadSelectedFeatureDataException extends
+    DerivedGeometriesException {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -1477432246895858868L;
+
+    private static final String MESSAGE =
+        "An error has been produced loading selected features.";
+
+    private static final String KEY = "_LoadSelectedFeatureDataException";
+
+    public LoadSelectedFeatureDataException(Throwable ex) {
+        super(MESSAGE, ex, KEY, serialVersionUID);
+    }
+
+    public LoadSelectedFeatureDataException(String message, Throwable ex) {
+        super(message, ex, KEY, serialVersionUID);
+    }
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/FormatRowException.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/FormatRowException.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/FormatRowException.java	(revision 831)
@@ -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.derivedgeometries.swing.api.exceptions;
+
+
+public class FormatRowException extends DerivedGeometriesException {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 6292433772869829638L;
+    
+    private static final String MESSAGE =
+        "An error has been produced formating row.";
+
+    private static final String KEY = "_FormatRowException";
+
+    public FormatRowException(Throwable ex) {
+        super(MESSAGE, ex, KEY, serialVersionUID);
+    }
+
+    public FormatRowException(String message, Throwable ex) {
+        super(message, ex, KEY, serialVersionUID);
+    }
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/FetaureTableModelException.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/FetaureTableModelException.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/FetaureTableModelException.java	(revision 831)
@@ -0,0 +1,45 @@
+/* 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.derivedgeometries.swing.api.exceptions;
+
+public class FetaureTableModelException extends DerivedGeometriesException {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -5003333029683139078L;
+
+    private static final String MESSAGE =
+        "An error has been produced creating feature table model.";
+
+    private static final String KEY = "_FeatureTableModelException";
+
+    public FetaureTableModelException(Throwable ex) {
+        super(MESSAGE, ex, KEY, serialVersionUID);
+    }
+
+    public FetaureTableModelException(String message, Throwable ex) {
+        super(message, ex, KEY, serialVersionUID);
+    }
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/DerivedGeometriesException.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/DerivedGeometriesException.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/DerivedGeometriesException.java	(revision 831)
@@ -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.derivedgeometries.swing.api.exceptions;
+
+import org.gvsig.tools.exception.BaseException;
+
+public class DerivedGeometriesException extends BaseException {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -5881366280361882646L;
+
+    private static final String MESSAGE =
+        "An error has been produced in the Derived Geometries library";
+
+    private static final String KEY = "_DerivedGeometriesException";
+
+    /**
+     * 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 DerivedGeometriesException() {
+        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 DerivedGeometriesException(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 DerivedGeometriesException(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 DerivedGeometriesException(String message, Throwable cause,
+        String key, long code) {
+        super(message, cause, key, code);
+    }
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/ValidateSourceLayerException.java
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/ValidateSourceLayerException.java	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/org.gvsig.derivedgeometries.swing.api/src/main/java/org/gvsig/derivedgeometries/swing/api/exceptions/ValidateSourceLayerException.java	(revision 831)
@@ -0,0 +1,45 @@
+/* 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.derivedgeometries.swing.api.exceptions;
+
+public class ValidateSourceLayerException extends DerivedGeometriesException {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 6671117008934615055L;
+
+    private static final String MESSAGE =
+        "An error has been produced validating source layer.";
+
+    private static final String KEY = "_ValidateSourceLayerException";
+
+    public ValidateSourceLayerException(Throwable ex) {
+        super(MESSAGE, ex, KEY, serialVersionUID);
+    }
+
+    public ValidateSourceLayerException(String message, Throwable ex) {
+        super(message, ex, KEY, serialVersionUID);
+    }
+
+}
Index: org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/pom.xml
===================================================================
--- org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/pom.xml	(revision 0)
+++ org.gvsig.derivedgeometries/tags/org.gvsig.derivedgeometries-1.0.156/org.gvsig.derivedgeometries.swing/pom.xml	(revision 831)
@@ -0,0 +1,15 @@
+<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.derivedgeometries</artifactId>
+    <version>1.0.156</version>
+  </parent>
+  <artifactId>org.gvsig.derivedgeometries.swing</artifactId>
+  <packaging>pom</packaging>
+  <name>org.gvsig.derivedgeometries.swing</name>
+  <modules>
+  	<module>org.gvsig.derivedgeometries.swing.api</module>
+  	<module>org.gvsig.derivedgeometries.swing.impl</module>
+  </modules>
+</project>
\ No newline at end of file
