/// <summary> /// Determines whether the configuration in the Apply method should be applied to this edge instance. /// </summary> /// <param name="nodeInfo">Information on the edge currently being inspected.</param> /// <returns> /// An indication of whether we should proceed with configuring this edge instance. /// </returns> public bool ShouldApply(IEdgeInfo nodeInfo) { var from = (int) nodeInfo.FromNode.Tag; var to = (int)nodeInfo.ToNode.Tag; // Apply this convention on edges from even nodes to odd nodes. return (from.IsEven() && (to.IsOdd())); }
/// <summary> /// If the provided <see cref="LayoutGraph"/> edge has a represented edge, /// returns the edge of the original input graph that corresponds to this edge. /// </summary> protected IEdge GetRepresentedEdge(Edge layoutEdge) { IEdgeInfo edgeInfo = result.GetEdgeInfo(layoutEdge); Edge representedEdge = edgeInfo.RepresentedEdge; if (null != representedEdge) { CopiedLayoutGraph copiedLayoutGraph = representedEdge.Graph as CopiedLayoutGraph; if (null != copiedLayoutGraph) { return((IEdge)copiedLayoutGraph.GetOriginalEdge(representedEdge)); } } return(null); }
/// <summary> /// Copies the given edge. Delegate to the type specific implementations. /// </summary> /// <param name="pageLayoutGraph">The layout graph.</param> /// <param name="layoutEdge">The edge in the layout graph.</param> /// <param name="pageView"> The view graph to create the copy in.</param> /// <returns>The copied edge.</returns> private IEdge CopyEdge(LayoutGraph pageLayoutGraph, Edge layoutEdge, IGraph pageView) { IEdgeInfo edgeInfo = result.GetEdgeInfo(layoutEdge); switch (edgeInfo.Type) { case EdgeType.Normal: return(CreateNormalEdge(pageLayoutGraph, layoutEdge, pageView)); case EdgeType.Connector: return(CreateConnectorEdge(pageLayoutGraph, layoutEdge, pageView)); case EdgeType.Proxy: return(CreateProxyEdge(pageLayoutGraph, layoutEdge, pageView)); case EdgeType.ProxyReference: return(CreateProxyReferenceEdge(pageLayoutGraph, layoutEdge, pageView)); } throw new ArgumentException("unknown edge type"); }
/// <summary> /// Returns an edge of the original input graph that corresponds /// the provided edge of the <see cref="LayoutGraph"/> returned by the /// multi-page layout. /// </summary> /// <remarks> /// As the multi-page layout introduces auxiliary nodes, this method /// might return <see langword="null"/> /// </remarks> protected IEdge GetModelEdge(Edge layoutEdge) { IEdgeInfo edgeInfo = result.GetEdgeInfo(layoutEdge); return(edgeInfo.Id as IEdge); }
public void Apply(IEdgeInfo edgeInfo, IEdgeExpression edge) { edge.WithLabel("Even to Odd").WithColor(Color.Red); }
public void Apply(IEdgeInfo edgeInfo, IEdgeExpression edge) { edge.WithLabel("Odd to Even").WithColor(Color.Blue); }
public bool ShouldApply(IEdgeInfo nodeInfo) { throw new System.NotImplementedException(); }
public void Apply(IEdgeInfo edgeInfo, FluentDot.Expressions.Edges.IEdgeExpression edge) { throw new System.NotImplementedException(); }
public void Process(IEdgeInfo <T> edge, Dictionary <string, string> attributes, IChain <MessageInfo, T> map) { _rule(edge, attributes, map); }