/// <summary>
 /// When we select the edit option, this makes the current edit window into a new one
 /// </summary>
 /// <param name="node"></param>
 public void editNode(Node node)
 {
     //1. Destroy the previous one.
     this.editWindow.Hide();
     this.editWindow = null;
     //2. Create a new one with this node.
     this.editWindow = new EditWindow(node.data.name, node);
     this.editWindow.Show();
 }
Exemple #2
0
 /// <summary>
 /// create a connection between this node and the one passed in
 /// </summary>
 /// <param name="nodeNumber">the ID of the node</param>
 /// <param name="node">the node to make a connection with</param>
 public void createConnection(int nodeNumber, Node node)
 {
     if (!data.connectionTargets.Contains(nodeNumber))
     {
         drawingConfiguration.createConnection(node, data.topleft);
         data.connectionTargets.Add(nodeNumber);
     }
 }
        public void createButton_Click(object sender, ContactEventArgs e)
        {
            //if (this.appState != APPSTATE_DEFAULT) return;

            /*
                        Int32 id = this.nodes.Keys.Count;
                        Node n = new Node(MainGrid, new System.Windows.Point(600, 600),
                                this, id);
                        this.nodes.Add(id, n);
            */
            Node created = new Node(mainGrid, new Point(300, 300), this, nodes.Count);
            nodes.Add(created);
            /*            Node n = Node.ForWPFContext(this, MainGrid);
            this.nodes.Add(n.data.id, n);*/
        }
Exemple #4
0
            public void createConnection(Node node, Point center)
            {
                Line connection = new Line();
                connection.Stroke = Brushes.SpringGreen;
                connection.StrokeThickness = 30;
                connection.VerticalAlignment = VerticalAlignment.Top;
                connection.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
                connection.Y1 = ellipse.Height/2 + center.Y;
                connection.Y2 = node.drawingConfiguration.ellipse.Height/2 + node.data.topleft.Y;
                connection.X1 = ellipse.Width/2 + center.X;
                connection.X2 = node.drawingConfiguration.ellipse.Width/ 2 + node.data.topleft.X;

                   /* connection.Y1 = center.Y + 600 + ellipse.Height;
                    connection.Y2 = node.data.center.Y + 600 + node.drawingConfiguration.ellipse.Height/2;

                        connection.X1 = center.X + 800 + ellipse.Width/2;
                        connection.X2 = node.data.center.X + 800 + node.drawingConfiguration.ellipse.Width/2;
                */
                mainGrid.Children.Add(connection);
                //MultitouchScreen.AddContactMovedHandler(connection, connection_Drag);
                connectionLines.Add(connection);
            }