X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FAlignFrame.java;h=ea3fdf2c01b9c21afb7056c00e7e989e438e41e2;hb=b21429180fdda3586d67b5d0f43c89d35b504be7;hp=d9d5f279b4ddd73d4ba0e4bbdf54f93eaaa3830c;hpb=1ee9dde6abe6c467f28409fac5b3f06dd67d51bf;p=jalview.git diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index d9d5f27..ea3fdf2 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -1313,7 +1313,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, if (viewport.hasHiddenColumns() && !settings.isExportHiddenColumns()) { - omitHidden = viewport.getViewAsString(false); + omitHidden = viewport.getViewAsString(false, + settings.isExportHiddenSequences()); } int[] alignmentStartEnd = new int[2]; @@ -4646,24 +4647,21 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { showProducts.removeAll(); final boolean dna = viewport.getAlignment().isNucleotide(); - String[] ptypes = (selection == null || selection.length == 0) ? null - : CrossRef.findSequenceXrefTypes(dna, selection, dataset); + List ptypes = (selection == null || selection.length == 0) ? null + : CrossRef.findXrefSourcesForSequences(dna, selection, dataset); - for (int t = 0; ptypes != null && t < ptypes.length; t++) + for (final String source : ptypes) { showp = true; final AlignFrame af = this; - final String source = ptypes[t]; - JMenuItem xtype = new JMenuItem(ptypes[t]); + JMenuItem xtype = new JMenuItem(source); xtype.addActionListener(new ActionListener() { - @Override public void actionPerformed(ActionEvent e) { showProductsFor(af.viewport.getSequenceSelection(), dna, source); } - }); showProducts.add(xtype); } @@ -4671,7 +4669,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, showProducts.setEnabled(showp); } catch (Exception e) { - jalview.bin.Cache.log + Cache.log .warn("canShowProducts threw an exception - please report to help@jalview.org", e); return false; @@ -4679,6 +4677,17 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, return showp; } + /** + * Finds and displays cross-references for the selected sequences (protein + * products for nucleotide sequences, dna coding sequences for peptides). + * + * @param sel + * the sequences to show cross-references for + * @param dna + * true if from a nucleotide alignment (so showing proteins) + * @param source + * the database to show cross-references for + */ protected void showProductsFor(final SequenceI[] sel, final boolean dna, final String source) { @@ -4749,7 +4758,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, System.err.println("Failed to make CDS alignment"); } al.getCodonFrames().clear(); - al.getCodonFrames().addAll(copyAlignment.getCodonFrames()); + al.addCodonFrames(copyAlignment.getCodonFrames()); + al.addCodonFrames(cf); /* * pending getting Embl transcripts to 'align', @@ -4767,7 +4777,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { copyAlignment = AlignmentUtils.makeCopyAlignment( sequenceSelection, xrefs.getSequencesArray()); - copyAlignment.getCodonFrames().addAll(cf); + copyAlignment.addCodonFrames(cf); + al.addCodonFrames(copyAlignment.getCodonFrames()); + al.addCodonFrames(cf); } copyAlignment.setGapCharacter(AlignFrame.this.viewport .getGapCharacter()); @@ -4926,7 +4938,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, .getString("label.error_when_translating_sequences_submit_bug_report"); final String errorTitle = MessageManager .getString("label.implementation_error") - + MessageManager.getString("translation_failed"); + + MessageManager.getString("label.translation_failed"); JOptionPane.showMessageDialog(Desktop.desktop, msg, errorTitle, JOptionPane.ERROR_MESSAGE); return;