From f89b132a228ea9b89195f2b1a8cc89e3ae6b772a Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 16 Mar 2006 15:21:24 +0000 Subject: [PATCH] HiddenSequence methods --- src/jalview/datamodel/Sequence.java | 40 ++++++++++++++++++++++++---------- src/jalview/datamodel/SequenceI.java | 14 +++++------- 2 files changed, 35 insertions(+), 19 deletions(-) diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 48057b8..87a9306 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -49,6 +49,11 @@ public class Sequence implements SequenceI /** DOCUMENT ME!! */ public SequenceFeature [] sequenceFeatures; + /** This array holds hidden sequences + * of which this sequence is the representitive member of a group + */ + SequenceGroup hiddenSequences; + /** * Creates a new Sequence object. * @@ -496,16 +501,6 @@ public class Sequence implements SequenceI } } - /** - * DOCUMENT ME! - * - * @param i DOCUMENT ME! - * @param c DOCUMENT ME! - */ - public void insertCharAt(int i, char c) - { - insertCharAt(i, c, true); - } /** * DOCUMENT ME! @@ -514,7 +509,7 @@ public class Sequence implements SequenceI * @param c DOCUMENT ME! * @param chop DOCUMENT ME! */ - public void insertCharAt(int i, char c, boolean chop) + public void insertCharAt(int i, char c) { String tmp = new String(sequence); @@ -612,4 +607,27 @@ public class Sequence implements SequenceI this.annotation.addElement( annotation ); } + public SequenceGroup getHiddenSequences() + { + return hiddenSequences; + } + + public void addHiddenSequence(SequenceI seq) + { + if(hiddenSequences==null) + { + hiddenSequences = new SequenceGroup(); + } + hiddenSequences.addSequence(seq, false); + } + + public void showHiddenSequence(SequenceI seq) + { + hiddenSequences.deleteSequence(seq, false); + if (hiddenSequences.getSize() < 1) + { + hiddenSequences = null; + } + + } } diff --git a/src/jalview/datamodel/SequenceI.java b/src/jalview/datamodel/SequenceI.java index 089a5f6..1f7a232 100755 --- a/src/jalview/datamodel/SequenceI.java +++ b/src/jalview/datamodel/SequenceI.java @@ -183,14 +183,6 @@ public interface SequenceI */ public void insertCharAt(int i, char c); - /** - * DOCUMENT ME! - * - * @param i DOCUMENT ME! - * @param c DOCUMENT ME! - * @param chop DOCUMENT ME! - */ - public void insertCharAt(int i, char c, boolean chop); /** * DOCUMENT ME! @@ -256,4 +248,10 @@ public interface SequenceI public void addAlignmentAnnotation(AlignmentAnnotation annotation); + public SequenceGroup getHiddenSequences(); + + public void addHiddenSequence(SequenceI seq); + + public void showHiddenSequence(SequenceI seq); + } -- 1.7.10.2