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); }
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; }