{\r
\r
public SeqCanvas seqCanvas;\r
- public AlignmentPanel parent;\r
+ public AlignmentPanel ap;\r
\r
protected int startres;\r
protected int lastres;\r
setLayout(new BorderLayout());\r
add(seqCanvas, BorderLayout.CENTER);\r
\r
- parent = p;\r
+ ap = p;\r
\r
addMouseMotionListener( new MouseMotionAdapter()\r
{\r
\r
seqEditOccurred = -1;\r
\r
- parent.RefreshPanels();\r
+ ap.RefreshPanels();\r
repaint();\r
\r
}\r
\r
public void doMousePressed(MouseEvent evt) {\r
- parent.alignFrame.addHistoryItem("sequence edit");\r
+ ap.alignFrame.addHistoryItem("sequence edit");\r
int seq;\r
int res;\r
\r
if(aa!="")\r
text.append(" Residue: "+aa+" ("+ av.getAlignment().getSequenceAt(seq).findPosition(res)+")");\r
\r
- parent.alignFrame.statusBar.setText(text.toString());\r
+ ap.alignFrame.statusBar.setText(text.toString());\r
\r
}\r
\r
sg.addSequence( (Sequence)av.getAlignment().getSequenceAt(seq) );\r
av.setRubberbandGroup( sg );\r
stretchGroup = sg;\r
+\r
+ if(av.getConservationSelected())\r
+ Desktop.setConservationSliderSource(ap, av.getGlobalColourScheme(), "Background");\r
+ else if(av.getGlobalColourScheme()!=null && av.getGlobalColourScheme().canThreshold())\r
+ {\r
+ ResidueColourScheme rcs = (ResidueColourScheme) av.getGlobalColourScheme();\r
+ int threshold = rcs.getThreshold();\r
+ if (threshold > 0)\r
+ Desktop.setPIDSliderSource(ap, av.getGlobalColourScheme(), "Background");\r
+ }\r
+\r
}\r
else if( javax.swing.SwingUtilities.isRightMouseButton(evt))\r
{\r
- jalview.gui.PopupMenu pop = new jalview.gui.PopupMenu( parent , null);\r
+ jalview.gui.PopupMenu pop = new jalview.gui.PopupMenu( ap , null);\r
pop.show(this, evt.getX(), evt.getY());\r
\r
// edit the properties of existing group\r
\r
public void doMouseReleasedDefineMode(MouseEvent evt)\r
{\r
+\r
+ if(stretchGroup.cs instanceof ClustalxColourScheme)\r
+ {\r
+ stretchGroup.cs = new ClustalxColourScheme(stretchGroup.sequences, av.alignment.getWidth());\r
+ seqCanvas.paintFlag = true;\r
+ repaint();\r
+ }\r
+\r
+ else if(stretchGroup.cs instanceof ConservationColourScheme)\r
+ {\r
+ ConservationColourScheme ccs = (ConservationColourScheme)stretchGroup.cs;\r
+\r
+ Conservation c = new Conservation("Group",\r
+ ResidueProperties.propHash, 3, stretchGroup.sequences, 0,\r
+ av.alignment.getWidth() );\r
+\r
+ c.calculate();\r
+ c.verdict(false, 100);\r
+ ccs = new ConservationColourScheme(c, ccs.cs);\r
+\r
+ stretchGroup.cs = ccs;\r
+\r
+\r
+ Desktop.setConservationSliderSource(ap, stretchGroup.cs, stretchGroup.getName()) ;\r
+\r
+ seqCanvas.paintFlag = true;\r
+ repaint();\r
+ }\r
+ else\r
+ {\r
+ if(stretchGroup.cs !=null && stretchGroup.cs.canThreshold())\r
+ {\r
+ ResidueColourScheme rcs = (ResidueColourScheme) stretchGroup.cs;\r
+ int threshold = rcs.getThreshold();\r
+ if(threshold>0)\r
+ Desktop.setPIDSliderSource(ap, stretchGroup.cs, stretchGroup.getName());\r
+ }\r
+\r
+ }\r
+\r
+\r
changeEndRes = false;\r
changeStartRes = false;\r
stretchGroup = null;\r
changeEndRes = true;\r
\r
else if(stretchGroup.getStartRes()==res)\r
- // Edit end res position of selected group\r
+ // Edit start res position of selected group\r
changeStartRes = true;\r
\r
\r