JAL-2491 first addition of new event
[jalview.git] / src / jalview / viewmodel / ViewportRanges.java
index c91d2d9..bbdaa9e 100644 (file)
@@ -79,7 +79,7 @@ public class ViewportRanges extends ViewportProperties
   }
 
   /**
-   * Set first residue visible in the viewport
+   * Set first residue visible in the viewport, and retain the current width.
    * 
    * @param res
    *          residue position
@@ -94,7 +94,18 @@ public class ViewportRanges extends ViewportProperties
     {
       res = 0;
     }
+
+    int oldres = this.startRes;
     this.startRes = res;
+    // changeSupport.firePropertyChange("startres", oldres, res);
+  }
+
+  public void setStartEndRes(int startres, int endres)
+  {
+    int oldres = this.startRes;
+    setStartRes(startres);
+    setEndRes(endres);
+    changeSupport.firePropertyChange("startres", oldres, startres);
   }
 
   /**
@@ -113,7 +124,10 @@ public class ViewportRanges extends ViewportProperties
     {
       res = 0;
     }
+    int oldres = this.endRes;
     this.endRes = res;
+
+    // changeSupport.firePropertyChange("endres", oldres, res);
   }
 
   /**
@@ -132,7 +146,18 @@ public class ViewportRanges extends ViewportProperties
     {
       seq = 0;
     }
+
+    int oldseq = this.startSeq;
     this.startSeq = seq;
+    // changeSupport.firePropertyChange("startseq", oldseq, seq);
+  }
+
+  public void setStartEndSeq(int startseq, int endseq)
+  {
+    int oldseq = this.startSeq;
+    setStartSeq(startseq);
+    setEndSeq(endseq);
+    changeSupport.firePropertyChange("startseq", oldseq, startseq);
   }
 
   /**
@@ -151,7 +176,10 @@ public class ViewportRanges extends ViewportProperties
     {
       seq = 0;
     }
+    int oldseq = this.endSeq;
     this.endSeq = seq;
+
+    // changeSupport.firePropertyChange("endseq", oldseq, seq);
   }
 
   /**