X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FPopupMenu.java;h=1a367c5e58d494e8354f494db9ba1e9ad797ea25;hb=8f2bef6f91e7a6e47e41e78a82f45f7e406ef90a;hp=c1bbc8d58d0167bab19eb405f995533f9ee27a1b;hpb=b81d4d7d46ea8b1c89df086fb847baab6b69d427;p=jalview.git
diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java
index c1bbc8d..1a367c5 100644
--- a/src/jalview/gui/PopupMenu.java
+++ b/src/jalview/gui/PopupMenu.java
@@ -1,13 +1,13 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, 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 file is part of Jalview.
*
* 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
@@ -24,7 +24,6 @@ import java.awt.event.*;
import javax.swing.*;
-import MCview.*;
import jalview.analysis.*;
import jalview.commands.*;
import jalview.datamodel.*;
@@ -85,6 +84,10 @@ public class PopupMenu extends JPopupMenu
JMenuItem sequenceName = new JMenuItem();
+ JMenuItem sequenceDetails = new JMenuItem();
+
+ JMenuItem sequenceSelDetails = new JMenuItem();
+
SequenceI sequence;
JMenuItem unGroupMenuItem = new JMenuItem();
@@ -162,8 +165,8 @@ public class PopupMenu extends JPopupMenu
* @param links
* @param groupLinks
*/
- public PopupMenu(final AlignmentPanel ap, final SequenceI seq, Vector links,
- Vector groupLinks)
+ public PopupMenu(final AlignmentPanel ap, final SequenceI seq,
+ Vector links, Vector groupLinks)
{
// /////////////////////////////////////////////////////////
// If this is activated from the sequence panel, the user may want to
@@ -236,8 +239,10 @@ public class PopupMenu extends JPopupMenu
{
public void actionPerformed(ActionEvent e)
{
- // 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);
+ // 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);
}
@@ -257,28 +262,29 @@ public class PopupMenu extends JPopupMenu
{
if (ap.av.getAlignment().isNucleotide() == false)
{
- structureMenu.remove(viewStructureMenu);
+ structureMenu.remove(viewStructureMenu);
}
// structureMenu.remove(colStructureMenu);
}
if (ap.av.getAlignment().isNucleotide() == true)
{
- AlignmentAnnotation[] aa = ap.av.getAlignment().getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = ap.av.getAlignment()
+ .getAlignmentAnnotation();
for (int i = 0; i < aa.length; i++)
{
if (aa[i].getRNAStruc() != null)
{
final String rnastruc = aa[i].getRNAStruc();
- final String structureLine=aa[i].label;
+ final String structureLine = aa[i].label;
menuItem = new JMenuItem();
- menuItem.setText("2D RNA "+structureLine);
+ menuItem.setText("2D RNA " + structureLine);
menuItem.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
{
- new AppVarna(structureLine, seq, seq.getSequenceAsString(), rnastruc, seq
- .getName(), ap);
+ new AppVarna(structureLine, seq, seq.getSequenceAsString(),
+ rnastruc, seq.getName(), ap);
}
});
viewStructureMenu.add(menuItem);
@@ -295,17 +301,18 @@ public class PopupMenu extends JPopupMenu
if (seqAnno[i].getRNAStruc() != null)
{
final String rnastruc = seqAnno[i].getRNAStruc();
-
- // TODO: make rnastrucF a bit more nice
+
+ // TODO: make rnastrucF a bit more nice
menuItem = new JMenuItem();
- menuItem.setText("2D RNA - "+seq.getName());
+ menuItem.setText("2D RNA - " + seq.getName());
menuItem.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
{
// TODO: VARNA does'nt print gaps in the sequence
- new AppVarna(seq.getName()+" structure",seq,seq.getSequenceAsString(), rnastruc, seq
- .getName(), ap);
+ new AppVarna(seq.getName() + " structure", seq, seq
+ .getSequenceAsString(), rnastruc, seq.getName(),
+ ap);
}
});
viewStructureMenu.add(menuItem);
@@ -313,7 +320,6 @@ public class PopupMenu extends JPopupMenu
}
}
-
}
menuItem = new JMenuItem("Hide Sequences");
@@ -364,7 +370,8 @@ public class PopupMenu extends JPopupMenu
}
}
// for the case when no sequences are even visible
- if (ap.av.hasHiddenRows()) {
+ if (ap.av.hasHiddenRows())
+ {
{
menuItem = new JMenuItem("Reveal All");
menuItem.addActionListener(new ActionListener()
@@ -386,9 +393,9 @@ public class PopupMenu extends JPopupMenu
SequenceGroup sg = ap.av.getSelectionGroup();
- if (sg != null&& sg.getSize()>0)
+ if (sg != null && sg.getSize() > 0)
{
- groupName.setText("Name: "+sg.getName());
+ groupName.setText("Name: " + sg.getName());
groupName.setText("Edit name and description of current group.");
if (sg.cs instanceof ZappoColourScheme)
@@ -462,36 +469,43 @@ public class PopupMenu extends JPopupMenu
buildGroupURLMenu(sg, groupLinks);
}
// Add a 'show all structures' for the current selection
- HashtableAnnotation for " + seq.getDisplayId(true)
+ + "
"); + new SequenceAnnotationReport(null) + .createSequenceAnnotationReport( + contents, + seq, + true, + true, + false, + (ap.seqPanel.seqCanvas.fr != null) ? ap.seqPanel.seqCanvas.fr.minmax + : null); + contents.append("
"); + } + cap.setText("" + contents.toString() + ""); + + Desktop.instance.addInternalFrame(cap, "Sequence Details for " + + (sequences.length == 1 ? sequences[0].getDisplayId(true) + : "Selection"), 500, 400); + + } + protected void showNonconserved_actionPerformed() { getGroup().setShowNonconserved(displayNonconserved.isSelected()); @@ -1288,8 +1359,7 @@ public class PopupMenu extends JPopupMenu protected void clustalColour_actionPerformed() { SequenceGroup sg = getGroup(); - sg.cs = new ClustalxColourScheme( - sg,ap.av.getHiddenRepSequences()); + sg.cs = new ClustalxColourScheme(sg, ap.av.getHiddenRepSequences()); refresh(); } @@ -1416,8 +1486,8 @@ public class PopupMenu extends JPopupMenu if (abovePIDColour.isSelected()) { sg.cs.setConsensus(AAFrequency.calculate( - sg.getSequences(ap.av.getHiddenRepSequences()), sg.getStartRes(), - sg.getEndRes() + 1)); + sg.getSequences(ap.av.getHiddenRepSequences()), + sg.getStartRes(), sg.getEndRes() + 1)); int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup() .getName()); @@ -1470,8 +1540,8 @@ public class PopupMenu extends JPopupMenu SequenceGroup sg = getGroup(); sg.cs = new PIDColourScheme(); sg.cs.setConsensus(AAFrequency.calculate( - sg.getSequences(ap.av.getHiddenRepSequences()), sg.getStartRes(), - sg.getEndRes() + 1)); + sg.getSequences(ap.av.getHiddenRepSequences()), + sg.getStartRes(), sg.getEndRes() + 1)); refresh(); } @@ -1488,8 +1558,8 @@ public class PopupMenu extends JPopupMenu sg.cs = new Blosum62ColourScheme(); sg.cs.setConsensus(AAFrequency.calculate( - sg.getSequences(ap.av.getHiddenRepSequences()), sg.getStartRes(), - sg.getEndRes() + 1)); + sg.getSequences(ap.av.getHiddenRepSequences()), + sg.getStartRes(), sg.getEndRes() + 1)); refresh(); } @@ -1523,8 +1593,8 @@ public class PopupMenu extends JPopupMenu if (conservationMenuItem.isSelected()) { Conservation c = new Conservation("Group", - ResidueProperties.propHash, 3, - sg.getSequences(ap.av.getHiddenRepSequences()), sg.getStartRes(), + ResidueProperties.propHash, 3, sg.getSequences(ap.av + .getHiddenRepSequences()), sg.getStartRes(), sg.getEndRes() + 1); c.calculate(); @@ -1806,8 +1876,8 @@ public class PopupMenu extends JPopupMenu } ChangeCaseCommand caseCommand = new ChangeCaseCommand(description, - sg.getSequencesAsArray(ap.av.getHiddenRepSequences()), startEnd, - caseChange); + sg.getSequencesAsArray(ap.av.getHiddenRepSequences()), + startEnd, caseChange); ap.alignFrame.addHistoryItem(caseCommand); @@ -1833,7 +1903,8 @@ public class PopupMenu extends JPopupMenu 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(); + AlignmentAnnotation[] nala = ap.av.getAlignment() + .getAlignmentAnnotation(); if (nala != null) { for (int i = 0; i < nala.length; i++) @@ -1852,8 +1923,10 @@ public class PopupMenu extends JPopupMenu jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser( jalview.bin.Cache.getProperty("LAST_DIRECTORY")); chooser.setFileView(new jalview.io.JalviewFileView()); - chooser.setDialogTitle("Select a PDB file for "+sequence.getDisplayId(false)); - chooser.setToolTipText("Load a PDB file and associate it with sequence '"+sequence.getDisplayId(false)+"'"); + chooser.setDialogTitle("Select a PDB file for " + + sequence.getDisplayId(false)); + chooser.setToolTipText("Load a PDB file and associate it with sequence '" + + sequence.getDisplayId(false) + "'"); int value = chooser.showOpenDialog(null); @@ -1861,7 +1934,8 @@ public class PopupMenu extends JPopupMenu { String choice = chooser.getSelectedFile().getPath(); jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice); - new AssociatePdbFileWithSeq().associatePdbWithSeq(choice, jalview.io.AppletFormatAdapter.FILE, sequence, true); + new AssociatePdbFileWithSeq().associatePdbWithSeq(choice, + jalview.io.AppletFormatAdapter.FILE, sequence, true); } } @@ -1947,8 +2021,8 @@ public class PopupMenu extends JPopupMenu public void colourByStructure(String pdbid) { - Annotation[] anots = ap.av.getStructureSelectionManager().colourSequenceFromStructure( - sequence, pdbid); + Annotation[] anots = ap.av.getStructureSelectionManager() + .colourSequenceFromStructure(sequence, pdbid); AlignmentAnnotation an = new AlignmentAnnotation("Structure", "Coloured by " + pdbid, anots);