import jalview.schemes.TurnColourScheme;
import jalview.schemes.UserColourScheme;
import jalview.schemes.ZappoColourScheme;
+import jalview.structure.StructureSelectionManager;
import jalview.util.MessageManager;
import jalview.viewmodel.AlignmentViewport;
import jalview.ws.jws1.Discoverer;
* Set the 'follow' flag on the Viewport (and scroll to position if now
* true).
*/
- if (viewport.followHighlight = this.followHighlightMenuItem.getState())
+ final boolean state = this.followHighlightMenuItem.getState();
+ viewport.setFollowHighlight(state);
+ if (state)
{
alignPanel.scrollToPosition(
alignPanel.getSeqPanel().seqCanvas.searchResults, false);
sprods[s].updatePDBIds();
}
Alignment al = new Alignment(sprods);
- Set<AlignedCodonFrame> cf = prods.getCodonFrames();
al.setDataset(ds);
+
+ /*
+ * Copy dna-to-protein mappings to new alignment
+ */
+ // TODO 1: no mappings are set up for EMBL product
+ // TODO 2: if they were, should add them to protein alignment, not
+ // dna
+ Set<AlignedCodonFrame> cf = prods.getCodonFrames();
for (AlignedCodonFrame acf : cf)
{
al.addCodonFrame(acf);
+ getTitle();
naf.setTitle(newtitle);
- // remove this flag once confirmed we want a split view
- boolean asSplitFrame = true;
+ // temporary flag until SplitFrame is released
+ boolean asSplitFrame = Cache.getDefault(
+ Preferences.ENABLE_SPLIT_FRAME, false);
if (asSplitFrame)
{
- final Alignment copyAlignment = new Alignment(new Alignment(
- AlignFrame.this.viewport.getSequenceSelection()));
+ /*
+ * Make a copy of this alignment (sharing the same dataset
+ * sequences). If we are DNA, drop introns and update mappings
+ */
+ AlignmentI copyAlignment = null;
+ final SequenceI[] sequenceSelection = AlignFrame.this.viewport
+ .getSequenceSelection();
+ if (dna)
+ {
+ copyAlignment = AlignmentUtils.makeExonAlignment(
+ sequenceSelection, cf);
+ al.getCodonFrames().clear();
+ al.getCodonFrames().addAll(cf);
+ final StructureSelectionManager ssm = StructureSelectionManager
+ .getStructureSelectionManager(Desktop.instance);
+ ssm.addMappings(cf);
+ }
+ else
+ {
+ copyAlignment = new Alignment(new Alignment(
+ sequenceSelection));
+ }
AlignFrame copyThis = new AlignFrame(copyAlignment,
AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
copyThis.setTitle(AlignFrame.this.getTitle());
"label.translation_of_params", new Object[]
{ this.getTitle() });
af.setTitle(newTitle);
- final SequenceI[] seqs = viewport.getSelectionAsNewSequence();
- viewport.openSplitFrame(af, new Alignment(seqs), al.getCodonFrames());
- // Desktop.addInternalFrame(af, newTitle, DEFAULT_WIDTH, DEFAULT_HEIGHT);
+ if (Cache.getDefault(Preferences.ENABLE_SPLIT_FRAME, false))
+ {
+ final SequenceI[] seqs = viewport.getSelectionAsNewSequence();
+ viewport.openSplitFrame(af, new Alignment(seqs),
+ al.getCodonFrames());
+ }
+ else
+ {
+ Desktop.addInternalFrame(af, newTitle, DEFAULT_WIDTH,
+ DEFAULT_HEIGHT);
+ }
}
}