public void SetModel(SplamModel model) { panel1.Controls.Clear(); m_Model = model; m_Views.Clear(); float sz = (float)(panel1.Width) / (m_Model.numDim - 1.0f); int szi = (int)sz; for (int i = 0; i < m_Model.SplatList.Count; i++) { var view = new SplatterviewContainer(); int I = m_Model.Iindex[i]; int J = m_Model.Jindex[i] - 1; view.Name = "splom" + I + J; view.Size = new System.Drawing.Size(szi - 25, szi - 25); view.Location = new Point(I * szi + 25, J * szi); view.PointSelection += new EventHandler(view_PointSelection); m_Views.Add(view.View); view.View.DoubleClick += new EventHandler(view_DoubleClick); view.View.setSplatPM(m_Model.SplatList[i]); panel1.Controls.Add(view); } sliderController1.SetView(m_Views); foreach (var series in m_Model.Series) { ListViewItem item = new ListViewItem(series.Name); item.Name = series.Name; item.BackColor = series.Color; if (!listView1.Items.ContainsKey(item.Name)) { m_Series[item] = series; listView1.Items.Add(item); } } }
private void buttonSplam_Click(object sender, EventArgs e) { AddDialog dialog = new AddDialog(); dialog.Text = "Show splatterplot matrix"; if (listViewDataFiles.SelectedItems.Count > 0) { var item = listViewDataFiles.SelectedItems[0]; var dataFile = m_Files[item]; dialog.SetDataFile(dataFile); var res = dialog.ShowDialog(this); if (res == System.Windows.Forms.DialogResult.OK) { var schema = dialog.GetSchema(); var list = dataFile.ConvertToDataSeries(schema, -1); var model = new SplamModel(list); var splamDialog = new SplamDialog(); splamDialog.Text = string.Format("Splatterplot matrix({0}): {1}", SplamCount++, dataFile.Name); splamDialog.SetModel(model); splamDialog.Show(); splamDialog.BringToFront(); } } }