From 51afb2227c77bfab9c174f09ff03f996915e2479 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Sun, 18 Jan 2015 15:38:57 +0000 Subject: [PATCH] JAL-1628 formatting and javadoc --- src/jalview/io/AnnotationFile.java | 58 ++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index 7736332..849f633 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -20,13 +20,34 @@ */ package jalview.io; -import java.io.*; -import java.net.*; -import java.util.*; - -import jalview.analysis.*; -import jalview.datamodel.*; -import jalview.schemes.*; +import jalview.analysis.Conservation; +import jalview.api.AlignViewportI; +import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.AlignmentI; +import jalview.datamodel.Annotation; +import jalview.datamodel.ColumnSelection; +import jalview.datamodel.GraphLine; +import jalview.datamodel.HiddenSequences; +import jalview.datamodel.SequenceGroup; +import jalview.datamodel.SequenceI; +import jalview.schemes.ColourSchemeI; +import jalview.schemes.ColourSchemeProperty; +import jalview.schemes.ResidueProperties; +import jalview.schemes.UserColourScheme; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.InputStreamReader; +import java.io.StringReader; +import java.net.URL; +import java.util.ArrayList; +import java.util.BitSet; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.List; +import java.util.Map; +import java.util.StringTokenizer; +import java.util.Vector; public class AnnotationFile { @@ -67,13 +88,13 @@ public class AnnotationFile } /** - * convenience method for pre-2.4 feature files which have no view, hidden + * convenience method for pre-2.9 annotation files which have no view, hidden * columns or hidden row keywords. * * @param annotations * @param list * @param properties - * @return feature file as a string. + * @return annotation file as a string. */ public String printAnnotations(AlignmentAnnotation[] annotations, List list, Hashtable properties) @@ -123,6 +144,12 @@ public class AnnotationFile { // TODO: resolve views issue : annotationFile could contain visible region, // or full data + hidden region specifications for a view. + if (views != null) + { + // are views defined and then annotation added to alignment or the other + // way around ? + + } if (annotations != null) { boolean oneColour = true; @@ -320,7 +347,9 @@ public class AnnotationFile } if (row.hasScore()) + { text.append("\t" + row.score); + } text.append(newline); @@ -619,7 +648,7 @@ public class AnnotationFile } if (in != null) { - return parseAnnotationFrom(al, in); + return parseAnnotationFrom(al, colSel, in); } } catch (Exception ex) @@ -642,7 +671,8 @@ public class AnnotationFile private static String GRAPHLINE = "GRAPHLINE", COMBINE = "COMBINE"; - public boolean parseAnnotationFrom(AlignmentI al, BufferedReader in) + public boolean parseAnnotationFrom(AlignmentI al, ColumnSelection colSel, + BufferedReader in) throws Exception { nlinesread = 0; @@ -852,7 +882,9 @@ public class AnnotationFile { description = line; if (st.hasMoreTokens()) + { line = st.nextToken(); + } } if (st.hasMoreTokens()) @@ -1004,7 +1036,7 @@ public class AnnotationFile (StringTokenizer) _deferred_args[1], // st (SequenceI) _deferred_args[2], // refSeq (_deferred_args[3] == null) ? null : groupRefLookup - .get((String) _deferred_args[3]) // the reference + .get(_deferred_args[3]) // the reference // group, or null ); } @@ -1024,7 +1056,7 @@ public class AnnotationFile (StringTokenizer) _combine_args[0], // st (SequenceI) _combine_args[1], // refSeq (_combine_args[2] == null) ? null : groupRefLookup - .get((String) _combine_args[2]) // the reference group, + .get(_combine_args[2]) // the reference group, // or null ); } -- 1.7.10.2