public NodeConnectionControl CreateNewNodeConnectionControl() 
 {
     Experiment experimentOwner = m_applicationContext.Application.Experiment;
     NodeConnectionControl connectionControl = new NodeConnectionControl(experimentOwner);
     connectionControl.ConnectionCompleted += HandleConnectionCompleted;
     return connectionControl; 
 }
Example #2
0
        private IConnectionFigure CreateConnection()
        {
            NodeConnectionControl connection = m_applicationContext.NodeConnectionControlFactory.CreateNewNodeConnectionControl();

            connection.IsEditable = true;
            return(connection);
        }
 public NodeConnectionControl CreateNewNodeConnectionControl(BasicNodeControl sourceComponent, BasicNodeControl targetComponent) 
 {
     Experiment experimentOwner = m_applicationContext.Application.Experiment;
     NodeConnectionControl connectionControl = new NodeConnectionControl(experimentOwner, sourceComponent, targetComponent);
     connectionControl.ConnectionCompleted += HandleConnectionCompleted;
     return connectionControl; 
 }
        public NodeConnectionControl CreateNewNodeConnectionControl()
        {
            Experiment            experimentOwner   = m_applicationContext.Application.Experiment;
            NodeConnectionControl connectionControl = new NodeConnectionControl(experimentOwner);

            connectionControl.ConnectionCompleted += HandleConnectionCompleted;
            return(connectionControl);
        }
        public NodeConnectionControl CreateNewNodeConnectionControl(BasicNodeControl sourceComponent, BasicNodeControl targetComponent)
        {
            Experiment            experimentOwner   = m_applicationContext.Application.Experiment;
            NodeConnectionControl connectionControl = new NodeConnectionControl(experimentOwner, sourceComponent, targetComponent);

            connectionControl.ConnectionCompleted += HandleConnectionCompleted;
            return(connectionControl);
        }
        /// <summary>
        /// Handles the connection completed event.
        /// When node connection control is connected to the end and completed,
        /// this method stores the mapping from Experiment Node Connection (model)
        /// to Node Connection Control (view).
        /// </summary>
        /// <param name='sender'>
        /// Sender.
        /// </param>
        /// <param name='e'>
        /// E.
        /// </param>
        private void HandleConnectionCompleted(object sender, ConnectionCompletedEventArgs e)
        {
            NodeConnectionControl connectionControl = sender as NodeConnectionControl;

            m_mapEdgesToControls.Add(e.ExperimentNodeConnection, connectionControl);

            //listener now can be removed
            connectionControl.ConnectionCompleted -= HandleConnectionCompleted;
        }
Example #7
0
        private void DrawEdge(ExperimentNodeConnection edge)
        {
            ExperimentNode source = edge.Source;
            ExperimentNode target = edge.Target;

            BasicNodeControl sourceControl, targetControl;

            if (m_applicationContext.NodeControlFactory.TryGetNodeControl(source, out sourceControl) &&
                m_applicationContext.NodeControlFactory.TryGetNodeControl(target, out targetControl))
            {
                NodeConnectionControl connection = m_applicationContext.NodeConnectionControlFactory.CreateNewNodeConnectionControl(sourceControl, targetControl);
                connection.ConnectStart(sourceControl.ConnectorAt(source.Data.X, source.Data.Y));
                connection.ConnectEnd(targetControl.ConnectorAt(target.Data.X, target.Data.Y));
                connection.UpdateConnection();

                m_experimentCanvasWidget.ExperimentCanvas.View.Drawing.Add(connection);
                m_experimentCanvasWidget.ExperimentCanvas.View.ClearSelection();
                m_experimentCanvasWidget.ExperimentCanvas.View.AddToSelection(connection);
            }
        }
Example #8
0
        public void DrawEdge(ExperimentNodeConnection edge, bool editable)
        {
            ExperimentNode source = edge.Source;
            ExperimentNode target = edge.Target;

            BasicNodeControl sourceControl, targetControl;

            if (m_nodeControlFactory.TryGetNodeControl(source, out sourceControl) &&
                m_nodeControlFactory.TryGetNodeControl(target, out targetControl))
            {
                NodeConnectionControl connection = m_nodeConnectionControlFactory.CreateNewNodeConnectionControl(sourceControl, targetControl);
                connection.ConnectStart(sourceControl.ConnectorAt(source.Data.X, source.Data.Y));
                connection.ConnectEnd(targetControl.ConnectorAt(target.Data.X, target.Data.Y));
                connection.UpdateConnection();

                // HERZUM SPRINT 2.4 TLAB-157
                if (connection.ExperimentNodeConnection != null && connection.ExperimentNodeConnection.Source != null && connection.ExperimentNodeConnection.Target != null)
                {
                    // END HERZUM SPRINT 2.4 TLAB-157
                    // HERZUM SPRINT 2.3: TLAB-160
                    if ((connection.ExperimentNodeConnection.Source is ExperimentDecisionNode && connection.ExperimentNodeConnection.Target is ScopeNode) ||
                        (connection.ExperimentNodeConnection.Target is ExitDecisionNode))
                    {
                        connection.IsEditable = false;
                    }
                    else
                    {
                        // END HERZUM SPRINT 2.3: TLAB-160
                        connection.IsEditable = editable;
                    }
                }

                m_experimentCanvasWidget.ExperimentCanvas.View.Drawing.Add(connection);
                m_experimentCanvasWidget.ExperimentCanvas.View.ClearSelection();
            }
        }
Example #9
0
 public RemoveConnectionHandle(NodeConnectionControl owner, ILocator locator): base (owner, locator, s_trashIcon) 
 {
     m_ownerConnection = owner;
 }
Example #10
0
 public RemoveConnectionHandle(NodeConnectionControl owner, ILocator locator) : base(owner, locator, s_trashIcon)
 {
     m_ownerConnection = owner;
 }
 public bool TryGetConnectionControl(ExperimentNodeConnection nodeConnection, out NodeConnectionControl connectionControl)
 {
     return m_mapEdgesToControls.TryGetValue(nodeConnection, out connectionControl);
 }
 public bool TryGetConnectionControl(ExperimentNodeConnection nodeConnection, out NodeConnectionControl connectionControl)
 {
     return(m_mapEdgesToControls.TryGetValue(nodeConnection, out connectionControl));
 }