stify">//перед тим як малювати вершини, потрібно отрисовать ребра
for (int i=0; i lt; aEdge.Count; i ++)
{
//отрісовиваємих тільки видимі і не помічені як видалені ребра
if ((aEdge [i] .Visible == true || (aEdge [i] .Visible == false amp; amp; showInvisible
== true))
amp; amp; (aEdge [i] .Deleted == false || (aEdge [i] .Deleted == true amp; amp;
showDeleted == true)))
{x1=aVertex [aEdge [i] .srcVertex] .X; y1=aVertex [aEdge [i] .srcVertex] .Y; x2=aVertex [aEdge [i] .destVertex] .X ; y2=aVertex [aEdge [i] .destVertex] .Y; xm=(x1 + x2)/2; ym=(y1 + y2)/2;
//колір виходить від першої вершини
dcPen.Width=4;
dcPen.Color=aGraph [aVertex [aEdge [i] .srcVertex] .iGraph] .Color; .DrawLine (dcPen, x1, y1, xm, ym) ;. Color=aGraph [aVertex [ aEdge [i] .destVertex] .iGraph] .Color; .DrawLine (dcPen, x2, y2, xm, ym) ;. Width=2; .Color=aEdge [i] .Color; .DrawLine (dcPen, x1, y1 , x2, y2);
((SolidBrush) dcBrush) .Color=aEdge [i] .Color; suffix= raquo ;; prefix= raquo ;;
if (aEdge [i] .Enabled == false) suffix +=? raquo ;;
if (aEdge [i] .Visible == false) suffix += ° raquo ;; (aEdge [i] .Deleted == true) suffix += † raquo ;; ( aEdge [i] .IsPartOfPath == true)
{
//suffix += = raquo ;;
//prefix== raquo ;;
((SolidBrush) dcBrush) .Color=Color.FromArgb (200, 200, 200);
} (aEdge [i] .Selected == true)
{. Width=2;
//малюємо кружечок за який можна тягати ребро
dc.FillEllipse (dcBrush, xm - rSize, ym - rSize, 2 * rSize, 2 * rSize) ;. Color=aGraph [aVertex [aEdge [i] .srcVertex] .iGraph] .Color ; .DashStyle=System.Drawing.Drawing2D.DashStyle.Dot; .DashOffset=0; .DrawEllipse (dcPen, xm - rSize, ym - rSize, 2 * rSize, 2 * rSize) ;. Color=aGraph [aVertex [aEdge [ i] .destVertex] .iGraph] .Color; .DashOffset=1; .DrawEllipse (dcPen, xm - rSize, ym - rSize, 2 * rSize, 2 * rSize) ;. DashStyle=System.Drawing.Drawing2D.DashStyle.Solid ;
//напис на ребрі
int x=xm;
int y=ym; textSize=TextRenderer.MeasureText (prefix +
aEdge [i] .Weight.ToString () + suffix, textFontBold); -=textSize.Width/2; -=textSize.Height/2; textRect=new Rectangle (x, y, textSize.Width, textSize.Height) ;. DrawText (this.dc, prefix + aEdge [i] .Weight.ToString () +, textFontBold, textRect, Color.Black);
}
{. Width=1;
//малюємо кружечок за який можна тягати ребро
dc.FillEllipse (dcBrush, xm - rSize, ym - rSize, 2 * rSize, 2 * rSize) ;. Color=aGraph [aVertex [aEdge [i] .srcVertex] .iGraph] .Color ; .DashStyle=System.Drawing.Drawing2D.DashStyle.Dot; .DashOffset=0; .DrawEllipse (dcPen, xm - rSize, ym - rSize, 2 * rSize, 2 * rSize) ;. Color=aGraph [aVertex [aEdge [ i] .destVertex] .iGraph] .Color; .DashOffset=1; .DrawEllipse (dcPen, xm - rSize, ym - rSize, 2 * rSize, 2 * rSize) ;. DashStyle=System.Drawing.Drawing2D.DashStyle.Solid ;
//напис на ребреx=xm;
int y=ym; textSize=TextRenderer.MeasureText (prefix +
aEdge [i] .Weight.ToString () + suffix, textFontNormal); -=textSize.Width/2; -=textSize.Height/2; textRect=new Rectangle (x, y, textSize.Width, textSize.Height) ;. DrawText (this.dc, prefix + aEdge [i] .Weight.ToString () +
suffix, textFontNormal, textRect, Color.Black);
}
}
}
//тепер необхідно отрисовать вершини (int i=0; i lt; aVertex.Count; i ++)
{
//отрісовиваємих тільки видимі і не помічені як видалені
вершини
if ((aVertex [i] .Visible == true || (aVertex [i] .Visible == false amp; amp;
showInvisible == true))
amp; amp; (aVertex [i] .Deleted == false || (aVertex [i] .Deleted == true amp; amp;
showDeleted == true)))
{
//колір граніци.Color=aGraph [aVertex [i] .iGraph] .Color;
//колір заповнення
((SolidBrush) dcBrush) .Color=aVertex [i] .Color; suffix= raquo ;; (aVertex [i] .Enabled == false) suffix +=. ; (aVertex [i] .Visible == false) suffix += ° raquo ;; (aVertex [i] .Deleted == true) suffix += † raquo ;; (...