JAL-1499 tweak output format for Description
[jalview.git] / src / jalview / io / MegaFile.java
index 238061a..af9889b 100644 (file)
@@ -955,8 +955,21 @@ public class MegaFile extends AlignFile
   {
     StringBuilder sb = new StringBuilder(128);
     sb.append(MEGA_ID).append(newline);
-    printProperty(al, sb, PROP_TITLE, TITLE);
-    printProperty(al, sb, PROP_DESCRIPTION, DESCRIPTION);
+    String propertyValue = (String) al.getProperty(PROP_TITLE);
+    if (propertyValue != null)
+    {
+      sb.append(BANG).append(TITLE).append(SPACE)
+.append(propertyValue)
+              .append(SEMICOLON)
+              .append(newline);
+    }
+    propertyValue = (String) al.getProperty(PROP_DESCRIPTION);
+    if (propertyValue != null)
+    {
+      sb.append(BANG).append(DESCRIPTION).append(newline)
+              .append(propertyValue).append(SEMICOLON)
+              .append(newline);
+    }
 
     /*
      * !Format DataType CodeTable
@@ -1166,27 +1179,6 @@ public class MegaFile extends AlignFile
   }
 
   /**
-   * Helper method to append a property e.g. !Title to the output buffer, if the
-   * property is set on the alignment.
-   * 
-   * @param al
-   * @param headers
-   * @param propertyName
-   * @param propertyKeyword
-   */
-  protected void printProperty(AlignmentI al, StringBuilder headers,
-          String propertyName, String propertyKeyword)
-  {
-    String propertyValue = (String) al.getProperty(propertyName);
-    if (propertyValue != null)
-    {
-      headers.append(BANG).append(propertyKeyword).append(SPACE)
-              .append(propertyValue).append(SEMICOLON)
-              .append(newline);
-    }
-  }
-
-  /**
    * Returns the number of sequence positions output per line
    * 
    * @return