示例#1
0
文件: EndNode.cs 项目: wuyi165/Roro
        public override GraphicsPath Render(Graphics g, Rectangle r, NodeStyle o)
        {
            var leftRect  = new Rectangle(r.X, r.Y, r.Height, r.Height);
            var rightRect = new Rectangle(r.Right - r.Height, r.Y, r.Height, r.Height);
            var path      = new GraphicsPath();

            path.StartFigure();
            path.AddArc(leftRect, 90, 180);
            path.AddArc(rightRect, -90, 180);
            path.CloseFigure();
            //
            g.FillPath(o.BackBrush, path);
            g.DrawPath(o.BorderPen, path);
            return(path);
        }
示例#2
0
        public override GraphicsPath Render(Graphics g, Rectangle r, NodeStyle o)
        {
            var path = new GraphicsPath();

            path.StartFigure();
            path.AddPolygon(new Point[]
            {
                r.CenterTop(),
                r.CenterRight(),
                r.CenterBottom(),
                r.CenterLeft()
            });
            path.CloseFigure();
            //
            g.FillPath(o.BackBrush, path);
            g.DrawPath(o.BorderPen, path);
            return(path);
        }
示例#3
0
        public override GraphicsPath Render(Graphics g, Rect r, NodeStyle o)
        {
            var path = new GraphicsPath();

            path.StartFigure();
            path.AddPolygon(new Point[]
            {
                new Point(r.X + PageRenderOptions.GridSize, r.Y),
                new Point(r.Right, r.Y),
                new Point(r.Right - PageRenderOptions.GridSize, r.Bottom),
                new Point(r.X, r.Bottom),
            });
            path.CloseFigure();
            //
            g.FillPath(o.BackBrush, path);
            g.DrawPath(o.BorderPen, path);
            return(path);
        }
示例#4
0
 private void RenderPorts(Graphics g)
 {
     if (this.MoveNodeOffsetPoint == Point.Empty)
     {
         var o = new NodeStyle();
         foreach (var node in this.SelectedNodes)
         {
             node.RenderedPorts.Clear();
             var nodePath = this.RenderedNodes[node];
             foreach (var port in node.Ports)
             {
                 var portPath = port.Render(g, node.Bounds, o);
                 node.RenderedPorts.Add(port, portPath);
                 nodePath.FillMode = FillMode.Winding;
                 nodePath.AddPath(portPath, false);
             }
         }
     }
 }
示例#5
0
        private void RenderLines(Graphics g)
        {
            var o = new NodeStyle();
            var f = new PathFinder(this.Nodes);

            foreach (var node in this.Nodes)
            {
                foreach (var port in node.Ports)
                {
                    o.LinePenWithArrow.Brush = port.GetBackBrush();
                    if (this.LinkNodeEndPoint != Point.Empty && this.LinkNodeStartPort == port)
                    {
                        g.DrawLine(o.LinePenWithArrow, port.Bounds.Center().X, port.Bounds.Center().Y, this.LinkNodeEndPoint.X, this.LinkNodeEndPoint.Y);
                    }
                    else if (this.GetNodeById(port.NextNodeId) is Node linkedNode)
                    {
                        g.DrawPath(o.LinePenWithArrow, f.GetPath(port.Bounds.Center(), linkedNode.Bounds.CenterTop()));
                    }
                }
            }
        }
示例#6
0
文件: Node.cs 项目: mrkem598/Roro
 public void RenderText(Graphics g, Rectangle r, NodeStyle o)
 {
     g.DrawString(this.Name, o.Font, o.FontBrush, r, o.StringFormat);
 }
示例#7
0
文件: Node.cs 项目: mrkem598/Roro
 public abstract GraphicsPath Render(Graphics g, Rectangle r, NodeStyle o);
示例#8
0
 public override void RenderText(Graphics g, Rect r, NodeStyle o)
 {
     g.DrawString(this.Name + Environment.NewLine + this.CurrentValue, o.Font, o.FontBrush, r, o.StringFormat);
 }