Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/ViewPort.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/ViewPort.java	(revision 42176)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/ViewPort.java	(revision 42177)
@@ -695,6 +695,7 @@
    * <p>
    * Sets as envelope and adjusted envelope of this view port, the previous.
    * Recalculating its parameters.
+   * Stores the current extent in the next extents of the history.
    * </p>
    * 
    * @see #getExtents()
@@ -716,6 +717,7 @@
    * <p>
    * Sets as envelope and adjusted envelope of this view port, the next.
    * Recalculating its parameters.
+   * Stores the current extent in the previous extents of the history.
    * </p>
    * 
    * @see #getExtents()
@@ -825,6 +827,7 @@
    * @see #getExtents()
    * @see #calculateAffineTransform()
    * @see #setPreviousExtent()
+   * @see #clear()
    */
   public void setEnvelope(Envelope r) {
     Rectangle2D newExtent = null;
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/ExtentHistory.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/ExtentHistory.java	(revision 42176)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/ExtentHistory.java	(revision 42177)
@@ -69,7 +69,7 @@
 
   /**
    * <p>
-   * Number of extents stored.
+   * Number of previous extents stored.
    * </p>
    *
    * @see #hasPrevious()
@@ -79,6 +79,16 @@
    */
   private int num = 0;
 
+  /**
+   * <p>
+   * Number of next extents stored.
+   * </p>
+   *
+   * @see #hasNext()
+   * @see #putNext(Rectangle2D)
+   * @see #getNext()
+   * @see #removeNext()
+   */
   private int numNext = 0;
 
   /**
@@ -108,7 +118,7 @@
 
   /**
    * <p>
-   * Appends the specified extent to the end of this history.
+   * Appends the specified extent at the end of the array of previous zooms.
    * </p>
    *
    * @param ext the new extent
@@ -129,15 +139,25 @@
       }
     }
   }
-  
+
+  /**
+   * <p>
+   * Appends the specified extent at the end of the array of next zooms.
+   * </p>
+   *
+   * @param ext the new extent
+   * @see #getNext()
+   * @see #hasNext()
+   */
   public void putNext(Rectangle2D ext) {
-    if ((ext != null) && ((numNext < 1) || (ext != extentsNext[numNext - 1])) ) {
+    if ((ext != null) && ((numNext < 1) || (ext != extentsNext[numNext - 1]))) {
       if (numNext < (NUMREC)) {
         extentsNext[numNext] = ext;
         numNext++;
-      } else {
+      }
+      else {
         for (int i = 0; i < (NUMREC - 1); i++) {
-          extentsNext[i] = extentsNext[i+1];
+          extentsNext[i] = extentsNext[i + 1];
         }
         extentsNext[numNext - 1] = ext;
       }
@@ -146,10 +166,10 @@
 
   /**
    * <p>
-   * Returns <code>true</code> if there are extents registered.
+   * Returns <code>true</code> if there are previous extents registered.
    * </p>
    *
-   * @return <code>true</code> if there are extents registered;
+   * @return <code>true</code> if there are previous extents registered;
    *         <code>false</code> otherwise
    * @see #put(Rectangle2D)
    * @see #removePrev()
@@ -159,16 +179,27 @@
     return num > 0;
   }
 
+  /**
+   * <p>
+   * Returns <code>true</code> if there are next extents registered.
+   * </p>
+   *
+   * @return <code>true</code> if there are next extents registered;
+   *         <code>false</code> otherwise
+   * @see #putNext(Rectangle2D)
+   * @see #removeNext()
+   * @see #getNext()
+   */
   public boolean hasNext() {
     return numNext > 0;
   }
 
   /**
    * <p>
-   * Returns the last extent in the history.
+   * Returns the last previous extent in the history.
    * </p>
    *
-   * @return the last extent in the history
+   * @return the last previous extent in the history
    * @see #put(Rectangle2D)
    * @see #getXMLEntity()
    */
@@ -181,6 +212,15 @@
     return ext;
   }
 
+  /**
+   * <p>
+   * Returns the last next extent in the history.
+   * </p>
+   *
+   * @return the last next extent in the history
+   * @see #putNext(Rectangle2D)
+   * @see #getXMLEntity()
+   */
   public Rectangle2D getNext() {
     if (numNext <= 0) {
       return null;
@@ -193,10 +233,10 @@
 
   /**
    * <p>
-   * Extracts (removing) the last extent from the history.
+   * Extracts (removing) the last previous extent from the history.
    * </p>
    *
-   * @return last extent in the history
+   * @return last previous extent in the history
    * @see #hasPrevious()
    */
   public Rectangle2D removePrev() {
@@ -210,10 +250,10 @@
 
   /**
    * <p>
-   * Extracts (removing) the last extent from the history.
+   * Extracts (removing) the last next extent from the history.
    * </p>
    *
-   * @return last extent in the history
+   * @return last next extent in the history
    * @see #hasNext()
    */
   public Rectangle2D removeNext() {
@@ -225,6 +265,14 @@
     return ext;
   }
 
+  /**
+   * <p>
+   * Sets to zero the number of next extents from the history.
+   * </p>
+   *
+   * @see #getNext()
+   * @see #hasNext()
+   */
   public void clear() {
     numNext = 0;
   }
