public abstract TreeModel getCurrentTree();
public abstract void setCurrentTree(TreeModel tree);
+
+ /**
+ * @param update
+ * - set the flag for updating structures on next repaint
+ */
+ void setUpdateStructures(boolean update);
+
+ /**
+ *
+ * @return true if structure views will be updated on next refresh
+ */
+ boolean isUpdateStructures();
+
+ /**
+ * check if structure views need to be updated, and clear the flag afterwards.
+ *
+ * @return if an update is needed
+ */
+ boolean needToUpdateStructureViews();
+
}
addNotify();
// TODO: many places call this method and also paintAlignment with various
// different settings. this means multiple redraws are triggered...
- paintAlignment(true, false);
+ paintAlignment(true, av.needToUpdateStructureViews());
}
/**
}
}
}
+ // indicate that associated structure views will need an update
+ aps[a].av.setUpdateStructures(true);
}
}
- // notify the panel(s) to redo any group specific stuff.
+ // notify the panel(s) to redo any group specific stuff
+ // also updates structure views if necessary
for (int a = 0; a < aps.length; a++)
{
aps[a].updateAnnotation();
- // TODO: JAL-868 - need to ensure view colour change message is broadcast
- // to any Jmols listening in
final AlignViewportI codingComplement = aps[a].av
.getCodingComplement();
if (codingComplement != null)
{
return currentTree;
}
+
+ /**
+ * flag set to indicate if structure views might be out of sync with sequences
+ * in the alignment
+ */
+
+ private boolean needToUpdateStructureViews = false;
+
+ @Override
+ public boolean isUpdateStructures()
+ {
+ return needToUpdateStructureViews;
+ }
+
+ @Override
+ public void setUpdateStructures(boolean update)
+ {
+ needToUpdateStructureViews = update;
+ }
+
+ @Override
+ public boolean needToUpdateStructureViews()
+ {
+ boolean update = needToUpdateStructureViews;
+ needToUpdateStructureViews = false;
+ return update;
+ }
+
}