- /*
- * Open in split pane. DNA sequence above, protein below.
- */
- AlignFrame copyMe = new AlignFrame(thisAlignment,
- AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
- copyMe.setTitle(getAlignPanel().alignFrame.getTitle());
- final AlignFrame proteinFrame = al.isNucleotide() ? copyMe
- : newAlignFrame;
- final AlignFrame cdnaFrame = al.isNucleotide() ? newAlignFrame
- : copyMe;
- protein = proteinFrame.viewport.getAlignment();
-
- cdnaFrame.setVisible(true);
- proteinFrame.setVisible(true);
- String sep = String.valueOf(File.separatorChar);
- String proteinShortName = StringUtils.getLastToken(
- proteinFrame.getTitle(), sep);
- String dnaShortName = StringUtils.getLastToken(cdnaFrame.getTitle(),
- sep);
- String linkedTitle = MessageManager.formatMessage(
- "label.linked_view_title", dnaShortName, proteinShortName);
- JInternalFrame splitFrame = new SplitFrame(cdnaFrame, proteinFrame);
- Desktop.addInternalFrame(splitFrame, linkedTitle,
- AlignFrame.DEFAULT_WIDTH,
- AlignFrame.DEFAULT_HEIGHT);
-
- /*
- * Set the frames to listen for each other's edit and sort commands.
- */
- ssm.addCommandListener(cdnaFrame.getViewport());
- ssm.addCommandListener(proteinFrame.getViewport());
-
- /*
- * 'Coding complement' (dna/protein) views will mirror each others' edits,
- * selections, sorting etc as decided from time to time by the relevant
- * authorities.
- */
- proteinFrame.getViewport().setCodingComplement(cdnaFrame.getViewport());