Index: DefaultViewDocument.java
===================================================================
--- DefaultViewDocument.java	(revision 44454)
+++ DefaultViewDocument.java	(revision 44455)
@@ -21,7 +21,6 @@
  * 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.app.project.documents.view;
 
 import javax.swing.JOptionPane;
@@ -50,40 +49,37 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
-
 /**
  * Clase que representa una vista del proyecto
- * 
+ *
  */
-
 public class DefaultViewDocument extends BaseViewDocument {
 
-	private static Logger logger = LoggerFactory.getLogger(DefaultViewDocument.class);
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 676711512482334764L;
+    private static Logger logger = LoggerFactory.getLogger(DefaultViewDocument.class);
+    /**
+     *
+     */
+    private static final long serialVersionUID = 676711512482334764L;
 
-	public static final String PERSISTENCE_DEFINITION_NAME = "DefaultViewDocument";
-	
+    public static final String PERSISTENCE_DEFINITION_NAME = "DefaultViewDocument";
+
     private class SetViewPortExtentWhenAddLayerListener extends BaseLayerCollectionListener {
 
         private Thread th = null;
         private final ViewPort viewPort;
-        
+
         public SetViewPortExtentWhenAddLayerListener(ViewPort viewPort) {
             this.viewPort = viewPort;
         }
-        
+
         @Override
         public synchronized void layerAdded(LayerCollectionEvent e) {
-            if( th != null ) {
+            if (th != null) {
                 return;
             }
             if (viewPort.getEnvelope() == null) {
                 final FLayer layer = e.getAffectedLayer();
-                if (layer.isAvailable() )  {
+                if (layer.isAvailable()) {
                     th = new Thread(new Runnable() {
                         @Override
                         public void run() {
@@ -91,8 +87,8 @@
                                 ApplicationManager application = ApplicationLocator.getManager();
                                 I18nManager i18n = ToolsLocator.getI18nManager();
                                 application.message(
-                                    i18n.getTranslation("_Calculating_envelope"),
-                                    JOptionPane.INFORMATION_MESSAGE
+                                        i18n.getTranslation("_Calculating_envelope"),
+                                        JOptionPane.INFORMATION_MESSAGE
                                 );
                                 Envelope envelope = layer.getFullEnvelope();
                                 // Si nadie le ha asignado un envelope mientras se
@@ -101,8 +97,8 @@
                                     viewPort.setEnvelope(envelope);
                                 }
                                 application.message(
-                                    "",
-                                    JOptionPane.INFORMATION_MESSAGE
+                                        "",
+                                        JOptionPane.INFORMATION_MESSAGE
                                 );
                             } catch (ReadException ex) {
                             }
@@ -119,113 +115,109 @@
                 }
             }
         }
-            
+
     }
 
-	public DefaultViewDocument() {
-		this(null);
-	}
-	
-	public DefaultViewDocument(DocumentManager factory) {
-		super(factory); 
+    public DefaultViewDocument() {
+        this(null);
+    }
 
-		ViewPort vp;
-	
-		ProjectPreferences preferences = (ProjectPreferences) ApplicationLocator.getManager().getPreferences("project");
-    	
-    	MapContext viewMapContext = new MapContext(
-				new ViewPort( preferences.getDefaultProjection() )
-		);
-		vp = viewMapContext.getViewPort();
-		vp.setBackColor(preferences.getDefaultViewBackColor());
-		vp.setDistanceUnits(preferences.getDefaultDistanceUnits());
-		vp.setDistanceArea(preferences.getDefaultDistanceArea());
-		
-		/*
+    public DefaultViewDocument(DocumentManager factory) {
+        super(factory);
+
+        ViewPort vp;
+
+        ProjectPreferences preferences = (ProjectPreferences) ApplicationLocator.getManager().getPreferences("project");
+
+        MapContext viewMapContext = new MapContext(
+                new ViewPort(preferences.getDefaultProjection())
+        );
+        vp = viewMapContext.getViewPort();
+        vp.setBackColor(preferences.getDefaultViewBackColor());
+        vp.setDistanceUnits(preferences.getDefaultDistanceUnits());
+        vp.setDistanceArea(preferences.getDefaultDistanceArea());
+
+        /*
 		 * Another user preference: the order manager
-		 */
-		LayerOrderManager lom = getCurrentOrderManager();
-		viewMapContext.setOrderManager(lom);
-		
-		
-		/*
+         */
+        LayerOrderManager lom = getCurrentOrderManager();
+        viewMapContext.setOrderManager(lom);
+
+        /*
 		 * Not very elegant but we are forcing meters if projected
-		 */
-		if (viewMapContext.getProjection().isProjected()) {
-		    vp.setMapUnits(1);
-		} else {
+         */
+        if (viewMapContext.getProjection().isProjected()) {
+            vp.setMapUnits(1);
+        } else {
             vp.setMapUnits(8);
-		}
-		
-		
-		this.setMapContext(viewMapContext);
-		
-		MapContext overviewMapContext = new MapContext(
-				new ViewPort( viewMapContext.getProjection() )
-		);
-		vp = viewMapContext.getViewPort();
-		vp.setBackColor(preferences.getDefaultViewBackColor());
-		this.setMapOverViewContext(overviewMapContext);
-        
+        }
+
+        this.setMapContext(viewMapContext);
+
+        MapContext overviewMapContext = new MapContext(
+                new ViewPort(viewMapContext.getProjection())
+        );
+        vp = viewMapContext.getViewPort();
+        vp.setBackColor(preferences.getDefaultViewBackColor());
+        this.setMapOverViewContext(overviewMapContext);
+
         this.getMapContext().getLayers().addLayerCollectionListener(
-            new SetViewPortExtentWhenAddLayerListener(this.getMapContext().getViewPort())
+                new SetViewPortExtentWhenAddLayerListener(this.getMapContext().getViewPort())
         );
         this.getMapOverViewContext().getLayers().addLayerCollectionListener(
-            new SetViewPortExtentWhenAddLayerListener(this.getMapOverViewContext().getViewPort())
+                new SetViewPortExtentWhenAddLayerListener(this.getMapOverViewContext().getViewPort())
         );
-	}
-	
-	/**
-	 * Get current order manager from persistence
-	 * 
-	 * @return
-	 */
-	private LayerOrderManager getCurrentOrderManager() {
-		
-		DynObject props = this.getPluginProperties();
-		// current_layer_order_manager
-		Object val_obj = null;
-		if (props.hasDynValue(LayerOrderPage.PREFERENCES_ID)) {
-			val_obj = props.getDynValue(LayerOrderPage.PREFERENCES_ID);
-		}
-		if (val_obj != null && val_obj instanceof LayerOrderManager) {
-			LayerOrderManager lom = (LayerOrderManager) val_obj;
-			return lom;
-		} else {
-			logger.info("No order manager found in persistence.");
-			return MapContextLocator.getDefaultOrderManager();
-		}
-		
-	}
-	
-	private DynObject getPluginProperties() {
+    }
+
+    /**
+     * Get current order manager from persistence
+     *
+     * @return
+     */
+    private LayerOrderManager getCurrentOrderManager() {
+
+        DynObject props = this.getPluginProperties();
+        // current_layer_order_manager
+        Object val_obj = null;
+        if (props.hasDynValue(LayerOrderPage.PREFERENCES_ID)) {
+            val_obj = props.getDynValue(LayerOrderPage.PREFERENCES_ID);
+        }
+        if (val_obj != null && val_obj instanceof LayerOrderManager) {
+            LayerOrderManager lom = (LayerOrderManager) val_obj;
+            return lom;
+        } else {
+            logger.info("No order manager found in persistence.");
+            return MapContextLocator.getDefaultOrderManager();
+        }
+
+    }
+
+    private DynObject getPluginProperties() {
         PluginsManager pluginsManager = PluginsLocator.getManager();
         return pluginsManager.getPlugin(AddLayer.class).getPluginProperties();
-	}
-	
-	
-	public void saveToState(PersistentState state) throws PersistenceException {
-		super.saveToState(state);
-	}
-	
-	public void loadFromState(PersistentState state) throws PersistenceException {
-		super.loadFromState(state);
-	}
+    }
 
-	public String exportDocumentAsText() {
-		// FIXME: jjdc PersistentManager getStateAsText o similar
+    public void saveToState(PersistentState state) throws PersistenceException {
+        super.saveToState(state);
+    }
+
+    public void loadFromState(PersistentState state) throws PersistenceException {
+        super.loadFromState(state);
+    }
+
+    public String exportDocumentAsText() {
+        // FIXME: jjdc PersistentManager getStateAsText o similar
 //		 PersistenceManager manager = ToolsLocator.getPersistenceManager();
 //		 PersistentState state = manager.getState(this);
 //		 return manager.getStateAsText(state);
-		return null;
-	}
+        return null;
+    }
 
-	public void setStateFromText(String text) {
-		// FIXME: jjdc PersistentManager getStateFromText o similar
+    public void setStateFromText(String text) {
+        // FIXME: jjdc PersistentManager getStateFromText o similar
 //		 PersistenceManager manager = ToolsLocator.getPersistenceManager();
 //		 PersistentState state = manager.getStateFromText(text);
 //		 this.loadFromState(state);
-	}
+    }
 
-	
 }
