Esempio n. 1
0
        /// <summary>
        /// 
        /// </summary>
        public PPathwayAlias(PPathwayVariable variable)
        {
            this.m_variable = variable;
            this.m_canvas = variable.Canvas;
            this.AddPath(variable.Figure.GraphicsPath, false);
            this.Brush = variable.Setting.CreateBrush(m_path);
            this.Text = string.Format("[{0}]", variable.EcellObject.LocalID);
            this.Layer = variable.Layer;
            this.Setting = variable.Setting;

            this.AddInputEventListener(new NodeDragHandler(variable.Canvas));
        }
Esempio n. 2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ev"></param>
        /// <param name="variable"></param>
        private void ResetAlias(EcellVariable ev, PPathwayVariable variable)
        {
            ev.Aliases.Clear();
            if (variable.Aliases.Count <= 0)
                return;

            foreach (PPathwayAlias alias in variable.Aliases)
            {
                EcellLayout layout = new EcellLayout();
                layout.Center = alias.Center;
                layout.Layer = alias.Layer.Name;
                ev.Aliases.Add(layout);
            }
        }
Esempio n. 3
0
        /// <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();
        }
Esempio n. 4
0
        /// <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>
        /// 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();
        }
Esempio n. 6
0
        private void SetVariableAnimation(PPathwayVariable variable)
        {
            double molarConc = GetValue(variable.EcellObject.FullID + ":" + Constants.xpathMolarConc);
            float size = GetEntitySize(variable.EcellObject, molarConc);
            float width =  size * variable.Figure.Width;
            float height =  size * variable.Figure.Height;
            PointF pos = variable.Center;

            // set variable.
            if (variable.Visible)
            {
                variable.Width = width;
                variable.Height = height;
                variable.Center = pos;
                variable.Brush = GetEntityBrush(molarConc, variable.Setting, variable.Path);
            }
            // set alias
            foreach (PPathwayAlias alias in variable.Aliases)
            {
                if (!alias.Visible)
                    continue;

                pos = alias.Center;

                alias.Width = width;
                alias.Height = height;
                alias.Center = pos;
                alias.Brush = GetEntityBrush(molarConc, alias.Setting, alias.Path);
            }

            // set threshold
            if (!_autoThreshold)
                return;
            SetThreshold(molarConc);
        }
Esempio n. 7
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="variable"></param>
        private void ResetVariableAnimation(PPathwayVariable variable)
        {
            double molarConc = GetValue(variable.EcellObject.FullID + ":" + Constants.xpathMolarConc);

            variable.ViewMode = false;
            float width = variable.Figure.Width;
            float height = variable.Figure.Height;
            PointF pos = variable.Center;
            Brush brush = GetEntityBrush(molarConc, variable.Setting, variable.Path);

            // set variable.
            variable.Width = width;
            variable.Height = height;
            variable.Center = pos;
            variable.RefreshView();

            // set alias
            foreach (PPathwayAlias alias in variable.Aliases)
            {
                pos = alias.Center;
                alias.Width = width;
                alias.Height = height;
                alias.Center = pos;
                alias.RefreshView();
            }
        }