Revision: 4528
          http://sourceforge.net/p/jump-pilot/code/4528
Author:   ma15569
Date:     2015-07-08 05:36:39 +0000 (Wed, 08 Jul 2015)
Log Message:
-----------
Fixed bug #407 Sextante raster : displaying cell values throws NPE 

Modified Paths:
--------------
    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
    core/trunk/src/org/openjump/core/ui/plugin/raster/RasterQueryCursorTool.java

Modified: core/trunk/src/language/jump.properties
===================================================================
--- core/trunk/src/language/jump.properties     2015-07-06 09:45:34 UTC (rev 
4527)
+++ core/trunk/src/language/jump.properties     2015-07-08 05:36:39 UTC (rev 
4528)
@@ -1044,6 +1044,7 @@
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.value = value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.previous.value = Previous 
value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.info = The selected 
raster is not a monoband raster
+org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.message=Inspection 
outside the extension of selected Raster layer
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn = Raster 
Layer Info
 
org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.raster-statistics=
 Raster statistics
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.file.bands 
= Raster bands

Modified: core/trunk/src/language/jump_cz.properties
===================================================================
--- core/trunk/src/language/jump_cz.properties  2015-07-06 09:45:34 UTC (rev 
4527)
+++ core/trunk/src/language/jump_cz.properties  2015-07-08 05:36:39 UTC (rev 
4528)
@@ -1010,6 +1010,7 @@
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.value = \#T\:value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.previous.value = 
\#T\:Previous value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.info = \#T\:The selected 
raster is not a monoband raster
+org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.message= \#T\:Inspection 
outside the extension of selected Raster layer
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn = 
\#T\:Raster Layer Info
 
org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.raster-statistics=
 \#T\:Raster statistics
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.file.bands 
= \#T\:Raster bands

Modified: core/trunk/src/language/jump_de.properties
===================================================================
--- core/trunk/src/language/jump_de.properties  2015-07-06 09:45:34 UTC (rev 
4527)
+++ core/trunk/src/language/jump_de.properties  2015-07-08 05:36:39 UTC (rev 
4528)
@@ -1011,6 +1011,7 @@
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.value = \#T\:value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.previous.value = 
\#T\:Previous value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.info = \#T\:The selected 
raster is not a monoband raster
+org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.message= \#T\:Inspection 
outside the extension of selected Raster layer
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn = 
\#T\:Raster Layer Info
 
org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.raster-statistics=
 \#T\:Raster statistics
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.file.bands 
= \#T\:Raster bands

Modified: core/trunk/src/language/jump_es.properties
===================================================================
--- core/trunk/src/language/jump_es.properties  2015-07-06 09:45:34 UTC (rev 
4527)
+++ core/trunk/src/language/jump_es.properties  2015-07-08 05:36:39 UTC (rev 
4528)
@@ -1089,6 +1089,7 @@
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.info=La capa seleccionada 
no es un raster monobanda
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.previous.value=valor 
anterior
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.value=valor
+org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.message= Inspecci\xF3n 
fuera de la extensi\xF3n de la capa raster seleccionada
 
org.openjump.core.ui.plugin.style.ImportArcMapStylePlugIn.Must-Select-Location-Of-SLD=El
 siguiente paso es seleccionar la SLD\nque se gener\u00F3 por ArcMap2SLD.
 
org.openjump.core.ui.plugin.style.ImportArcMapStylePlugIn.Must-Select-Location-Of-Tool=Para
 poder utilizar el programa externo ArcMap2SLD, \npor favor, especificar su 
ubicaci\u00F3n en el siguiente cuadro de di\u00E1logo.
 
org.openjump.core.ui.plugin.style.ImportArcMapStylePlugIn.name=Importaci\u00F3n 
ArcMap Estilo

Modified: core/trunk/src/language/jump_fi.properties
===================================================================
--- core/trunk/src/language/jump_fi.properties  2015-07-06 09:45:34 UTC (rev 
4527)
+++ core/trunk/src/language/jump_fi.properties  2015-07-08 05:36:39 UTC (rev 
4528)
@@ -1118,6 +1118,7 @@
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.info=Valittu rasteritaso 
ei ole yksikanavainen
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.previous.value=edellinen 
arvo
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.value=arvo
+org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.message= \#T\:Inspection 
outside the extension of selected Raster layer
 
org.openjump.core.ui.plugin.style.ImportArcMapStylePlugIn.Must-Select-Location-Of-SLD=Valitse
 seuraavaksi SLD-tyylitiedosto, joka on tehty ArcMap2SLD\:ll\u00E4.
 
org.openjump.core.ui.plugin.style.ImportArcMapStylePlugIn.Must-Select-Location-Of-Tool=K\u00E4ytt\u00E4\u00E4ksesi
 ulkoista ArcMap2SLD-ohjelmaa,\n\tanna sen sijainti seuraavassa kyselyss\u00E4.
 org.openjump.core.ui.plugin.style.ImportArcMapStylePlugIn.name=Tuo 
ArcMap-tyylitiedosto

Modified: core/trunk/src/language/jump_fr.properties
===================================================================
--- core/trunk/src/language/jump_fr.properties  2015-07-06 09:45:34 UTC (rev 
4527)
+++ core/trunk/src/language/jump_fr.properties  2015-07-08 05:36:39 UTC (rev 
4528)
@@ -1014,6 +1014,7 @@
 org.openjump.core.ui.plugin.raster.ProfileGraphTool.cell-statistics= 
Statistiques sur les pixels
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.previous.value = valeur 
pr\u00e9c\u00e9dente
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.info = L'image 
s\u00e9lectionn\u00e9e n'est pas mono-bande
+org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.message= \#T\:Inspection 
outside the extension of selected Raster layer
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn = 
Propri\u00e9t\u00e9s de la couche Raster
 
org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.raster-statistics=
 Statistiques raster
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.file.bands 
= Nombre de bandes

Modified: core/trunk/src/language/jump_hu.properties
===================================================================
--- core/trunk/src/language/jump_hu.properties  2015-07-06 09:45:34 UTC (rev 
4527)
+++ core/trunk/src/language/jump_hu.properties  2015-07-08 05:36:39 UTC (rev 
4528)
@@ -1011,6 +1011,7 @@
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.value = \#T\:value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.previous.value = 
\#T\:Previous value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.info = \#T\:The selected 
raster is not a monoband raster
+org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.message= \#T\:Inspection 
outside the extension of selected Raster layer
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn = 
\#T\:Raster Layer Info
 
org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.raster-statistics=
 \#T\:Raster statistics
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.file.bands 
= \#T\:Raster bands

Modified: core/trunk/src/language/jump_it.properties
===================================================================
--- core/trunk/src/language/jump_it.properties  2015-07-06 09:45:34 UTC (rev 
4527)
+++ core/trunk/src/language/jump_it.properties  2015-07-08 05:36:39 UTC (rev 
4528)
@@ -1089,6 +1089,7 @@
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.info=Il livello 
selezionato non \u00E8 un raster monobanda
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.previous.value=valore 
precedente
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.value=valore
+org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.message= L'ispezione \xE8 
esterna alla area del raster selezionato
 
org.openjump.core.ui.plugin.style.ImportArcMapStylePlugIn.Must-Select-Location-Of-SLD=Il
 prossimo passo \u00E8 selezionare il SLD \ngenerato da ArcMap2SLD
 
org.openjump.core.ui.plugin.style.ImportArcMapStylePlugIn.Must-Select-Location-Of-Tool=Per
 poter utilizzare il programma esterno ArcMap2SLD,\nper favore specifica la sua 
ubicazione nel dialogo succesivo.
 org.openjump.core.ui.plugin.style.ImportArcMapStylePlugIn.name=Importa stile 
ArcMap

Modified: core/trunk/src/language/jump_ja_JP.properties
===================================================================
--- core/trunk/src/language/jump_ja_JP.properties       2015-07-06 09:45:34 UTC 
(rev 4527)
+++ core/trunk/src/language/jump_ja_JP.properties       2015-07-08 05:36:39 UTC 
(rev 4528)
@@ -1010,6 +1010,7 @@
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.value = \#T\:value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.previous.value = 
\#T\:Previous value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.info = \#T\:The selected 
raster is not a monoband raster
+org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.message= \#T\:Inspection 
outside the extension of selected Raster layer
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn = 
\#T\:Raster Layer Info
 
org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.raster-statistics=
 \#T\:Raster statistics
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.file.bands 
= \#T\:Raster bands

Modified: core/trunk/src/language/jump_ml.properties
===================================================================
--- core/trunk/src/language/jump_ml.properties  2015-07-06 09:45:34 UTC (rev 
4527)
+++ core/trunk/src/language/jump_ml.properties  2015-07-08 05:36:39 UTC (rev 
4528)
@@ -1370,6 +1370,7 @@
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.value = \#T\:value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.previous.value = 
\#T\:Previous value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.info = \#T\:The selected 
raster is not a monoband raster
+org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.message= \#T\:Inspection 
outside the extension of selected Raster layer
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn = 
\#T\:Raster Layer Info
 
org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.raster-statistics=
 \#T\:Raster statistics
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.file.bands 
= \#T\:Raster bands

Modified: core/trunk/src/language/jump_pt.properties
===================================================================
--- core/trunk/src/language/jump_pt.properties  2015-07-06 09:45:34 UTC (rev 
4527)
+++ core/trunk/src/language/jump_pt.properties  2015-07-08 05:36:39 UTC (rev 
4528)
@@ -1010,6 +1010,7 @@
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.value = \#T\:value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.previous.value = 
\#T\:Previous value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.info = \#T\:The selected 
raster is not a monoband raster
+org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.message= \#T\:Inspection 
outside the extension of selected Raster layer
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn = 
\#T\:Raster Layer Info
 
org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.raster-statistics=
 \#T\:Raster statistics
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.file.bands 
= \#T\:Raster bands

Modified: core/trunk/src/language/jump_pt_BR.properties
===================================================================
--- core/trunk/src/language/jump_pt_BR.properties       2015-07-06 09:45:34 UTC 
(rev 4527)
+++ core/trunk/src/language/jump_pt_BR.properties       2015-07-08 05:36:39 UTC 
(rev 4528)
@@ -1010,6 +1010,7 @@
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.value = \#T\:value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.previous.value = 
\#T\:Previous value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.info = \#T\:The selected 
raster is not a monoband raster
+org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.message= \#T\:Inspection 
outside the extension of selected Raster layer
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn = 
\#T\:Raster Layer Info
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.file.bands 
= \#T\:Raster bands
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.file.size 
= \#T\:Raster size

Modified: core/trunk/src/language/jump_ta_IN.properties
===================================================================
--- core/trunk/src/language/jump_ta_IN.properties       2015-07-06 09:45:34 UTC 
(rev 4527)
+++ core/trunk/src/language/jump_ta_IN.properties       2015-07-08 05:36:39 UTC 
(rev 4528)
@@ -1008,6 +1008,7 @@
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.value = \#T\:value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.previous.value = 
\#T\:Previous value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.info = \#T\:The selected 
raster is not a monoband raster
+org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.message= \#T\:Inspection 
outside the extension of selected Raster layer
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn = 
\#T\:Raster Layer Info
 
org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.raster-statistics=
 \#T\:Raster statistics
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.file.bands 
= \#T\:Raster bands

Modified: core/trunk/src/language/jump_te.properties
===================================================================
--- core/trunk/src/language/jump_te.properties  2015-07-06 09:45:34 UTC (rev 
4527)
+++ core/trunk/src/language/jump_te.properties  2015-07-08 05:36:39 UTC (rev 
4528)
@@ -1184,6 +1184,7 @@
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.value = \#T\:value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.previous.value = 
\#T\:Previous value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.info = \#T\:The selected 
raster is not a monoband raster
+org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.message= \#T\:Inspection 
outside the extension of selected Raster layer
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn = 
\#T\:Raster Layer Info
 
org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.raster-statistics=
 \#T\:Raster statistics
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.file.bands 
= \#T\:Raster bands

Modified: core/trunk/src/language/jump_zh_CN.properties
===================================================================
--- core/trunk/src/language/jump_zh_CN.properties       2015-07-06 09:45:34 UTC 
(rev 4527)
+++ core/trunk/src/language/jump_zh_CN.properties       2015-07-08 05:36:39 UTC 
(rev 4528)
@@ -1004,6 +1004,7 @@
 org.openjump.core.ui.plugin.raster.ProfileGraphTool.values = \u503c
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn = \#T\:Pixel inspection
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.value = \#T\:value
+org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.message= \#T\:Inspection 
outside the extension of selected Raster layer
 org.openjump.core.ui.plugin.raster.ProfileGraphTool.Profile= \#T\:Profile
 org.openjump.core.ui.plugin.raster.ProfileGraphTool.Profile-info= \#T\:Info 
Profile
 org.openjump.core.ui.plugin.raster.ProfileGraphTool.Profile-length= \#T\:Length

Modified: core/trunk/src/language/jump_zh_HK.properties
===================================================================
--- core/trunk/src/language/jump_zh_HK.properties       2015-07-06 09:45:34 UTC 
(rev 4527)
+++ core/trunk/src/language/jump_zh_HK.properties       2015-07-08 05:36:39 UTC 
(rev 4528)
@@ -1013,6 +1013,7 @@
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.value = \#T\:value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.previous.value = 
\#T\:Previous value
 org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.info = \#T\:The selected 
raster is not a monoband raster
+org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.message= \#T\:Inspection 
outside the extension of selected Raster layer
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn = 
\#T\:Raster Layer Info
 
org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.raster-statistics==
 \#T\:Raster statistics
 org.openjump.core.ui.plugin.raster.RasterImageLayerPropertiesPlugIn.file.bands 
= \#T\:Raster bands

Modified: 
core/trunk/src/org/openjump/core/ui/plugin/raster/RasterQueryCursorTool.java
===================================================================
--- 
core/trunk/src/org/openjump/core/ui/plugin/raster/RasterQueryCursorTool.java    
    2015-07-06 09:45:34 UTC (rev 4527)
+++ 
core/trunk/src/org/openjump/core/ui/plugin/raster/RasterQueryCursorTool.java    
    2015-07-08 05:36:39 UTC (rev 4528)
@@ -42,10 +42,8 @@
 import java.io.IOException;
 
 import javax.swing.Icon;
-import javax.swing.JTextPane;
 
 import org.openjump.core.CheckOS;
-import org.openjump.core.apitools.LayerTools;
 import org.openjump.core.rasterimage.RasterImageLayer;
 import 
org.openjump.core.rasterimage.RasterImageLayer.RasterDataNotFoundException;
 
@@ -62,10 +60,12 @@
 import com.vividsolutions.jump.feature.FeatureSchema;
 import com.vividsolutions.jump.workbench.WorkbenchContext;
 import com.vividsolutions.jump.workbench.model.Layer;
+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.LayerNamePanel;
 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;
@@ -83,7 +83,8 @@
      * 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
+     * [2014_02_24] Giuseppe Aruta - Fixed minor bug on lower panel
+     * [2015_07_08] Giuseppe Aruta - Fixed bug #407 Sextante raster : 
displaying cell values throws NPE 
      */
 
     protected Coordinate tentativeCoordinate;
@@ -98,6 +99,8 @@
     private String VALUE = I18N
             .get("org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.value");
     private String name;
+    PlugInContext context;
+    LayerNamePanel namePanel;
 
     public RasterQueryCursorTool() {
         super(1);
@@ -116,66 +119,76 @@
         return createCursor(i);
     }
 
-    RasterImageLayer rLayer = (RasterImageLayer) LayerTools
-            .getSelectedLayerable(this.getWorkbench().getContext(),
-                    RasterImageLayer.class);
-
     protected void gestureFinished() throws NoninvertibleTransformException,
             IOException, RasterDataNotFoundException {
         reportNothingToUndoYet();
-        JTextPane txt = new JTextPane();
 
-        RasterImageLayer rLayer = (RasterImageLayer) LayerTools
-                .getSelectedLayerable(this.getWorkbench().getContext(),
-                        RasterImageLayer.class);
-        name = rLayer.getName();
-        Coordinate coord = (Coordinate) getCoordinates().get(0);
-        String cellValues = null;
-        if (getPoint().within(rLayer.getWholeImageEnvelopeAsGeometry())) {
-            try {
-                cellValues = "";
-                for (int b = 0; b < rLayer.getNumBands(); b++) {
-                    Double cellValue = rLayer.getCellValue(coord.x, coord.y, 
b);
-                    if (cellValue != null) {
-                        if (rLayer.isNoData(cellValue)) {
-                            cellValues = Double.toString(Double.NaN);
-                        } else {
-                            cellValues = cellValues.concat(Double
-                                    .toString(cellValue));
+        RasterImageLayer rLayer = null;
+
+        final WorkbenchContext wbcontext = this.getWorkbench().getContext();
+        RasterImageLayer aLayer = null;
+       
+        Layerable[] ls = (Layerable[]) wbcontext.getLayerNamePanel()
+                .selectedNodes(RasterImageLayer.class)
+                .toArray(new Layerable[] {});
+        if (ls != null && ls.length > 0) {
+            rLayer = (RasterImageLayer) ls[0];
+
+            name = rLayer.getName();
+            Coordinate coord = (Coordinate) getCoordinates().get(0);
+            String cellValues = null;
+            if (getPoint().within(rLayer.getWholeImageEnvelopeAsGeometry())) {
+                try {
+                    cellValues = "";
+                    for (int b = 0; b < rLayer.getNumBands(); b++) {
+                        Double cellValue = rLayer.getCellValue(coord.x,
+                                coord.y, b);
+                        if (cellValue != null) {
+                            if (rLayer.isNoData(cellValue)) {
+                                cellValues = Double.toString(Double.NaN);
+                            } else {
+                                cellValues = cellValues.concat(Double
+                                        .toString(cellValue));
+                            }
                         }
+                        cellValues = cellValues.concat("  ");
+                        if (Double.isNaN(cellValue))
+                            this.lastClick = "    ";
+                        else {
+                            this.lastClick = cellValues;
+                        }
                     }
-                    cellValues = cellValues.concat("  ");
-                    if (Double.isNaN(cellValue))
-                        this.lastClick = "    ";
-                    else {
-                        this.lastClick = cellValues;
-                    }
+                } catch (RasterDataNotFoundException ex) {
+                    cellValues = "???";
                 }
-            } catch (RasterDataNotFoundException ex) {
-                cellValues = "???";
-            }
-            Geometry measureGeometry = null;
-            if (wasShiftPressed()) {
-                pixelLayer().getFeatureCollectionWrapper().clear();
-                pixelLayer().getFeatureCollectionWrapper().add(
-                        toFeature(measureGeometry, pixelLayer()
-                                .getFeatureCollectionWrapper()
-                                .getFeatureSchema()));
+                Geometry measureGeometry = null;
+                if (wasShiftPressed()) {
+                    pixelLayer().getFeatureCollectionWrapper().clear();
+                    pixelLayer().getFeatureCollectionWrapper().add(
+                            toFeature(measureGeometry, pixelLayer()
+                                    .getFeatureCollectionWrapper()
+                                    .getFeatureSchema()));
+                } else {
+
+                    pixelLayer().getFeatureCollectionWrapper().add(
+                            toFeature(measureGeometry, pixelLayer()
+                                    .getFeatureCollectionWrapper()
+                                    .getFeatureSchema()));
+                }
+                getPanel().getContext().setStatusMessage(
+                        "(" + name + ") " + VALUE + ": " + lastClick);
             } else {
-
-                pixelLayer().getFeatureCollectionWrapper().add(
-                        toFeature(measureGeometry, pixelLayer()
-                                .getFeatureCollectionWrapper()
-                                .getFeatureSchema()));
+                getPanel()
+                        .getContext()
+                        .warnUser(
+                                
I18N.get("org.openjump.core.ui.plugin.raster.RasterQueryPlugIn.message"));
             }
-            getPanel().getContext().setStatusMessage(
-                    "(" + name + ") " + VALUE + ": " + lastClick);
-        } else {
+        } else
             getPanel()
                     .getContext()
                     .warnUser(
-                            "Inspection outside the extension of selected 
Raster layer");
-        }
+                            
I18N.get("org.openjump.core.rasterimage.SelectRasterImageFilesPanel.Select-Raster-Image"));
+
     }
 
     private Feature toFeature(Geometry measureGeometry, FeatureSchema schema)


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to