, "file":"estrogenReceptorCdna.fa"
, "file2":"estrogenReceptorProtein.fa"
, "defaultColour":"Purine/Pyrimidine"
- , "showAnnotation":"true"
- , "windowHeight":"800"
- , "windowWidth":"650"
- , "showConservation":"false"
- , "showQuality":"false"
- , "showConsensus":"true"
+ , "showAnnotation":"false"
+ , "windowHeight":"300"
+ , "windowWidth":"800"
, "showFullId":"false"} prots=true /></td>
<td valign="center">Displays a split window view of protein and its related cDNA</td>
</tr>
<param name="file" value="estrogenReceptorCdna.fa"/>
<param name="file2" value="estrogenReceptorProtein.fa"/>
<param name="showFullId" value="false"/>
-<param name="windowHeight" value="800"/>
-<param name="windowWidth" value="650"/>
-<param name="showAnnotation" value="true"/>
+<param name="windowHeight" value="300"/>
+<param name="windowWidth" value="800"/>
+<param name="showAnnotation" value="false"/>
<param name="defaultColour" value="Purine/Pyrimidine"/>
<param name="APPLICATION_URL"
value="http://www.jalview.org/services/launchApp"/>
import jalview.structure.StructureSelectionManager;
import java.awt.BorderLayout;
-import java.awt.Component;
+import java.awt.Dimension;
import java.awt.GridLayout;
-import java.awt.MouseInfo;
import java.awt.Panel;
-import java.awt.Point;
-import java.awt.Rectangle;
public class SplitFrame extends EmbmenuFrame
{
ssm.addCommandListener(protein);
}
- setCharacterWidth(protein, cdna);
+ adjustLayout();
}
/**
}
/**
- * Expand protein to 3 times character width of dna
- *
- * @param protein
- * @param cdna
+ * Make any adjustments to the layout
*/
- protected void setCharacterWidth(AlignViewport protein, AlignViewport cdna)
+ protected void adjustLayout()
{
+ AlignViewport cdna = topFrame.getAlignViewport().getAlignment()
+ .isNucleotide() ? topFrame.viewport : bottomFrame.viewport;
+ AlignViewport protein = cdna == topFrame.viewport ? bottomFrame.viewport
+ : topFrame.viewport;
+
+ /*
+ * Ensure sequence ids are the same width for good alignment.
+ */
+ // TODO should do this via av.getViewStyle/setViewStyle
+ // however at present av.viewStyle is not set in IdPanel.fontChanged
+ int w1 = topFrame.alignPanel.idPanel.idCanvas.getWidth();
+ int w2 = bottomFrame.alignPanel.idPanel.idCanvas.getWidth();
+ int w3 = Math.max(w1, w2);
+ if (w1 != w3)
+ {
+ Dimension d = topFrame.alignPanel.idPanel.idCanvas.getSize();
+ topFrame.alignPanel.idPanel.idCanvas.setSize(new Dimension(w3,
+ d.height));
+ }
+ if (w2 != w3)
+ {
+ Dimension d = bottomFrame.alignPanel.idPanel.idCanvas.getSize();
+ bottomFrame.alignPanel.idPanel.idCanvas.setSize(new Dimension(w3,
+ d.height));
+ }
+
+ /*
+ * Expand protein to 3 times character width of dna
+ */
if (protein != null && cdna != null)
{
ViewStyleI vs = protein.getViewStyle();
*/
public void addToDisplay(boolean embedded, JalviewLite applet)
{
- createAlignFrameWindow(embedded, applet);
+ createSplitFrameWindow(embedded, applet);
validate();
topFrame.alignPanel.adjustAnnotationHeight();
topFrame.alignPanel.paintAlignment(true);
* @param embed
* @param applet
*/
- public void createAlignFrameWindow(boolean embed, JalviewLite applet)
+ protected void createSplitFrameWindow(boolean embed, JalviewLite applet)
{
if (embed)
{