Esempio n. 1
0
        public void PositionConnection(IEdge e, Connection conn)
        {
            EdgeKeysEventArgs args = (EdgeKeysEventArgs)this.EdgeArgs[e];

            ArrayList list = new ArrayList();

            foreach (PointF p in args.Keys)
            {
                list.Add(new PointF(p.X * this.PositionScale, p.Y * this.PositionScale));
            }
            conn.AddPoints(list);
        }
Esempio n. 2
0
 private void LayEdge(Object sender, EdgeKeysEventArgs args)
 {
     Console.Write("{0} ({1}->{2}) ",
                   ((NamedEdge)args.Edge).Name,
                   ((NamedVertex)args.Edge.Source).Name,
                   ((NamedVertex)args.Edge.Target).Name
                   );
     foreach (PointF p in args.Keys)
     {
         Console.Write(" {0}", p.ToString());
     }
     Console.WriteLine();
 }
        public void Connect(
            IEdge e,
            Netron.Connection conn,
            Netron.Shape source,
            Netron.Shape target
            )
        {
            // get ports
            EdgeKeysEventArgs args = (EdgeKeysEventArgs)layouter.EdgeArgs[e];

            if (args.Keys.Count < 2)
            {
                throw new ArgumentException("not enough keys");
            }
            // find best from
            conn.From = FindNearestConnector(source, args.Keys[0]);
            conn.To   = FindNearestConnector(target, args.Keys[args.Keys.Count - 1]);
        }
Esempio n. 4
0
        public void PositionConnections()
        {
            // set up edges points
            foreach (DictionaryEntry de in this.EdgeArgs)
            {
                IEdge             e    = (IEdge)de.Key;
                EdgeKeysEventArgs args = (EdgeKeysEventArgs)de.Value;
                if (!this.graph.ContainsEdge(args.Edge))
                {
                    throw new Exception("could not find edge");
                }

                Connection conn = this.graph.EdgeConnections[e];
                ArrayList  list = new ArrayList();
                foreach (PointF p in args.Keys)
                {
                    list.Add(new PointF(p.X * this.PositionScale, p.Y * this.PositionScale));
                }

                conn.AddPoints(list);
            }
        }
Esempio n. 5
0
 private void LayEdge(object sender, EdgeKeysEventArgs e)
 {
     this.edgeArgs[e.Edge] = e;
 }