Revision: 4567
          http://sourceforge.net/p/jump-pilot/code/4567
Author:   michaudm
Date:     2015-12-05 00:31:00 +0000 (Sat, 05 Dec 2015)
Log Message:
-----------
add new plugin EraseLayerAWithLayerB in Tools>Analysis

Modified Paths:
--------------
    core/trunk/ChangeLog
    core/trunk/scripts/default-plugins.xml
    core/trunk/src/language/jump.properties
    core/trunk/src/language/jump_cz.properties
    core/trunk/src/language/jump_de.properties
    core/trunk/src/language/jump_es.properties
    core/trunk/src/language/jump_fi.properties
    core/trunk/src/language/jump_fr.properties
    core/trunk/src/language/jump_hu.properties
    core/trunk/src/language/jump_it.properties
    core/trunk/src/language/jump_ja_JP.properties
    core/trunk/src/language/jump_ml.properties
    core/trunk/src/language/jump_pt.properties
    core/trunk/src/language/jump_pt_BR.properties
    core/trunk/src/language/jump_ta_IN.properties
    core/trunk/src/language/jump_te.properties
    core/trunk/src/language/jump_zh_CN.properties
    core/trunk/src/language/jump_zh_HK.properties

Added Paths:
-----------
    
core/trunk/src/org/openjump/core/ui/plugin/tools/EraseLayerAWithLayerBPlugIn.java

Modified: core/trunk/ChangeLog
===================================================================
--- core/trunk/ChangeLog        2015-12-04 21:25:34 UTC (rev 4566)
+++ core/trunk/ChangeLog        2015-12-05 00:31:00 UTC (rev 4567)
@@ -1,5 +1,9 @@
 # for display continuity sake please use 2 spaces instead of tabs
 
+
+2015-12-03 mmichaud <m.michael.mich...@orange.fr>
+  * add new plugin EraseLayerAWithLayerB in Tools>Analysis
+
 2015-12-04 Giuseppe Aruta  <giuseppe_ar...@yahoo.it>
    * Added CutFeatures tool into the editing toolbox
    * This tool partially derives from SplitPolygonPlugIn.class from Kosmo SAIG
@@ -10,8 +14,11 @@
     activates in PLUS as it needs DBQuery's *gt2-oracle-spatial-2.x.jar*
     also *ojdbc6.jar* must be downloaded and installed manually because
     of licensing restrictions
-  * extensions can hold messages now (eg. tell why they are not activated) 
+  * extensions can hold messages now (eg. tell why they are not activated)
 
+2015-12-03 mmichaud <m.michael.mich...@orange.fr>
+  * fix inconsistency between sld management and new XBasicStyle
+
 2015-11-23 mmichaud <m.michael.mich...@orange.fr>
   * Fix bug #411 : plugins in attributeTable context menu was deactivated
 

Modified: core/trunk/scripts/default-plugins.xml
===================================================================
--- core/trunk/scripts/default-plugins.xml      2015-12-04 21:25:34 UTC (rev 
4566)
+++ core/trunk/scripts/default-plugins.xml      2015-12-05 00:31:00 UTC (rev 
4567)
@@ -615,6 +615,9 @@
                
com.vividsolutions.jump.workbench.ui.plugin.analysis.GeometryFunctionPlugIn
        </plug-in>
        <plug-in>
+               org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn
+       </plug-in>
+       <plug-in>
                
com.vividsolutions.jump.workbench.ui.plugin.analysis.OverlayPlugIn
        </plug-in>
        <plug-in>

Modified: core/trunk/src/language/jump.properties
===================================================================
--- core/trunk/src/language/jump.properties     2015-12-04 21:25:34 UTC (rev 
4566)
+++ core/trunk/src/language/jump.properties     2015-12-05 00:31:00 UTC (rev 
4567)
@@ -1301,6 +1301,14 @@
 org.openjump.core.ui.plugin.tools.DeleteDuplicateGeometriesPlugIn.select-layer 
= select layer
 
org.openjump.core.ui.plugin.tools.DeleteDuplicateGeometriesPlugIn.keep-deleted-features
 = keep deleted features in a separate layer
 
org.openjump.core.ui.plugin.tools.DeleteEmptyGeometriesPlugIn.Delete-Empty-Geometries-in-Selection
 = Delete Empty Geometries in Selection
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn = Erase a layer 
with another
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.source-layer = 
Source Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.eraser-layer = 
Eraser Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.description = 
The plugin will substract eraser layer from geometries of first 
layer.\nGeometries divided into several dijoined geometries by the operation 
may be kept as a single multi-geometry or divided into several 
features.\nOptionally, a layer containing vertices added during the difference 
operation can be produced.
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.show-new-vertices
 = Show new vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.decompose-multi 
= Decompose multi-geometries
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.minus = moins
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.vertex-layer-suffix
 = added vertices
 
org.openjump.core.ui.plugin.tools.ExtractCommonBoundaryBetweenPolysPlugIn.Classifies-the-boundaries-of-a-polygon-by-using-a-neighbourhood-graph
 = Classifies the boundaries of a polygon by using a neighbourhood graph.
 
org.openjump.core.ui.plugin.tools.ExtractCommonBoundaryBetweenPolysPlugIn.Extract-Common-Boundary-Between-Polygons
 = Extract Common Boundary Between Polygons
 
org.openjump.core.ui.plugin.tools.ExtractCommonBoundaryBetweenPolysPlugIn.boundaries
 = boundaries

Modified: core/trunk/src/language/jump_cz.properties
===================================================================
--- core/trunk/src/language/jump_cz.properties  2015-12-04 21:25:34 UTC (rev 
4566)
+++ core/trunk/src/language/jump_cz.properties  2015-12-05 00:31:00 UTC (rev 
4567)
@@ -2554,4 +2554,14 @@
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn=\#T\:Show WMS Layer Legend
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.panel=\#T\:WMS Legend
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.message=\#T\:Error or no 
legend associated to selected layer
-org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
\ No newline at end of file
+org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.layer-to-erase=\#T\:Layer
 to erase
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.vertex-layer-suffix=\#T\:added
 vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.source-layer=\#T\:Source
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.eraser-layer=\#T\:Eraser
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.description=\#T\:The
 plugin will substract eraser layer from geometries of first layer.\nGeometries 
divided into several dijoined geometries by the operation may be kept as a 
single multi-geometry or divided into several features.\nOptionally, a layer 
containing vertices added during the difference operation can be produced.
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.show-new-vertices=\#T\:Show
 new vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.decompose-multi=\#T\:Decompose
 multi-geometries
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.result-layer-suffix=\#T\:erased
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.minus=\#T\:minus
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn=\#T\:Erase a 
layer with another
\ No newline at end of file

Modified: core/trunk/src/language/jump_de.properties
===================================================================
--- core/trunk/src/language/jump_de.properties  2015-12-04 21:25:34 UTC (rev 
4566)
+++ core/trunk/src/language/jump_de.properties  2015-12-05 00:31:00 UTC (rev 
4567)
@@ -2550,4 +2550,14 @@
 
org.openjump.core.ui.plugin.tools.AddGeometryAttributesPlugIn.add-compacity=\#T\:Add
 Compacity (Grav\xE9lius)
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.panel=\#T\:WMS Legend
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.message=\#T\:Error or no 
legend associated to selected layer
-org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
\ No newline at end of file
+org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.vertex-layer-suffix=\#T\:added
 vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.layer-to-erase=\#T\:Layer
 to erase
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.source-layer=\#T\:Source
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.eraser-layer=\#T\:Eraser
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.description=\#T\:The
 plugin will substract eraser layer from geometries of first layer.\nGeometries 
divided into several dijoined geometries by the operation may be kept as a 
single multi-geometry or divided into several features.\nOptionally, a layer 
containing vertices added during the difference operation can be produced.
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.show-new-vertices=\#T\:Show
 new vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.decompose-multi=\#T\:Decompose
 multi-geometries
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.result-layer-suffix=\#T\:erased
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.minus=\#T\:minus
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn=\#T\:Erase a 
layer with another
\ No newline at end of file

Modified: core/trunk/src/language/jump_es.properties
===================================================================
--- core/trunk/src/language/jump_es.properties  2015-12-04 21:25:34 UTC (rev 
4566)
+++ core/trunk/src/language/jump_es.properties  2015-12-05 00:31:00 UTC (rev 
4567)
@@ -2530,4 +2530,14 @@
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn=\#T\:Show WMS Layer Legend
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.panel=\#T\:WMS Legend
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.message=\#T\:Error or no 
legend associated to selected layer
-org.openjump.core.ui.plugin.tools.CutFeaturesTool = Cortar poligonos o lineas
\ No newline at end of file
+org.openjump.core.ui.plugin.tools.CutFeaturesTool = Cortar poligonos o lineas
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.vertex-layer-suffix=\#T\:added
 vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.layer-to-erase=\#T\:Layer
 to erase
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.source-layer=\#T\:Source
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.eraser-layer=\#T\:Eraser
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.description=\#T\:The
 plugin will substract eraser layer from geometries of first layer.\nGeometries 
divided into several dijoined geometries by the operation may be kept as a 
single multi-geometry or divided into several features.\nOptionally, a layer 
containing vertices added during the difference operation can be produced.
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.show-new-vertices=\#T\:Show
 new vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.decompose-multi=\#T\:Decompose
 multi-geometries
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.result-layer-suffix=\#T\:erased
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.minus=\#T\:minus
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn=\#T\:Erase a 
layer with another
\ No newline at end of file

Modified: core/trunk/src/language/jump_fi.properties
===================================================================
--- core/trunk/src/language/jump_fi.properties  2015-12-04 21:25:34 UTC (rev 
4566)
+++ core/trunk/src/language/jump_fi.properties  2015-12-05 00:31:00 UTC (rev 
4567)
@@ -2529,4 +2529,14 @@
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.panel=\#T\:WMS Legend
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.message=\#T\:Error or no 
legend associated to selected layer
 
org.openjump.core.ui.plugin.mousemenu.MeasureSelectedFeaturePlugIn.message1=\#T\:not
 supported for this type of operation
-org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
\ No newline at end of file
+org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.vertex-layer-suffix=\#T\:added
 vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.layer-to-erase=\#T\:Layer
 to erase
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.source-layer=\#T\:Source
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.eraser-layer=\#T\:Eraser
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.description=\#T\:The
 plugin will substract eraser layer from geometries of first layer.\nGeometries 
divided into several dijoined geometries by the operation may be kept as a 
single multi-geometry or divided into several features.\nOptionally, a layer 
containing vertices added during the difference operation can be produced.
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.show-new-vertices=\#T\:Show
 new vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.decompose-multi=\#T\:Decompose
 multi-geometries
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.result-layer-suffix=\#T\:erased
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.minus=\#T\:minus
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn=\#T\:Erase a 
layer with another
\ No newline at end of file

Modified: core/trunk/src/language/jump_fr.properties
===================================================================
--- core/trunk/src/language/jump_fr.properties  2015-12-04 21:25:34 UTC (rev 
4566)
+++ core/trunk/src/language/jump_fr.properties  2015-12-05 00:31:00 UTC (rev 
4567)
@@ -177,7 +177,6 @@
 com.vividsolutions.jump.workbench.ui.style.BasicStylePanel.error-opening-file 
= Erreur \u00e0 l''ouverture du fichier\: {0}
 com.vividsolutions.jump.workbench.ui.style.ChangeStylesPlugIn = Modifier le 
style
 com.vividsolutions.jump.workbench.ui.warp.AffineTransformPlugIn = 
Transformation affine (vecteurs d\u00e9formants)
-com.vividsolutions.jump.workbench.ui.warp.AffineTransformPlugIn=Transformaci\u00F3n
 af\u00EDn (con vectores de deformaccion)
 
com.vividsolutions.jump.workbench.ui.warp.AffineTransformPlugIn.message1=Charger
 cette image avec le pilote Sextante pour effectuer cette transformation
 com.vividsolutions.jump.workbench.ui.warp.AffineTransformPlugIn.message2=Les 
transformations affines ne sont pas encore impl\xE9ment\xE9es opur ce type 
d'image
 com.vividsolutions.jump.workbench.ui.warp.AffineTransformPlugIn.message3=Les 
transformations affines raster ne marchent actuellement que sur les images RVB
@@ -2556,4 +2555,16 @@
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn=Montrer la l\xE9gende WMS
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.panel=L\xE9gende WMS
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.message=Erreur ou aucune 
l\xE9gende associ\xE9e \xE0 la couche s\xE9lectionn\xE9e
-org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
\ No newline at end of file
+org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.vertex-layer-suffix=points
 ajout\xE9s
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.layer-to-erase=\#T\:Layer
 to erase
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.source-layer=Couche
 source
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.eraser-layer=Couche
 \xE0 soustraire
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.description=Le 
plugin soustrait la deuxi\xE8me couche des g\xE9om\xE9tries de la 
premi\xE8re.\n\
+  Les g\xE9om\xE9tries divis\xE9es en plusieurs parties disjointes peuvent 
\xEAtre g\xE9r\xE9es comme des multi-g\xE9om\xE9tries ou \xEAtre \xE9clat\xE9es 
en plusieurs objets.\n\
+  En option, il est possible de produire une couche des points d'intersection 
ajout\xE9s par l'op\xE9ration.
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.show-new-vertices=Montrer
 les nouveaux points
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.decompose-multi=D\xE9composer
 les multi-g\xE9om\xE9tries
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.result-layer-suffix=moins
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.minus=moins
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn=D\xE9couper une 
couche par une autre
\ No newline at end of file

Modified: core/trunk/src/language/jump_hu.properties
===================================================================
--- core/trunk/src/language/jump_hu.properties  2015-12-04 21:25:34 UTC (rev 
4566)
+++ core/trunk/src/language/jump_hu.properties  2015-12-05 00:31:00 UTC (rev 
4567)
@@ -2549,4 +2549,14 @@
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.panel=\#T\:WMS Legend
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.message=\#T\:Error or no 
legend associated to selected layer
 ui.EditOptionsPanel.enable-JUMP-basic-tooltips=\#T\:Enable basic JUMP Tooltip
-org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
\ No newline at end of file
+org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.vertex-layer-suffix=\#T\:added
 vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.layer-to-erase=\#T\:Layer
 to erase
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.source-layer=\#T\:Source
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.eraser-layer=\#T\:Eraser
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.description=\#T\:The
 plugin will substract eraser layer from geometries of first layer.\nGeometries 
divided into several dijoined geometries by the operation may be kept as a 
single multi-geometry or divided into several features.\nOptionally, a layer 
containing vertices added during the difference operation can be produced.
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.show-new-vertices=\#T\:Show
 new vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.decompose-multi=\#T\:Decompose
 multi-geometries
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.result-layer-suffix=\#T\:erased
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.minus=\#T\:minus
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn=\#T\:Erase a 
layer with another
\ No newline at end of file

Modified: core/trunk/src/language/jump_it.properties
===================================================================
--- core/trunk/src/language/jump_it.properties  2015-12-04 21:25:34 UTC (rev 
4566)
+++ core/trunk/src/language/jump_it.properties  2015-12-05 00:31:00 UTC (rev 
4567)
@@ -2530,4 +2530,13 @@
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn=\#T\:Show WMS Layer Legend
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.panel=\#T\:WMS Legend
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.message=\#T\:Error or no 
legend associated to selected layer
-org.openjump.core.ui.plugin.tools.CutFeaturesTool = Taglia poligoni o linee
\ No newline at end of file
+org.openjump.core.ui.plugin.tools.CutFeaturesTool = Taglia poligoni o linee
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.vertex-layer-suffix=\#T\:added
 vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.source-layer=\#T\:Source
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.eraser-layer=\#T\:Eraser
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.description=\#T\:The
 plugin will substract eraser layer from geometries of first layer.\nGeometries 
divided into several dijoined geometries by the operation may be kept as a 
single multi-geometry or divided into several features.\nOptionally, a layer 
containing vertices added during the difference operation can be produced.
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.show-new-vertices=\#T\:Show
 new vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.decompose-multi=\#T\:Decompose
 multi-geometries
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.result-layer-suffix=\#T\:erased
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.minus=\#T\:minus
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn=\#T\:Erase a 
layer with another
\ No newline at end of file

Modified: core/trunk/src/language/jump_ja_JP.properties
===================================================================
--- core/trunk/src/language/jump_ja_JP.properties       2015-12-04 21:25:34 UTC 
(rev 4566)
+++ core/trunk/src/language/jump_ja_JP.properties       2015-12-05 00:31:00 UTC 
(rev 4567)
@@ -2551,4 +2551,13 @@
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.panel=\#T\:WMS Legend
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.message=\#T\:Error or no 
legend associated to selected layer
 ui.EditOptionsPanel.enable-JUMP-basic-tooltips=\#T\:Enable basic JUMP Tooltip
-org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
\ No newline at end of file
+org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.vertex-layer-suffix=\#T\:added
 vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.source-layer=\#T\:Source
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.eraser-layer=\#T\:Eraser
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.description=\#T\:The
 plugin will substract eraser layer from geometries of first layer.\nGeometries 
divided into several dijoined geometries by the operation may be kept as a 
single multi-geometry or divided into several features.\nOptionally, a layer 
containing vertices added during the difference operation can be produced.
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.show-new-vertices=\#T\:Show
 new vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.decompose-multi=\#T\:Decompose
 multi-geometries
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.result-layer-suffix=\#T\:erased
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.minus=\#T\:minus
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn=\#T\:Erase a 
layer with another
\ No newline at end of file

Modified: core/trunk/src/language/jump_ml.properties
===================================================================
--- core/trunk/src/language/jump_ml.properties  2015-12-04 21:25:34 UTC (rev 
4566)
+++ core/trunk/src/language/jump_ml.properties  2015-12-05 00:31:00 UTC (rev 
4567)
@@ -3822,4 +3822,13 @@
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.panel=\#T\:WMS Legend
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.message=\#T\:Error or no 
legend associated to selected layer
 ui.EditOptionsPanel.enable-JUMP-basic-tooltips=\#T\:Enable basic JUMP Tooltip
-org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
\ No newline at end of file
+org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.vertex-layer-suffix=\#T\:added
 vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.source-layer=\#T\:Source
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.eraser-layer=\#T\:Eraser
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.description=\#T\:The
 plugin will substract eraser layer from geometries of first layer.\nGeometries 
divided into several dijoined geometries by the operation may be kept as a 
single multi-geometry or divided into several features.\nOptionally, a layer 
containing vertices added during the difference operation can be produced.
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.show-new-vertices=\#T\:Show
 new vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.decompose-multi=\#T\:Decompose
 multi-geometries
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.result-layer-suffix=\#T\:erased
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.minus=\#T\:minus
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn=\#T\:Erase a 
layer with another
\ No newline at end of file

Modified: core/trunk/src/language/jump_pt.properties
===================================================================
--- core/trunk/src/language/jump_pt.properties  2015-12-04 21:25:34 UTC (rev 
4566)
+++ core/trunk/src/language/jump_pt.properties  2015-12-05 00:31:00 UTC (rev 
4567)
@@ -2548,4 +2548,13 @@
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.panel=\#T\:WMS Legend
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.message=\#T\:Error or no 
legend associated to selected layer
 ui.EditOptionsPanel.enable-JUMP-basic-tooltips=\#T\:Enable basic JUMP Tooltip
-org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
\ No newline at end of file
+org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.vertex-layer-suffix=\#T\:added
 vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.source-layer=\#T\:Source
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.eraser-layer=\#T\:Eraser
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.description=\#T\:The
 plugin will substract eraser layer from geometries of first layer.\nGeometries 
divided into several dijoined geometries by the operation may be kept as a 
single multi-geometry or divided into several features.\nOptionally, a layer 
containing vertices added during the difference operation can be produced.
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.show-new-vertices=\#T\:Show
 new vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.decompose-multi=\#T\:Decompose
 multi-geometries
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.result-layer-suffix=\#T\:erased
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.minus=\#T\:minus
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn=\#T\:Erase a 
layer with another
\ No newline at end of file

Modified: core/trunk/src/language/jump_pt_BR.properties
===================================================================
--- core/trunk/src/language/jump_pt_BR.properties       2015-12-04 21:25:34 UTC 
(rev 4566)
+++ core/trunk/src/language/jump_pt_BR.properties       2015-12-05 00:31:00 UTC 
(rev 4567)
@@ -2548,4 +2548,13 @@
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.panel=\#T\:WMS Legend
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.message=\#T\:Error or no 
legend associated to selected layer
 ui.EditOptionsPanel.enable-JUMP-basic-tooltips=\#T\:Enable basic JUMP Tooltip
-org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
\ No newline at end of file
+org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.vertex-layer-suffix=\#T\:added
 vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.source-layer=\#T\:Source
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.eraser-layer=\#T\:Eraser
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.description=\#T\:The
 plugin will substract eraser layer from geometries of first layer.\nGeometries 
divided into several dijoined geometries by the operation may be kept as a 
single multi-geometry or divided into several features.\nOptionally, a layer 
containing vertices added during the difference operation can be produced.
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.show-new-vertices=\#T\:Show
 new vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.decompose-multi=\#T\:Decompose
 multi-geometries
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.result-layer-suffix=\#T\:erased
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.minus=\#T\:minus
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn=\#T\:Erase a 
layer with another
\ No newline at end of file

Modified: core/trunk/src/language/jump_ta_IN.properties
===================================================================
--- core/trunk/src/language/jump_ta_IN.properties       2015-12-04 21:25:34 UTC 
(rev 4566)
+++ core/trunk/src/language/jump_ta_IN.properties       2015-12-05 00:31:00 UTC 
(rev 4567)
@@ -2547,4 +2547,13 @@
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.panel=\#T\:WMS Legend
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.message=\#T\:Error or no 
legend associated to selected layer
 ui.EditOptionsPanel.enable-JUMP-basic-tooltips=\#T\:Enable basic JUMP Tooltip
-org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
\ No newline at end of file
+org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.vertex-layer-suffix=\#T\:added
 vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.source-layer=\#T\:Source
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.eraser-layer=\#T\:Eraser
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.description=\#T\:The
 plugin will substract eraser layer from geometries of first layer.\nGeometries 
divided into several dijoined geometries by the operation may be kept as a 
single multi-geometry or divided into several features.\nOptionally, a layer 
containing vertices added during the difference operation can be produced.
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.show-new-vertices=\#T\:Show
 new vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.decompose-multi=\#T\:Decompose
 multi-geometries
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.result-layer-suffix=\#T\:erased
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.minus=\#T\:minus
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn=\#T\:Erase a 
layer with another
\ No newline at end of file

Modified: core/trunk/src/language/jump_te.properties
===================================================================
--- core/trunk/src/language/jump_te.properties  2015-12-04 21:25:34 UTC (rev 
4566)
+++ core/trunk/src/language/jump_te.properties  2015-12-05 00:31:00 UTC (rev 
4567)
@@ -3056,4 +3056,13 @@
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.panel=\#T\:WMS Legend
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.message=\#T\:Error or no 
legend associated to selected layer
 ui.EditOptionsPanel.enable-JUMP-basic-tooltips=\#T\:Enable basic JUMP Tooltip
-org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
\ No newline at end of file
+org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.vertex-layer-suffix=\#T\:added
 vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.source-layer=\#T\:Source
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.eraser-layer=\#T\:Eraser
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.description=\#T\:The
 plugin will substract eraser layer from geometries of first layer.\nGeometries 
divided into several dijoined geometries by the operation may be kept as a 
single multi-geometry or divided into several features.\nOptionally, a layer 
containing vertices added during the difference operation can be produced.
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.show-new-vertices=\#T\:Show
 new vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.decompose-multi=\#T\:Decompose
 multi-geometries
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.result-layer-suffix=\#T\:erased
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.minus=\#T\:minus
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn=\#T\:Erase a 
layer with another
\ No newline at end of file

Modified: core/trunk/src/language/jump_zh_CN.properties
===================================================================
--- core/trunk/src/language/jump_zh_CN.properties       2015-12-04 21:25:34 UTC 
(rev 4566)
+++ core/trunk/src/language/jump_zh_CN.properties       2015-12-05 00:31:00 UTC 
(rev 4567)
@@ -2711,4 +2711,13 @@
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.panel=\#T\:WMS Legend
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.message=\#T\:Error or no 
legend associated to selected layer
 ui.EditOptionsPanel.enable-JUMP-basic-tooltips=\#T\:Enable basic JUMP Tooltip
-org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
\ No newline at end of file
+org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.vertex-layer-suffix=\#T\:added
 vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.source-layer=\#T\:Source
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.eraser-layer=\#T\:Eraser
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.description=\#T\:The
 plugin will substract eraser layer from geometries of first layer.\nGeometries 
divided into several dijoined geometries by the operation may be kept as a 
single multi-geometry or divided into several features.\nOptionally, a layer 
containing vertices added during the difference operation can be produced.
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.show-new-vertices=\#T\:Show
 new vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.decompose-multi=\#T\:Decompose
 multi-geometries
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.result-layer-suffix=\#T\:erased
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.minus=\#T\:minus
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn=\#T\:Erase a 
layer with another
\ No newline at end of file

Modified: core/trunk/src/language/jump_zh_HK.properties
===================================================================
--- core/trunk/src/language/jump_zh_HK.properties       2015-12-04 21:25:34 UTC 
(rev 4566)
+++ core/trunk/src/language/jump_zh_HK.properties       2015-12-05 00:31:00 UTC 
(rev 4567)
@@ -2710,4 +2710,14 @@
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.panel=\#T\:WMS Legend
 org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.message=\#T\:Error or no 
legend associated to selected layer
 ui.EditOptionsPanel.enable-JUMP-basic-tooltips=\#T\:Enable basic JUMP Tooltip
-org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
\ No newline at end of file
+org.openjump.core.ui.plugin.tools.CutFeaturesTool = \#T\:Cut polygons or 
linestrings
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.vertex-layer-suffix=\#T\:added
 vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.layer-to-erase=
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.source-layer=\#T\:Source
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.eraser-layer=\#T\:Eraser
 Layer
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.description=\#T\:The
 plugin will substract eraser layer from geometries of first layer.\nGeometries 
divided into several dijoined geometries by the operation may be kept as a 
single multi-geometry or divided into several features.\nOptionally, a layer 
containing vertices added during the difference operation can be produced.
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.show-new-vertices=\#T\:Show
 new vertices
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.decompose-multi=\#T\:Decompose
 multi-geometries
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.result-layer-suffix=\#T\:erased
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.minus=\#T\:minus
+org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn=\#T\:Erase a 
layer with another
\ No newline at end of file

Added: 
core/trunk/src/org/openjump/core/ui/plugin/tools/EraseLayerAWithLayerBPlugIn.java
===================================================================
--- 
core/trunk/src/org/openjump/core/ui/plugin/tools/EraseLayerAWithLayerBPlugIn.java
                           (rev 0)
+++ 
core/trunk/src/org/openjump/core/ui/plugin/tools/EraseLayerAWithLayerBPlugIn.java
   2015-12-05 00:31:00 UTC (rev 4567)
@@ -0,0 +1,176 @@
+package org.openjump.core.ui.plugin.tools;
+
+import com.vividsolutions.jts.geom.Coordinate;
+import com.vividsolutions.jts.geom.Geometry;
+import com.vividsolutions.jts.geom.GeometryCollection;
+import com.vividsolutions.jts.geom.GeometryFactory;
+import com.vividsolutions.jts.index.strtree.STRtree;
+import com.vividsolutions.jump.I18N;
+import com.vividsolutions.jump.feature.*;
+import com.vividsolutions.jump.task.TaskMonitor;
+import com.vividsolutions.jump.workbench.WorkbenchContext;
+import com.vividsolutions.jump.workbench.model.Layer;
+import com.vividsolutions.jump.workbench.model.StandardCategoryNames;
+import com.vividsolutions.jump.workbench.plugin.EnableCheckFactory;
+import com.vividsolutions.jump.workbench.plugin.MultiEnableCheck;
+import com.vividsolutions.jump.workbench.plugin.PlugInContext;
+import com.vividsolutions.jump.workbench.ui.GUIUtil;
+import com.vividsolutions.jump.workbench.ui.MenuNames;
+import com.vividsolutions.jump.workbench.ui.MultiInputDialog;
+import com.vividsolutions.jump.workbench.ui.plugin.FeatureInstaller;
+import org.openjump.core.ui.plugin.AbstractThreadedUiPlugIn;
+
+import javax.swing.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * PlugIn to erase geometries of a layer with the geometries from another layer
+ */
+public class EraseLayerAWithLayerBPlugIn extends AbstractThreadedUiPlugIn {
+
+    public static String LAYER_A             = 
I18N.get("org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.source-layer");
+    public static String LAYER_B             = 
I18N.get("org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.eraser-layer");
+    public static String DESCRIPTION         = 
I18N.get("org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.description");
+    public static String SHOW_NEW_VERTICES   = 
I18N.get("org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.show-new-vertices");
+    public static String DECOMPOSE_MULTI     = 
I18N.get("org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.decompose-multi");
+    public static String MINUS               = 
I18N.get("org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.minus");
+    public static String VERTEX_LAYER_SUFFIX = 
I18N.get("org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn.vertex-layer-suffix");
+
+    private Layer layerA;
+    private Layer layerB;
+    private boolean showNewVertices;
+    private boolean decomposeMulti;
+
+    public EraseLayerAWithLayerBPlugIn() {
+    }
+
+    public String getName() {
+        return 
I18N.get("org.openjump.core.ui.plugin.tools.EraseLayerAWithLayerBPlugIn");
+    }
+
+    @Override
+    public void initialize(PlugInContext context) throws Exception {
+        super.initialize(context);
+        FeatureInstaller featureInstaller = new 
FeatureInstaller(context.getWorkbenchContext());
+        featureInstaller.addMainMenuPlugin(
+                this,
+                new String[] {MenuNames.TOOLS, MenuNames.TOOLS_ANALYSIS},
+                getName() + "...", false, null,
+                createEnableCheck(context.getWorkbenchContext()));
+    }
+
+    public static MultiEnableCheck createEnableCheck(WorkbenchContext 
workbenchContext) {
+        EnableCheckFactory checkFactory = new 
EnableCheckFactory(workbenchContext);
+        return new 
MultiEnableCheck().add(checkFactory.createAtLeastNLayersMustExistCheck(2));
+    }
+
+    @Override
+    public boolean execute(PlugInContext context) throws Exception {
+        MultiInputDialog dialog = new MultiInputDialog(
+                context.getWorkbenchFrame(), getName(), true);
+        initDialog(dialog, context);
+        dialog.setVisible(true);
+        if (!dialog.wasOKPressed()) {
+            return false;
+        }
+        getDialogValues(dialog);
+        return true;
+    }
+
+    private void initDialog(final MultiInputDialog dialog, PlugInContext 
context) {
+        dialog.setSideBarDescription(DESCRIPTION);
+        Layer candidateA = layerA == null ? context.getCandidateLayer(0) : 
layerA;
+        Layer candidateB = layerB == null ? context.getCandidateLayer(1) : 
layerB;
+        final JComboBox layerComboBoxA    = dialog.addLayerComboBox(LAYER_A, 
candidateA, context.getLayerManager());
+        final JComboBox layerComboBoxB    = dialog.addLayerComboBox(LAYER_B, 
candidateB, context.getLayerManager());
+        final JCheckBox showNewVerticesCB = 
dialog.addCheckBox(SHOW_NEW_VERTICES, showNewVertices, SHOW_NEW_VERTICES);
+        final JCheckBox decomposeMultiCB  = 
dialog.addCheckBox(DECOMPOSE_MULTI, showNewVertices, DECOMPOSE_MULTI);
+
+        GUIUtil.centreOnWindow(dialog);
+    }
+
+    private void getDialogValues(MultiInputDialog dialog) {
+        layerA = dialog.getLayer(LAYER_A);
+        layerB = dialog.getLayer(LAYER_B);
+        showNewVertices = dialog.getBoolean(SHOW_NEW_VERTICES);
+        decomposeMulti = dialog.getBoolean(DECOMPOSE_MULTI);
+    }
+
+    public void run(TaskMonitor monitor, PlugInContext context) throws 
Exception {
+        monitor.allowCancellationRequests();
+
+        // index layerB
+        STRtree index = new STRtree();
+        for (Object o : layerB.getFeatureCollectionWrapper().getFeatures()) {
+            Geometry g = ((Feature)o).getGeometry();
+            index.insert(g.getEnvelopeInternal(), g);
+        }
+
+        // Clone layerA
+        FeatureCollection result1 = new 
FeatureDataset(layerA.getFeatureCollectionWrapper().getFeatureSchema());
+        for (Object o : layerA.getFeatureCollectionWrapper().getFeatures()) {
+            result1.add(((Feature)o).clone(true, true));
+        }
+        for (Object o : result1.getFeatures()) {
+            Feature feature = (Feature)o;
+            List<Geometry> candidates = 
index.query(feature.getGeometry().getEnvelopeInternal());
+            for (Geometry b : candidates) {
+                feature.setGeometry(erase(feature.getGeometry(), b));
+            }
+        }
+        FeatureCollection result2 = new 
FeatureDataset(result1.getFeatureSchema());
+        for (Object o : result1.getFeatures()) {
+            Geometry geometry = ((Feature)o).getGeometry();
+            if (!geometry.isEmpty()) {
+                if (geometry instanceof GeometryCollection && decomposeMulti) {
+                    for (int i = 0 ; i < geometry.getNumGeometries() ; i++) {
+                        Feature f = ((Feature)o).clone(false, false);
+                        f.setGeometry(geometry.getGeometryN(i));
+                        result2.add(f);
+                    }
+                } else {
+                    result2.add((Feature)o);
+                }
+            }
+        }
+        
workbenchContext.getLayerManager().addLayer(StandardCategoryNames.RESULT,
+                layerA.getName() + " " + MINUS + " " + layerB.getName(), 
result2);
+
+        if (showNewVertices) {
+            FeatureSchema schemaVertices = new FeatureSchema();
+            schemaVertices.addAttribute("GEOMETRY", AttributeType.GEOMETRY);
+            schemaVertices.addAttribute("fid", AttributeType.INTEGER);
+            FeatureCollection fcVertices = new FeatureDataset(schemaVertices);
+            List cList = new ArrayList();
+            for (Object o : 
layerA.getFeatureCollectionWrapper().getFeatures()) {
+                Geometry g = ((Feature)o).getGeometry();
+                for (Coordinate c : g.getCoordinates()) {
+                    cList.add(c);
+                }
+            }
+            Collections.sort(cList);
+            GeometryFactory gf = new GeometryFactory();
+            for (Object o : result2.getFeatures()) {
+                Geometry g = ((Feature)o).getGeometry();
+                for (Coordinate c : g.getCoordinates()) {
+                    if (Collections.binarySearch(cList, c) < 0) {
+                        Feature f = new BasicFeature(schemaVertices);
+                        f.setGeometry(gf.createPoint(c));
+                        f.setAttribute("fid", ((Feature)o).getID());
+                        fcVertices.add(f);
+                    }
+                }
+            }
+            
workbenchContext.getLayerManager().addLayer(StandardCategoryNames.RESULT,
+                    layerA.getName() + " - " + VERTEX_LAYER_SUFFIX, 
fcVertices);
+        }
+        layerA.setVisible(false);
+    }
+
+    private Geometry erase(Geometry a, Geometry b) {
+        return a.difference(b);
+    }
+
+}


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to