- public void alignmentChanged()
- {
- AlignViewport av;
- AlignmentPanel ap;
-
- for(int i=0; i<alignPanels.size(); i++)
- {
- ap = (AlignmentPanel) alignPanels.elementAt(i);
- av = ap.av;
-
- if (av.padGaps)
- av.getAlignment().padGaps();
-
- if (av.hconsensus != null && av.autoCalculateConsensus)
- {
- av.updateConsensus();
- av.updateConservation();
- }
-
- resetAllColourSchemes();
-
- av.alignment.adjustSequenceAnnotations();
-
- if (ap.overviewPanel != null)
- ap.overviewPanel.updateOverviewImage();
-
- ap.repaint();
- }
- }
-
- void resetAllColourSchemes()
- {
- ColourSchemeI cs = viewport.globalColourScheme;
- if(cs!=null)
- {
- if (cs instanceof ClustalxColourScheme)
- {
- ( (ClustalxColourScheme) viewport.getGlobalColourScheme()).
- resetClustalX(viewport.alignment.getSequences(),
- viewport.alignment.getWidth());
- }
-
- cs.setConsensus(viewport.hconsensus);
- if (cs.conservationApplied())
- {
- Alignment al = (Alignment) viewport.alignment;
- Conservation c = new Conservation("All",
- ResidueProperties.propHash, 3,
- al.getSequences(), 0,
- al.getWidth() - 1);
- c.calculate();
- c.verdict(false, viewport.ConsPercGaps);
-
- cs.setConservation(c);
- }
- }
-
- int s, sSize = viewport.alignment.getGroups().size();
- for(s=0; s<sSize; s++)
- {
- SequenceGroup sg = (SequenceGroup)viewport.alignment.getGroups().elementAt(s);
- if(sg.cs!=null && sg.cs instanceof ClustalxColourScheme)
- {
- ((ClustalxColourScheme)sg.cs).resetClustalX(
- sg.getSequences(true), sg.getWidth());
- }
- sg.recalcConservation();
- }
- }
-