From: amwaterhouse Date: Fri, 17 Dec 2004 14:18:13 +0000 (+0000) Subject: Use the isGap method in utils X-Git-Tag: Release_2_0~795 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8af8289df86798d5e283e1d0aa275b8f98e563dc;p=jalview.git Use the isGap method in utils --- diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 3fa1379..f480f0f 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -112,7 +112,7 @@ public class Alignment implements AlignmentI if (current.getLength() > i) { /* MC Should move this to a method somewhere */ - if (current.getCharAt(i)!='-' && current.getCharAt(i)!='.' && current.getCharAt(i)!=' ') + if ( !jalview.util.Comparison.isGap(current.getCharAt(i))) delete = false; } @@ -385,12 +385,14 @@ public class Alignment implements AlignmentI } /** */ - public int findIndex(SequenceI s) { + public int findIndex(SequenceI s) + { int i=0; - while (i < sequences.size()) { - if (s == getSequenceAt(i)) { + while (i < sequences.size()) + { + if (s == getSequenceAt(i)) return i; - } + i++; } return -1; diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 7feadb9..c0216aa 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -280,7 +280,7 @@ public class AlignFrame extends GAlignFrame current = viewport.getAlignment().getSequenceAt(i); jSize = current.getLength(); for (int j=0; j < jSize; j++) - if (current.getCharAt(j)=='-' || current.getCharAt(j)=='.' || current.getCharAt(j)==' ') + if(jalview.util.Comparison.isGap(current.getCharAt(i))) { current.deleteCharAt(j); j--; diff --git a/src/jalview/gui/ScorePanel.java b/src/jalview/gui/ScorePanel.java index b4bb3c9..e6ba4b3 100755 --- a/src/jalview/gui/ScorePanel.java +++ b/src/jalview/gui/ScorePanel.java @@ -92,7 +92,7 @@ public class ScorePanel extends JPanel value = (int) ( (float) value / Float.parseFloat(hash.get("size").toString()) * 55); - if (character != ' ' && character != '.' && character != '-') + if ( !jalview.util.Comparison.isGap(character)) g.fillRect( (int) (i * av.charWidth), 60 - value, (int) av.charWidth, diff --git a/src/jalview/gui/SequenceRenderer.java b/src/jalview/gui/SequenceRenderer.java index 82124ce..5022050 100755 --- a/src/jalview/gui/SequenceRenderer.java +++ b/src/jalview/gui/SequenceRenderer.java @@ -101,7 +101,7 @@ try{ else s = ' '; - if(!renderGaps && (s=='-' || s=='.' || s==' ')) + if(!renderGaps && jalview.util.Comparison.isGap(s)) continue; g.setColor(Color.black);