}
/**
- * calculate residue conservation for group - but only if necessary.
+ * calculate residue conservation and colourschemes for group - but only if
+ * necessary. returns true if the calculation resulted in a visible change to
+ * group
*/
- public void recalcConservation()
+ public boolean recalcConservation()
+ {
+ return recalcConservation(false);
+ }
+
+ /**
+ * calculate residue conservation for group - but only if necessary. returns
+ * true if the calculation resulted in a visible change to group
+ *
+ * @param defer
+ * when set, colourschemes for this group are not refreshed after
+ * recalculation
+ */
+ public boolean recalcConservation(boolean defer)
{
if (cs == null && consensus == null && conservation == null)
{
- return;
+ return false;
}
+ // TODO: try harder to detect changes in state in order to minimise
+ // recalculation effort
try
{
Hashtable cnsns[] = AAFrequency.calculate(sequences, startRes,
}
}
}
- if (cs != null)
+ if (cs != null && !defer)
{
+ // TODO: JAL-2034 should cs.alignmentChanged modify return state
cs.alignmentChanged(context != null ? context : this, null);
+ return true;
+ }
+ else
+ {
+ return false;
}
} catch (java.lang.OutOfMemoryError err)
{
// TODO: catch OOM
System.out.println("Out of memory loading groups: " + err);
}
-
+ return false;
}
private void _updateConservationRow(Conservation c)