Revision: 4436
          http://sourceforge.net/p/jump-pilot/code/4436
Author:   michaudm
Date:     2015-05-14 12:28:54 +0000 (Thu, 14 May 2015)
Log Message:
-----------
#393 : SimpleQueryPlugIn : the bug was not completely fixed : features
    must be cloned to be added to new Layer but not for Selection or InfoPanel

Modified Paths:
--------------
    core/trunk/ChangeLog
    core/trunk/src/org/openjump/core/ui/plugin/queries/QueryDialog.java

Modified: core/trunk/ChangeLog
===================================================================
--- core/trunk/ChangeLog        2015-05-12 06:37:53 UTC (rev 4435)
+++ core/trunk/ChangeLog        2015-05-14 12:28:54 UTC (rev 4436)
@@ -1,5 +1,9 @@
 # for display continuity sake please use 2 spaces instead of tabs
 
+2015-05-14 mmichaud <m.michael.mich...@orange.fr>
+  * #393 : SimpleQueryPlugIn : the bug was not completely fixed : features
+    must be cloned to be added to new Layer but not for Selection or InfoPanel
+
 2015-05-11 bertaz
   * Sextante raster layers: added ability to handle rasters with different x 
and y cell sizes.
 

Modified: core/trunk/src/org/openjump/core/ui/plugin/queries/QueryDialog.java
===================================================================
--- core/trunk/src/org/openjump/core/ui/plugin/queries/QueryDialog.java 
2015-05-12 06:37:53 UTC (rev 4435)
+++ core/trunk/src/org/openjump/core/ui/plugin/queries/QueryDialog.java 
2015-05-14 12:28:54 UTC (rev 4436)
@@ -938,7 +938,7 @@
                     FeatureCollection dataset = new 
FeatureDataset(fc.getFeatureSchema());
                     
                     // initialize a new list for the new selection
-                    List okFeatures = new ArrayList();
+                    List<Feature> okFeatures = new ArrayList<Feature>();
                     int mod = 1;
                     if (total > 1000) mod = 10;
                     if (total > 33000) mod = 100;
@@ -952,7 +952,7 @@
                             }
                             Feature f = (BasicFeature)it.next();
                             if (condition.test(f)) {
-                                okFeatures.add(f.clone());
+                                okFeatures.add(f);
                                 featuresfound++;
                             }
                             Thread.yield();
@@ -970,11 +970,11 @@
                     if(select.getState()) {
                         selectedFeatures.selectItems(layer, okFeatures);
                     }
-                    
-                    if(create.getState() || display.getState()) {
-                        dataset.addAll(okFeatures);
-                    }
+
                     if(create.getState()) {
+                        for (Feature f : okFeatures) {
+                            dataset.add((Feature)f.clone());
+                        }
                         String outputLayerName = layer.getName() + "_";
                         if (attributeType != 'G') {
                             outputLayerName += (attribute + "_");
@@ -1012,6 +1012,7 @@
                 }
                 
                 if(display.getState()) {
+                    info.pack();
                     context.getWorkbenchFrame().addInternalFrame(info);
                 }
                 


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to