}
int start = r[0];
int end = r[1];
- // System.err.println("Seq : "+seqIndex+" Scroll to "+start+","+end); // DEBUG
+ // System.err.println("Seq : "+seqIndex+" Scroll to "+start+","+end); //
+ // DEBUG
if (start < 0)
{
return false;
AlignmentAnnotation[] aan = av.alignment.getAlignmentAnnotation();
Hashtable oldrfs = new Hashtable();
- for (int an = 0; an < aan.length; an++)
+ if (aan != null)
{
- if (aan[an].autoCalculated && aan[an].groupRef != null)
+ for (int an = 0; an < aan.length; an++)
{
- oldrfs.put(aan[an].groupRef, aan[an].groupRef);
- av.alignment.deleteAnnotation(aan[an]);
- aan[an] = null;
+ if (aan[an].autoCalculated && aan[an].groupRef != null)
+ {
+ oldrfs.put(aan[an].groupRef, aan[an].groupRef);
+ av.alignment.deleteAnnotation(aan[an]);
+ aan[an] = null;
+ }
}
}
SequenceGroup sg;
- for (int g = 0; g < gr.size(); g++)
+ if (gr != null)
{
- updateCalcs = false;
- sg = (SequenceGroup) gr.elementAt(g);
- if (applyGlobalSettings || !oldrfs.containsKey(sg))
- {
- // set defaults for this group's conservation/consensus
- sg.setIncludeAllConsSymbols(showprf);
- sg.setShowConsensusHistogram(showConsHist);
- }
- if (conv)
- {
- updateCalcs = true;
- av.alignment.addAnnotation(sg.getConservationRow(), 0);
- }
- if (cons)
- {
- updateCalcs = true;
- av.alignment.addAnnotation(sg.getConsensus(), 0);
- }
- // refresh the annotation rows
- if (updateCalcs)
+ for (int g = 0; g < gr.size(); g++)
{
- sg.recalcConservation();
+ updateCalcs = false;
+ sg = (SequenceGroup) gr.elementAt(g);
+ if (applyGlobalSettings || !oldrfs.containsKey(sg))
+ {
+ // set defaults for this group's conservation/consensus
+ sg.setIncludeAllConsSymbols(showprf);
+ sg.setShowConsensusHistogram(showConsHist);
+ }
+ if (conv)
+ {
+ updateCalcs = true;
+ av.alignment.addAnnotation(sg.getConservationRow(), 0);
+ }
+ if (cons)
+ {
+ updateCalcs = true;
+ av.alignment.addAnnotation(sg.getConsensus(), 0);
+ }
+ // refresh the annotation rows
+ if (updateCalcs)
+ {
+ sg.recalcConservation();
+ }
}
}
oldrfs.clear();
}
af.setMenusFromViewport(af.viewport);
- af.alignPanel.updateAnnotation(false); // recompute any autoannotation
// TODO: we don't need to do this if the viewport is aready visible.
Desktop.addInternalFrame(af, view.getTitle(), view.getWidth(), view
.getHeight());
+ af.alignPanel.updateAnnotation(false); // recompute any autoannotation
return af;
}