public void DrawGraph(KmeansConfig config, Cluster[] clusters) { for (int k = 0; k < config.K; k++) { EnergyGraph e = (EnergyGraph)tableLayoutPanel1.Controls[k]; e.cluster = clusters[k]; /* * if (!checkBox_repaint.Checked) * continue; */ e.drawBitmap(); e.Invalidate(); } }
private void DrawStatistic(Statistic statistic, Cluster[] clusters) { Form f = new Form() { Size = new Size(1920, 480), StartPosition = FormStartPosition.CenterScreen, MinimizeBox = false, MaximizeBox = true, BackColor = Color.White }; TableLayoutPanel table = new TableLayoutPanel() { RowCount = 1, ColumnCount = 3, Dock = DockStyle.Fill }; table.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); table.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50)); table.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50)); table.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50)); EnergyGraph egF = new EnergyGraph { Cursor = Cursors.Default, cluster = statistic.id == "" ? statistic.tmp : clusters[statistic.maxF[0]], }; EnergyGraph egM = new EnergyGraph { Cursor = Cursors.Default, cluster = statistic.id == "" ? statistic.tmp : clusters[statistic.maxM[0]], }; EnergyGraph egD = new EnergyGraph { Cursor = Cursors.Default, cluster = statistic.id == "" ? statistic.tmp : clusters[statistic.maxD[0]], }; table.Controls.Add(egF); table.Controls.Add(egM); table.Controls.Add(egD); f.Controls.Add(table); egF.drawBitmap(); egM.drawBitmap(); egD.drawBitmap(); f.Show(); }
public void ReadyTables(KmeansConfig config, DataV2[] datas) { EnergyGraph.setHigh(datas); tableLayoutPanel1.SuspendLayout(); tableLayoutPanel1.RowCount = tableLayoutPanel1.ColumnCount = (int)config.grid + (config.grid == (int)config.grid ? 0 : 1); for (int i = tableLayoutPanel1.RowStyles.Count; i < tableLayoutPanel1.RowCount; i++) { tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); } while (tableLayoutPanel1.Controls.Count != tableLayoutPanel1.RowCount * tableLayoutPanel1.ColumnCount) { tableLayoutPanel1.Controls.Add(new EnergyGraph()); } for (int c = 0; c < tableLayoutPanel1.Controls.Count; c++) { aProp.SetValue(tableLayoutPanel1.Controls[c], true, null); } tableLayoutPanel1.ResumeLayout(); EnergyGraph.totalDataLength = datas.Length; }