+ public String getSequenceSetId()
+ {
+ if (sequenceSetID == null)
+ {
+ sequenceSetID = alignment.hashCode() + "";
+ }
+
+ return sequenceSetID;
+ }
+
+ public void alignmentChanged(AlignmentPanel ap)
+ {
+ alignment.padGaps();
+
+ if (hconsensus != null && autocalculateConsensus)
+ {
+ updateConsensus(ap);
+ updateConservation(ap);
+ }
+
+ // Reset endRes of groups if beyond alignment width
+ int alWidth = alignment.getWidth();
+ Vector groups = alignment.getGroups();
+ if (groups != null)
+ {
+ for (int i = 0; i < groups.size(); i++)
+ {
+ SequenceGroup sg = (SequenceGroup) groups.elementAt(i);
+ if (sg.getEndRes() > alWidth)
+ {
+ sg.setEndRes(alWidth - 1);
+ }
+ }
+ }
+
+ if (selectionGroup != null && selectionGroup.getEndRes() > alWidth)
+ {
+ selectionGroup.setEndRes(alWidth - 1);
+ }
+
+ resetAllColourSchemes();
+
+ // AW alignment.adjustSequenceAnnotations();
+ }
+
+ void resetAllColourSchemes()
+ {
+ ColourSchemeI cs = globalColourScheme;
+ if (cs != null)
+ {
+ if (cs instanceof ClustalxColourScheme)
+ {
+ ((ClustalxColourScheme) cs).resetClustalX(alignment.getSequences(),
+ alignment.getWidth());
+ }
+
+ cs.setConsensus(hconsensus);
+ if (cs.conservationApplied())
+ {
+ Alignment al = (Alignment) alignment;
+ Conservation c = new Conservation("All",
+ ResidueProperties.propHash, 3, al.getSequences(), 0, al
+ .getWidth() - 1);
+ c.calculate();
+ c.verdict(false, ConsPercGaps);
+
+ cs.setConservation(c);
+ }
+ }
+
+ int s, sSize = alignment.getGroups().size();
+ for (s = 0; s < sSize; s++)
+ {
+ SequenceGroup sg = (SequenceGroup) alignment.getGroups().elementAt(s);
+ if (sg.cs != null && sg.cs instanceof ClustalxColourScheme)
+ {
+ ((ClustalxColourScheme) sg.cs).resetClustalX(sg
+ .getSequences(hiddenRepSequences), sg.getWidth());
+ }
+ sg.recalcConservation();
+ }
+ }
+
+ boolean centreColumnLabels;
+
+
+ public boolean getCentreColumnLabels()
+ {
+ return centreColumnLabels;
+ }
+
+ public void updateSequenceIdColours()
+ {
+ Vector groups = alignment.getGroups();
+ for (int ig = 0, igSize = groups.size(); ig < igSize; ig++)
+ {
+ SequenceGroup sg = (SequenceGroup) groups.elementAt(ig);
+ if (sg.idColour != null)
+ {
+ Vector sqs = sg.getSequences(hiddenRepSequences);
+ for (int s = 0, sSize = sqs.size(); s < sSize; s++)
+ {
+ this.setSequenceColour((SequenceI) sqs.elementAt(s), sg.idColour);
+ }
+ }
+ }
+ }
+ public boolean followHighlight=false;
+ public boolean getFollowHighlight() {
+ return followHighlight;
+ }
+ /**
+ * show non-conserved residues only
+ */
+ public boolean showUnconserved=false;
+
+ /**
+ * when set, alignment should be reordered according to a newly opened tree
+ */
+ public boolean sortByTree=false;
+
+ /**
+ * @return the showUnconserved
+ */
+ public boolean getShowunconserved()
+ {
+ return showUnconserved;
+ }
+
+ /**
+ * @param showUnconserved the showUnconserved to set
+ */
+ public void setShowunconserved(boolean displayNonconserved)
+ {
+ this.showUnconserved = displayNonconserved;
+ }