{
setSize(AlignFrame.DEFAULT_WIDTH, Desktop.instance.getHeight() - 20);
- setCharacterWidth();
+ adjustLayout();
addCloseFrameListener();
}
/**
- * Set the character width for protein to 3 times that for dna.
+ * Do any tweaking and twerking of the layout wanted.
*/
- private void setCharacterWidth()
+ private void adjustLayout()
{
+ /*
+ * Ensure sequence ids are the same width for good alignment.
+ */
+ int w1 = ((AlignFrame) getTopFrame()).getViewport().getIdWidth();
+ int w2 = ((AlignFrame) getBottomFrame()).getViewport().getIdWidth();
+ int w3 = Math.max(w1, w2);
+ ((AlignFrame) getTopFrame()).getViewport().setIdWidth(w3);
+ ((AlignFrame) getBottomFrame()).getViewport().setIdWidth(w3);
+
+ /*
+ * Set the character width for protein to 3 times that for dna.
+ */
final AlignViewport topViewport = ((AlignFrame) getTopFrame()).viewport;
final AlignViewport bottomViewport = ((AlignFrame) getBottomFrame()).viewport;
final AlignmentI topAlignment = topViewport.getAlignment();