package jalview.gui;
import jalview.api.SplitContainerI;
-import jalview.api.ViewStyleI;
import jalview.datamodel.AlignmentI;
import jalview.jbgui.GAlignFrame;
import jalview.jbgui.GSplitFrame;
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;
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)
: (!bottomAlignment.isNucleotide() ? bottomViewport : null);
if (protein != null && cdna != null)
{
- ViewStyleI vs = protein.getViewStyle();
- int scale = vs.isScaleProteinAsCdna() ? 3 : 1;
- vs.setCharWidth(scale * cdna.getViewStyle().getCharWidth());
- protein.setViewStyle(vs);
+ int scale = protein.isScaleProteinAsCdna() ? 3 : 1;
+ protein.setCharWidth(scale * cdna.getViewStyle().getCharWidth());
}
}
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();
+ (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);
}
actioned = true;
e.consume();
}
+ break;
default:
}
return actioned;
}
/**
+ * return the AlignFrames held by this container
+ *
+ * @return { Top alignFrame (Usually CDS), Bottom AlignFrame (Usually
+ * Protein)}
+ */
+ public List<AlignFrame> 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.