/// <summary>Compares two edges by the x-coordinates of the centers of their target nodes.</summary> /// <param name="edge1">the first edge</param> /// <param name="edge2">the second edge</param> /// <returns>a negative value if the first target node is left of the second target node, a positive value if it's the /// other way round and <c>0</c> if both target nodes are at the same x-coordinate</returns> public virtual int Compare(object edge1, object edge2) { Node va = ((Edge)edge1).Target; Node vb = ((Edge)edge2).Target; LayoutGraph graph = (LayoutGraph)va.Graph; return((int)((100.0 * (graph.GetCenterX(va) - graph.GetCenterX(vb))))); }