From c5c9b2ef14a1864342ef505bd6bd479e3dcc013f Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 27 Apr 2007 12:24:40 +0000 Subject: [PATCH] newlines in alignment properties converted to
--- src/jalview/gui/AlignFrame.java | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 8ba8628..71581f6 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -2293,22 +2293,35 @@ public class AlignFrame contents.append("
Maximum Sequence Length: "+max); contents.append("
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("

"); while(en.hasMoreElements()) { String key = en.nextElement().toString(); - contents.append(""); + 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("
"); + } + pos = npos+1; + } while (npos!=-1); + contents.append(""); } contents.append("
"+key+""+props.get(key)+"
"+key+""+val+"
"); } editPane.setText(contents.toString()+""); JInternalFrame frame = new JInternalFrame(); frame.getContentPane().add(editPane); - Desktop.instance.addInternalFrame(frame,"Alignment Properties: "+getTitle(),500,400); } -- 1.7.10.2