Index: InfoByPixelPointViewTool.java
===================================================================
--- InfoByPixelPointViewTool.java	(revision 7270)
+++ InfoByPixelPointViewTool.java	(revision 7271)
@@ -2,22 +2,22 @@
 *
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
 * of the Valencian Government (CIT)
-* 
+*
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
-* 
+*
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
-* 
+*
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA  02110-1301, USA.
-* 
+*
 */
 package org.gvsig.raster.wms.app.wmsclient.infobypoint.viewtool;
 
@@ -51,7 +51,7 @@
 /**
  * Extensión de la clase SelectImageListenerImple de FMap. Esta clase permite
  * capturar el evento de la selección de un punto RGB sobre la vista
- * 
+ *
  * 22/02/2008
  * @author Nacho Brodin (nachobrodin@gmail.com)
  */
@@ -63,23 +63,23 @@
 	private FLayers                  layers              = null;
 	private List<String>             list                = null;
 	private MainInfoByPointDialog    dialog              = null;
-	
+
 	/**
 	 * Reference to the <code>MapControl</code> object that uses.
 	 */
 	protected MapControl mapCtrl;
 
 	/**
-	 * World equivalent coordinates of the point 2D 
+	 * World equivalent coordinates of the point 2D
 	 */
 	protected Point2D wcPoint = null;
-	
+
 	/**
 	 * Contructor
 	 * @param mapCtrl
 	 */
 	public InfoByPixelPointViewTool(
-			MapControl mapCtrl, 
+			MapControl mapCtrl,
 			InfoByPointDataModel model,
 			MainInfoByPointDialog dialog) {
 		this.mapCtrl = mapCtrl;
@@ -100,24 +100,24 @@
 		int r = (value >> 16) & 0xff;
 		int g = (value >> 8) & 0xff;
 		int b = value & 0xff;
-		
+
 		double[] cmyk = conv.RGBtoCMYK(r & 0xff, g & 0xff, b & 0xff, 1D);
-		
+
 		double[] hsl = conv.RGBtoHSL(r & 0xff, g & 0xff, b & 0xff);
 		hsl[0] = (int)(255.0 * hsl[0] / 360.0 + 0.5);
 		hsl[2] = (int) (hsl[2] * 255. + 0.5);
 		hsl[1] = (int) (hsl[1] * 255. + 0.5);
-		
+
 		Point2D mapPoint = viewPort.toMapPoint(point2D);
-		
+
 		model.setARGB(r, g, b);
 		model.setCMYK(cmyk);
 		model.setHSL(hsl[0], hsl[1], hsl[2]);
 		model.setViewPoint(point2D.getX(), point2D.getY());
 		model.setWorldPoint(mapPoint.getX(), mapPoint.getY());
-		
+
 		//Raster dependent
-		
+
 		list.clear();
 		FLyrWMS selected = null;
 		for (int i = layers.getLayersCount() - 1; i >= 0; i--) {
@@ -131,12 +131,35 @@
 				}
 			}
 		}
-		
+
 		if(selected != null) {
 			Point2D rasterPoint = selected.getDataStore().worldToRaster(mapPoint);
 			model.setNumberOfBands(selected.getDataStore().getBandCount());
 			model.setBandValues(getBandValues(selected.getDataStore(), rasterPoint));
 			model.setPixelPoint(rasterPoint.getX(), rasterPoint.getY());
+
+			Point p = new Point();
+			p.setLocation(point2D.getX(), point2D.getY());
+			try {
+			    DynObjectSetWMSInfo dos = (DynObjectSetWMSInfo)selected.getInfo(p, 0D, null, true);
+			    String txt = dos.getInfoElement();
+			    if(dos.getTypeInfo().compareTo("text/plain") == 0)
+			        dialog.setWMSInfoText(txt, dos.getTypeInfo());
+			    else if(dos.getTypeInfo().compareTo("text/html") == 0) {
+			        int beginIndex = txt.indexOf("<html");
+			        if(beginIndex > 0)
+			            txt = txt.substring(beginIndex, txt.length());
+			        dialog.setWMSInfoText(txt, "text/html");
+			    } else if(dos.getTypeInfo().endsWith("vnd.ogc.gml") || dos.getTypeInfo().compareTo("text/xml") == 0) {
+			        dialog.setWMSInfoText(txt, "text/xml");
+			    }else
+			        dialog.setWMSInfoText(txt, "text/html");
+
+			} catch (LoadLayerException e) {
+			    e.printStackTrace();
+			} catch (DataException e) {
+			    e.printStackTrace();
+			}
 		} else {
 			list.clear();
 			list.add("...");
@@ -145,32 +168,10 @@
 			model.setPixelPoint(-1, -1);
 		}
 		model.setLayerList(list);
-		
-		Point p = new Point();
-		p.setLocation(point2D.getX(), point2D.getY());
-		try {
-			DynObjectSetWMSInfo dos = (DynObjectSetWMSInfo)selected.getInfo(p, 0D, null, true);
-			String txt = dos.getInfoElement();
-			if(dos.getTypeInfo().compareTo("text/plain") == 0)
-				dialog.setWMSInfoText(txt, dos.getTypeInfo());
-			else if(dos.getTypeInfo().compareTo("text/html") == 0) {
-				int beginIndex = txt.indexOf("<html");
-				if(beginIndex > 0)
-					txt = txt.substring(beginIndex, txt.length());
-				dialog.setWMSInfoText(txt, "text/html");
-			} else if(dos.getTypeInfo().endsWith("vnd.ogc.gml") || dos.getTypeInfo().compareTo("text/xml") == 0) {
-				dialog.setWMSInfoText(txt, "text/xml");
-			}else
-				dialog.setWMSInfoText(txt, "text/html");
-				
-		} catch (LoadLayerException e) {
-			e.printStackTrace();
-		} catch (DataException e) {
-			e.printStackTrace();
-		}
+
 		model.notifyObservers();
 	}
-	
+
 	/**
 	 * Loads the values of a pixel point
 	 * @param dataStore
@@ -209,7 +210,7 @@
 			for (int i = 0; i < dataStore.getBandCount(); i++) {
 				res[i] = Double.NaN;
 			}
-		} 
+		}
 		return res;
 	}
 
