X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FShiftList.java;h=8885e2c9607706b8b2e9816a4c88fd1769a39382;hb=a4833a9c3e15e416598b61e6887ee5743c3c2734;hp=325a681b1d63824cc874131b2845ba6a69cc149f;hpb=451619e33c0a90c8130c7d79ffa38161af1c6e0f;p=jalview.git diff --git a/src/jalview/util/ShiftList.java b/src/jalview/util/ShiftList.java index 325a681..8885e2c 100644 --- a/src/jalview/util/ShiftList.java +++ b/src/jalview/util/ShiftList.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -28,7 +28,7 @@ import java.util.*; */ public class ShiftList { - public Vector shifts; + public Vector shifts; public ShiftList() { shifts = new Vector(); @@ -42,13 +42,21 @@ public class ShiftList public void addShift(int pos, int shift) { int sidx = 0; - int[] rshift=null; - while (sidx0) { - shiftList=new ShiftList(); - for (int i=0,p=0; i 0) + { + shiftList = new ShiftList(); + for (int i = 0, p = 0; i < gapMap.length; p++, i++) + { + if (p != gapMap[i]) + { + shiftList.addShift(p, gapMap[i] - p); + p = gapMap[i]; } } }