Revision: 6456
          http://sourceforge.net/p/jump-pilot/code/6456
Author:   edso
Date:     2020-09-13 11:08:39 +0000 (Sun, 13 Sep 2020)
Log Message:
-----------
austoselect created new layer so the opened image layer mgr will add img to it 
and not to a scond newly created one 

Modified Paths:
--------------
    
core/trunk/src/com/vividsolutions/jump/workbench/ui/plugin/imagery/AddImageLayerPlugIn.java

Modified: 
core/trunk/src/com/vividsolutions/jump/workbench/ui/plugin/imagery/AddImageLayerPlugIn.java
===================================================================
--- 
core/trunk/src/com/vividsolutions/jump/workbench/ui/plugin/imagery/AddImageLayerPlugIn.java
 2020-09-13 10:59:20 UTC (rev 6455)
+++ 
core/trunk/src/com/vividsolutions/jump/workbench/ui/plugin/imagery/AddImageLayerPlugIn.java
 2020-09-13 11:08:39 UTC (rev 6456)
@@ -16,10 +16,12 @@
 import com.vividsolutions.jump.workbench.model.Category;
 import com.vividsolutions.jump.workbench.model.Layer;
 import com.vividsolutions.jump.workbench.model.LayerManager;
+import com.vividsolutions.jump.workbench.model.Layerable;
 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.TreeLayerNamePanel;
 import com.vividsolutions.jump.workbench.ui.images.IconLoader;
 
 public class AddImageLayerPlugIn extends AbstractUiPlugIn {
@@ -39,10 +41,13 @@
   public boolean execute(PlugInContext context) throws Exception {
     LayerManager lm = context.getLayerManager();
     lm.setFiringEvents(false);
-    Layer layer = createLayer(lm);
+    Layerable layer = createLayer(lm);
     lm.setFiringEvents(true);
     Category category = TaskUtil.getSelectedCategoryName(workbenchContext);
     lm.addLayerable(category.getName(), layer);
+    // select the new layer in layer tree
+    final TreeLayerNamePanel lnp = (TreeLayerNamePanel) 
context.getWorkbenchContext().getLayerableNamePanel();
+    lnp.setSelectedLayerables(new Layerable[]{layer});
 
     boolean success = new ImageLayerManagerPlugIn().execute(context);
 



_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to