}\r
\r
\r
- if ((seq != null)\r
- && seq.getDatasetSequence().getPDBId() != null)\r
+ if (seq != null)\r
{\r
- java.util.Enumeration e = seq.getDatasetSequence().getPDBId().elements();\r
- while(e.hasMoreElements())\r
+ JMenuItem menuItem;\r
+ if( seq.getDatasetSequence().getPDBId() != null)\r
{\r
- final PDBEntry pdb = (PDBEntry)e.nextElement();\r
-\r
- JMenuItem pdbMenuItem = new JMenuItem();\r
- pdbMenuItem.setText("View PDB entry: "+pdb.getId());\r
- pdbMenuItem.addActionListener(new java.awt.event.ActionListener()\r
+ java.util.Enumeration e = seq.getDatasetSequence().getPDBId().\r
+ elements();\r
+ while (e.hasMoreElements())\r
{\r
+ final PDBEntry pdb = (PDBEntry) e.nextElement();\r
+\r
+ menuItem = new JMenuItem();\r
+ menuItem.setText("View PDB entry: " + pdb.getId());\r
+ menuItem.addActionListener(new java.awt.event.ActionListener()\r
+ {\r
public void actionPerformed(ActionEvent e)\r
{\r
new PDBViewer(pdb, sequence, ap.seqPanel.seqCanvas);\r
}\r
+ });\r
+ sequenceMenu.add(menuItem);\r
+ }\r
+ }\r
+\r
+ menuItem = new JMenuItem("Hide Sequences");\r
+ menuItem.addActionListener(new java.awt.event.ActionListener()\r
+ {\r
+ public void actionPerformed(ActionEvent e)\r
+ {\r
+ hideSequences(false);\r
+ }\r
+ });\r
+ sequenceMenu.add(menuItem);\r
+\r
+ if(ap.av.getSelectionGroup() !=null && ap.av.getSelectionGroup().getSize()>1)\r
+ {\r
+ menuItem = new JMenuItem("Represent Group with " + seq.getName());\r
+ menuItem.addActionListener(new java.awt.event.ActionListener()\r
+ {\r
+ public void actionPerformed(ActionEvent e)\r
+ {\r
+ hideSequences(true);\r
+ }\r
});\r
- sequenceMenu.add(pdbMenuItem);\r
+ sequenceMenu.add(menuItem);\r
}\r
\r
+\r
}\r
\r
+\r
+\r
SequenceGroup sg = ap.av.getSelectionGroup();\r
\r
if (sg != null)\r
}\r
}\r
\r
+\r
/**\r
* DOCUMENT ME!\r
*\r
ex.printStackTrace();\r
}\r
}\r
+\r
+ void hideSequences(boolean representGroup)\r
+ {\r
+ SequenceGroup sg = ap.av.getSelectionGroup();\r
+ if(sg==null || sg.getSize()<1)\r
+ {\r
+ ap.av.hideSequence(sequence);\r
+ return;\r
+ }\r
+\r
+ int index = 0;\r
+ while(index < sg.sequences.size())\r
+ {\r
+ if(representGroup && sg.getSequenceAt(index)!=sequence)\r
+ {\r
+ sequence.addHiddenSequence(sg.getSequenceAt(index));\r
+ ap.av.hideSequence(sg.getSequenceAt(index));\r
+ }\r
+ else if(!representGroup)\r
+ {\r
+ ap.av.hideSequence(sg.getSequenceAt(index));\r
+ }\r
+ index ++;\r
+ }\r
+\r
+ ap.av.setSelectionGroup(null);\r
+ refresh();\r
+ }\r
+\r
}\r