JMenuItem sequenceFeature = new JMenuItem();\r
JMenuItem textColour = new JMenuItem();\r
JMenu jMenu1 = new JMenu();\r
+ JMenu structureMenu = new JMenu();\r
+ JMenu viewStructureMenu = new JMenu();\r
+ JMenu colStructureMenu = new JMenu();\r
\r
/**\r
* Creates a new PopupMenu object.\r
final PDBEntry pdb = (PDBEntry) e.nextElement();\r
\r
menuItem = new JMenuItem();\r
- menuItem.setText("View PDB entry: " + pdb.getId());\r
+ menuItem.setText(pdb.getId());\r
menuItem.addActionListener(new java.awt.event.ActionListener()\r
{\r
public void actionPerformed(ActionEvent e)\r
{\r
-\r
Vector seqs = new Vector();\r
for (int i = 0; i < ap.av.alignment.getHeight(); i++)\r
{\r
\r
continue;\r
}\r
-\r
}\r
}\r
\r
new AppJMol(pdb, seqs2, ap);\r
}\r
});\r
- sequenceMenu.add(menuItem);\r
+ viewStructureMenu.add(menuItem);\r
+\r
+ menuItem = new JMenuItem();\r
+ menuItem.setText(pdb.getId());\r
+ menuItem.addActionListener(new java.awt.event.ActionListener()\r
+ {\r
+ public void actionPerformed(ActionEvent e)\r
+ {\r
+ colourByStructure(pdb.getId());\r
+ }\r
+ });\r
+ colStructureMenu.add(menuItem);\r
}\r
}\r
\r
if (seq == null)\r
{\r
sequenceMenu.setVisible(false);\r
- pdbMenu.setVisible(false);\r
+ structureMenu.setVisible(false);\r
}\r
\r
if (links != null && links.size() > 0)\r
}\r
});\r
jMenu1.setText("Group");\r
+ structureMenu.setText("Structure");\r
+ viewStructureMenu.setText("View Structure");\r
+ colStructureMenu.setText("Colour By Structure");\r
+\r
add(groupMenu);\r
\r
add(sequenceMenu);\r
+ this.add(structureMenu);\r
groupMenu.add(editMenu);\r
groupMenu.add(outputMenu);\r
groupMenu.add(sequenceFeature);\r
groupMenu.add(jMenu1);\r
sequenceMenu.add(sequenceName);\r
- sequenceMenu.add(pdbMenu);\r
colourMenu.add(textColour);\r
colourMenu.add(noColourmenuItem);\r
colourMenu.add(clustalColour);\r
jMenu1.add(showText);\r
jMenu1.add(showColourText);\r
jMenu1.add(outline);\r
+ structureMenu.add(pdbMenu);\r
+ structureMenu.add(viewStructureMenu);\r
+ structureMenu.add(colStructureMenu);\r
noColourmenuItem.setText("None");\r
noColourmenuItem.addActionListener(new java.awt.event.ActionListener()\r
{\r
\r
public void discoverPDB_actionPerformed()\r
{\r
- new jalview.io.DBRefFetcher(\r
- ap.av.getAlignment(), ap.alignFrame).fetchDBRefs(false);\r
+ SequenceI[] sequences =\r
+ ap.av.selectionGroup == null ?\r
+ new Sequence[]{sequence}\r
+ : ap.av.selectionGroup.getSequencesInOrder(ap.av.alignment);\r
+\r
+ new jalview.io.DBRefFetcher(sequences,\r
+ ap.alignFrame).fetchDBRefs(false);\r
}\r
\r
public void sequenceFeature_actionPerformed()\r
new TextColourChooser().chooseColour(ap, sg);\r
}\r
}\r
+\r
+ public void colourByStructure(String pdbid)\r
+ {\r
+ Annotation [] anots = jalview.structure.StructureSelectionManager.getStructureSelectionManager()\r
+ .colourSequenceFromStructure(sequence, pdbid);\r
+\r
+ AlignmentAnnotation an = new AlignmentAnnotation(\r
+ "Structure", "Coloured by "+pdbid, anots);\r
+\r
+ ap.av.alignment.addAnnotation(an);\r
+ an.createSequenceMapping(sequence, 0, true);\r
+ //an.adjustForAlignment();\r
+ ap.av.alignment.setAnnotationIndex(an,0);\r
+\r
+ ap.adjustAnnotationHeight();\r
+\r
+ sequence.addAlignmentAnnotation(an);\r
+\r
+ }\r
}\r