Exemplo n.º 1
0
        protected override IVisualEdge CreateEdge(IVisual root, IVisual leaf)
        {
            var result = Registry.Pooled <IVisualFactory>().CreateEdge(root, leaf, "");

            result.Data = GraphExtensions.EdgeString <IVisual, IVisualEdge>(result);
            return(result);
        }
Exemplo n.º 2
0
        public virtual void MakeEdgeStrings(IGraph <TItem, TEdge> graph)
        {
            var changer = Factory as IGraphModelPropertyChanger <TItem, TEdge>;

            if (changer != null)
            {
                foreach (var edge in graph.Edges())
                {
                    changer.SetProperty(edge, GraphExtensions.EdgeString <TItem, TEdge> (edge));
                }
            }
        }
Exemplo n.º 3
0
        private void NodeItems(Node <IVisual> node, IVisual nodeVisual,
                               IDictionary <IVisual, IVisual> itemsDone)
        {
            var factory = Registry.Pooled <IVisualFactory>();

            foreach (var visual in node.Items)
            {
                IVisual childVisual = null;
                itemsDone.TryGetValue(visual, out childVisual);
                if (childVisual == null)
                {
                    string ws = visual.Data.ToString();
                    if (visual is IVisualEdge)
                    {
                        ws = GraphExtensions.EdgeString <IVisual, IVisualEdge>((IVisualEdge)visual);
                    }
                    string ds = ws + "\r\n" +
                                visual.Shape.BoundsRect.ToString();

                    if (!node.Envelope.Contains(visual.Shape.BoundsRect))
                    {
                        ds = "! " + ds;
                    }
                    childVisual          = factory.CreateItem(ds);
                    childVisual.Shape    = this.VisualsDisplay.ShapeFactory.Create <IRoundedRectangleShape>();
                    childVisual.Location = visual.Location;
                    childVisual.Size     = visual.Size;

                    this.VisualsDisplay.Data.Add(childVisual);
                    itemsDone.Add(visual, childVisual);
                }

                var edge = factory.CreateEdge(childVisual, nodeVisual, string.Empty);

                edge.Shape = this.VisualsDisplay.Layout.CreateShape(edge);
                this.VisualsDisplay.Data.Add(edge);
            }
        }
Exemplo n.º 4
0
 public override string ToString()
 {
     return(GraphExtensions.EdgeString <IGraphEntity, IGraphEdge>(this));
 }
Exemplo n.º 5
0
 public override string ToString()
 {
     return(GraphExtensions.EdgeString <T, IEdge <T> >(this));
 }