From: amwaterhouse Date: Fri, 3 Dec 2004 16:24:30 +0000 (+0000) Subject: Now has res start, res end X-Git-Tag: Release_2_0~874 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7387d1f2fa08709dd4b954ce9f7cfc3d41b3dc8a;p=jalview.git Now has res start, res end --- diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index c8b375a..051db30 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -5,35 +5,40 @@ import jalview.analysis.*; import jalview.datamodel.*; import java.util.Vector; -public class SequenceGroup{ - String groupName; - boolean isSelected; - boolean displayBoxes; - boolean displayText; - boolean colourText; - boolean display; - Conservation conserve; - Vector aaFrequency; - boolean aaFrequencyValid = false; - public Vector sequences = new Vector(); - int width = -1; - public ColourSchemeI cs; - - - public SequenceGroup() { +public class SequenceGroup +{ + String groupName; + boolean isSelected; + boolean displayBoxes; + boolean displayText; + boolean colourText; + boolean display; + Conservation conserve; + Vector aaFrequency; + boolean aaFrequencyValid = false; + public Vector sequences = new Vector(); + int width = -1; + public ColourSchemeI cs; + int startRes = 20; + int endRes = 35; + + public SequenceGroup() + { groupName = "Group"; this.isSelected = false; this.displayBoxes = true; this.displayText = true; this.colourText = false; this.display = true; - cs = new ZappoColourScheme(); + cs = null; } - public SequenceGroup( String groupName, ColourSchemeI scheme, boolean isSelected, - boolean displayBoxes, boolean displayText, - boolean colourText, - boolean display) { + public SequenceGroup(String groupName, ColourSchemeI scheme, + boolean isSelected, + boolean displayBoxes, boolean displayText, + boolean colourText, + boolean display) + { this.groupName = groupName; this.isSelected = isSelected; @@ -53,69 +58,107 @@ public class SequenceGroup{ { groupName = name; } - public Conservation getConservation() { - return conserve; + + public Conservation getConservation() + { + return conserve; } + public void setConservation(Conservation c) - { conserve = c; } + { + conserve = c; + } - public void addSequence(SequenceI s) { + public void addSequence(SequenceI s) + { sequences.addElement(s); } - public void deleteSequence(SequenceI s) { + public void deleteSequence(SequenceI s) + { sequences.removeElement(s); } - public void setColourText(boolean state) { + public void setColourText(boolean state) + { colourText = state; } - public boolean getColourText() { + + public boolean getColourText() + { return colourText; } - public void setDisplayText(boolean state) { + public void setDisplayText(boolean state) + { displayText = state; } - public boolean getDisplayText() { + public boolean getDisplayText() + { return displayText; } - public void setDisplayBoxes(boolean state) { + public void setDisplayBoxes(boolean state) + { displayBoxes = state; } - public boolean getDisplayBoxes() { + public boolean getDisplayBoxes() + { return displayBoxes; } - public int getSize() { - return sequences.size(); - } - public SequenceI getSequenceAt(int i) { - return (SequenceI)sequences.elementAt(i); - } + public int getStartRes() + { + return startRes; + } + + public int getEndRes() + { + return endRes; + } + + public void setStartRes(int i) + { + startRes = i; + } + + public void setEndRes(int i) + { + endRes = i; + } + + public int getSize() + { + return sequences.size(); + } - public Vector getAAFrequency() { - if (aaFrequency == null || aaFrequencyValid == false) { - aaFrequency = AAFrequency.calculate(sequences,0,getWidth()); - aaFrequencyValid = true; - } - return aaFrequency; + public SequenceI getSequenceAt(int i) + { + return (SequenceI) sequences.elementAt(i); + } + + public Vector getAAFrequency() + { + if (aaFrequency == null || aaFrequencyValid == false) + { + aaFrequency = AAFrequency.calculate(sequences, 0, getWidth()); + aaFrequencyValid = true; } + return aaFrequency; + } - public int getWidth() + public int getWidth() + { + System.out.println("it is called"); + // MC This needs to get reset when characters are inserted and deleted + for (int i = 0; i < sequences.size(); i++) { - // MC This needs to get reset when characters are inserted and deleted - for (int i = 0; i < sequences.size(); i++) - { - SequenceI seq = (SequenceI) sequences.elementAt(i); - if (seq.getLength() > width) - width = seq.getLength(); - } - return width; + SequenceI seq = (SequenceI) sequences.elementAt(i); + if (seq.getLength() > width) + width = seq.getLength(); } + return width; + } } - -