selection handler and sender bugfix
authorjprocter <Jim Procter>
Fri, 19 Jun 2009 09:59:46 +0000 (09:59 +0000)
committerjprocter <Jim Procter>
Fri, 19 Jun 2009 09:59:46 +0000 (09:59 +0000)
src/jalview/gui/VamsasApplication.java

index a62eeb5..777d71b 100644 (file)
@@ -816,7 +816,7 @@ public class VamsasApplication implements SelectionSource
                 if (jvobjs[o] == null)
                 {
                   // can't cope with selections for unmapped objects
-                  // continue;
+                  continue;
                 }
                 if (type == null)
                 {
@@ -902,26 +902,14 @@ public class VamsasApplication implements SelectionSource
                   {
                     int[] prange = uk.ac.vamsas.objects.utils.Range
                             .getBounds(sm.getRanges());
-                    boolean rangeset = false;
-                    colsel = new ColumnSelection();
+                    jselection.setStartRes(prange[0] - 1);
+                    jselection.setEndRes(prange[1] - 1);
                     prange = uk.ac.vamsas.objects.utils.Range
                             .getIntervals(sm.getRanges());
+                    colsel = new ColumnSelection();
                     for (int p = 0; p < prange.length; p += 2)
                     {
                       int d = (prange[p] <= prange[p + 1]) ? 1 : -1;
-                      if (!rangeset)
-                      {
-                        if (jselection != null)
-                        {
-                          // set the bounds of the selected area using the first
-                          // interval.
-                          jselection.setStartRes(prange[p] - 1);
-                          jselection.setEndRes(prange[p + 1] - 1);
-                          rangeset = true;
-                        }
-                      }
-                      else
-                      {
                         // try to join up adjacent columns to make a larger
                         // selection
                         // lower and upper bounds
@@ -939,7 +927,6 @@ public class VamsasApplication implements SelectionSource
                         {
                           jselection.setEndRes(prange[p + u] - 1);
                         }
-                      }
                       // mark all the columns in the range.
                       for (int sr = prange[p], er = prange[p + 1], de = er
                               + d; sr != de; sr += d)