}
}
}
- if (calcIdSet.size()>0)
+ if (calcIdSet.size() > 0)
{
- for (String calcId:calcIdSet)
+ for (String calcId : calcIdSet)
{
- if (calcId.trim().length()>0) {
- view.addCalcIdParam(createCalcIdParam(calcId, av));
+ if (calcId.trim().length() > 0)
+ {
+ CalcIdParam cidp = createCalcIdParam(calcId, av);
+ // Some calcIds have no parameters.
+ if (cidp != null)
+ {
+ view.addCalcIdParam(cidp);
+ }
}
}
}
jaa = new jalview.datamodel.AlignmentAnnotation(an[i].getLabel(),
an[i].getDescription(), anot);
}
- if (autoForView)
+ // register new annotation
+ if (an[i].getId() != null)
+ {
+ annotationIds.put(an[i].getId(), jaa);
+ jaa.annotationId = an[i].getId();
+ }
+ // recover sequence association
+ if (an[i].getSequenceRef() != null)
{
- // register new annotation
- if (an[i].getId() != null)
+ if (al.findName(an[i].getSequenceRef()) != null)
{
- annotationIds.put(an[i].getId(), jaa);
- jaa.annotationId = an[i].getId();
- }
- // recover sequence association
- if (an[i].getSequenceRef() != null)
- {
- if (al.findName(an[i].getSequenceRef()) != null)
- {
- jaa.createSequenceMapping(
- al.findName(an[i].getSequenceRef()), 1, true);
- al.findName(an[i].getSequenceRef()).addAlignmentAnnotation(
- jaa);
- }
+ jaa.createSequenceMapping(al.findName(an[i].getSequenceRef()),
+ 1, true);
+ al.findName(an[i].getSequenceRef()).addAlignmentAnnotation(jaa);
}
}
// and make a note of any group association
);
}
}
- if (view.getCalcIdParam()!=null)
+ if (view.getCalcIdParam() != null)
{
- for (CalcIdParam calcIdParam:view.getCalcIdParam())
+ for (CalcIdParam calcIdParam : view.getCalcIdParam())
{
- if (recoverCalcIdParam(calcIdParam, af.viewport)) {
- } else {
- warn("Couldn't recover parameters for "+calcIdParam.getCalcId());
+ if (calcIdParam != null)
+ {
+ if (recoverCalcIdParam(calcIdParam, af.viewport))
+ {
+ }
+ else
+ {
+ warn("Couldn't recover parameters for "
+ + calcIdParam.getCalcId());
+ }
}
}
}