Revision: 4319
          http://sourceforge.net/p/jump-pilot/code/4319
Author:   ma15569
Date:     2015-02-24 02:03:21 +0000 (Tue, 24 Feb 2015)
Log Message:
-----------
2014_01_24 Giuseppe Aruta (ma15569) 
Fix minor bug on lower panel value display

Modified Paths:
--------------
    core/trunk/ChangeLog
    core/trunk/src/org/openjump/core/ui/plugin/raster/RasterQueryCursorTool.java

Modified: core/trunk/ChangeLog
===================================================================
--- core/trunk/ChangeLog        2015-02-23 06:10:00 UTC (rev 4318)
+++ core/trunk/ChangeLog        2015-02-24 02:03:21 UTC (rev 4319)
@@ -1,5 +1,8 @@
 # for display continuity sake please use 2 spaces instead of tabs
 
+2014_01_24 Giuseppe Aruta (ma15569) 
+       - RasterQueryPlugIn. Fix minor bug on lower panel
+
 2015-02-23 mmichaud <m.michael.mich...@orange.fr>
     - Fix Save dataset as Postgis Table (insert all Features as New Rows)
 

Modified: 
core/trunk/src/org/openjump/core/ui/plugin/raster/RasterQueryCursorTool.java
===================================================================
--- 
core/trunk/src/org/openjump/core/ui/plugin/raster/RasterQueryCursorTool.java    
    2015-02-23 06:10:00 UTC (rev 4318)
+++ 
core/trunk/src/org/openjump/core/ui/plugin/raster/RasterQueryCursorTool.java    
    2015-02-24 02:03:21 UTC (rev 4319)
@@ -65,6 +65,7 @@
 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.cursortool.NClickTool;
 import com.vividsolutions.jump.workbench.ui.images.IconLoader;
 import com.vividsolutions.jump.workbench.ui.renderer.style.LabelStyle;
@@ -74,13 +75,15 @@
 public class RasterQueryCursorTool extends NClickTool {
 
     /*
-     * [2013_05_27] Giuseppe Aruta Simple plugin that allows to inspect raster 
cell value for
-     *  DTM ver 0.1 2013_05_27
+     * [2013_05_27] Giuseppe Aruta Simple plugin that allows to inspect raster
+     * cell value for DTM ver 0.1 2013_05_27
      * 
      * [2014_01_24] Giuseppe Aruta - Extended inspection to multiband raster
-     *  layers. Now multiple measure are displayed (and saved) by default. 
Press
-     *  SHIFT to display only last measure. Moving cursor on image shows raster
-     *  cell value on lower panel
+     * layers. Now multiple measure are displayed (and saved) by default. Press
+     * SHIFT to display only last measure. Moving cursor on image shows raster
+     * cell value on lower panel
+     * 
+     * [2014_02_24] Fix minor bug on lower panel
      */
 
     protected Coordinate tentativeCoordinate;
@@ -272,20 +275,28 @@
     }
 
     /*
-     * Displays cell values while moving cursor on the raster
+     * Displays cell values on system bar while moving cursor on the raster
      */
+    PlugInContext gContext;
+
     public void mouseMoved(MouseEvent me) {
 
+        final WorkbenchContext wbcontext = this.getWorkbench().getContext();
+        RasterImageLayer aLayer = null;
+        for (java.util.Iterator i = wbcontext.getLayerNamePanel()
+                .selectedNodes(RasterImageLayer.class).iterator(); 
i.hasNext();) {
+            aLayer = (RasterImageLayer) i.next();
+        }
         String cellValues = null;
         try {
             cellValues = "";
             Coordinate tentativeCoordinate = getPanel().getViewport()
                     .toModelCoordinate(me.getPoint());
-            for (int b = 0; b < rLayer.getNumBands(); b++) {
-                Double cellValue = rLayer.getCellValue(tentativeCoordinate.x,
+            for (int b = 0; b < aLayer.getNumBands(); b++) {
+                Double cellValue = aLayer.getCellValue(tentativeCoordinate.x,
                         tentativeCoordinate.y, b);
                 if (cellValue != null) {
-                    if (rLayer.isNoData(cellValue)) {
+                    if (aLayer.isNoData(cellValue)) {
                         cellValues = Double.toString(Double.NaN);
                     } else {
                         cellValues = cellValues.concat(Double
@@ -306,6 +317,12 @@
         }
         name = rLayer.getName();
 
+        // gContext.getWorkbenchContext()
+        // .getLayerViewPanel()
+        // .setToolTipText(
+        // "(" + name + ") " + VALUE + ": "
+        // + cellValues.toString());
+
         getPanel().getContext().setStatusMessage(
                 "(" + name + ") " + VALUE + ": " + cellValues.toString());
     }


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to