added unofficial support for concise output parsing from the JNet server to extract...
[jalview.git] / src / jalview / datamodel / AlignmentAnnotation.java
index d75683c..7f6b08a 100755 (executable)
@@ -139,6 +139,8 @@ public class AlignmentAnnotation
         this.annotations = annotations;\r
         graph = graphType;\r
 \r
+        boolean drawValues = true;\r
+\r
         if (min == max)\r
         {\r
             min = 999999999;\r
@@ -149,6 +151,11 @@ public class AlignmentAnnotation
                     continue;\r
                 }\r
 \r
+                if(drawValues && annotations[i].displayCharacter.length() > 1 )\r
+                {\r
+                  drawValues = false;\r
+                }\r
+\r
                 if (annotations[i].value > max)\r
                 {\r
                     max = annotations[i].value;\r
@@ -161,6 +168,15 @@ public class AlignmentAnnotation
             }\r
         }\r
 \r
+        if(!drawValues)\r
+        {\r
+          for (int i = 0; i < annotations.length; i++)\r
+          {\r
+            if (annotations[i] != null)\r
+              annotations[i].displayCharacter = "";\r
+          }\r
+        }\r
+\r
         graphMin = min;\r
         graphMax = max;\r
 \r
@@ -254,7 +270,7 @@ public class AlignmentAnnotation
         if(startRes < sequenceRef.getStart())\r
           startRes = sequenceRef.getStart();\r
 \r
-        int seqPos, seqIndex;\r
+        int seqPos;\r
 \r
         int fileOffset = 0;\r
         if(startRes > sequenceRef.getStart())\r
@@ -264,16 +280,13 @@ public class AlignmentAnnotation
 \r
         for(int i = 0; i < annotations.length; i++)\r
         {\r
-            seqPos = sequenceRef.findPosition(i - fileOffset)-1;\r
+            seqPos = sequenceRef.findPosition(i + fileOffset);\r
             if(seqPos<annotations.length)\r
             {\r
-              if (annotations[seqPos] != null)\r
+              if (annotations[i] != null)\r
               {\r
-                seqIndex = sequenceRef.findIndex(i) + 1;\r
-\r
-                if(seqIndex>=startRes)\r
-                sequenceMapping.put(new Integer(seqIndex),\r
-                                    annotations[seqPos]);\r
+                  sequenceMapping.put(new Integer(seqPos),\r
+                                      annotations[i]);\r
               }\r
             }\r
          }\r