private void dgv_ET_Peak_List_CellClick(object sender, System.Windows.Forms.MouseEventArgs e) { int clickedRow = dgv_ET_Peak_List.HitTest(e.X, e.Y).RowIndex; int clickedCol = dgv_ET_Peak_List.HitTest(e.X, e.Y).ColumnIndex; if (clickedRow < Sweet.lollipop.et_relations.Count && clickedRow >= 0 && clickedCol >= 0 && clickedCol < dgv_ET_Peak_List.ColumnCount) { if (e.Button == System.Windows.Forms.MouseButtons.Left) { ct_ET_peakList.ChartAreas[0].AxisX.StripLines.Clear(); DeltaMassPeak selected_peak = (dgv_ET_Peak_List.Rows[clickedRow].DataBoundItem as DisplayObject).display_object as DeltaMassPeak; DisplayUtility.GraphSelectedDeltaMassPeak(ct_ET_peakList, selected_peak, Sweet.lollipop.et_relations); } else { if (e.Button == System.Windows.Forms.MouseButtons.Right && clickedRow >= 0 && clickedRow < Sweet.lollipop.et_relations.Count) { System.Windows.Forms.ContextMenuStrip ET_peak_List_Menu = new System.Windows.Forms.ContextMenuStrip(); int position_xy_mouse_row = dgv_ET_Peak_List.HitTest(e.X, e.Y).RowIndex; DisplayDeltaMassPeak selected_peak = dgv_ET_Peak_List.Rows[clickedRow].DataBoundItem as DisplayDeltaMassPeak; if (position_xy_mouse_row > 0) { ET_peak_List_Menu.Items.Add("Increase Experimental Mass " + Lollipop.MONOISOTOPIC_UNIT_MASS + " Da").Name = "IncreaseMass"; ET_peak_List_Menu.Items.Add("Decrease Experimental Mass " + Lollipop.MONOISOTOPIC_UNIT_MASS + " Da").Name = "DecreaseMass"; } ET_peak_List_Menu.Show(dgv_ET_Peak_List, new System.Drawing.Point(e.X, e.Y)); //event menu click ET_peak_List_Menu.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler((s, ev) => ET_peak_List_Menu_ItemClicked(s, ev, selected_peak)); } } } }
private void tb_peakTableFilter_TextChanged(object sender, TextChangedEventArgs e) { IEnumerable<object> selected_peaks = tb_peakTableFilter.Text == "" ? Sweet.lollipop.ee_peaks : ExtensionMethods.filter(Sweet.lollipop.ee_peaks, tb_peakTableFilter.Text); DisplayUtility.FillDataGridView(dgv_EE_Peaks, selected_peaks.OfType<DeltaMassPeak>().Select(p => new DisplayDeltaMassPeak(p))); DisplayDeltaMassPeak.FormatPeakListGridView(dgv_EE_Peaks, true); }
public List <DataTable> SetTables() { DataTables = new List <DataTable> { DisplayProteoformRelation.FormatRelationsGridView(Sweet.lollipop.et_relations.OfType <ProteoformRelation>().Select(p => new DisplayProteoformRelation(p)).ToList(), "ETRelations", true, false, (bool)cbdiscoveryhistogram), DisplayDeltaMassPeak.FormatPeakListGridView(Sweet.lollipop.et_peaks.Select(p => new DisplayDeltaMassPeak(p)).ToList(), "ETPeaks", false) }; return(DataTables); }
public List<DataTable> SetTables() { DataTables = new List<DataTable> { DisplayProteoformRelation.FormatRelationsGridView(Sweet.lollipop.ee_relations.OfType<ProteoformRelation>().Select(r => new DisplayProteoformRelation(r)).ToList(), "EERelations", false, true, false), DisplayDeltaMassPeak.FormatPeakListGridView(Sweet.lollipop.ee_peaks.Select(p => new DisplayDeltaMassPeak(p)).ToList(), "EEPeaks", true) }; return DataTables; }
public void FillTablesAndCharts() { dgv_EE_Peaks.CurrentCellDirtyStateChanged -= EE_Peak_List_DirtyStateChanged;//remove event handler on form load and table refresh event DisplayUtility.FillDataGridView(dgv_EE_Peaks, Sweet.lollipop.ee_peaks.OrderByDescending(p => p.peak_relation_group_count).Select(p => new DisplayDeltaMassPeak(p))); DisplayUtility.FillDataGridView(dgv_EE_Relations, Sweet.lollipop.ee_relations.Select(r => new DisplayProteoformRelation(r))); DisplayProteoformRelation.FormatRelationsGridView(dgv_EE_Relations, false, true, false); DisplayDeltaMassPeak.FormatPeakListGridView(dgv_EE_Peaks, true); CK_View = false; GraphEERelations(); GraphEEPeaks(); ct_EE_Histogram.ChartAreas[0].AxisY.StripLines.Clear(); if (is_cb_Graph_lowerThreshold.HasValue && (bool)is_cb_Graph_lowerThreshold) ct_EE_Histogram.ChartAreas[0].AxisY.StripLines.Add(new StripLine() { BorderColor = Color.Red, IntervalOffset = Convert.ToDouble(nUD_PeakCountMinThreshold.Value) }); update_figures_of_merit(); dgv_EE_Peaks.CurrentCellDirtyStateChanged += EE_Peak_List_DirtyStateChanged;//re-instate event handler after form load and table refresh event }
public void FillTablesAndCharts() { dgv_ET_Peak_List.CurrentCellDirtyStateChanged -= ET_Peak_List_DirtyStateChanged;//remove event handler on form load and table refresh event DisplayUtility.FillDataGridView(dgv_ET_Peak_List, Sweet.lollipop.et_peaks.OrderByDescending(p => p.peak_relation_group_count).Select(p => new DisplayDeltaMassPeak(p)).ToList()); DisplayDeltaMassPeak.FormatPeakListGridView(dgv_ET_Peak_List, false); DisplayUtility.FillDataGridView(dgv_ET_Relations, Sweet.lollipop.et_relations.Select(r => new DisplayProteoformRelation(r)).ToList()); DisplayProteoformRelation.FormatRelationsGridView(dgv_ET_Relations, true, false, false); GraphETRelations(); GraphETPeaks(); ct_ET_Histogram.ChartAreas[0].AxisY.StripLines.Clear(); if ((bool)cbgraphlowerthreshold) { ct_ET_Histogram.ChartAreas[0].AxisY.StripLines.Add(new System.Windows.Forms.DataVisualization.Charting.StripLine() { BorderColor = System.Drawing.Color.Red, IntervalOffset = Convert.ToDouble(nUD_PeakCountMinThreshold.Value) }); } update_figures_of_merit(); CBDISCOVERYHISTOGRAM = false; CBVIEWDECOYHISTOGRAM = false; dgv_ET_Peak_List.CurrentCellDirtyStateChanged += ET_Peak_List_DirtyStateChanged;//re-instate event handler after form load and table refresh event }
//will leave option to change one at a time by right clicking private void ET_peak_List_Menu_ItemClicked(object sender, System.Windows.Forms.ToolStripItemClickedEventArgs e, DisplayDeltaMassPeak peak) { int int_mass_shifter = 0; try { int_mass_shifter = Convert.ToInt32(peak.MassShifter); } catch { MessageBox.Show("Oops, this mass shifter " + peak.MassShifter + " is not an integer."); return; } switch (e.ClickedItem.Name.ToString()) { case "IncreaseMass": peak.MassShifter = (int_mass_shifter + 1).ToString(); break; case "DecreaseMass": peak.MassShifter = (int_mass_shifter - 1).ToString(); break; } dgv_ET_Peak_List.Refresh(); }