X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignmentAnnotation.java;h=5a2c46e0b3e2be52032af8a67f02cfbefdde6cfc;hb=23d3cb8d0e4c227224587135f41132d436dc1178;hp=fcf984477e2f28e99ff0692ba435fa8251e9f2c3;hpb=7e4c4ad887a30dc26496087b0150f4ac2fe355ec;p=jalview.git diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index fcf9844..5a2c46e 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -27,7 +27,7 @@ package jalview.datamodel; */ public class AlignmentAnnotation { - public SequenceI refSequence; + public SequenceI sequenceRef; /** DOCUMENT ME!! */ public String label; @@ -38,6 +38,7 @@ public class AlignmentAnnotation /** DOCUMENT ME!! */ public Annotation[] annotations; + public java.util.Hashtable sequenceMapping; /** DOCUMENT ME!! */ public float graphMin; @@ -45,7 +46,7 @@ public class AlignmentAnnotation /** DOCUMENT ME!! */ public float graphMax; - public java.util.Vector graphLines; + public GraphLine threshold; // Graphical hints and tips @@ -138,6 +139,8 @@ public class AlignmentAnnotation this.annotations = annotations; graph = graphType; + boolean drawValues = true; + if (min == max) { min = 999999999; @@ -148,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; @@ -165,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 = ""; + } + } } /** @@ -228,21 +247,82 @@ public class AlignmentAnnotation return buffer.toString(); } - public void addGraphLine(GraphLine line) + public void setThreshold(GraphLine line) { - if(graphLines==null) - graphLines = new java.util.Vector(); + threshold = line; + } - graphLines.add(line); + public GraphLine getThreshold() + { + return threshold; } - public GraphLine getGraphLine(int index) + /** + * This + */ + public void createSequenceMapping(SequenceI seqRef, int startRes) { - if(graphLines!=null && index sequenceRef.getStart()) + { + fileOffset = startRes - sequenceRef.getStart(); + } + + for(int i = 0; i < annotations.length; i++) + { + seqPos = sequenceRef.findPosition(i + fileOffset); + if(seqPos