newlines in alignment properties converted to <br>
authorjprocter <Jim Procter>
Fri, 27 Apr 2007 12:24:40 +0000 (12:24 +0000)
committerjprocter <Jim Procter>
Fri, 27 Apr 2007 12:24:40 +0000 (12:24 +0000)
src/jalview/gui/AlignFrame.java

index 8ba8628..71581f6 100755 (executable)
@@ -2293,22 +2293,35 @@ public class AlignFrame
     contents.append("<br>Maximum Sequence Length: "+max);
     contents.append("<br>Average Length: "+(int)avg);
 
-    if (((Alignment)viewport.alignment).alignmentProperties != null)
+    if (((Alignment)viewport.alignment).getProperties() != null)
     {
-      Hashtable props = ((Alignment)viewport.alignment).alignmentProperties;
+      Hashtable props = ((Alignment)viewport.alignment).getProperties();
       Enumeration en = props.keys();
       contents.append("<br><br><table border=\"1\">");
       while(en.hasMoreElements())
       {
         String key = en.nextElement().toString();
-        contents.append("<tr><td>"+key+"</td><td>"+props.get(key)+"</td></tr>");
+        StringBuffer val = new StringBuffer();
+        String vals = props.get(key).toString();
+        int pos=0, npos;
+        do {
+          npos = vals.indexOf("\n",pos);
+          if (npos==-1)
+          {
+            val.append(vals.substring(pos));
+          } else {
+            val.append(vals.substring(pos, npos));
+            val.append("<br>");
+          }
+          pos = npos+1;
+        } while (npos!=-1);
+        contents.append("<tr><td>"+key+"</td><td>"+val+"</td></tr>");
       }
       contents.append("</table>");
     }
     editPane.setText(contents.toString()+"</html>");
     JInternalFrame frame = new JInternalFrame();
     frame.getContentPane().add(editPane);
-
     Desktop.instance.addInternalFrame(frame,"Alignment Properties: "+getTitle(),500,400);
   }