/// <summary>
        /// SetProcessGraphs
        /// </summary>
        private void SetProcessGraphs()
        {
            if (!checkBoxProcess.Checked)
                return;

            foreach (PPathwayProcess process in _processes)
            {
                // Create Graph
                if (process.Graph == null)
                {
                    PPathwayGraph graph = new PPathwayGraph();
                    graph.PointF = process.PointF;
                    graph.Refresh();
                    process.Graph = graph;
                }

                // Update params.
                string param = ":" + GetProcessParam();
                process.Graph.Title = process.EcellObject.LocalID + param;
                process.Graph.EntityPath = process.EcellObject.FullID + param;
                process.Graph.Visible = process.Visible;
                process.Graph.Pickable = process.Visible;

                _graphs.Add(process.Graph);
                process.Layer.AddChild(process.Graph);
            }
        }
        /// <summary>
        /// SetVariableGraphs
        /// </summary>
        private void SetVariableGraphs()
        {
            if (!checkBoxVariable.Checked)
                return;

            foreach (PPathwayVariable variable in _variables)
            {
                // Create Graph
                if (variable.Graph == null)
                {
                    PPathwayGraph graph = new PPathwayGraph();
                    graph.PointF = variable.PointF;
                    graph.Refresh();
                    variable.Graph = graph;
                }

                // Update params.
                string param = ":" + GetVariableParam();
                variable.Graph.Title = variable.EcellObject.LocalID + param;
                variable.Graph.EntityPath = variable.EcellObject.FullID + param;
                variable.Graph.Visible = variable.Visible;
                variable.Graph.Pickable = variable.Visible;

                _graphs.Add(variable.Graph);
                variable.Layer.AddChild(variable.Graph);
            }
        }
Exemple #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="graph"></param>
 /// <returns></returns>
 private static string CreateSVGGraph(PPathwayGraph graph)
 {
     string svgObj = "";
     if (graph == null || graph.Parent == null)
         return svgObj;
     graph.Refresh();
     //
     string pen = "Black";
     string fill = BrushManager.ParseBrushToString(graph.Brush);
     svgObj += SVGUtil.Rectangle(graph.Rect, pen, fill);
     // panel
     fill = BrushManager.ParseBrushToString(graph.Panel.Brush);
     svgObj += SVGUtil.Rectangle(graph.Panel.Rect, pen, fill);
     // graph
     pen = "Red";
     if(graph.Graph.Width > 0)
         svgObj += SVGUtil.Polyline(graph.Graph.Path.PathPoints, pen, "1");
     // title
     float margin = 2f;
     svgObj += SVGUtil.Text(new PointF(graph.PText.X + margin, graph.PText.Y + SVGUtil.SVG_FONT_SIZE + margin), graph.PText.Text, "Black");
     return svgObj;
 }