Formatting changes
[jalview.git] / src / jalview / datamodel / AlignmentAnnotation.java
index 35297b5..9cfdff6 100755 (executable)
 */\r
 package jalview.datamodel;\r
 \r
-public class AlignmentAnnotation {\r
+\r
+/**\r
+ * DOCUMENT ME!\r
+ *\r
+ * @author $author$\r
+ * @version $Revision$\r
+ */\r
+public class AlignmentAnnotation\r
+{\r
+    /** DOCUMENT ME!! */\r
     public String label;\r
+\r
+    /** DOCUMENT ME!! */\r
     public String description;\r
+\r
+    /** DOCUMENT ME!! */\r
     public Annotation[] annotations;\r
+\r
+    /** DOCUMENT ME!! */\r
     public boolean isGraph = false;\r
+\r
+    /** DOCUMENT ME!! */\r
     public float graphMin;\r
+\r
+    /** DOCUMENT ME!! */\r
     public float graphMax;\r
+\r
+    /** DOCUMENT ME!! */\r
     public int windowLength;\r
 \r
     // Graphical hints and tips\r
+\r
+    /** DOCUMENT ME!! */\r
     public boolean editable = false;\r
+\r
+    /** DOCUMENT ME!! */\r
     public boolean hasIcons; //\r
+\r
+    /** DOCUMENT ME!! */\r
     public boolean hasText;\r
+\r
+    /** DOCUMENT ME!! */\r
     public boolean visible = true;\r
+\r
+    /** DOCUMENT ME!! */\r
     public int height = 0;\r
 \r
+    /**\r
+     * Creates a new AlignmentAnnotation object.\r
+     *\r
+     * @param label DOCUMENT ME!\r
+     * @param description DOCUMENT ME!\r
+     * @param annotations DOCUMENT ME!\r
+     */\r
     public AlignmentAnnotation(String label, String description,\r
-        Annotation[] annotations) {\r
+        Annotation[] annotations)\r
+    {\r
         // always editable?\r
         editable = true;\r
         this.label = label;\r
         this.description = description;\r
         this.annotations = annotations;\r
 \r
-        for (int i = 0; i < annotations.length; i++) {\r
+        for (int i = 0; i < annotations.length; i++)\r
+        {\r
             if ((annotations[i] != null) &&\r
                     ((annotations[i].secondaryStructure == 'H') ||\r
-                    (annotations[i].secondaryStructure == 'E'))) {\r
+                    (annotations[i].secondaryStructure == 'E')))\r
+            {\r
                 hasIcons = true;\r
             }\r
 \r
             if ((annotations[i] != null) &&\r
-                    (annotations[i].displayCharacter.length() > 0)) {\r
+                    (annotations[i].displayCharacter.length() > 0))\r
+            {\r
                 hasText = true;\r
             }\r
         }\r
     }\r
 \r
+    /**\r
+     * Creates a new AlignmentAnnotation object.\r
+     *\r
+     * @param label DOCUMENT ME!\r
+     * @param description DOCUMENT ME!\r
+     * @param annotations DOCUMENT ME!\r
+     * @param min DOCUMENT ME!\r
+     * @param max DOCUMENT ME!\r
+     * @param winLength DOCUMENT ME!\r
+     */\r
     public AlignmentAnnotation(String label, String description,\r
-        Annotation[] annotations, float min, float max, int winLength) {\r
+        Annotation[] annotations, float min, float max, int winLength)\r
+    {\r
         // graphs are not editable\r
         this.label = label;\r
         this.description = description;\r
         this.annotations = annotations;\r
         isGraph = true;\r
 \r
-        if (min == max) {\r
-            for (int i = 0; i < annotations.length; i++) {\r
-                if (annotations[i] == null) {\r
+        if (min == max)\r
+        {\r
+            for (int i = 0; i < annotations.length; i++)\r
+            {\r
+                if (annotations[i] == null)\r
+                {\r
                     continue;\r
                 }\r
 \r
-                if (annotations[i].value > max) {\r
+                if (annotations[i].value > max)\r
+                {\r
                     max = annotations[i].value;\r
                 }\r
 \r
-                if (annotations[i].value < min) {\r
+                if (annotations[i].value < min)\r
+                {\r
                     min = annotations[i].value;\r
                 }\r
             }\r
@@ -84,30 +142,46 @@ public class AlignmentAnnotation {
         graphMax = max;\r
         windowLength = winLength;\r
 \r
-        for (int i = 0; i < annotations.length; i++) {\r
+        for (int i = 0; i < annotations.length; i++)\r
+        {\r
             if ((annotations[i] != null) &&\r
                     ((annotations[i].secondaryStructure == 'H') ||\r
-                    (annotations[i].secondaryStructure == 'E'))) {\r
+                    (annotations[i].secondaryStructure == 'E')))\r
+            {\r
                 hasIcons = true;\r
             }\r
 \r
             if ((annotations[i] != null) &&\r
-                    (annotations[i].displayCharacter.length() > 0)) {\r
+                    (annotations[i].displayCharacter.length() > 0))\r
+            {\r
                 hasText = true;\r
             }\r
         }\r
     }\r
 \r
-    public String toString() {\r
+    /**\r
+     * DOCUMENT ME!\r
+     *\r
+     * @return DOCUMENT ME!\r
+     */\r
+    public String toString()\r
+    {\r
         StringBuffer buffer = new StringBuffer();\r
 \r
-        for (int i = 0; i < annotations.length; i++) {\r
-            if (annotations[i] != null) {\r
-                if (isGraph) {\r
+        for (int i = 0; i < annotations.length; i++)\r
+        {\r
+            if (annotations[i] != null)\r
+            {\r
+                if (isGraph)\r
+                {\r
                     buffer.append(annotations[i].value);\r
-                } else if (hasIcons) {\r
+                }\r
+                else if (hasIcons)\r
+                {\r
                     buffer.append(annotations[i].secondaryStructure);\r
-                } else {\r
+                }\r
+                else\r
+                {\r
                     buffer.append(annotations[i].displayCharacter);\r
                 }\r
             }\r
@@ -115,11 +189,14 @@ public class AlignmentAnnotation {
             buffer.append(", ");\r
         }\r
 \r
-        if (label.equals("Consensus")) {\r
+        if (label.equals("Consensus"))\r
+        {\r
             buffer.append("\n");\r
 \r
-            for (int i = 0; i < annotations.length; i++) {\r
-                if (annotations[i] != null) {\r
+            for (int i = 0; i < annotations.length; i++)\r
+            {\r
+                if (annotations[i] != null)\r
+                {\r
                     buffer.append(annotations[i].description);\r
                 }\r
 \r