domain + go output work begins
[jalview.git] / forester / java / src / org / forester / phylogeny / data / PhylogenyDataUtil.java
index a90181d..48da0e0 100644 (file)
@@ -5,7 +5,7 @@
 // Copyright (C) 2008-2009 Christian M. Zmasek
 // Copyright (C) 2008-2009 Burnham Institute for Medical Research
 // All rights reserved
-// 
+//
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 // Lesser General Public License for more details.
-// 
+//
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 //
 // Contact: phylosoft @ gmail . com
-// WWW: www.phylosoft.org/forester
+// WWW: https://sites.google.com/site/cmzmasek/home/software/forester
 
 package org.forester.phylogeny.data;
 
@@ -35,6 +35,9 @@ import org.forester.util.ForesterUtil;
 
 public final class PhylogenyDataUtil {
 
+    /** Value of -99.0 is used as default value. */
+    public final static double BRANCH_LENGTH_DEFAULT = -1024.0;
+
     public static void appendClose( final Writer w, final String element_name ) throws IOException {
         w.write( "</" );
         w.write( element_name );
@@ -101,6 +104,18 @@ public final class PhylogenyDataUtil {
 
     public static void appendElement( final Writer w,
                                       final String element_name,
+                                      final String value,
+                                      final String attribute1_name,
+                                      final String attribute1_value,
+                                      final String attribute2_name,
+                                      final String attribute2_value ) throws IOException {
+        appendOpen( w, element_name, attribute1_name, attribute1_value, attribute2_name, attribute2_value );
+        w.write( replaceIllegalXmlCharacters( value ) );
+        appendClose( w, element_name );
+    }
+
+    public static void appendElement( final Writer w,
+                                      final String element_name,
                                       final String attribute1_name,
                                       final String attribute1_value,
                                       final String attribute2_name,
@@ -336,7 +351,7 @@ public final class PhylogenyDataUtil {
 
     /**
      * Creates a deep copy of ArrayList of PhylogenyData objects.
-     * 
+     *
      * @param list
      *            an ArrayList of PhylogenyData objects
      * @return a deep copy of ArrayList list
@@ -356,11 +371,6 @@ public final class PhylogenyDataUtil {
                     org.forester.util.ForesterUtil.roundToInt( y2 ) );
     }
 
-    public static void drawString( final String str, final double x, final double y, final Graphics g ) {
-        g.drawString( str, org.forester.util.ForesterUtil.roundToInt( x ), org.forester.util.ForesterUtil
-                .roundToInt( y ) );
-    }
-
     public static String replaceIllegalXmlCharacters( final String value ) {
         String v = value.replaceAll( "&", "&amp;" );
         v = v.replaceAll( "<", "&lt;" );