Esempio n. 1
0
 public override void Draw(DrawingStyle ds, Graphics g)
 {
     g.DrawRectangle(Pens.Gray, new Rectangle(Position, Bounds));
     g.DrawString(Predicate, ds.TextFont, Brushes.Black, new Point(Position.X + ds.VertexMargin, Position.Y + ds.VertexMargin));
     FirstBranch.Draw(ds, g);
     SecondBranch.Draw(ds, g);
 }
Esempio n. 2
0
 public override Size Layout(DrawingStyle ds, Graphics g, int ox, int oy)
 {
     Position = new Point(ox, oy);
     var textSize = g.MeasureString(Predicate, ds.TextFont).ToSize();
     int y = oy + ds.VertexMargin + textSize.Height + ds.SubGraphHeadPadding;
     var branch1 = FirstBranch.Layout(ds, g, ox + ds.VertexMargin, y);
     y += branch1.Height + ds.SubGraphHeadPadding;
     var branch2 = SecondBranch.Layout(ds, g, ox + ds.VertexMargin, y);
     Bounds.Height = y - oy + branch2.Height + ds.VertexMargin;
     Bounds.Width = Math.Max(branch1.Width, Math.Max(branch2.Width, textSize.Width)) + ds.VertexMargin * 2;
     return Bounds;
 }
Esempio n. 3
0
 public override Size Layout(DrawingStyle ds, Graphics g, int ox, int oy)
 {
     Position = new Point(ox, oy);
     Bounds = SubGraph.Layout(ds, g, ox, oy);
     return Bounds;
 }
Esempio n. 4
0
 public override void Draw(DrawingStyle ds, Graphics g)
 {
     SubGraph.Draw(ds, g);
 }
Esempio n. 5
0
 public override Size Layout(DrawingStyle ds, Graphics g, int ox, int oy)
 {
     Position = new Point(ox, oy);
     Bounds = new Size(ds.RecurCircleSize, ds.RecurCircleSize);
     return Bounds;
 }
Esempio n. 6
0
 public override void Draw(DrawingStyle ds, Graphics g)
 {
     // Draw backloop
     g.DrawLines(ds.BackloopPen, new Point[]
     {
         new Point(Position.X + Bounds.Width/2, Position.Y + Bounds.Height/2),
         new Point(Position.X + Bounds.Width/2, HeadNode.Position.Y + HeadNode.Bounds.Height - ds.BackloopSpacing/2),
         new Point(HeadNode.Position.X-ds.ConnectorSize, HeadNode.Position.Y + HeadNode.Bounds.Height - ds.BackloopSpacing/2),
         new Point(HeadNode.Position.X-ds.ConnectorSize, HeadNode.Position.Y + HeadNode.Bounds.Height/2 + ds.ConnectorSize),
         new Point(HeadNode.Position.X, HeadNode.Position.Y + HeadNode.Position.Y + HeadNode.Bounds.Height/2 + ds.ConnectorSize)
     });
     g.FillEllipse(Brushes.Black, new Rectangle(Position, Bounds));
 }
Esempio n. 7
0
 public override Size Layout(DrawingStyle ds, Graphics g, int ox, int oy)
 {
     Position = new Point(ox, oy);
     var textSize = g.MeasureString("Recurring", ds.TextFont).ToSize();
     int y = oy + ds.VertexMargin + textSize.Height + ds.SubGraphHeadPadding;
     var subgraph = SubGraph.Layout(ds, g, ox + ds.VertexMargin, y);
     Bounds.Height = y - oy + subgraph.Height + ds.VertexMargin + ds.BackloopSpacing;
     Bounds.Width = Math.Max(subgraph.Width, textSize.Width) + ds.VertexMargin * 2;
     return Bounds;
 }
Esempio n. 8
0
 public override void Draw(DrawingStyle ds, Graphics g)
 {
     g.DrawRectangle(Pens.Gray, new Rectangle(Position.X, Position.Y, Bounds.Width, Bounds.Height - ds.BackloopSpacing));
     g.DrawString("Recurring", ds.TextFont, Brushes.Black, new Point(Position.X + ds.VertexMargin, Position.Y + ds.VertexMargin));
     SubGraph.Draw(ds, g);
 }
Esempio n. 9
0
 public abstract Size Layout(DrawingStyle ds, Graphics g, int ox, int oy);
Esempio n. 10
0
 public override Size Layout(DrawingStyle ds, Graphics g, int ox, int oy)
 {
     List<Size> sizes = new List<Size>();
     List<Size> connectorSizes = new List<Size>();
     foreach (var node in Nodes)
         sizes.Add(node.Layout(ds, g, ox, oy));
     foreach (var c in Connectors)
         connectorSizes.Add(c.Layout(ds, g, ox, oy));
     var height = sizes.Max(s => s.Height);
     int x = ox;
     for (int i = 0; i < Nodes.Count; i++)
     {
         int y = oy + (height - sizes[i].Height) / 2;
         Nodes[i].Layout(ds, g, x, y);
         x += Nodes[i].Bounds.Width;
         if (i < connectorSizes.Count)
         {
             x += ds.ConnectorMargin;
             Connectors[i].Layout(ds, g, x, oy + (height - connectorSizes[i].Height) / 2);
             x += Connectors[i].Bounds.Width + ds.ConnectorMargin;
         }
     }
     Bounds.Width = x - ox;
     Bounds.Height = height;
     return Bounds;
 }
Esempio n. 11
0
 public override void Draw(DrawingStyle ds, Graphics g)
 {
     foreach (var node in Nodes)
         node.Draw(ds, g);
     foreach (var c in Connectors)
         c.Draw(ds, g);
 }
Esempio n. 12
0
 public override void Draw(DrawingStyle ds, Graphics g)
 {
     g.DrawLine(ds.MapPen, Position.X, Position.Y + Bounds.Height / 2, Position.X + Bounds.Width - ds.MapPen.Width, Position.Y + Bounds.Height / 2);
 }
Esempio n. 13
0
 public override Size Layout(DrawingStyle ds, Graphics g, int ox, int oy)
 {
     Position = new Point(ox, oy);
     var tsize = g.MeasureString(Text, ds.TextFont).ToSize();
     Bounds.Width = ds.VertexMargin * 2 + tsize.Width;
     Bounds.Height = ds.VertexMargin * 2 + tsize.Height;
     return Bounds;
 }
Esempio n. 14
0
 public override void Draw(DrawingStyle ds, Graphics g)
 {
     g.DrawString(Text, ds.TextFont, Brushes.Black, Position.X + ds.VertexMargin, Position.Y + ds.VertexMargin);
 }
Esempio n. 15
0
 public override Size Layout(DrawingStyle ds, Graphics g, int ox, int oy)
 {
     Position = new Point(ox, oy);
     Bounds.Width = (int)(ds.InputDiamondSize * 1.414f);
     Bounds.Height = Bounds.Width;
     return Bounds;
 }
Esempio n. 16
0
 public override void Draw(DrawingStyle ds, Graphics g)
 {
     g.TranslateTransform(Position.X + Bounds.Width / 2, Position.Y + Bounds.Height / 2);
     g.RotateTransform(45.0f);
     g.FillRectangle(Brushes.DarkGray, -ds.InputDiamondSize / 2, -ds.InputDiamondSize / 2, ds.InputDiamondSize, ds.InputDiamondSize);
     g.ResetTransform();
 }
Esempio n. 17
0
 public override void Draw(DrawingStyle ds, Graphics g)
 {
     int ex = Position.X + Bounds.Width;
     int ey = Position.Y + Bounds.Height / 2;
     g.DrawLine(ds.PipeGS_Pen, Position.X, ey, ex - 4.5f, ey);
     using (var p = new Pen(Brushes.Black))
     {
         p.Width = 2;
         g.DrawLine(p, ex - 12, ey - 8, ex, ey);
         g.DrawLine(p, ex - 12, ey + 8, ex, ey);
     }
 }
Esempio n. 18
0
 public abstract void Draw(DrawingStyle ds, Graphics g);