X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fio%2FAnnotationFile.java;h=2721fb28fe8cd3690e55f95511fefb7f54ceb33f;hb=10e588500da51e79f255e000a46e65065a49f8aa;hp=a7c67cd0638dd6b4520fbc588ee33cf5c02ed3f7;hpb=d70d7e5bc8da1189f44709b6ec59ea1e23f6f557;p=jalview.git diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index a7c67cd..2721fb2 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -1,176 +1,470 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5) + * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Jalview. If not, see . */ - package jalview.io; import java.io.*; -import jalview.datamodel.*; +import java.net.*; import java.util.*; -import java.net.URL; -import jalview.schemes.*; +import jalview.analysis.*; +import jalview.datamodel.*; +import jalview.schemes.*; public class AnnotationFile { + StringBuffer text = new StringBuffer("JALVIEW_ANNOTATION\n" + + "# Created: " + new java.util.Date() + "\n\n"); + + /** + * convenience method for pre-2.4 feature files which have no view, hidden + * columns or hidden row keywords. + * + * @param annotations + * @param groups + * @param properties + * @return feature file as a string. + */ + public String printAnnotations(AlignmentAnnotation[] annotations, + Vector groups, Hashtable properties) + { + return printAnnotations(annotations, groups, properties, null); + + } - public String printAnnotations(AlignmentAnnotation [] annotations) + /** + * hold all the information about a particular view definition read from or + * written out in an annotations file. + */ + public class ViewDef { - StringBuffer text = new StringBuffer( - "JALVIEW_ANNOTATION\n" - +"# Created: " - +new java.util.Date()+"\n\n"); + public String viewname; - AlignmentAnnotation row; - String comma; - SequenceI seqref = null; + public HiddenSequences hidseqs; - StringBuffer colours = new StringBuffer(); - StringBuffer graphLine = new StringBuffer(); + public ColumnSelection hiddencols; - Hashtable graphGroup = new Hashtable(); + public Vector visibleGroups; - java.awt.Color color; + public Hashtable hiddenRepSeqs; - for(int i=0; i