private void considerLink(IDiagramLine l, IDiagramPort p, Search s, ArrayList items) { bool flag1 = (s & Search.NotSelf) == ((Search)0); if ((l.FromPort == p) && ((flag1 || (l.ToPort.DiagramShape == null)) || !l.ToPort.DiagramShape.IsChildOf(this))) { if ((s & Search.LinksOut) != ((Search)0)) { this.addItem(items, l); } if ((s & Search.NodesOut) != ((Search)0)) { this.addItem(items, l.ToNode); } } if ((l.ToPort == p) && ((flag1 || (l.FromPort.DiagramShape == null)) || !l.FromPort.DiagramShape.IsChildOf(this))) { if ((s & Search.LinksIn) != ((Search)0)) { this.addItem(items, l); } if ((s & Search.NodesIn) != ((Search)0)) { this.addItem(items, l.FromNode); } } }
public virtual void OnPortChanged(IDiagramPort port, int subhint, int oldI, object oldVal, RectangleF oldRect, int newI, object newVal, RectangleF newRect) { if (this.RealLink != null) { this.RealLink.OnPortChanged(port, subhint, oldI, oldVal, oldRect, newI, newVal, newRect); } this.LayoutChildren((port == null) ? null : port.DiagramShape); }
public virtual float GetAngle(IDiagramLine link) { if (link == null) { return(0f); } IDiagramPort port1 = link.GetOtherPort(this); if (port1 == null) { if (((link.FromPort != null) && (link.FromPort.DiagramShape != null)) && (link.FromPort.DiagramShape.Bounds == this.Bounds)) { port1 = link.ToPort; } else if (((link.ToPort != null) && (link.ToPort.DiagramShape != null)) && (link.ToPort.DiagramShape.Bounds == this.Bounds)) { port1 = link.FromPort; } } if (port1 == null) { return(0f); } DiagramShape obj1 = port1.DiagramShape; if (obj1 == null) { return(0f); } PointF tf1 = obj1.Center; PointF tf2 = base.Center; Shapes.LineGraph link1 = link as Shapes.LineGraph; if ((link1 == null) && (link is TextLine)) { link1 = ((TextLine)link).RealLink; } if ((link1 != null) && (link1.PointsCount > 0)) { if (link1.FromPort == port1) { tf1 = link1.GetPoint(0); } else { tf1 = link1.GetPoint(link1.PointsCount - 1); } } return(StrokeGraph.GetAngle(tf1.X - tf2.X, tf1.Y - tf2.Y)); }
private void findAllAux(DiagramShape obj, Search s, ArrayList items) { IDiagramPort port1 = obj as IDiagramPort; if (port1 != null) { if ((s & Search.Ports) != ((Search)0)) { this.addItem(items, port1); } DiagramPort port2 = port1 as DiagramPort; if (port2 != null) { PortLinkEnumerator enumerator1 = port2.Links.GetEnumerator(); while (enumerator1.MoveNext()) { IDiagramLine link1 = enumerator1.Current; this.considerLink(link1, port1, s, items); } } else { foreach (IDiagramLine link2 in port1.Links) { this.considerLink(link2, port1, s, items); } } } GroupShape group1 = obj as GroupShape; if (group1 != null) { GroupEnumerator enumerator5 = group1.GetEnumerator(); GroupEnumerator enumerator4 = enumerator5.GetEnumerator(); while (enumerator4.MoveNext()) { DiagramShape obj1 = enumerator4.Current; this.findAllAux(obj1, s, items); } } }
public IDiagramPort GetOtherPort(IDiagramPort p) { return(Shapes.LineGraph.GetOtherPort(this, p)); }
public IDiagramPort GetOtherPort(IDiagramPort p) { return Shapes.LineGraph.GetOtherPort(this, p); }
public virtual void OnPortChanged(IDiagramPort port, int subhint, int oldI, object oldVal, RectangleF oldRect, int newI, object newVal, RectangleF newRect) { if (port != null) { if ((subhint == 0x516) || (subhint == 0x517)) { if (((oldVal != newVal) || (this.AdjustingStyle == LineAdjustingStyle.Calculate)) || ((this.AdjustingStyle == LineAdjustingStyle.Scale) && this.Orthogonal)) { this.CalculateStroke(); } this.PortsOnLinkChanged(subhint, oldI, oldVal, oldRect, newI, newVal, newRect); } else if ((subhint != 0x6a6) && (subhint != 0x6a7)) { DiagramPort port1 = port.DiagramShape as DiagramPort; if (((port1 != null) && (port1 == this.FromPort)) && (this.PointsCount > 0)) { PointF tf1 = port1.GetFromLinkPoint(this.AbstractLink); PointF tf2 = this.GetPoint(0); if (!base.IsApprox(tf1.X, tf2.X) || !base.IsApprox(tf1.Y, tf2.Y)) { this.CalculateStroke(); } } else if (((port1 != null) && (port1 == this.ToPort)) && (this.PointsCount >= 2)) { PointF tf3 = port1.GetToLinkPoint(this.AbstractLink); PointF tf4 = this.GetPoint(this.PointsCount - 1); if (!base.IsApprox(tf3.X, tf4.X) || !base.IsApprox(tf3.Y, tf4.Y)) { this.CalculateStroke(); } } else { this.CalculateStroke(); } } } }
public static IDiagramPort GetOtherPort(IDiagramLine l, IDiagramPort p) { if (l.FromPort == p) { return l.ToPort; } if (l.ToPort == p) { return l.FromPort; } return null; }