X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FPopupMenu.java;h=25cad0ae528dc98385d038fdae2a247afd28f667;hb=3640aa8bd3308650c499f631fb2922cde429c43b;hp=ace4762c49997db5116f6f653648bc00f301013b;hpb=c3e47d769fd4d7556a2f266ae7a7047f7541aa11;p=jalview.git diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index ace4762..25cad0a 100644 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -256,9 +256,12 @@ public class PopupMenu extends JPopupMenu { // TODO re JAL-860: optionally open dialog or provide a menu entry // allowing user to open just one structure per sequence - new AppJmol(pdb, ap.av.collateForPDB(new PDBEntry[] - { pdb })[0], null, ap); - // new PDBViewer(pdb, seqs2, null, ap, AppletFormatAdapter.FILE); + //new AppJmol(pdb, ap.av.collateForPDB(new PDBEntry[] + //{ pdb })[0], null, ap); + new StructureViewer(ap.getStructureSelectionManager()) + .viewStructures(pdb, + ap.av.collateForPDB(new PDBEntry[] + { pdb })[0], null, ap); } }); @@ -558,7 +561,7 @@ public class PopupMenu extends JPopupMenu @Override public void actionPerformed(ActionEvent e) { - new AppJmol(ap, pe, ap.av.collateForPDB(pe)); + new StructureViewer(ap.getStructureSelectionManager()).viewStructures(ap, pe, ap.av.collateForPDB(pe)); } }); if (reppdb.size() > 1 && reppdb.size() < pdbe.size()) @@ -576,7 +579,7 @@ public class PopupMenu extends JPopupMenu @Override public void actionPerformed(ActionEvent e) { - new AppJmol(ap, pr, ap.av.collateForPDB(pr)); + new StructureViewer(ap.getStructureSelectionManager()).viewStructures(ap, pr, ap.av.collateForPDB(pr)); } }); } @@ -2068,23 +2071,21 @@ public class PopupMenu extends JPopupMenu System.out.println("PROMPT USER HERE"); // TODO: decide if a prompt happens // or we simply trust the user wants // wysiwig behaviour - SequenceGroup sg = ap.av.getSelectionGroup(); - ColumnSelection csel = new ColumnSelection(ap.av.getColumnSelection()); - omitHidden = ap.av.getViewAsString(true); - Alignment oal = new Alignment(ap.av.getSequenceSelection()); - AlignmentAnnotation[] nala = ap.av.getAlignment() - .getAlignmentAnnotation(); - if (nala != null) + + AlignmentView selvew = ap.av.getAlignmentView(true, false); + AlignmentI aselview = selvew.getVisibleAlignment(ap.av + .getGapCharacter()); + List ala = (ap.av + .getVisibleAlignmentAnnotation(true)); + if (ala != null) { - for (int i = 0; i < nala.length; i++) + for (AlignmentAnnotation aa : ala) { - AlignmentAnnotation na = nala[i]; - oal.addAnnotation(na); + aselview.addAnnotation(aa); } } cap.setText(new FormatAdapter().formatSequences(e.getActionCommand(), - oal, omitHidden, csel, sg)); - oal = null; + aselview, null, null, null)); } public void pdbFromFile_actionPerformed()