X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAPopupMenu.java;h=c71818e2dae8ab46be141ffdf76a1507b99a0e2a;hb=296d1d4fdf60f651889d03a475e54aee135890d4;hp=25a7a934a52b84f84ffb9322bd3c84a851dcf299;hpb=e6172518e085efc5703a2e0ce6675fe5f81ea253;p=jalview.git
diff --git a/src/jalview/appletgui/APopupMenu.java b/src/jalview/appletgui/APopupMenu.java
index 25a7a93..c71818e 100755
--- a/src/jalview/appletgui/APopupMenu.java
+++ b/src/jalview/appletgui/APopupMenu.java
@@ -1,20 +1,19 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
- * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
+ * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This file is part of Jalview.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see
"); + new SequenceAnnotationReport(null) + .createSequenceAnnotationReport( + contents, + seq, + true, + true, + false, + (ap.seqPanel.seqCanvas.fr != null) ? ap.seqPanel.seqCanvas.fr.minmax + : null); + contents.append("
"); + } + Frame frame = new Frame(); + frame.add(cap); + jalview.bin.JalviewLite.addFrame(frame, "Sequence Details for " + + (sequences.length == 1 ? sequences[0].getDisplayId(true) + : "Selection"), 600, 500); + cap.setText("" + contents.toString() + ""); } void editName() { - EditNameDialog dialog = new EditNameDialog(seq.getName(), seq - .getDescription(), " Sequence Name", + EditNameDialog dialog = new EditNameDialog(seq.getName(), + seq.getDescription(), " Sequence Name", "Sequence Description", ap.alignFrame, "Edit Sequence Name / Description", 500, 100, true); @@ -677,7 +723,8 @@ public class APopupMenu extends java.awt.PopupMenu implements cap.setPDBImport(seq); Frame frame = new Frame(); frame.add(cap); - jalview.bin.JalviewLite.addFrame(frame, "Paste PDB file ", 400, 300); + jalview.bin.JalviewLite.addFrame(frame, + "Paste PDB file for sequence " + seq.getName(), 400, 300); } } @@ -700,6 +747,8 @@ public class APopupMenu extends java.awt.PopupMenu implements showBoxes.setState(true); showBoxes.addItemListener(this); sequenceName.addActionListener(this); + sequenceDetails.addActionListener(this); + selSeqDetails.addActionListener(this); displayNonconserved.setLabel("Show Nonconserved"); displayNonconserved.setState(false); displayNonconserved.addItemListener(this); @@ -713,11 +762,14 @@ public class APopupMenu extends java.awt.PopupMenu implements hideSeqs.setLabel("Hide Sequences"); repGroup.setLabel("Represent Group with"); revealAll.setLabel("Reveal All"); + revealSeq.setLabel("Reveal Sequences"); menu1.setLabel("Group"); add(groupMenu); this.add(seqMenu); this.add(hideSeqs); + this.add(revealSeq); this.add(revealAll); + // groupMenu.add(selSeqDetails); groupMenu.add(editGroupName); groupMenu.add(editMenu); groupMenu.add(outputmenu); @@ -784,7 +836,12 @@ public class APopupMenu extends java.awt.PopupMenu implements toLower.addActionListener(this); editMenu.add(toggleCase); seqMenu.add(sequenceName); - seqMenu.add(pdb); + // seqMenu.add(sequenceDetails); + + if (!ap.av.applet.useXtrnalSviewer) + { + seqMenu.add(pdb); + } seqMenu.add(repGroup); menu1.add(unGroupMenuItem); menu1.add(colourMenu); @@ -797,6 +854,7 @@ public class APopupMenu extends java.awt.PopupMenu implements hideSeqs.addActionListener(this); repGroup.addActionListener(this); revealAll.addActionListener(this); + revealSeq.addActionListener(this); } void refresh() @@ -807,9 +865,7 @@ public class APopupMenu extends java.awt.PopupMenu implements protected void clustalColour_actionPerformed() { SequenceGroup sg = getGroup(); - sg.cs = new ClustalxColourScheme(sg - .getSequences(ap.av.hiddenRepSequences), ap.av.alignment - .getWidth()); + sg.cs = new ClustalxColourScheme(sg, ap.av.getHiddenRepSequences()); refresh(); } @@ -871,9 +927,8 @@ public class APopupMenu extends java.awt.PopupMenu implements if (abovePIDColour.getState()) { - sg.cs.setConsensus(AAFrequency.calculate(sg - .getSequences(ap.av.hiddenRepSequences), 0, ap.av.alignment - .getWidth())); + sg.cs.setConsensus(AAFrequency.calculate(sg.getSequences(ap.av + .getHiddenRepSequences()), 0, ap.av.getAlignment().getWidth())); int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup() .getName()); @@ -901,9 +956,8 @@ public class APopupMenu extends java.awt.PopupMenu implements { SequenceGroup sg = getGroup(); sg.cs = new PIDColourScheme(); - sg.cs.setConsensus(AAFrequency.calculate(sg - .getSequences(ap.av.hiddenRepSequences), 0, ap.av.alignment - .getWidth())); + sg.cs.setConsensus(AAFrequency.calculate(sg.getSequences(ap.av + .getHiddenRepSequences()), 0, ap.av.getAlignment().getWidth())); refresh(); } @@ -913,9 +967,8 @@ public class APopupMenu extends java.awt.PopupMenu implements sg.cs = new Blosum62ColourScheme(); - sg.cs.setConsensus(AAFrequency.calculate(sg - .getSequences(ap.av.hiddenRepSequences), 0, ap.av.alignment - .getWidth())); + sg.cs.setConsensus(AAFrequency.calculate(sg.getSequences(ap.av + .getHiddenRepSequences()), 0, ap.av.getAlignment().getWidth())); refresh(); } @@ -937,16 +990,10 @@ public class APopupMenu extends java.awt.PopupMenu implements if (conservationMenuItem.getState()) { - Conservation c = new Conservation("Group", - ResidueProperties.propHash, 3, sg - .getSequences(ap.av.hiddenRepSequences), 0, - ap.av.alignment.getWidth()); - - c.calculate(); - c.verdict(false, ap.av.ConsPercGaps); - - sg.cs.setConservation(c); - + sg.cs.setConservation(Conservation.calculateConservation("Group", + ResidueProperties.propHash, 3, sg.getSequences(ap.av + .getHiddenRepSequences()), 0, ap.av.getAlignment() + .getWidth(), false, ap.av.getConsPercGaps(), false)); SliderPanel.setConservationSlider(ap, sg.cs, sg.getName()); SliderPanel.showConservationSlider(); } @@ -966,7 +1013,7 @@ public class APopupMenu extends java.awt.PopupMenu implements // this method won't add a new group if it already exists if (sg != null) { - ap.av.alignment.addGroup(sg); + ap.av.getAlignment().addGroup(sg); } return sg; @@ -975,7 +1022,7 @@ public class APopupMenu extends java.awt.PopupMenu implements void unGroupMenuItem_actionPerformed() { SequenceGroup sg = ap.av.getSelectionGroup(); - ap.av.alignment.deleteGroup(sg); + ap.av.getAlignment().deleteGroup(sg); ap.av.setSelectionGroup(null); ap.paintAlignment(true); } @@ -994,7 +1041,7 @@ public class APopupMenu extends java.awt.PopupMenu implements public void showNonconserved_itemStateChanged() { - getGroup().setShowunconserved(this.displayNonconserved.getState()); + getGroup().setShowNonconserved(this.displayNonconserved.getState()); refresh(); } @@ -1035,6 +1082,7 @@ public class APopupMenu extends java.awt.PopupMenu implements } ap.av.hideSequence(hseqs); + ap.av.sendSelection(); } }