X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignmentAnnotation.java;h=5a2c46e0b3e2be52032af8a67f02cfbefdde6cfc;hb=521ce3c96d5977a9bd941894eda7a13dd09deea9;hp=b93f178e522c2efea539a3295a17a406155bb7a5;hpb=e0a4b92352ee3e31a8dea075a51ec080ae3945f2;p=jalview.git diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index b93f178..5a2c46e 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -29,11 +29,6 @@ public class AlignmentAnnotation { public SequenceI sequenceRef; - /** This annotation is the original loaded annotation - * without any gaps. It is necessary to adjust the annotation - * if sequences are updated */ - public AlignmentAnnotation datasetAnnotation; - /** DOCUMENT ME!! */ public String label; @@ -43,6 +38,7 @@ public class AlignmentAnnotation /** DOCUMENT ME!! */ public Annotation[] annotations; + public java.util.Hashtable sequenceMapping; /** DOCUMENT ME!! */ public float graphMin; @@ -50,7 +46,7 @@ public class AlignmentAnnotation /** DOCUMENT ME!! */ public float graphMax; - public java.util.Vector graphLines; + public GraphLine threshold; // Graphical hints and tips @@ -143,6 +139,8 @@ public class AlignmentAnnotation this.annotations = annotations; graph = graphType; + boolean drawValues = true; + if (min == max) { min = 999999999; @@ -153,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; @@ -170,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 = ""; + } + } } /** @@ -233,38 +247,79 @@ 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.addElement(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(seqPosindex) - temp[a] = datasetAnnotation.annotations[index]; - } + index = new Integer(a); + if(sequenceMapping.containsKey(index)) + { + position = sequenceRef.findIndex(a)-1; + + temp[position] = (Annotation)sequenceMapping.get(index); + } } annotations = temp;