Index: FLyrVect.java
===================================================================
--- FLyrVect.java	(revision 42288)
+++ FLyrVect.java	(revision 42289)
@@ -3,23 +3,22 @@
  *
  * Copyright (C) 2007-2013 gvSIG Association.
  *
- * 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 3
- * of the License, or (at your option) any later version.
+ * 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 3 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.
+ * 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,
- * MA  02110-1301, USA.
+ * 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, MA 02110-1301, USA.
  *
- * For any additional information, do not hesitate to contact us
- * at info AT gvsig.com, or visit our website www.gvsig.com.
+ * For any additional information, do not hesitate to contact us at info AT
+ * gvsig.com, or visit our website www.gvsig.com.
  */
 package org.gvsig.fmap.mapcontext.layers.vectorial;
 
@@ -89,24 +88,24 @@
 import org.gvsig.tools.persistence.PersistenceManager;
 import org.gvsig.tools.persistence.PersistentState;
 import org.gvsig.tools.persistence.exception.PersistenceException;
-import org.gvsig.tools.persistence.exception.PersistenceRuntimeException;
 import org.gvsig.tools.task.Cancellable;
 import org.gvsig.tools.util.Callable;
 
 /**
  * Capa básica Vectorial.
- * 
+ *
  */
-
 public class FLyrVect extends FLyrDefault implements VectorLayer,
-    LegendContentsChangedListener, Observer {
+        LegendContentsChangedListener, Observer {
 
-    final static private org.slf4j.Logger logger =
-        LoggerFactory.getLogger(FLyrVect.class);
-    private final GeometryManager geomManager =
-        GeometryLocator.getGeometryManager();
+    final static private org.slf4j.Logger logger
+            = LoggerFactory.getLogger(FLyrVect.class);
+    private final GeometryManager geomManager
+            = GeometryLocator.getGeometryManager();
 
-    /** Leyenda de la capa vectorial */
+    /**
+     * Leyenda de la capa vectorial
+     */
     private IVectorLegend legend;
     private int typeShape = -1;
     private FeatureStore featureStore = null;
@@ -125,23 +124,23 @@
     public FLyrVect() {
         super();
     }
-    
-	public String getTocImageIcon() {
-	    if (this.isAvailable()) {
+
+    public String getTocImageIcon() {
+        if (this.isAvailable()) {
             return MapContextLocator.getMapContextManager().getIconLayer(this.getDataStore());
-	    } else {
-	        /*
-	         * data store can be be null,
-	         * for example, a layer not loaded from persistence
-	         */
+        } else {
+            /*
+             * data store can be be null,
+             * for example, a layer not loaded from persistence
+             */
             return "layer-icon-unavailable";
-	    }
-		
-	}
+        }
 
+    }
+
     /**
      * Devuelve el VectorialAdapater de la capa.
-     * 
+     *
      * @return VectorialAdapter.
      */
     public DataStore getDataStore() {
@@ -150,22 +149,22 @@
         }
         return featureStore;
     }
-    
+
     /**
-     * Asigna el data-store a la capa.
-     * Esta operacion no se deneria poder hacer desde fuera de la clase.
-     * 
+     * Asigna el data-store a la capa. Esta operacion no se deneria poder hacer
+     * desde fuera de la clase.
+     *
      * @param dataStore
      * @throws LoadLayerException
      * @deprecated use {@link #bindToDataStore(DataStore)}
      */
     public void setDataStore(DataStore dataStore) throws LoadLayerException {
-    	bindToDataStore(dataStore);
+        bindToDataStore(dataStore);
     }
-    
+
     /**
      * Enlaza la capa con el DataStore indicado.
-     *  
+     *
      * @param dataStore
      * @throws LoadLayerException
      */
@@ -176,12 +175,12 @@
 
         featureStore = (FeatureStore) dataStore;
 
-        MapContextManager mapContextManager =
-            MapContextLocator.getMapContextManager();
-        
+        MapContextManager mapContextManager
+                = MapContextLocator.getMapContextManager();
+
         //Set the legend
-        IVectorLegend legend =
-            (IVectorLegend)mapContextManager.getLegend(dataStore);
+        IVectorLegend legend
+                = (IVectorLegend) mapContextManager.getLegend(dataStore);
 
         if (legend == null) {
             throw new LegendLayerException(this.getName());
@@ -190,14 +189,14 @@
         this.setLegend(legend);
 
         //Set the labeling strategy
-        ILabelingStrategy labeler = 
-            (ILabelingStrategy) mapContextManager.getLabelingStrategy(dataStore);
+        ILabelingStrategy labeler
+                = (ILabelingStrategy) mapContextManager.getLabelingStrategy(dataStore);
 
         if (labeler != null) {
             labeler.setLayer(this);
             this.setLabelingStrategy(labeler);
             this.setIsLabeled(true); // TODO: ací no s'hauria de detectar si té
-                                     // etiquetes?????
+            // etiquetes?????
         }
 
         this.delegate(dataStore);
@@ -218,10 +217,10 @@
         // Esto es para cuando se crea una capa nueva con el fullExtent de ancho
         // y alto 0.
         if (rAux == null || rAux.isEmpty() || rAux.getMaximum(0) - rAux.getMinimum(0) == 0
-            && rAux.getMaximum(1) - rAux.getMinimum(1) == 0) {
+                && rAux.getMaximum(1) - rAux.getMinimum(1) == 0) {
             try {
-                rAux =
-                    geomManager.createEnvelope(0, 0, 90, 90, SUBTYPES.GEOM2D);
+                rAux
+                        = geomManager.createEnvelope(0, 0, 90, 90, SUBTYPES.GEOM2D);
             } catch (CreateEnvelopeException e) {
                 logger.error("Error creating the envelope", e);
                 e.printStackTrace();
@@ -230,7 +229,7 @@
         // Si existe reproyección, reproyectar el extent
         ICoordTrans ct = getCoordTrans();
         if (ct != null) {
-        	rAux = rAux.convert(ct);
+            rAux = rAux.convert(ct);
         }
         return rAux;
 
@@ -239,7 +238,7 @@
     /**
      * Draws using IFeatureIterator. This method will replace the old draw(...)
      * one.
-     * 
+     *
      * @autor jaume dominguez faus - jaume.dominguez@iver.es
      * @param image
      * @param g
@@ -249,10 +248,10 @@
      * @throws ReadDriverException
      */
     public void draw(BufferedImage image,
-        Graphics2D g,
-        ViewPort viewPort,
-        Cancellable cancel,
-        double scale) throws ReadException {
+            Graphics2D g,
+            ViewPort viewPort,
+            Cancellable cancel,
+            double scale) throws ReadException {
 
         if (legend == null) {
             return;
@@ -272,13 +271,13 @@
 
         FeatureQuery featureQuery = null;
         try {
-            FeatureAttributeDescriptor featureAttributeDescriptor =
-                getFeatureStore().getDefaultFeatureType().getDefaultTimeAttribute();
+            FeatureAttributeDescriptor featureAttributeDescriptor
+                    = getFeatureStore().getDefaultFeatureType().getDefaultTimeAttribute();
 
-            if ((viewPort.getTime() != null) && (featureAttributeDescriptor != null)){
+            if ((viewPort.getTime() != null) && (featureAttributeDescriptor != null)) {
                 featureQuery = getFeatureStore().createFeatureQuery();
-                IntersectsTimeEvaluator intersectsTimeEvaluator =
-                    new IntersectsTimeEvaluator(viewPort.getTime(), featureAttributeDescriptor.getName());
+                IntersectsTimeEvaluator intersectsTimeEvaluator
+                        = new IntersectsTimeEvaluator(viewPort.getTime(), featureAttributeDescriptor.getName());
                 featureQuery.addFilter(intersectsTimeEvaluator);
             }
         } catch (DataException e1) {
@@ -286,22 +285,22 @@
         }
 
         try {
-            
+
             long tini = System.currentTimeMillis();
-            
+
             legend.draw(image,
-                g,
-                viewPort,
-                cancel,
-                scale,
-                null,
-                getCoordTrans(),
-                getFeatureStore(),
-                featureQuery);
-            
-            logger.debug("Layer " + this.getName() + " drawn in " +
-                (System.currentTimeMillis() - tini) + " milliseconds.");
+                    g,
+                    viewPort,
+                    cancel,
+                    scale,
+                    null,
+                    getCoordTrans(),
+                    getFeatureStore(),
+                    featureQuery);
 
+            logger.debug("Layer " + this.getName() + " drawn in "
+                    + (System.currentTimeMillis() - tini) + " milliseconds.");
+
         } catch (LegendException e) {
             this.setVisible(false);
             this.setActive(false);
@@ -314,10 +313,10 @@
     }
 
     public void print(Graphics2D g,
-        ViewPort viewPort,
-        Cancellable cancel,
-        double scale,
-        PrintAttributes properties) throws ReadException {
+            ViewPort viewPort,
+            Cancellable cancel,
+            double scale,
+            PrintAttributes properties) throws ReadException {
         if (!this.isWithinScale(scale)) {
             return;
         }
@@ -327,14 +326,14 @@
 
         try {
             legend.print(g,
-                viewPort,
-                cancel,
-                scale,
-                null,
-                getCoordTrans(),
-                getFeatureStore(),
-                null,
-                properties);
+                    viewPort,
+                    cancel,
+                    scale,
+                    null,
+                    getCoordTrans(),
+                    getFeatureStore(),
+                    null,
+                    properties);
 
         } catch (LegendException e) {
             this.setVisible(false);
@@ -360,8 +359,8 @@
             this.legend.addDrawingObserver(this);
             this.legend.addLegendListener(this);
         }
-        LegendChangedEvent e =
-            LegendChangedEvent.createLegendChangedEvent(oldLegend, this.legend);
+        LegendChangedEvent e
+                = LegendChangedEvent.createLegendChangedEvent(oldLegend, this.legend);
         e.setLayer(this);
         updateDrawVersion();
         callLegendChanged(e);
@@ -369,7 +368,7 @@
 
     /**
      * Devuelve la Leyenda de la capa.
-     * 
+     *
      * @return Leyenda.
      */
     public ILegend getLegend() {
@@ -377,76 +376,75 @@
     }
 
     public int getShapeType() throws ReadException {
-    	if (typeShape == -1) {
-    		FeatureType featureType = null;
-    		try {
-    			if( getDataStore()!=null ){
-    				featureType =
-    					(((FeatureStore) getDataStore()).getDefaultFeatureType());
-    			}
-    		} catch (DataException e) {
-    			throw new ReadException(getName(), e);
-    		}
-    		if( featureType!=null ){
-    			int indexGeom = featureType.getDefaultGeometryAttributeIndex();
-    			typeShape =
-    				featureType.getAttributeDescriptor(indexGeom).getGeometryType();
-    		}
-    	}
-    	return typeShape;
+        if (typeShape == -1) {
+            FeatureType featureType = null;
+            try {
+                if (getDataStore() != null) {
+                    featureType
+                            = (((FeatureStore) getDataStore()).getDefaultFeatureType());
+                }
+            } catch (DataException e) {
+                throw new ReadException(getName(), e);
+            }
+            if (featureType != null) {
+                int indexGeom = featureType.getDefaultGeometryAttributeIndex();
+                typeShape
+                        = featureType.getAttributeDescriptor(indexGeom).getGeometryType();
+            }
+        }
+        return typeShape;
     }
 
     /**
      * Returns the layer's geometry type
-     * 
+     *
      * @return the geometry type
-     * 
-     * @throws ReadException
-     *             if there is an error getting the geometry type
+     *
+     * @throws ReadException if there is an error getting the geometry type
      */
     public GeometryType getGeometryType() throws ReadException {
         FeatureType featureType = null;
         try {
             if (getDataStore() != null) {
-                featureType =
-                    (((FeatureStore) getDataStore()).getDefaultFeatureType());
+                featureType
+                        = (((FeatureStore) getDataStore()).getDefaultFeatureType());
             }
         } catch (DataException e) {
             throw new ReadException(getName(), e);
         }
         return featureType == null ? null : featureType
-            .getDefaultGeometryAttribute().getGeomType();
+                .getDefaultGeometryAttribute().getGeomType();
     }
 
     public void saveToState(PersistentState state) throws PersistenceException {
 
         FeatureStore featureStore = null;
 
-        if ( !this.isAvailable() ) {
+        if (!this.isAvailable()) {
             logger.info("The '" + this.getName() + "' layer is not available, it will persist not.");
             return;
         }
-        
+
         try {
             super.saveToState(state);
 
-            if ( getLegend() != null ) {
+            if (getLegend() != null) {
                 state.set("legend", getLegend());
             }
 
             featureStore = getFeatureStore();
 
-            if ( featureStore != null ) {
+            if (featureStore != null) {
                 state.set("featureStore", featureStore);
             }
 
             state.set("isLabeled", isLabeled);
 
-            if ( strategy != null ) {
+            if (strategy != null) {
                 state.set("labelingStrategy", strategy);
             }
 
-            if ( getLinkProperties() != null ) {
+            if (getLinkProperties() != null) {
                 state.set("linkProperties", getLinkProperties());
             }
 
@@ -461,7 +459,6 @@
 
     }
 
-
     public void loadFromState(PersistentState state) throws PersistenceException {
 
         DataStore store = null;
@@ -470,16 +467,15 @@
         Boolean isLabeled = Boolean.FALSE;
 
         try {
-                super.loadFromState(state);
-                store = (DataStore) state.get("featureStore");
+            super.loadFromState(state);
+            store = (DataStore) state.get("featureStore");
 
             try {
                 this.bindToDataStore(store);
             } catch (LoadLayerException e) {
-                throw new PersistenceException("Can't bind layer '"+this.getName()+"' to store '"+store.getFullName()+"'.",e);
+                throw new PersistenceException("Can't bind layer '" + this.getName() + "' to store '" + store.getFullName() + "'.", e);
             }
 
-
             vectorLegend = (IVectorLegend) state.get("legend");
 
             try {
@@ -488,10 +484,9 @@
                 throw new PersistenceException("Can't set vector legend to the layer.", e);
             }
 
-
             try {
                 isLabeled = (Boolean) state.get("isLabeled");
-                if ( isLabeled.booleanValue() ) {
+                if (isLabeled.booleanValue()) {
                     labelingStrategy = (ILabelingStrategy) state.get("labelingStrategy");
                 }
             } catch (Exception ex) {
@@ -499,7 +494,7 @@
                         ex);
             }
 
-            if ( isLabeled.booleanValue() ) {
+            if (isLabeled.booleanValue()) {
                 this.setIsLabeled(true);
                 this.setLabelingStrategy(labelingStrategy);
             } else {
@@ -510,8 +505,8 @@
             typeShape = state.getInt("typeShape");
 
         } catch (Throwable e) {
-            String storeName = (store == null)? "unknow" : store.getFullName();
-            logger.warn("can't load layer '" + this.getName() + "' (store="+storeName+") from persisted state.", e);
+            String storeName = (store == null) ? "unknow" : store.getFullName();
+            logger.warn("can't load layer '" + this.getName() + "' (store=" + storeName + ") from persisted state.", e);
             this.setAvailable(false);
             return;
         }
@@ -521,7 +516,7 @@
     /**
      * Sobreimplementación del método toString para que las bases de datos
      * identifiquen la capa.
-     * 
+     *
      * @return DOCUMENT ME!
      */
     public String toString() {
@@ -546,20 +541,19 @@
             return fs.isEditing();
         }
     }
-    
-    
+
     public void setEditing(boolean b) throws StartEditionLayerException {
-        
+
         try {
             throw new RuntimeException();
         } catch (Throwable th) {
             logger.info("This method is deprecated. ", th);
         }
-        
+
         if (b == super.isEditing()) {
             return;
         }
-        
+
         super.setEditing(b);
         FeatureStore fs = getFeatureStore();
         if (b) {
@@ -573,7 +567,6 @@
         callEditionChanged(LayerEvent.createEditionChangedEvent(this, "edition"));
     }
 
-
     /**
      * @deprecated Use {@link #getSpatialCache()}
      */
@@ -601,7 +594,7 @@
 
     /**
      * Siempre es un numero mayor de 1000
-     * 
+     *
      * @param maxFeatures
      */
     public void setMaxFeaturesInEditionCache(int maxFeatures) {
@@ -612,13 +605,11 @@
     }
 
     /**
-     * This method returns a boolean that is used by the FPopMenu
-     * to make visible the properties menu or not. It is visible by
-     * default, and if a later don't have to show this menu only
-     * has to override this method.
-     * 
-     * @return
-     *         If the properties menu is visible (or not)
+     * This method returns a boolean that is used by the FPopMenu to make
+     * visible the properties menu or not. It is visible by default, and if a
+     * later don't have to show this menu only has to override this method.
+     *
+     * @return If the properties menu is visible (or not)
      */
     public boolean isPropertiesMenuVisible() {
         return true;
@@ -691,19 +682,19 @@
     }
 
     protected boolean isOnePoint(AffineTransform graphicsTransform,
-        ViewPort viewPort,
-        double dpi,
-        CartographicSupport csSym,
-        Geometry geom,
-        int[] xyCoords) {
+            ViewPort viewPort,
+            double dpi,
+            CartographicSupport csSym,
+            Geometry geom,
+            int[] xyCoords) {
         return isOnePoint(graphicsTransform, viewPort, geom, xyCoords)
-            && csSym.getCartographicSize(viewPort, dpi, geom) <= 1;
+                && csSym.getCartographicSize(viewPort, dpi, geom) <= 1;
     }
 
     private boolean isOnePoint(AffineTransform graphicsTransform,
-        ViewPort viewPort,
-        Geometry geom,
-        int[] xyCoords) {
+            ViewPort viewPort,
+            Geometry geom,
+            int[] xyCoords) {
         boolean onePoint = false;
         int type = geom.getType();
         if (type == Geometry.TYPES.NULL) {
@@ -714,26 +705,24 @@
             Envelope geomBounds = geom.getEnvelope();
 
             // ICoordTrans ct = getCoordTrans();
-
             // Se supone que la geometria ya esta reproyectada
             // if (ct!=null) {
             // // geomBounds = ct.getInverted().convert(geomBounds);
             // geomBounds = geomBounds.convert(ct);
             // }
-
             double dist1Pixel = viewPort.getDist1pixel();
 
-            onePoint =
-                (geomBounds.getLength(0) <= dist1Pixel && geomBounds.getLength(1) <= dist1Pixel);
+            onePoint
+                    = (geomBounds.getLength(0) <= dist1Pixel && geomBounds.getLength(1) <= dist1Pixel);
 
             if (onePoint) {
                 // avoid out of range exceptions
                 org.gvsig.fmap.geom.primitive.Point p;
                 try {
-                    p =
-                        geomManager.createPoint(geomBounds.getMinimum(0),
-                            geomBounds.getMinimum(1),
-                            SUBTYPES.GEOM2D);
+                    p
+                            = geomManager.createPoint(geomBounds.getMinimum(0),
+                                    geomBounds.getMinimum(1),
+                                    SUBTYPES.GEOM2D);
                     p.transform(viewPort.getAffineTransform());
                     p.transform(graphicsTransform);
                     xyCoords[0] = (int) p.getX();
@@ -770,21 +759,21 @@
     }
 
     public void drawLabels(BufferedImage image,
-        Graphics2D g,
-        ViewPort viewPort,
-        Cancellable cancel,
-        double scale,
-        double dpi) throws ReadException {
+            Graphics2D g,
+            ViewPort viewPort,
+            Cancellable cancel,
+            double scale,
+            double dpi) throws ReadException {
         if (strategy != null && isWithinScale(scale)) {
             strategy.draw(image, g, scale, viewPort, cancel, dpi);
         }
     }
 
     public void printLabels(Graphics2D g,
-        ViewPort viewPort,
-        Cancellable cancel,
-        double scale,
-        PrintAttributes properties) throws ReadException {
+            ViewPort viewPort,
+            Cancellable cancel,
+            double scale,
+            PrintAttributes properties) throws ReadException {
         if (strategy != null) {
             strategy.print(g, scale, viewPort, cancel, properties);
         }
@@ -792,7 +781,7 @@
 
     /**
      * Return true, because a Vectorial Layer supports HyperLink
-     * 
+     *
      * @deprecated the hiperlink functionaliti is out the layer now
      */
     public boolean allowLinks() {
@@ -808,22 +797,23 @@
     }
 
     /**
-     * @deprecated use instead {@link #queryByPoint(org.gvsig.fmap.geom.primitive.Point, double, FeatureType)}
+     * @deprecated use instead
+     * {@link #queryByPoint(org.gvsig.fmap.geom.primitive.Point, double, FeatureType)}
      */
     public FeatureSet queryByPoint(Point2D mapPoint,
-        double tol,
-        FeatureType featureType) throws DataException {
+            double tol,
+            FeatureType featureType) throws DataException {
         logger.warn("Deprecated use of queryByPoint.");
         GeometryManager manager = GeometryLocator.getGeometryManager();
         org.gvsig.fmap.geom.primitive.Point center;
         try {
-            center =
-                (org.gvsig.fmap.geom.primitive.Point) manager.create(TYPES.POINT,
-                    SUBTYPES.GEOM2D);
+            center
+                    = (org.gvsig.fmap.geom.primitive.Point) manager.create(TYPES.POINT,
+                            SUBTYPES.GEOM2D);
             center.setX(mapPoint.getX());
             center.setY(mapPoint.getY());
-            Circle circle =
-                (Circle) manager.create(TYPES.CIRCLE, SUBTYPES.GEOM2D);
+            Circle circle
+                    = (Circle) manager.create(TYPES.CIRCLE, SUBTYPES.GEOM2D);
             circle.setPoints(center, tol);
             return queryByGeometry(circle, featureType);
         } catch (org.gvsig.fmap.geom.exception.CreateGeometryException e) {
@@ -832,12 +822,12 @@
     }
 
     public FeatureSet queryByPoint(org.gvsig.fmap.geom.primitive.Point point,
-        double tol,
-        FeatureType featureType) throws DataException {
+            double tol,
+            FeatureType featureType) throws DataException {
         GeometryManager manager = GeometryLocator.getGeometryManager();
         try {
-            Circle circle =
-                (Circle) manager.create(TYPES.CIRCLE, SUBTYPES.GEOM2D);
+            Circle circle
+                    = (Circle) manager.create(TYPES.CIRCLE, SUBTYPES.GEOM2D);
             circle.setPoints(point, tol);
             return queryByGeometry(circle, featureType);
         } catch (org.gvsig.fmap.geom.exception.CreateGeometryException e) {
@@ -847,7 +837,7 @@
 
     /**
      * Input geom must be in the CRS of the view.
-     * 
+     *
      * @param geom
      * @param featureType
      * @return
@@ -855,23 +845,23 @@
      */
     public FeatureSet queryByGeometry(Geometry geom, FeatureType featureType) throws DataException {
         FeatureQuery featureQuery = featureStore.createFeatureQuery();
-        String geomName =
-            featureStore.getDefaultFeatureType()
+        String geomName
+                = featureStore.getDefaultFeatureType()
                 .getDefaultGeometryAttributeName();
         featureQuery.setFeatureType(featureType);
-        
+
         Geometry query_geo = this.transformToSourceCRS(geom, true);
         IProjection query_proj = getMapContext().getProjection();
         if (this.getCoordTrans() != null) {
-            query_proj = this.getCoordTrans().getPOrig(); 
+            query_proj = this.getCoordTrans().getPOrig();
         }
 
-        IntersectsGeometryEvaluator iee =
-            new IntersectsGeometryEvaluator(
-                query_geo,
-                query_proj,
-                featureStore.getDefaultFeatureType(),
-                geomName);
+        IntersectsGeometryEvaluator iee
+                = new IntersectsGeometryEvaluator(
+                        query_geo,
+                        query_proj,
+                        featureStore.getDefaultFeatureType(),
+                        geomName);
         featureQuery.setFilter(iee);
         featureQuery.setAttributeNames(null);
         return getFeatureStore().getFeatureSet(featureQuery);
@@ -880,13 +870,11 @@
 
     /**
      * It return the {@link FeatureSet} that intersects with the envelope.
-     * @param envelope
-     *          envelope that defines the area for the query.
-     * @param featureType
-     *          only the features with this feature type are used in
-     *          the query.    
-     * @return
-     *          the set of features that intersect with the envelope.
+     *
+     * @param envelope envelope that defines the area for the query.
+     * @param featureType only the features with this feature type are used in
+     * the query.
+     * @return the set of features that intersect with the envelope.
      * @throws DataException
      */
     public FeatureSet queryByEnvelope(Envelope envelope, FeatureType featureType) throws DataException {
@@ -895,20 +883,18 @@
 
     /**
      * It return the {@link FeatureSet} that intersects with the envelope.
-     * @param envelope
-     *          envelope that defines the area for the query in viewport CRS
-     * @param featureType
-     *          only the features with this feature type are used in
-     *          the query.
-     * @param names
-     *          the feature attributes that have to be checked.
-     * @return
-     *          the set of features that intersect with the envelope.
+     *
+     * @param envelope envelope that defines the area for the query in viewport
+     * CRS
+     * @param featureType only the features with this feature type are used in
+     * the query.
+     * @param names the feature attributes that have to be checked.
+     * @return the set of features that intersect with the envelope.
      * @throws DataException
      */
     public FeatureSet queryByEnvelope(Envelope envelope,
-        FeatureType featureType,
-        String[] names) throws DataException {
+            FeatureType featureType,
+            String[] names) throws DataException {
         FeatureQuery featureQuery = featureStore.createFeatureQuery();
         if (names == null) {
             featureQuery.setFeatureType(featureType);
@@ -918,56 +904,56 @@
         }
         String geomName = featureStore.getDefaultFeatureType()
                 .getDefaultGeometryAttributeName();
-        
+
         Envelope query_env = fromViewPortCRSToSourceCRS(this, envelope);
         IProjection query_proj = getMapContext().getProjection();
         if (this.getCoordTrans() != null) {
-            query_proj = this.getCoordTrans().getPOrig(); 
+            query_proj = this.getCoordTrans().getPOrig();
         }
-        
-        IntersectsGeometryEvaluator iee =
-            new IntersectsGeometryEvaluator(
-                query_env.getGeometry(), query_proj, 
-                featureStore.getDefaultFeatureType(),
-                geomName);
+
+        IntersectsGeometryEvaluator iee
+                = new IntersectsGeometryEvaluator(
+                        query_env.getGeometry(), query_proj,
+                        featureStore.getDefaultFeatureType(),
+                        geomName);
         featureQuery.setFilter(iee);
         return getFeatureStore().getFeatureSet(featureQuery);
 
     }
 
     public DynObjectSet getInfo(Point p, double tolerance, Cancellable cancel) throws LoadLayerException,
-        DataException {
+            DataException {
 
         return getInfo(p, tolerance, cancel, true);
     }
 
     public DynObjectSet getInfo(Point p,
-        double tolerance,
-        Cancellable cancel,
-        boolean fast) throws LoadLayerException, DataException {
+            double tolerance,
+            Cancellable cancel,
+            boolean fast) throws LoadLayerException, DataException {
         Point2D infop = new Point2D.Double(p.x, p.y);
         Point2D pReal = this.getMapContext().getViewPort().toMapPoint(infop);
         return queryByPoint(pReal,
-            tolerance,
-            getFeatureStore().getDefaultFeatureType()).getDynObjectSet(fast);
+                tolerance,
+                getFeatureStore().getDefaultFeatureType()).getDynObjectSet(fast);
     }
 
     public DynObjectSet getInfo(org.gvsig.fmap.geom.primitive.Point p,
-        double tolerance) throws LoadLayerException, DataException {
-        return queryByPoint(p,tolerance, getFeatureStore().getDefaultFeatureType()).getDynObjectSet(false);
+            double tolerance) throws LoadLayerException, DataException {
+        return queryByPoint(p, tolerance, getFeatureStore().getDefaultFeatureType()).getDynObjectSet(false);
     }
-    
+
     public void legendCleared(LegendClearEvent event) {
         this.updateDrawVersion();
-        LegendChangedEvent e =
-            LegendChangedEvent.createLegendChangedEvent(legend, legend);
+        LegendChangedEvent e
+                = LegendChangedEvent.createLegendChangedEvent(legend, legend);
         this.callLegendChanged(e);
     }
 
     public boolean symbolChanged(SymbolLegendEvent e) {
         this.updateDrawVersion();
-        LegendChangedEvent ev =
-            LegendChangedEvent.createLegendChangedEvent(legend, legend);
+        LegendChangedEvent ev
+                = LegendChangedEvent.createLegendChangedEvent(legend, legend);
         this.callLegendChanged(ev);
         return true;
     }
@@ -975,30 +961,30 @@
     public void update(Observable observable, Object notification) {
         if (observable.equals(this.featureStore)) {
             if (notification instanceof FeatureStoreNotification) {
-                FeatureStoreNotification event =
-                    (FeatureStoreNotification) notification;
+                FeatureStoreNotification event
+                        = (FeatureStoreNotification) notification;
                 if (event.getType() == FeatureStoreNotification.AFTER_DELETE
-                    || event.getType() == FeatureStoreNotification.AFTER_UNDO
-                    || event.getType() == FeatureStoreNotification.AFTER_REDO
-                    || event.getType() == FeatureStoreNotification.AFTER_REFRESH
-                    || event.getType() == FeatureStoreNotification.AFTER_UPDATE
-                    || event.getType() == FeatureStoreNotification.AFTER_UPDATE_TYPE
-                    || event.getType() == FeatureStoreNotification.SELECTION_CHANGE
-                    || event.getType() == FeatureStoreNotification.AFTER_INSERT) {
+                        || event.getType() == FeatureStoreNotification.AFTER_UNDO
+                        || event.getType() == FeatureStoreNotification.AFTER_REDO
+                        || event.getType() == FeatureStoreNotification.AFTER_REFRESH
+                        || event.getType() == FeatureStoreNotification.AFTER_UPDATE
+                        || event.getType() == FeatureStoreNotification.AFTER_UPDATE_TYPE
+                        || event.getType() == FeatureStoreNotification.SELECTION_CHANGE
+                        || event.getType() == FeatureStoreNotification.AFTER_INSERT) {
                     this.updateDrawVersion();
-                    
+
                 } else if (event.getType() == FeatureStoreNotification.AFTER_CANCELEDITING) {
-                    
+
                     setSpatialCacheEnabled(false);
                     callEditionChanged(LayerEvent.createEditionChangedEvent(this, "edition"));
                     this.updateDrawVersion();
-                    
+
                 } else if (event.getType() == FeatureStoreNotification.AFTER_STARTEDITING) {
-                    
+
                     setSpatialCacheEnabled(true);
                     callEditionChanged(LayerEvent.createEditionChangedEvent(this, "edition"));
 
-                } else if (event.getType() == FeatureStoreNotification.TRANSFORM_CHANGE){
+                } else if (event.getType() == FeatureStoreNotification.TRANSFORM_CHANGE) {
                     //If a transform has to be applied, try to reload the layer.
                     try {
                         reload();
@@ -1008,21 +994,20 @@
                     }
                 } else if (event.getType() == FeatureStoreNotification.RESOURCE_CHANGED) {
                     this.setAvailable(false);
-                } else 	if (event.getType() == FeatureStoreNotification.AFTER_FINISHEDITING) {
+                } else if (event.getType() == FeatureStoreNotification.AFTER_FINISHEDITING) {
                     this.setAvailable(true);
                     setSpatialCacheEnabled(false);
                     callEditionChanged(LayerEvent.createEditionChangedEvent(this, "edition"));
                     this.updateDrawVersion();
                 }
             }
-        }
-        else if (notification instanceof FeatureDrawnNotification
-            && (isEditing() || isLayerToSnap())) {
+        } else if (notification instanceof FeatureDrawnNotification
+                && (isEditing() || isLayerToSnap())) {
             // This code is needed in editing mode
-        	// for all layers involved in snapping
-        	// (including the layer being edited)
-            Geometry geometry =
-                ((FeatureDrawnNotification) notification).getDrawnGeometry();
+            // for all layers involved in snapping
+            // (including the layer being edited)
+            Geometry geometry
+                    = ((FeatureDrawnNotification) notification).getDrawnGeometry();
             spatialCache.insert(geometry.getEnvelope(), geometry);
         }
     }
@@ -1037,21 +1022,21 @@
         } else {
             return this.getMapContext().getLayersToSnap().contains(this);
         }
-    	
-    	/*
-    	Iterator itersnap = this.getMapContext().getLayersToSnap().iterator();
-    	Object item = null;
-    	while (itersnap.hasNext()) {
-    		item = itersnap.next();
-    		if (item == this) {
-    			return true;
-    		}
-    	}
-		return false;
-		*/
-	}
 
-	/*
+        /*
+         Iterator itersnap = this.getMapContext().getLayersToSnap().iterator();
+         Object item = null;
+         while (itersnap.hasNext()) {
+         item = itersnap.next();
+         if (item == this) {
+         return true;
+         }
+         }
+         return false;
+         */
+    }
+
+    /*
      * (non-Javadoc)
      * 
      * @see org.gvsig.metadata.Metadata#getMetadataChildren()
@@ -1069,24 +1054,22 @@
      */
     public Object getMetadataID() throws MetadataException {
         return "Layer(" + this.getName() + "):"
-            + this.featureStore.getMetadataID();
+                + this.featureStore.getMetadataID();
     }
 
-    
-
     public GeometryType getTypeVectorLayer() throws DataException,
-        LocatorException,
-        GeometryTypeNotSupportedException,
-        GeometryTypeNotValidException {
+            LocatorException,
+            GeometryTypeNotSupportedException,
+            GeometryTypeNotValidException {
         // FIXME Esto deberia de pedirse a FType!!!!
         FeatureStore fs = this.getFeatureStore();
         FeatureType fType = fs.getDefaultFeatureType();
-        FeatureAttributeDescriptor attr =
-            fType.getAttributeDescriptor(fType.getDefaultGeometryAttributeIndex());
-        GeometryType geomType =
-            GeometryLocator.getGeometryManager()
+        FeatureAttributeDescriptor attr
+                = fType.getAttributeDescriptor(fType.getDefaultGeometryAttributeIndex());
+        GeometryType geomType
+                = GeometryLocator.getGeometryManager()
                 .getGeometryType(attr.getGeometryType(),
-                    attr.getGeometrySubType());
+                        attr.getGeometrySubType());
         return geomType;
     }
 
@@ -1124,11 +1107,11 @@
         dispose(featureStore);
         spatialCache.clearAll();
     }
-    
+
     /**
-     * Returns envelope in layer's data source CRS
-     * from envelope provided in viewport CRS
-     * 
+     * Returns envelope in layer's data source CRS from envelope provided in
+     * viewport CRS
+     *
      * @param lyr
      * @param env
      * @return
@@ -1148,14 +1131,13 @@
     }
 
     public Geometry transformToSourceCRS(Geometry geom, boolean clone) {
-        return fromViewPortCRSToSourceCRS(this,geom,clone);
+        return fromViewPortCRSToSourceCRS(this, geom, clone);
     }
-    
-    
+
     /**
-     * Returns geometry in layer's data source CRS
-     * from geometry provided in viewport CRS
-     * 
+     * Returns geometry in layer's data source CRS from geometry provided in
+     * viewport CRS
+     *
      * @param lyr
      * @param geo
      * @param clone
@@ -1163,10 +1145,10 @@
      * @deprecated use the transformToSourceCRS method of layer.
      */
     public static Geometry fromViewPortCRSToSourceCRS(
-        FLayer lyr,
-        Geometry geo,
-        boolean clone) {
-        
+            FLayer lyr,
+            Geometry geo,
+            boolean clone) {
+
         if (lyr == null || geo == null) {
             return null;
         }
@@ -1181,5 +1163,4 @@
         return resp;
     }
 
-    
 }
