From 3642de417a2240bef7edc3810a0d0cbe24b03da3 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 19 Jun 2009 09:59:46 +0000 Subject: [PATCH] selection handler and sender bugfix --- src/jalview/gui/VamsasApplication.java | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/jalview/gui/VamsasApplication.java b/src/jalview/gui/VamsasApplication.java index a62eeb5..777d71b 100644 --- a/src/jalview/gui/VamsasApplication.java +++ b/src/jalview/gui/VamsasApplication.java @@ -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) -- 1.7.10.2