JMenuItem sequenceName = new JMenuItem();\r
Sequence sequence;\r
JMenuItem unGroupMenuItem = new JMenuItem();\r
- JMenuItem pdbMenuItem = new JMenuItem();\r
JMenuItem outline = new JMenuItem();\r
JRadioButtonMenuItem nucleotideMenuItem = new JRadioButtonMenuItem();\r
JMenu colourMenu = new JMenu();\r
* @param ap DOCUMENT ME!\r
* @param seq DOCUMENT ME!\r
*/\r
- public PopupMenu(AlignmentPanel ap, Sequence seq)\r
+ public PopupMenu(final AlignmentPanel ap, Sequence seq)\r
{\r
///////////////////////////////////////////////////////////\r
// If this is activated from the sequence panel, the user may want to\r
e.printStackTrace();\r
}\r
\r
- if ((seq == null) || (seq.getPDBId() == null))\r
+\r
+ if ((seq != null)\r
+ && seq.getDatasetSequence().getPDBId() != null)\r
{\r
- pdbMenuItem.setVisible(false);\r
+ java.util.Enumeration e = seq.getDatasetSequence().getPDBId().elements();\r
+ while(e.hasMoreElements())\r
+ {\r
+\r
+ final PDBEntry pdb = (PDBEntry)e.nextElement();\r
+ JMenuItem pdbMenuItem = new JMenuItem();\r
+ pdbMenuItem.setText("View PDB entry: "+pdb.getId());\r
+ pdbMenuItem.addActionListener(new java.awt.event.ActionListener()\r
+ {\r
+ public void actionPerformed(ActionEvent e)\r
+ {\r
+ PDBViewer viewer = new PDBViewer(pdb, sequence, ap.seqPanel.seqCanvas);\r
+ }\r
+ });\r
+ sequenceMenu.add(pdbMenuItem);\r
+ }\r
+\r
}\r
\r
SequenceGroup sg = ap.av.getSelectionGroup();\r
unGroupMenuItem_actionPerformed(e);\r
}\r
});\r
- pdbMenuItem.setText("View PDB structure");\r
- pdbMenuItem.addActionListener(new java.awt.event.ActionListener()\r
- {\r
- public void actionPerformed(ActionEvent e)\r
- {\r
- pdbMenuItem_actionPerformed(e);\r
- }\r
- });\r
+\r
outline.setText("Border colour");\r
outline.addActionListener(new java.awt.event.ActionListener()\r
{\r
groupMenu.addSeparator();\r
groupMenu.add(outline);\r
sequenceMenu.add(sequenceName);\r
- sequenceMenu.add(pdbMenuItem);\r
colourMenu.add(noColourmenuItem);\r
colourMenu.add(clustalColour);\r
colourMenu.add(BLOSUM62Colour);\r
refresh();\r
}\r
\r
- /**\r
- * DOCUMENT ME!\r
- *\r
- * @param e DOCUMENT ME!\r
- */\r
- void pdbMenuItem_actionPerformed(ActionEvent e)\r
- {\r
- if (sequence.getPDBId() == null)\r
- {\r
- return;\r
- }\r
-\r
- try\r
- {\r
- EBIFetchClient ebi = new EBIFetchClient();\r
- String[] result = ebi.fetchData("pdb:" + sequence.getPDBId(), null,\r
- null);\r
-\r
- PDBfile pdb = new PDBfile(result);\r
-\r
- rotCanvas rc = new rotCanvas(pdb, sequence, ap.av);\r
- JInternalFrame frame = new JInternalFrame();\r
- frame.setContentPane(rc);\r
- Desktop.addInternalFrame(frame,\r
- sequence.getName() + " " + sequence.getPDBId(), 400, 400);\r
- }\r
- catch (Exception ex)\r
- {\r
- ex.printStackTrace();\r
- }\r
- }\r
\r
/**\r
* DOCUMENT ME!\r