Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            visHierar win = new visHierar(hNode, name, measure);

            win.ShowCloseButton();
            win.ShowDialog();
            sel.start = Convert.ToInt32(numericUpDown1.Value);
            sel.stop  = Convert.ToInt32(numericUpDown2.Value);
            sel.range = radioButton1.Checked;
            if (win.listNodes != null)
            {
                if (sel.clusters != null)
                {
                    sel.clusters.Clear();
                }
                else
                {
                    sel.clusters = new List <List <string> >();
                }
                label4.Text = win.listNodes.Count.ToString();
                foreach (var item in win.listNodes)
                {
                    List <string> cl = new List <string>(item.Key.setStruct);
                    sel.clusters.Add(cl);
                }
            }
            else
            {
                label4.Text = "0";
            }
        }
Exemplo n.º 2
0
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == 3 && e.RowIndex >= 0)
     {
         string        str    = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
         ClusterOutput output = dicOuput[str];
         if (output.hNode != null)
         {
             visHierar select = new visHierar(output.hNode, "Select clusters", output.measure, null);
             select.ShowCloseButton();
             DialogResult res = select.ShowDialog();
             if (res == DialogResult.OK)
             {
                 ((List <List <string> >)(dataGridView1.Rows[e.RowIndex].Cells[5].Value)).Clear();
                 foreach (var item in select.listNodes)
                 {
                     ((List <List <string> >)(dataGridView1.Rows[e.RowIndex].Cells[5].Value)).Add(item.Key.setStruct);
                 }
                 dataGridView1.Rows[e.RowIndex].Cells[3].Value    = select.listNodes.Count;
                 dataGridView1.Rows[e.RowIndex].Cells[4].ReadOnly = false;
             }
         }
     }
     if (e.ColumnIndex == 4 && e.RowIndex >= 0)
     {
         if (!dataGridView1.Rows[e.RowIndex].Cells[4].ReadOnly || !dataGridView1.Columns["Column5"].Visible)
         {
             dataGridView1.Rows[e.RowIndex].Cells[4].Value = !(bool)dataGridView1.Rows[e.RowIndex].Cells[4].Value;
         }
     }
 }
Exemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {

            if (clOut.hNode != null)
            {
                visHierar formSelect = new visHierar(clOut.hNode, "Select clusters",clOut.measure);
                formSelect.ShowCloseButton();
                DialogResult res = formSelect.ShowDialog();

                if (res == DialogResult.OK)
                {
                    if (formSelect.listNodes != null)
                    {
                        if (selected == null)
                            selected = new List<List<string>>();
                        selected.Clear();
                        foreach (var item in formSelect.listNodes)
                        //for (int i = 0; i < formSelect.listNodes.Count; i++)
                            selected.Add(item.Key.setStruct);

                        if(textBox1.Text!=null && textBox1.Text.Length>0)
                            button3.Enabled = true;

                        label4.Text = "Number of selected clusters: " + formSelect.listNodes.Count;
                    }
                }

            }
        }
Exemplo n.º 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (output.hNode != null)
            {
                visHierar formSelect = new visHierar(output.hNode, "Select clusters", output.measure, null);
                formSelect.ShowCloseButton();
                DialogResult res = formSelect.ShowDialog();

                if (res == DialogResult.OK)
                {
                    if (formSelect.listNodes != null)
                    {
                        if (selected == null)
                        {
                            selected = new List <List <string> >();
                        }
                        selected.Clear();
                        foreach (var item in formSelect.listNodes)
                        {
                            selected.Add(item.Key.setStruct);
                        }

                        button3.Enabled = true;
                    }
                }
            }
        }
Exemplo n.º 5
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (clOut.hNode != null)
            {
                visHierar formSelect = new visHierar(clOut.hNode, "Select clusters", clOut.measure, null);
                formSelect.ShowCloseButton();
                DialogResult res = formSelect.ShowDialog();

                if (res == DialogResult.OK)
                {
                    if (formSelect.listNodes != null)
                    {
                        if (selected == null)
                        {
                            selected = new List <List <string> >();
                        }
                        selected.Clear();
                        foreach (var item in formSelect.listNodes)
                        {
                            //for (int i = 0; i < formSelect.listNodes.Count; i++)
                            selected.Add(item.Key.setStruct);
                        }

                        if (textBox1.Text != null && textBox1.Text.Length > 0)
                        {
                            button3.Enabled = true;
                        }

                        label4.Text = "Number of selected clusters: " + formSelect.listNodes.Count;
                    }
                }
            }
        }
Exemplo n.º 6
0
        private void panel1_MouseClick(object sender, MouseEventArgs e)
        {
//            thr += 2;
//            CC = 0;
            if (e.Button == MouseButtons.Left)
            {
                HClusterNode remNode = currentNode;
                currentNode = CheckRegion(e.X, e.Y);
                if (currentNode != null)
                {
                    allRegions.Clear();
                    memoryClicks.Push(remNode);
                    this.Invalidate();
                    this.Refresh();
                }
                else
                {
                    currentNode = remNode;
                }

                string lab = CheckColorRegion(e.X, e.Y);
                if (lab != null)
                {
                    DialogResult res;
                    colorDialog1 = new ColorDialog();

                    res = colorDialog1.ShowDialog();
                    if (res == DialogResult.OK)
                    {
                        colorMap[labelColor[lab]][0] = colorDialog1.Color.R;
                        colorMap[labelColor[lab]][1] = colorDialog1.Color.G;
                        colorMap[labelColor[lab]][2] = colorDialog1.Color.B;

                        this.Invalidate();
                        this.Refresh();
                    }
                }
                toolStripButton2.Enabled = true;
            }
            else
            {
                HClusterNode remNode = CheckRegion(e.X, e.Y);

                if (remNode != null)
                {
                    visHierar dendrog = new visHierar(remNode, "", measureName, null);
                    dendrog.Show();
                }
            }
        }
Exemplo n.º 7
0
        public void SClusters(string item, string measureName, string option)
        {
            Dictionary <string, string> dic = ClusterOutput.ReadLabelsFile(output.GetLabelFile());

            if (output.clusters != null)
            {
                switch (option)
                {
                case "Order Visual":
                    if (active == null || !(active is VisOrder))
                    {
                        VisOrder visOrder;
                        visOrder           = new VisOrder(output.clusters, item, null);
                        visOrder.closeForm = Closing;
                        active             = visOrder;
                        visOrder.Show();
                    }
                    return;

                case "Text List":
                default:
                    if (active == null || !(active is ListVisual))
                    {
                        ListVisual visBaker;
                        visBaker           = new ListVisual(output.clusters, item, dic);
                        visBaker.closeForm = Closing;
                        active             = visBaker;
                        visBaker.Show();
                    }
                    return;
                }
            }
            if (output.hNode != null)
            {
                // win = new visHierar(output.hNode,item,measureName);
                if (option == null)
                {
                    return;
                }
                switch (option)
                {
                case "Dendrogram":
                default:
                    if (active == null || !(active is visHierar))
                    {
                        visHierar winH;
                        winH           = new visHierar(output.hNode, item, measureName, dic);
                        winH.closeForm = Closing;
                        active         = winH;
                        winH.Show();
                    }
                    return;

                case "Sunburst chart":
                    if (active == null || !(active is VisHierarCircle))
                    {
                        VisHierarCircle winC;
                        winC           = new VisHierarCircle(output.hNode, item, measureName);
                        winC.closeForm = Closing;
                        active         = winC;
                        winC.Show();
                    }
                    return;
                }
            }
            if (output.juryLike != null || output.hNNRes != null)
            {
                if (active == null || !(active is FormText))
                {
                    FormText showRes;
                    if (output.juryLike != null)
                    {
                        showRes = new FormText(output.juryLike, item);
                    }
                    else
                    {
                        showRes = new FormText(output.hNNRes, item);
                    }
                    showRes.closeForm = Closing;
                    active            = showRes;
                    showRes.Show();
                }
                return;
            }
            if (output.nodes != null)
            {
                HeatMap heatRes = new HeatMap(output.nodes[1], output.nodes[0], null, output.measure, output.name);
                active = heatRes;
                heatRes.Show();
            }
        }
Exemplo n.º 8
0
        public void SClusters(string item,string measureName,string option)
        {
            if (output.clusters != null)
            {
                switch(option)
                {
                    case "Order Visual":
                        if (active == null || !(active is VisOrder))
                        {
                            VisOrder visOrder;
                            visOrder = new VisOrder(output.clusters, item, null);
                            visOrder.closeForm = Closing;
                            active = visOrder;
                            visOrder.Show();
                        }
                        return;
                    case "Text List":
                        if (active == null || !(active is ListVisual))
                        {

                            ListVisual visBaker;
                            visBaker = new ListVisual(output.clusters, item);
                            visBaker.closeForm = Closing;
                            active = visBaker;
                            visBaker.Show();
                        }
                        return;
            }
             
            }
            if (output.hNode != null)
            {
               // win = new visHierar(output.hNode,item,measureName);
                if (option == null)
                    return;
                switch (option)
                {
                    case "Dendrogram":
                        if (active == null || !(active is visHierar))
                        {
                            visHierar winH;
                            winH = new visHierar(output.hNode, item, measureName);
                            winH.closeForm = Closing;
                            active = winH;
                            winH.Show();
                        }
                        return;                        
                    case "Circle Visual":
                        if (active == null || !(active is VisHierarCircle))
                        {

                            VisHierarCircle winC;
                            winC = new VisHierarCircle(output.hNode, item, measureName);
                            winC.closeForm = Closing;
                            active = winC;
                            winC.Show();
                        }
                        return;                        
                }


            }
            if (output.juryLike != null)
            {
                if (active == null || !(active is FormText))
                {

                    FormText showRes;
                    showRes = new FormText(output.juryLike, item);
                    showRes.closeForm = Closing;
                    active = showRes;
                    showRes.Show();
                }
                return;
            }

        }
Exemplo n.º 9
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (output.hNode!=null)
            {
                visHierar formSelect = new visHierar(output.hNode, "Select clusters", output.measure);
                formSelect.ShowCloseButton();
                DialogResult res=formSelect.ShowDialog();

                if (res == DialogResult.OK)
                {
                    if (formSelect.listNodes != null)
                    {
                        if (selected == null)
                            selected = new List<List<string>>();
                        selected.Clear();
                        foreach(var item in formSelect.listNodes)
                            selected.Add(item.Key.setStruct);

                        button3.Enabled = true;
                    }
                }
            }
        }
Exemplo n.º 10
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 3 && e.RowIndex >= 0)
            {
                string str=dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
                ClusterOutput output=dicOuput[str];
                if(output.hNode!=null)
                {
                    visHierar select = new visHierar(output.hNode, "Select clusters",output.measure);
                    select.ShowCloseButton();
                    DialogResult res=select.ShowDialog();
                    if (res == DialogResult.OK)
                    {
                        ((List<List<string>>)(dataGridView1.Rows[e.RowIndex].Cells[5].Value)).Clear();
                        foreach (var item in select.listNodes)                       
                            ((List<List<string>>)(dataGridView1.Rows[e.RowIndex].Cells[5].Value)).Add(item.Key.setStruct);
                        dataGridView1.Rows[e.RowIndex].Cells[3].Value = select.listNodes.Count;
                        dataGridView1.Rows[e.RowIndex].Cells[4].ReadOnly = false;
                    }

                }
            }
            if (e.ColumnIndex == 4 && e.RowIndex >= 0)
            {           
                if(!dataGridView1.Rows[e.RowIndex].Cells[4].ReadOnly || !dataGridView1.Columns["Column5"].Visible)
                    dataGridView1.Rows[e.RowIndex].Cells[4].Value = !(bool)dataGridView1.Rows[e.RowIndex].Cells[4].Value;
            }
        }