X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignmentAnnotation.java;h=5a2c46e0b3e2be52032af8a67f02cfbefdde6cfc;hb=d6e1bbede5adc04f34c969213ac6a4c6d9e5d34a;hp=d75683c60e6833ee58dd22613b2a96b099593619;hpb=133454102814512287d6bb5b1f4e5c2601eea863;p=jalview.git diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index d75683c..5a2c46e 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -139,6 +139,8 @@ public class AlignmentAnnotation this.annotations = annotations; graph = graphType; + boolean drawValues = true; + if (min == max) { min = 999999999; @@ -149,6 +151,11 @@ public class AlignmentAnnotation continue; } + if(drawValues && annotations[i].displayCharacter.length() > 1 ) + { + drawValues = false; + } + if (annotations[i].value > max) { max = annotations[i].value; @@ -166,19 +173,30 @@ public class AlignmentAnnotation for (int i = 0; i < annotations.length; i++) { - if ((annotations[i] != null) && - ((annotations[i].secondaryStructure == 'H') || + if (!hasIcons + && annotations[i] != null + && ((annotations[i].secondaryStructure == 'H') || (annotations[i].secondaryStructure == 'E'))) { hasIcons = true; } - if ((annotations[i] != null) && - (annotations[i].displayCharacter.length() > 0)) + if (!hasText + && annotations[i]!=null + && annotations[i].displayCharacter.length() > 0) { hasText = true; } } + + if(!drawValues && graphType!=NO_GRAPH) + { + for (int i = 0; i < annotations.length; i++) + { + if (annotations[i] != null) + annotations[i].displayCharacter = ""; + } + } } /** @@ -254,7 +272,7 @@ public class AlignmentAnnotation if(startRes < sequenceRef.getStart()) startRes = sequenceRef.getStart(); - int seqPos, seqIndex; + int seqPos; int fileOffset = 0; if(startRes > sequenceRef.getStart()) @@ -264,16 +282,13 @@ public class AlignmentAnnotation for(int i = 0; i < annotations.length; i++) { - seqPos = sequenceRef.findPosition(i - fileOffset)-1; + seqPos = sequenceRef.findPosition(i + fileOffset); if(seqPos=startRes) - sequenceMapping.put(new Integer(seqIndex), - annotations[seqPos]); + sequenceMapping.put(new Integer(seqPos), + annotations[i]); } } } @@ -286,9 +301,16 @@ public class AlignmentAnnotation { int a=0, aSize = sequenceRef.getLength(); + if(aSize == 0) + { + //Its been deleted + return; + } + int position; Annotation[] temp = new Annotation[aSize]; Integer index; + for (a = sequenceRef.getStart(); a <= sequenceRef.getEnd(); a++) { index = new Integer(a);