import jalview.schemes.*;
import jalview.util.UrlLink;
import jalview.io.AppletFormatAdapter;
+import jalview.io.SequenceAnnotationReport;
public class APopupMenu extends java.awt.PopupMenu implements
ActionListener, ItemListener
MenuItem sequenceFeature = new MenuItem("Create Sequence Feature");
MenuItem editSequence = new MenuItem("Edit Sequence");
+
+ MenuItem sequenceDetails = new MenuItem("Sequence Details ...");
+ MenuItem selSeqDetails = new MenuItem("Sequence Details ...");
+
Sequence seq;
MenuItem revealAll = new MenuItem();
{
editName();
}
+ else if (source == sequenceDetails)
+ {
+ showSequenceDetails();
+ }
+ else if (source == selSeqDetails)
+ {
+ showSequenceSelectionDetails();
+ }
else if (source == pdb)
{
addPDB();
}
+
void outputText(ActionEvent e)
{
CutAndPasteTransfer cap = new CutAndPasteTransfer(true, ap.alignFrame);
ap.av.showJVSuffix));
}
+ protected void showSequenceSelectionDetails()
+ {
+ createSequenceDetailsReport(ap.av.getSequenceSelection());
+ }
+
+ protected void showSequenceDetails()
+ {
+ createSequenceDetailsReport(new SequenceI[]{seq});
+ }
+ public void createSequenceDetailsReport(SequenceI[] sequences)
+ {
+
+ CutAndPasteTransfer cap = new CutAndPasteTransfer(false, ap.alignFrame);
+
+ StringBuffer contents = new StringBuffer();
+ for (SequenceI seq:sequences)
+ {
+ contents.append("<p><h2>Annotation for "+seq.getDisplayId(true)+"</h2></p><p>");
+ new SequenceAnnotationReport(null)
+ .createSequenceAnnotationReport(
+ contents,
+ seq,
+ true,
+ true,false,
+ (ap.seqPanel.seqCanvas.fr != null) ? ap.seqPanel.seqCanvas.fr.minmax
+ : null);
+ contents.append("</p>");
+ }
+ 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("<html>" + contents.toString() + "</html>");
+ }
void editName()
{
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);
this.add(hideSeqs);
this.add(revealSeq);
this.add(revealAll);
+ // groupMenu.add(selSeqDetails);
groupMenu.add(editGroupName);
groupMenu.add(editMenu);
groupMenu.add(outputmenu);
toLower.addActionListener(this);
editMenu.add(toggleCase);
seqMenu.add(sequenceName);
+ // seqMenu.add(sequenceDetails);
+
if (!ap.av.applet.useXtrnalSviewer)
{
seqMenu.add(pdb);