Exemplo n.º 1
0
Arquivo: Form1.cs Projeto: FtMan/ES
 void reset_graphic_editor()
 {
     node_views.Clear();
     width             = 0;
     current_edge_view = null;
     current_node_view = null;
 }
Exemplo n.º 2
0
Arquivo: Form1.cs Projeto: FtMan/ES
 void editor_edge_delete_button_click(object sender, EventArgs e)
 {
     current_edge_view.remove_self();
     current_edge_view.destination_node.parent_edge = null;
     current_edge_view = null;
     editor_workspace.Refresh();
     change_edit_pannels();
 }
Exemplo n.º 3
0
Arquivo: Form1.cs Projeto: FtMan/ES
        void reset_exper_system()
        {
            current_node_view = null;
            current_edge_view = null;


            questions.Clear();
            facts.Clear();
            nodes.Clear();
        }
Exemplo n.º 4
0
Arquivo: Form1.cs Projeto: FtMan/ES
        void pictureBox_mouseDown(object sender, MouseEventArgs e)
        {
            if (isCreationNode)
            {
                return;
            }

            Point downPoint = e.Location;

            if (current_node_view != null)
            {
                if (current_node_view.isClickedOnEllipse(downPoint))
                {
                    isCreationEdge = true;
                    isMovingEdge   = true; // добавил Радмир
                    start_cur_edge = new Point(e.Location.X, e.Location.Y);
                    return;
                }

                if (current_node_view.isClickedOnRectangle(downPoint))
                {
                    isMovingNode = true;
                    return;
                }
            }

            foreach (Node_view nv in node_views)
            {
                if (nv.isClickedOnRectangle(downPoint))
                {
                    down_node_veiw = nv;
                    return;
                }
            }
            foreach (Node_view nv in node_views)
            {
                foreach (Edge_view ev in nv.edge_views)
                {
                    if (ev.isClickedOnEdge(downPoint))
                    {
                        down_edge_view = ev;
                        return;
                    }
                }
            }


            current_node_view = null;
            current_edge_view = null;
            change_edit_pannels();
            editor_workspace.Refresh();
        }
Exemplo n.º 5
0
Arquivo: Form1.cs Projeto: FtMan/ES
        void create_edge_views_list()
        {
            foreach (Node_view nv in node_views)
            {
                foreach (Edge e in nv.node.edges_collection.edges)
                {
                    int       dest_node_id = e.node_id;
                    Node_view dest_nv      = node_views.Find(x => x.node.id == dest_node_id);


                    Edge_view ev = new Edge_view(nv, dest_nv, e, facts);
                    nv.edge_views.Add(ev);
                    dest_nv.parent_edge = ev;
                    dest_nv.parent_node = nv;

                    edge_views.Add(ev);
                }
            }
        }
Exemplo n.º 6
0
Arquivo: Form1.cs Projeto: FtMan/ES
        void pictureBox_mouseUp(object sender, MouseEventArgs e)
        {
            Point upPoint = e.Location;

            isMovingNode = false;
            isMovingEdge = false; //Добавил Радмир
            if (isCreationNode)
            {
                Node_view nv = new Node_view(upPoint);
                node_views.Add(nv);
                current_node_view = nv;
                current_edge_view = null;

                node_view_selected();
                change_edit_pannels();
                editor_workspace.Refresh();

                isCreationNode = false;
            }
            else
            {
                if (isCreationEdge)
                {
                    foreach (Node_view nv in node_views)
                    {
                        if (nv.isClickedOnRectangle(upPoint) && nv != current_node_view && nv.parent_edge == null)
                        {
                            Edge_view ev = new Edge_view(current_node_view, nv);
                            current_node_view.edge_views.Add(ev);
                            nv.parent_edge = ev;
                            nv.parent_node = current_node_view;
                            isCreationEdge = false;

                            current_node_view = null;
                            current_edge_view = ev;

                            edge_view_selected();
                            change_edit_pannels();
                            editor_workspace.Refresh();

                            return;
                        }
                    }
                    isCreationEdge = false;
                }
                foreach (Node_view nv in node_views)
                {
                    if (nv.isClickedOnRectangle(upPoint))
                    {
                        if (nv == down_node_veiw)
                        {
                            current_node_view = nv;
                            current_edge_view = null;
                            editor_workspace.Refresh();
                            node_view_selected();//<-here
                            change_edit_pannels();
                            return;
                        }
                    }
                }
                foreach (Node_view nv in node_views)
                {
                    foreach (Edge_view ev in nv.edge_views)
                    {
                        if (ev.isClickedOnEdge(upPoint))
                        {
                            if (ev == down_edge_view)
                            {
                                current_node_view = null;
                                current_edge_view = ev;
                                editor_workspace.Refresh();
                                edge_view_selected();
                                change_edit_pannels();
                                return;
                            }
                        }
                    }
                }


                current_node_view = null;
                current_edge_view = null;
                change_edit_pannels();
                editor_workspace.Refresh();
            }
        }