コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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();
        }