- end = viewport.getSelectionGroup().getEndRes()+1;
- }
- else
- {
- seqs = viewport.alignment.getSequences();
- }
- /* Commented out regions below are partial implementation of todo above.
- * divide start,end into visible chunks, and for each:
- int diff=end-start+1;
- int diffmax=0;
- int dr[] = new int[seqs.size()];
- */
- for (int i = 0; i < seqs.size(); i++)
- {
- current = (SequenceI) seqs.elementAt(i);
- //dr[i]=
- current.removeGaps(start, end);
- /*if (d<diff) // can only shift
- diff=d;
- if (diffmax<d)
- diffmax=d;
- */
- }
- /* // after the end of each chunk -
- * if (diff>0) {
- // record shift for history.
- editgaps.addShift(start, diff);
- if (viewport.hasHiddenColumns && diffmax>diff) {
- // pad sequence
- StringBuffer gaps=new StringBuffer(diffmax);
- for (int i=0,j=diffmax-diff; i<j; i++)
- gaps.append(viewport.getGapCharacter());
- for (int i=0, j=seqs.size(); i<j; i++) {
- current = (SequenceI) seqs.elementAt(i);
- if (dr[i]-diff>0) {
- String sq = current.getSequence();
- current.setSequence(sq.substring(0, hcend-dr[i])+gaps.substring(0, dr[i]-diff)+sq.substring());
- }
- }
- }
- }*/
-
- viewport.setStartRes(seq.findIndex(startRes)-1);
-
- viewport.firePropertyChange("alignment", null, viewport.getAlignment().getSequences());
-
- }
-
- 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(ap);
- av.updateConservation(ap);
- ap.annotationPanel.repaint();
- }
-
- resetAllColourSchemes();
-
- av.alignment.adjustSequenceAnnotations();
-
- if (ap.overviewPanel != null)
- ap.overviewPanel.updateOverviewImage();