public BasicNodeControl CreateNodeControl(ExperimentNode node) 
        {
            BasicNodeControl control;

            if (node is ComponentNode) 
            {
                control = new ComponentControl(node, m_applicationContext);
            } 
            else if (node is ExperimentStartNode) 
            {
                control = new StartNodeControl(node, m_applicationContext);
            } 
            else if (node is ExperimentEndNode) 
            { 
                control = new EndNodeControl(node, m_applicationContext);
            }
            else if (node is ExperimentDecisionNode) 
            { 
                control = new DecisionNodeControl(node, m_applicationContext);
            }
            else if (node is CompositeComponentNode)
            {
                control = new CompositeComponentControl(node, m_applicationContext);
            }
            else 
            {
                control = new BasicNodeControl(node, m_applicationContext);
            }

            m_mapNodesToControls.Add(node, control);

            return control;
        }
        private Gtk.Widget CreateInfoWidget(BasicNodeControl basicComponentControl)
        {
            //case 1: Component Panel
            ComponentControl componentControl = basicComponentControl as ComponentControl;
            if(componentControl != null) 
            {
                ComponentInfoPanel panel = new ComponentInfoPanel();
                panel.Component = componentControl;
                return panel;
            } 
            else 
            {
                //case 2: decision panel
                DecisionNodeControl decisionControl = basicComponentControl as DecisionNodeControl;
                if(decisionControl != null) 
                {
                    DecisionInfoPanel panel = new DecisionInfoPanel(m_applicationContext);
                    panel.DecisionControl = decisionControl;
                    return panel;
                }
            }

            //invalid
            Gtk.Label errorLabel = new Gtk.Label("Not implemented. Panels not supported for the given component control.");
            return errorLabel;
        }
        private Gtk.Widget CreateInfoWidget(BasicNodeControl basicComponentControl)
        {
            //case 1: decision panel
            //must be check first, as it inherits from ComponentControl
            DecisionNodeControl decisionControl = basicComponentControl as DecisionNodeControl;
            if(decisionControl != null) 
            {
                DecisionInfoPanel panel = new DecisionInfoPanel(m_applicationContext);
                panel.DecisionControl = decisionControl;
                return panel;
            }
            else 
            {
                //case 2: Component Panel
                if(basicComponentControl is ComponentControl || basicComponentControl is CompositeComponentControl) 
                {
                    ComponentInfoPanel panel = new ComponentInfoPanel();
                    panel.Component = basicComponentControl;
                    return panel;
                }
            }

            //invalid
            Gtk.Label errorLabel = new Gtk.Label("Not implemented. Panels not supported for the given component control.");
            return errorLabel;
        }
 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 NodeControlButtons(BasicNodeControl ownerControl, ApplicationContext applicationContext)
        {
            //first column with icons
            m_newConnectionHandle = new NewConnectionHandle (ownerControl, applicationContext, new QuickActionLocator (15, 0, QuickActionPosition.Right));
            m_infoHandle = new PixToggleButtonHandle (ownerControl, new QuickActionLocator (15, 0.8, QuickActionPosition.Right),
                                              s_infoIcon, s_infoOnIcon);

            //second column with icons
            m_removeHandle = new RemoveNodeHandle (ownerControl, new QuickActionLocator (35, 0, QuickActionPosition.Right));
        }
        /// <summary>
        /// Shows the component info pad.
        /// </summary>
        /// <param name="component">Component.</param>
        /// <param name="defaultLocationX">Default location x for the floating window</param>
        /// <param name="defaultLocationY">Default location y for the floating window</param>
        /// <param name="onVisibleChanged">The action that is executed when visibility of window changes.</param>
        internal void ShowComponentInfoPad(BasicNodeControl component, 
                                           int defaultLocationX, int defaultLocationY, System.Action<Boolean> onVisibleChanged) 
        {   
            DockItem infoDockItem = m_mainWindowDockFrame.GetItem(component.ExperimentNode.ID);
            if(infoDockItem == null) 
            {
                infoDockItem = m_mainWindowDockFrame.AddItem(component.ExperimentNode.ID);
                infoDockItem.Content = CreateInfoWidget(component);

                infoDockItem.Label = component.ExperimentNode.Data.Metadata.Label;
                infoDockItem.DefaultHeight = 150;
                infoDockItem.DefaultWidth = 200;
                
                infoDockItem.DefaultLocation = GetLocation();

                infoDockItem.Visible = true;

                //attach action on visible changed, so that if window is closed then it toggles off the info icon
                infoDockItem.VisibleChanged += (object sender, EventArgs e) => 
                {
                    bool isVisible = ((DockItem)sender).Visible;
                    onVisibleChanged(isVisible);
                };

                AttachMouseOverHighlightHandlers (component, infoDockItem);

                infoPads.AddLast(infoDockItem);

                //Float window
                //this line allows setting window as floating automatically, to consider in future
                m_mainWindowDockFrame.SetStatus(infoDockItem, DockItemStatus.Floating);
                Gdk.Rectangle floatRectangle = infoDockItem.FloatingPosition;
                floatRectangle.Width = 350;
                floatRectangle.Height = 180;
                
                //location of info box next to the component node just sligthly below cursor click
                floatRectangle.X = defaultLocationX;
                floatRectangle.Y = defaultLocationY + 20;
                infoDockItem.SetFloatMode(floatRectangle);
            }
            else
            {
                //if already exists just set it visible
                infoDockItem.Visible = true;
            }
        }
Example #7
0
        public NodeControlButtons(BasicNodeControl ownerControl, ApplicationContext applicationContext)
        {
            //first column with icons
            m_newConnectionHandle = new NewConnectionHandle (ownerControl, applicationContext, new QuickActionLocator (15, 0, QuickActionPosition.Right));
 
            // HERZUM SPRINT 5.0: TLAB-230
            // HERZUM SPRINT 5.1: TLAB-230
            if (ownerControl is ScopeNodeControl || ownerControl is CommentNodeControl)
                m_infoHandle = new PixToggleButtonHandle (ownerControl, new QuickActionLocator (15, 0.12, QuickActionPosition.Right),
                                                          s_infoIcon, s_infoOnIcon);
            else
                m_infoHandle = new PixToggleButtonHandle (ownerControl, new QuickActionLocator (15, 0.8, QuickActionPosition.Right),
                                                          s_infoIcon, s_infoOnIcon);
            // END HERZUM SPRINT 5.1: TLAB-230
            // END HERZUM SPRINT 5.0: TLAB-230


            //second column with icons
            m_removeHandle = new RemoveNodeHandle (ownerControl, new QuickActionLocator (35, 0, QuickActionPosition.Right));
        }
        //HERZUM END SPRINT 2: TLAB-156

        public static ExperimentCanvasPad CreateExperimentCanvasPad(ApplicationContext applicationContext, BasicNodeControl basicNodeControl) 
        {
            IExperiment experiment = null;
            ScopeBaseMetadata scopeMetadata = basicNodeControl.ExperimentNode.Data.Metadata as ScopeBaseMetadata;
            if (scopeMetadata != null)
                experiment = scopeMetadata.ComponentGraph.GetExperiment ();
            else
                return applicationContext.MainWindow.ExperimentCanvasPad;

            ExperimentCanvasPad   experimentCanvasPad = new  ExperimentCanvasPad(applicationContext);
            if (!m_mapPadToNodes.ContainsKey(applicationContext.GetHashCode() + experiment.ExperimentInfo.Id))
                //HERZUM SPRINT 2: TLAB-156
                {
                  // HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
                  // m_mapPadToNodes.Add(experiment.ExperimentInfo.Id, experimentCanvasPad);
                  // m_mapIdToNodes.Add (experiment.ExperimentInfo.Id, basicNodeControl);
                  m_mapPadToNodes.Add(applicationContext.GetHashCode() + experiment.ExperimentInfo.Id, experimentCanvasPad);
                  m_mapIdToNodes.Add (applicationContext.GetHashCode() + experiment.ExperimentInfo.Id, basicNodeControl);
                // END HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
                }
            //HERZUM END SPRINT 2: TLAB-156
            return experimentCanvasPad;
        }
        internal void ShowComponentInfoPad(BasicNodeControl component) 
        {   
            DockItem infoDockItem = m_mainWindowDockFrame.GetItem(component.ExperimentNode.ID);
            if(infoDockItem == null) 
            {
                infoDockItem = m_mainWindowDockFrame.AddItem(component.ExperimentNode.ID);
                infoDockItem.Content = CreateInfoWidget(component);
            }
            
            infoDockItem.Label = component.ExperimentNode.Data.Metadata.Label;
            infoDockItem.DefaultHeight = 150;
            infoDockItem.DefaultWidth = 200;
            
            infoDockItem.DefaultLocation = GetLocation();
            
            m_mainWindowDockFrame.SetVisible(infoDockItem, true);
            
            infoPads.AddLast(infoDockItem);

            //TODO: floating info panels
            //there is still problem with below solution - if user resizes the window it frequently crashes (not always though)
            //however it crashes only when running from MONO Develop with attached debugger
            
            //            //this line allows setting window as floating automatically, to consider in future
            //            m_dockFrame.SetStatus(infoDockItem, DockItemStatus.Floating);
            //            Gdk.Rectangle floatRectangle = infoDockItem.FloatingPosition;
            //            floatRectangle.Width = 350;
            //            floatRectangle.Height = 180;
            //
            //            // TODO set location of info box next to the component node
            //            // to do this probably some translation will be needed of componentControl.DisplayBox on experiment canvas
            //            // to absolute x and y in relation to window
            //            floatRectangle.X = 600;
            //            floatRectangle.Y = 600;
            //            infoDockItem.SetFloatMode(floatRectangle);
        }
Example #10
0
        private Gtk.Widget CreateInfoWidget(BasicNodeControl basicComponentControl)
        {
            //case 1: decision panel
            //must be check first, as it inherits from ComponentControl
            DecisionNodeControl decisionControl = basicComponentControl as DecisionNodeControl;
            // HERZUM SPRINT 1.1 LOOP
            // TO DO New LoopInfoPanel

            // HERZUM SPRINT 2.0: TLAB-65
            /*
            ChallengeNodeControl challengeControl = basicComponentControl as ChallengeNodeControl;
            if(challengeControl != null) 
            {
                AboutExperimentDialog  dialog = new AboutExperimentDialog(m_applicationContext.MainWindow.);
                return dialog;
            }
            */
            // END HERZUM SPRINT 2.0: TLAB-65

            LoopNodeControl loopControl = basicComponentControl as LoopNodeControl;
            if(loopControl != null) 
            {
                LoopDecisionInfoPanel panel = new LoopDecisionInfoPanel(m_applicationContext);
                panel.LoopNodeControl = loopControl;
                return panel;
            } 

            // END HERZUM SPRINT 1.1 LOOP
            if(decisionControl != null) 
            {
                DecisionInfoPanel panel = new DecisionInfoPanel(m_applicationContext);
                panel.DecisionControl = decisionControl;
                return panel;
            }
            else 
            {
                // SPRINT 2: TLAB-98, TLAB-127
                //case 2: Component Panel
                if(basicComponentControl is ScopeNodeControl || basicComponentControl is CommentNodeControl) 
                {
                    BaseInfoPanel panel = new BaseInfoPanel();
                    panel.Component = basicComponentControl;
                    return panel;
                }
                // END SPRINT2: TLAB-98, TLAB-127
                //case 3: Component Panel
                if(basicComponentControl is ComponentControl || basicComponentControl is CompositeComponentControl) 
                {
                    // HERZUM SPRINT 2.4: TLAB-162
                    ComponentInfoPanel panel = new ComponentInfoPanel(m_applicationContext);
                    // END HERZUM SPRINT 2.4: TLAB-162

                    panel.Component = basicComponentControl;

                    return panel;
                }
            }

            //invalid
            Gtk.Label errorLabel = new Gtk.Label("Not implemented. Panels not supported for the given component control.");
            return errorLabel;
        }
 internal void HideComponentInfoPad(BasicNodeControl component)
 {
     m_infoPanelFactory.HideComponentInfoPad(component);
 }
Example #12
0
        /// <summary>
        /// Attaches the handlers to mouse over and mouse leave event
        /// If mouse is over the panel it highlights the corresponding control.
        /// </summary>
        /// <param name="component">Component.</param>
        /// <param name="infoDockItem">Info dock item.</param>
        static void AttachMouseOverHighlightHandlers (BasicNodeControl component, DockItem infoDockItem)
        {
            var enter = new Action<object, EnterNotifyEventArgs>(
                delegate (object o, Gtk.EnterNotifyEventArgs args) {
                    component.IsHighlighted = true;
            });
            var leave =  new Action<object, LeaveNotifyEventArgs>(
                delegate (object o, Gtk.LeaveNotifyEventArgs args) {
                    component.IsHighlighted = false;
            });

            //attach listeners to enter and leave events of DockItemContainer header, and DockItem content
            //note that Content and that header are EventBoxes, thus the notification works
            foreach (Gtk.Widget widget in new Gtk.Widget[] { infoDockItem.Widget.Header, infoDockItem.Content }) 
            {
                widget.EnterNotifyEvent += new EnterNotifyEventHandler(enter);
                widget.LeaveNotifyEvent += new LeaveNotifyEventHandler(leave);
            }

            //attach to all children
            AttachHandler(infoDockItem.Content as Container, enter, leave);
        }
Example #13
0
 internal void HideComponentInfoPad(BasicNodeControl component) 
 {
     DockItem infoDockItem = m_mainWindowDockFrame.GetItem(component.ExperimentNode.ID);
     if(infoDockItem != null) 
     {
         if(infoDockItem.Visible == true)
         {
             //just set invisible
             //no need for removing it, as it may be opened again
             infoDockItem.Visible = false;
         }
     }
 }
Example #14
0
 /// <summary>
 /// Shows the component info pad.
 /// </summary>
 /// <param name="component">Component.</param>
 /// <param name="defaultLocationX">Default location x for the floating window</param>
 /// <param name="defaultLocationY">Default location y for the floating window</param>
 /// <param name="onVisibleChanged">The action that is executed when visibility of window changes.</param>
 internal void ShowComponentInfoPad(BasicNodeControl component,
                                    int defaultLocationX, int defaultLocationY, System.Action <Boolean> onVisibleChanged)
 {
     //delegate creation of component info panel to panel factory
     m_infoPanelFactory.ShowComponentInfoPad(component, defaultLocationX, defaultLocationY, onVisibleChanged);
 }
Example #15
0
        /// <summary>
        /// Shows the component info pad.
        /// </summary>
        /// <param name="component">Component.</param>
        /// <param name="defaultLocationX">Default location x for the floating window</param>
        /// <param name="defaultLocationY">Default location y for the floating window</param>
        /// <param name="onVisibleChanged">The action that is executed when visibility of window changes.</param>
        internal void ShowComponentInfoPad(BasicNodeControl component, 
                                           int defaultLocationX, int defaultLocationY, System.Action<Boolean> onVisibleChanged) 
        {   
            DockItem infoDockItem = m_mainWindowDockFrame.GetItem(component.ExperimentNode.ID);
            if(infoDockItem == null) 
            {
                infoDockItem = m_mainWindowDockFrame.AddItem(component.ExperimentNode.ID);
                infoDockItem.Content = CreateInfoWidget(component);

                if (component is DecisionNodeControl) {
                //    string m = component.ExperimentNode.ID;
                  //  if (m. ID.Equals (DecisionMetadataDefinition.GotoDecisionGuid)) {
                    if(component.ExperimentNode.Data.Metadata.Label.Equals("Goto Decision")){
                        infoDockItem.Label = GOTO_INFO_PANEL_TITLE_LABEL;
                    } else {
                        infoDockItem.Label = DECISION_INFO_PANEL_TITLE_LABEL;
                    }
                } else if (component is LoopNodeControl) {
                    infoDockItem.Label = LOOP_INFO_PANEL_TITLE_LABEL;
                } else {
                    infoDockItem.Label = component.ExperimentNode.Data.Metadata.Label;
                }

                infoDockItem.DefaultHeight = 150;
                //infoDockItem.DefaultWidth = 200;
                // HERZUM SPRINT 4.2: TLAB-226
                infoDockItem.DefaultHeight = 100;
                if(component is ScopeNodeControl || component is CommentNodeControl) 
                    infoDockItem.DefaultHeight = 50;
                // END HERZUM SPRINT 4.2: TLAB-226

                infoDockItem.DefaultLocation = GetLocation();

                infoDockItem.Visible = true;

                //attach action on visible changed, so that if window is closed then it toggles off the info icon
                infoDockItem.VisibleChanged += (object sender, EventArgs e) => 
                {
                    bool isVisible = ((DockItem)sender).Visible;
                    onVisibleChanged(isVisible);
                };

                AttachMouseOverHighlightHandlers (component, infoDockItem);

                infoPads.AddLast(infoDockItem);

                //Float window
                //this line allows setting window as floating automatically, to consider in future
                m_mainWindowDockFrame.SetStatus(infoDockItem, DockItemStatus.Floating);
                Gdk.Rectangle floatRectangle = infoDockItem.FloatingPosition;
                floatRectangle.Width = 350;
                //floatRectangle.Height = 180;
                // HERZUM SPRINT 4.2: TLAB-225
                floatRectangle.Height = 100;
                if(component is ScopeNodeControl || component is CommentNodeControl) 
                    floatRectangle.Height = 50;
                // END HERZUM SPRINT 4.2: TLAB-225
                
                //location of info box next to the component node just sligthly below cursor click
                floatRectangle.X = defaultLocationX;
                floatRectangle.Y = defaultLocationY + 20;
                infoDockItem.SetFloatMode(floatRectangle);

            }
            else
            {
                //if already exists just set it visible
                infoDockItem.Visible = true;
            }
        }
Example #16
0
        // END HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59

        // HERZUM SPRINT 2.5: TLAB-173
        public static void RemoveSubExperimentCanvasPad(ApplicationContext applicationContext, BasicNodeControl basicNodeControl)
        {
            IExperiment       experiment    = null;
            ScopeBaseMetadata scopeMetadata = basicNodeControl.ExperimentNode.Data.Metadata as ScopeBaseMetadata;

            if (scopeMetadata != null)
            {
                experiment = scopeMetadata.ComponentGraph.GetExperiment();
            }

            if (basicNodeControl is CommentNodeControl)
            {
                if (m_mapIdToNodes.ContainsKey(applicationContext.GetHashCode() + basicNodeControl.ExperimentNode.Owner.ExperimentInfo.Id))
                {
                    m_mapIdToNodes.Remove(applicationContext.GetHashCode() + basicNodeControl.ExperimentNode.Owner.ExperimentInfo.Id);
                }
                return;
            }
            m_mapPadToNodes.Remove(applicationContext.GetHashCode() + experiment.ExperimentInfo.Id);
            m_mapIdToNodes.Remove(applicationContext.GetHashCode() + experiment.ExperimentInfo.Id);
        }
Example #17
0
 // HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
 public static void RemoveExperimentCanvasPad(ApplicationContext applicationContext, BasicNodeControl basicNodeControl)
 {
     m_mapPadToNodes.Remove(applicationContext.GetHashCode() + basicNodeControl.ExperimentNode.Owner.ExperimentInfo.Id);
     //HERZUM SPRINT 2: TLAB-156
     m_mapIdToNodes.Remove(applicationContext.GetHashCode() + basicNodeControl.ExperimentNode.Owner.ExperimentInfo.Id);
     //HERZUM END SPRINT 2: TLAB-156
 }
 // HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
 public static void RemoveExperimentCanvasPad(ApplicationContext applicationContext,BasicNodeControl basicNodeControl) 
 {   
     m_mapPadToNodes.Remove (applicationContext.GetHashCode() + basicNodeControl.ExperimentNode.Owner.ExperimentInfo.Id);
     //HERZUM SPRINT 2: TLAB-156
     m_mapIdToNodes.Remove (applicationContext.GetHashCode() + basicNodeControl.ExperimentNode.Owner.ExperimentInfo.Id);
     //HERZUM END SPRINT 2: TLAB-156
 } 
Example #19
0
        //HERZUM END SPRINT 2: TLAB-156

        public static ExperimentCanvasPad CreateExperimentCanvasPad(ApplicationContext applicationContext, BasicNodeControl basicNodeControl)
        {
            IExperiment       experiment    = null;
            ScopeBaseMetadata scopeMetadata = basicNodeControl.ExperimentNode.Data.Metadata as ScopeBaseMetadata;

            if (scopeMetadata != null)
            {
                experiment = scopeMetadata.ComponentGraph.GetExperiment();
            }
            else
            {
                return(applicationContext.MainWindow.ExperimentCanvasPad);
            }

            ExperimentCanvasPad experimentCanvasPad = new  ExperimentCanvasPad(applicationContext);

            if (!m_mapPadToNodes.ContainsKey(applicationContext.GetHashCode() + experiment.ExperimentInfo.Id))
            //HERZUM SPRINT 2: TLAB-156
            {
                // HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
                // m_mapPadToNodes.Add(experiment.ExperimentInfo.Id, experimentCanvasPad);
                // m_mapIdToNodes.Add (experiment.ExperimentInfo.Id, basicNodeControl);
                m_mapPadToNodes.Add(applicationContext.GetHashCode() + experiment.ExperimentInfo.Id, experimentCanvasPad);
                m_mapIdToNodes.Add(applicationContext.GetHashCode() + experiment.ExperimentInfo.Id, basicNodeControl);
                // END HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
            }
            //HERZUM END SPRINT 2: TLAB-156
            return(experimentCanvasPad);
        }
Example #20
0
        // END HERZUM SPRINT 2.4 TLAB-157


        public static ExperimentCanvasPad GetExperimentCanvasPad(ApplicationContext applicationContext, BasicNodeControl basicNodeControl)
        {
            ExperimentCanvasPad experimentCanvasPad = null;

            // HERZUM SPRINT 2.4: TLAB-156
            if (basicNodeControl is CommentNodeControl && !m_mapIdToNodes.ContainsValue(basicNodeControl))
            {
                m_mapIdToNodes.Add(applicationContext.GetHashCode() + basicNodeControl.ExperimentNode.ID, basicNodeControl);
            }
            // END HERZUM SPRINT 2.4: TLAB-156

            // HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
            // if (m_mapPadToNodes.TryGetValue (basicNodeControl.ExperimentNode.Owner.ExperimentInfo.Id, out experimentCanvasPad))
            if (m_mapPadToNodes.TryGetValue(applicationContext.GetHashCode() + basicNodeControl.ExperimentNode.Owner.ExperimentInfo.Id, out experimentCanvasPad))
            {
                // END HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
                return(experimentCanvasPad);
            }
            else
            {
                return(applicationContext.MainWindow.ExperimentCanvasPad);
            }
        }
 public bool TryGetNodeControl(ExperimentNode node, out BasicNodeControl nodeControl)
 {
     return m_mapNodesToControls.TryGetValue(node, out nodeControl);
 }
 /// <summary>
 /// Shows the component info pad.
 /// </summary>
 /// <param name="component">Component.</param>
 /// <param name="defaultLocationX">Default location x for the floating window</param>
 /// <param name="defaultLocationY">Default location y for the floating window</param>
 /// <param name="onVisibleChanged">The action that is executed when visibility of window changes.</param>
 internal void ShowComponentInfoPad(BasicNodeControl component, 
                                    int defaultLocationX, int defaultLocationY, System.Action<Boolean> onVisibleChanged) 
 {  
     //delegate creation of component info panel to panel factory
     m_infoPanelFactory.ShowComponentInfoPad(component, defaultLocationX, defaultLocationY, onVisibleChanged);
 }
Example #23
0
 // HERZUM SPRINT 5.2: TLAB-249
 public void MoveIconInfo(BasicNodeControl ownerControl,double rel)
 {
     m_infoHandle = new PixToggleButtonHandle (ownerControl, new QuickActionLocator (15, rel, QuickActionPosition.Right),
                                           s_infoIcon, s_infoOnIcon);
 }
        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);
        }
Example #25
0
 public bool TryGetNodeControl(ExperimentNode node, out BasicNodeControl nodeControl)
 {
     return m_mapNodesToControls.TryGetValue(node, out nodeControl);
 }
Example #26
0
        public BasicNodeControl CreateNodeControl(ExperimentNode node) 
        {
            BasicNodeControl control;

            if (node is ComponentNode) 
            {
                control = new ComponentControl(node, m_applicationContext);
            } 
            else if (node is ExperimentStartNode) 
            {
                control = new StartNodeControl(node, m_applicationContext);
            } 
            else if (node is ExperimentEndNode) 
            { 
                control = new EndNodeControl(node, m_applicationContext);
            }
            else if (node is ExperimentDecisionNode) 
            { 
                control = new DecisionNodeControl(node, m_applicationContext);
            }
            else if (node is ExitDecisionNode)
            {
                // HERZUM  SPRINT 0.0
                // control = null;
                // throw new NotImplementedException();
                // HERZUM SPRINT 1.1 IF
                // control = new EndNodeControl(node, m_applicationContext);
                control = new ExitDecisionControl(node, m_applicationContext);
                // END HERZUM SPRINT 1.1 IF
                // END HERZUM 
            }
            else if (node is LoopScopeNode)
            {
                // HERZUM SPRINT 1.1 LOOP
                // control = null;
                // throw new NotImplementedException();
                control = new LoopNodeControl(node, m_applicationContext);
                // END HERZUM SPRINT 1.1 LOOP
            }
            else if (node is ScopeNode)
            {
                // HERZUM  SPRINT 0.0
                //control = null;
                //throw new NotImplementedException();
                control = new ScopeNodeControl(node, m_applicationContext);
                // END HERZUM 
            }
            // HERZUM SPRINT 2.0: TLAB-65 CLASS
            else if (node is ChallengeNode)
            {
                control = new ChallengeNodeControl(node, m_applicationContext);
            }
            // END HERZUM SPRINT 2.0: TLAB-65 CLASS
            else if (node is CompositeComponentNode)
            {
                control = new CompositeComponentControl(node, m_applicationContext);
            }
            // HERZUM SPRINT 1.0
            else if (node is CommentNode)
            {
                control = new CommentNodeControl(node, m_applicationContext);
            }
            // END HERZUM SPRINT 1.0
            else 
            {
                control = new BasicNodeControl(node, m_applicationContext);
            }

            m_mapNodesToControls.Add(node, control);

            return control;
        }
Example #27
0
 // HERZUM SPRINT 2.0: TLAB-136-2
 public virtual void CompositeComponentNoSelected(BasicNodeControl focusControl) 
 {
     if (!this.Equals(focusControl)){
         ExperimentCanvasPad pad = ExperimentCanvasPadFactory.GetExperimentCanvasPad(m_applicationContext, this);
         ExperimentCanvasPad pad2 = ExperimentCanvasPadFactory.GetExperimentCanvasPad(m_applicationContext, focusControl);
         if (!pad.Equals(pad2)){
             pad.ExperimentCanvasWidget.ExperimentCanvas.View.RemoveFromSelection(this);
             this.IsSelected = false;
         } 
     }
 }
Example #28
0
 // HERZUM SPRINT 5.2: TLAB-249
 public void MoveIconInfo(BasicNodeControl ownerControl, double rel)
 {
     m_infoHandle = new PixToggleButtonHandle(ownerControl, new QuickActionLocator(15, rel, QuickActionPosition.Right),
                                              s_infoIcon, s_infoOnIcon);
 }
        // END HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59

        // HERZUM SPRINT 2.5: TLAB-173
        public static void RemoveSubExperimentCanvasPad(ApplicationContext applicationContext,BasicNodeControl basicNodeControl) 
        {   
            IExperiment experiment = null;
            ScopeBaseMetadata scopeMetadata = basicNodeControl.ExperimentNode.Data.Metadata as ScopeBaseMetadata;
            if (scopeMetadata != null)
                experiment = scopeMetadata.ComponentGraph.GetExperiment ();

            if (basicNodeControl is CommentNodeControl)
            {   
                if (m_mapIdToNodes.ContainsKey(applicationContext.GetHashCode() + basicNodeControl.ExperimentNode.Owner.ExperimentInfo.Id))
                    m_mapIdToNodes.Remove (applicationContext.GetHashCode() + basicNodeControl.ExperimentNode.Owner.ExperimentInfo.Id);
                return;
            }
            m_mapPadToNodes.Remove (applicationContext.GetHashCode() + experiment.ExperimentInfo.Id);
            m_mapIdToNodes.Remove (applicationContext.GetHashCode() + experiment.ExperimentInfo.Id);
        } 
Example #30
0
        // HERZUM SPRINT 1.0
        // HERZUM SPRINT 1.0 CANVAS da commentare la routine
        public override void CompositeComponentNoSelected(BasicNodeControl focusControl)  {

            base.CompositeComponentNoSelected (focusControl);
            var metadata = this.ExperimentNode.Data.Metadata;
            ScopeBaseMetadata scopeMetadata = metadata as ScopeBaseMetadata;          
            if(scopeMetadata.ComponentGraph != null)
            {
                BasicNodeControl componentControl;
                foreach (ExperimentNode node in scopeMetadata.ComponentGraph.Vertices)
                    if (m_applicationContext.NodeControlFactory.TryGetNodeControl (node, out componentControl)){
                        // HERZUM SPRINT 2.0 TLAB-136-2
                        // if (!componentControl.Equals(focusControl)){                            
                            // m_scopeCanvasWidget.ExperimentCanvas.View.RemoveFromSelection(componentControl);
                        componentControl.CompositeComponentNoSelected (focusControl);                            
                        // }
                    // END HERZUM SPRINT 2.0 TLAB-136-2TLAB-136-2
                        
                     }
             }

         }
        // END HERZUM SPRINT 2.4 TLAB-157


        public static ExperimentCanvasPad GetExperimentCanvasPad(ApplicationContext applicationContext, BasicNodeControl basicNodeControl) 
        {
            ExperimentCanvasPad experimentCanvasPad=null;
            // HERZUM SPRINT 2.4: TLAB-156
            if (basicNodeControl is CommentNodeControl && !m_mapIdToNodes.ContainsValue(basicNodeControl))
                m_mapIdToNodes.Add (applicationContext.GetHashCode() + basicNodeControl.ExperimentNode.ID, basicNodeControl);
            // END HERZUM SPRINT 2.4: TLAB-156

            // HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
            // if (m_mapPadToNodes.TryGetValue (basicNodeControl.ExperimentNode.Owner.ExperimentInfo.Id, out experimentCanvasPad))
            if (m_mapPadToNodes.TryGetValue (applicationContext.GetHashCode() + basicNodeControl.ExperimentNode.Owner.ExperimentInfo.Id, out experimentCanvasPad))
            // END HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
                return experimentCanvasPad;
            else
                return applicationContext.MainWindow.ExperimentCanvasPad;

        }
Example #32
0
 internal void HideComponentInfoPad(BasicNodeControl component)
 {
     m_infoPanelFactory.HideComponentInfoPad(component);
 }