From 348802fdd7804327b447a17eac6f3df11181220a Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 27 Apr 2007 09:53:27 +0000 Subject: [PATCH] one colour flag in annotation export --- src/jalview/io/AnnotationFile.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index 463e922..e54ae71 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -40,6 +40,7 @@ public class AnnotationFile { if (annotations != null) { + boolean oneColour = true; AlignmentAnnotation row; String comma; SequenceI refSeq = null; @@ -61,6 +62,7 @@ public class AnnotationFile } color = null; + oneColour = true; if (row.sequenceRef == null) { @@ -151,6 +153,11 @@ public class AnnotationFile if (row.annotations[j] != null) { + if(color!=null && !color.equals(row.annotations[j].colour)) + { + oneColour = false; + } + color = row.annotations[j].colour; if (row.annotations[j].value != 0f) { @@ -174,7 +181,7 @@ public class AnnotationFile text.append("\n"); - if (color != null && color != java.awt.Color.black) + if (color != null && color != java.awt.Color.black && oneColour) { colours.append("COLOUR\t" + row.label + "\t" @@ -578,7 +585,8 @@ public class AnnotationFile } - if (displayChar.length() > 1 + if (displayChar!=null + && displayChar.length() > 1 && desc!=null && desc.length() == 1) { -- 1.7.10.2