From: gmungoc Date: Tue, 24 Feb 2015 16:29:21 +0000 (+0000) Subject: JAL-845 set top and bottom seq id widths the same X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=09b921c6d6e8a8dd782ac70d9f82557eb302cb33;p=jalview.git JAL-845 set top and bottom seq id widths the same --- diff --git a/src/jalview/gui/SplitFrame.java b/src/jalview/gui/SplitFrame.java index c46bcd4..e441371 100644 --- a/src/jalview/gui/SplitFrame.java +++ b/src/jalview/gui/SplitFrame.java @@ -54,7 +54,7 @@ public class SplitFrame extends GSplitFrame { setSize(AlignFrame.DEFAULT_WIDTH, Desktop.instance.getHeight() - 20); - setCharacterWidth(); + adjustLayout(); addCloseFrameListener(); @@ -64,10 +64,22 @@ public class SplitFrame extends GSplitFrame } /** - * 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();