/// <summary> /// /// </summary> /// <param name="process"></param> private void SetEdgeConnector(PPathwayProcess process) { foreach (PPathwayEdge edge in process.Edges) { foreach (EdgeLoader loader in m_edgeLoaders) { if (edge.Info.VariableKey != loader.VariableKey || edge.Info.ProcessKey != loader.ProcessKey) continue; edge.VIndex = loader.VIndex; edge.PIndex = loader.PIndex; edge.Refresh(); } } }
/// <summary> /// Add a E-cell class of this ComponentSetting. /// </summary> /// <param name="type">a type of class</param> private void AddCreateMethod(string type) { PPathwayObject obj = null; switch (type) { case EcellObject.SYSTEM: obj = new PPathwaySystem(); break; case EcellObject.PROCESS: obj = new PPathwayProcess(); break; case EcellObject.VARIABLE: obj = new PPathwayVariable(); break; case EcellObject.TEXT: obj = new PPathwayText(); break; case EcellObject.STEPPER: obj = new PPathwayStepper(); break; default: throw new PathwayException(MessageResources.ErrUnknowType); } m_createMethod = obj.CreateNewObject; }
/// <summary> /// Constructor /// </summary> /// <param name="canvas"></param> /// <param name="edgeInfo"></param> /// <param name="process"></param> /// <param name="variable"></param> public PPathwayEdge(CanvasControl canvas, EdgeInfo edgeInfo, PPathwayProcess process, PPathwayVariable variable) : this(canvas, edgeInfo) { m_variable = variable; m_process = process; m_variable.Edges.Add(this); m_process.Edges.Add(this); SetEdge(m_brush, LINE_WIDTH); base.Pickable = (variable.Visible && process.Visible); base.Visible = (variable.Visible && process.Visible); m_varPoint = variable.GetContactPoint(process.Center); m_proPoint = process.GetContactPoint(m_varPoint); this.DrawLine(); }
/// <summary> /// Create VariableReferenceList of process. /// </summary> /// <param name="process">VariableReferenceList for this process will be created</param> /// <param name="variable">VariableReferenceList to this variable will be created</param> /// <param name="type">RefChangeType of this connection.</param> /// <param name="coefficient">coefficient of connection.</param> private void CreateEdge(PPathwayProcess process, PPathwayVariable variable, RefChangeType type, int coefficient) { try { m_con.NotifyVariableReferenceChanged( process.EcellObject.Key, variable.EcellObject.Key, RefChangeType.Delete, 0, false); m_con.NotifyVariableReferenceChanged( process.EcellObject.Key, variable.EcellObject.Key, type, coefficient, true); } catch (EcellException) { Util.ShowErrorDialog(MessageResources.ErrCreateEdge); } m_con.Menu.ResetEventHandler(); }