X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSplitFrame.java;h=6c849c3750e101fcec52b03292a9021758d326d6;hb=9201765247470c08d366abef2713c1c736adf2cb;hp=617224f2a3179c712f80d14c21209440ad5d771c;hpb=9c6f9bb69f694cb37db088c8fca6582169efcb05;p=jalview.git diff --git a/src/jalview/gui/SplitFrame.java b/src/jalview/gui/SplitFrame.java index 617224f..6c849c3 100644 --- a/src/jalview/gui/SplitFrame.java +++ b/src/jalview/gui/SplitFrame.java @@ -37,6 +37,8 @@ import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.beans.PropertyVetoException; +import java.util.Arrays; +import java.util.List; import java.util.Map.Entry; import javax.swing.AbstractAction; @@ -68,7 +70,9 @@ public class SplitFrame extends GSplitFrame implements SplitContainerI private static final int WINDOWS_INSETS_HEIGHT = 50; // tbc private static final int MAC_INSETS_HEIGHT = 50; + private static final int DESKTOP_DECORATORS_HEIGHT = 65; + private static final long serialVersionUID = 1L; public SplitFrame(GAlignFrame top, GAlignFrame bottom) @@ -206,6 +210,7 @@ public class SplitFrame extends GSplitFrame implements SplitContainerI final AlignmentI bottomAlignment = bottomViewport.getAlignment(); boolean topAnnotations = topViewport.isShowAnnotation(); boolean bottomAnnotations = bottomViewport.isShowAnnotation(); + // TODO need number of visible sequences here, not #sequences - how? int topCount = topAlignment.getHeight(); int bottomCount = bottomAlignment.getHeight(); int topCharHeight = topViewport.getViewStyle().getCharHeight(); @@ -223,6 +228,11 @@ public class SplitFrame extends GSplitFrame implements SplitContainerI + (bottomAnnotations ? bottomViewport.calcPanelHeight() : 0); double ratio = ((double) topHeight) / (topHeight + bottomHeight); + /* + * limit to 0.2 <= ratio <= 0.8 to avoid concealing all sequences + */ + ratio = Math.min(ratio, 0.8d); + ratio = Math.max(ratio, 0.2d); setRelativeDividerLocation(ratio); } @@ -328,6 +338,7 @@ public class SplitFrame extends GSplitFrame implements SplitContainerI actioned = true; e.consume(); } + break; default: } return actioned; @@ -704,6 +715,18 @@ public class SplitFrame extends GSplitFrame implements SplitContainerI } /** + * return the AlignFrames held by this container + * + * @return { Top alignFrame (Usually CDS), Bottom AlignFrame (Usually + * Protein)} + */ + public List getAlignFrames() + { + return Arrays.asList(new AlignFrame[] { (AlignFrame) getTopFrame(), + (AlignFrame) getBottomFrame() }); + } + + /** * Replace Cmd-F Find action with our version. This is necessary because the * 'default' Finder searches in the first AlignFrame it finds. We need it to * search in the half of the SplitFrame that has the mouse.