JMenuItem annotateResidue = new JMenuItem();\r
\r
SequenceI sequence;\r
+ JMenuItem unGroupMenuItem = new JMenuItem();\r
\r
public PopupMenu(AlignmentPanel ap, SequenceI seq)\r
{\r
\r
if (sg.cs instanceof ConservationColourScheme)\r
conservationMenuItem.setSelected(true);\r
-\r
}\r
\r
+\r
if(seq!=null)\r
{\r
residueMenu.setVisible(false);\r
residueMenu.setText("Residue");\r
annotateResidue.setText("annotate residue???");\r
PIDColour.setFocusPainted(false);\r
+ unGroupMenuItem.setText("Remove Group");\r
+ unGroupMenuItem.addActionListener(new java.awt.event.ActionListener()\r
+ {\r
+ public void actionPerformed(ActionEvent e)\r
+ {\r
+ unGroupMenuItem_actionPerformed(e);\r
+ }\r
+ });\r
add(groupMenu);\r
this.add(sequenceMenu);\r
this.add(residueMenu);\r
groupMenu.add(defineMenu);\r
+ groupMenu.add(unGroupMenuItem);\r
groupMenu.addSeparator();\r
groupMenu.add(copyGroup);\r
groupMenu.add(moveGroup);\r
\r
protected void clustalColour_actionPerformed(ActionEvent e)\r
{\r
- getGroup().cs = new ClustalxColourScheme();\r
+ SequenceGroup sg = getGroup();\r
+ sg.cs = new ClustalxColourScheme(sg.sequences, ap.av.alignment.getWidth());\r
refresh();\r
}\r
\r
}\r
\r
\r
-/*\r
-public void conservationColourIncMenuItem_actionPerformed(ActionEvent e)\r
-{\r
-ConservationIncrementPanel cip = new ConservationIncrementPanel(viewport, alignPanel);\r
-JInternalFrame frame = new JInternalFrame();\r
-frame.setContentPane(cip);\r
-Desktop.addInternalFrame(frame, "Conservation Colour Increment", 400,90);\r
-frame.setMaximizable(false);\r
-\r
- }*/\r
-\r
-\r
protected void abovePIDColour_actionPerformed(ActionEvent e)\r
{\r
- SliderPanel sp = new SliderPanel(ap, 70, false, getGroup().cs );\r
- JInternalFrame frame = new JInternalFrame();\r
- frame.setContentPane(sp);\r
- Desktop.addInternalFrame(frame, "Percentage Identity Threshold ("+getGroup().getName()+")" , 400,90);\r
- frame.setMaximizable(false);\r
-\r
+ Desktop.setPIDSliderSource(ap, getGroup().cs, getGroup().getName());\r
}\r
\r
\r
{\r
SequenceGroup sg = getGroup();\r
\r
- Conservation c = new Conservation("Group",\r
- ResidueProperties.propHash, 3, sg.sequences, sg.getStartRes(),\r
- sg.getEndRes() );\r
+ if(conservationMenuItem.isSelected())\r
+ {\r
+\r
+ Conservation c = new Conservation("Group",\r
+ ResidueProperties.propHash, 3,\r
+ sg.sequences, 0,\r
+ ap.av.alignment.getWidth());\r
\r
- c.calculate();\r
- c.verdict(false, 100);\r
- ConservationColourScheme ccs = new ConservationColourScheme(c, sg.cs);\r
+ c.calculate();\r
+ c.verdict(false, 100);\r
+ ConservationColourScheme ccs = new ConservationColourScheme(c, sg.cs);\r
\r
- sg.cs = ccs;\r
+\r
+ sg.cs = ccs;\r
+\r
+ Desktop.setConservationSliderSource(ap, ccs, sg.getName());\r
+ }\r
+ else // remove ConservationColouring\r
+ {\r
+ ConservationColourScheme ccs = (ConservationColourScheme)sg.cs;\r
+ sg.cs = ccs.cs;\r
+ }\r
\r
refresh();\r
}\r
\r
ap.av.alignment.deleteGroup(sg);\r
ap.av.resetSeqLimits(ap.seqPanel.seqCanvas.getHeight());\r
- ap.seqPanel.parent.RefreshPanels();\r
+ ap.RefreshPanels();\r
\r
}\r
\r
}\r
\r
}\r
+\r
+ void unGroupMenuItem_actionPerformed(ActionEvent e)\r
+ {\r
+ SequenceGroup sg = ap.av.getRubberbandGroup();\r
+ ap.av.alignment.deleteGroup(sg);\r
+ ap.av.setRubberbandGroup(null);\r
+ ap.RefreshPanels();\r
+ }\r
}\r