Ejemplo n.º 1
0
        /// <summary>
        /// creates the port visual if it does not exist, and sets the port location
        /// </summary>
        /// <param name="portLocation"></param>
        public void SetSourcePortForEdgeRouting(Point portLocation)
        {
            var box = new Core.Geometry.Rectangle(portLocation);
            box.Pad(UnderlyingPolylineCircleRadius);

            if (SourcePortIsPresent) {
                var prevBox = new Core.Geometry.Rectangle(SourcePortLocation);
                prevBox.Pad(UnderlyingPolylineCircleRadius);
                box.Add(prevBox);
            }

            SourcePortIsPresent = true;
            SourcePortLocation = portLocation;

            panel.Invalidate(MapSourceRectangleToScreenRectangle(box));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 
 /// </summary>
 public void RemoveSourcePortEdgeRouting()
 {
     if (SourcePortIsPresent) {
         var prevBox = new Core.Geometry.Rectangle(SourcePortLocation);
         prevBox.Pad(UnderlyingPolylineCircleRadius);
         panel.Invalidate(MapSourceRectangleToScreenRectangle(prevBox));
         SourcePortIsPresent = false;
     }
 }