public abstract void colourByCharge();
/**
- * colour any structures associated with sequences in the given alignment
- * using the getFeatureRenderer() and getSequenceRenderer() renderers but only
- * if colourBySequence is enabled.
+ * Recolours the displayed structures, if they are coloured by sequence, or
+ * 'show only visible alignment' is selected. This supports updating structure
+ * colours on either change of alignment colours, or change to the visible
+ * region of the alignment.
*/
public void colourBySequence(AlignmentViewPanel alignmentv)
{
- if (!colourBySequence || !isLoadingFinished())
+ if (!isLoadingFinished())
+ {
+ return;
+ }
+ // todo: property change event for visibleAlignment
+ // to avoid unnecessary redraws here
+ if (!colourBySequence && !isShowAlignmentOnly())
{
return;
}
*
* @param alignViewportI
*/
- public abstract void showStructures(AlignViewportI alignViewportI);
+ public void showStructures(AlignViewportI alignViewportI)
+ {
+ // override with implementation
+ }
+
+ @Override
+ public void updateColours(Object source)
+ {
+ AlignmentViewPanel ap = (AlignmentViewPanel) source;
+ // ignore events from panels not used to colour this view
+ if (!getViewer().isUsedforcolourby(ap))
+ {
+ return;
+ }
+ if (!isLoadingFromArchive())
+ {
+ colourBySequence(ap);
+ }
+ }
}