public Point FindClosestPoint(Point point) { if (simpleAssociationJunction != null) { return(JunctionGeometryHelper.FindClosestPoint(simpleAssociationJunction, point)); } else if (Diamond != null) { return(Diamond.GetBounds().GetCenter()); } else { return(GetBounds().GetCenter()); } }
/// <summary> /// Returns context menu items. /// </summary> /// <returns></returns> internal IEnumerable <ContextMenuItem> GeneralizationMenuItems() { ContextMenuItem addCommentary = new ContextMenuItem("Add commentary"); addCommentary.Click += delegate { NewModelCommentToDiagramCommand command = (NewModelCommentToDiagramCommand)CommandFactoryBase <NewModelCommentaryToDiagramCommandFactory> .Factory().Create(Controller.DiagramController); command.AnnotatedElement = Generalization; Point p = JunctionGeometryHelper.FindClosestPoint(GeneralizationJunction, GeneralizationJunction.GetBounds().GetCenter()); command.X = p.X + 20; command.Y = p.Y + 20; command.Set(Controller.DiagramController.ModelController, null); command.Execute(); }; return(new ContextMenuItem[] { addCommentary }); }
/// <summary> /// Finds the closest point. /// </summary> /// <param name="point">The point.</param> /// <returns></returns> Point IPrimitiveJunctionTarget.FindClosestPoint(Point point) { return(JunctionGeometryHelper.FindClosestPoint(Junction, point)); }
public Point FindClosestPoint(Point point) { return(JunctionGeometryHelper.FindClosestPoint(this, point)); }
/// <summary> /// Finds the closest point. /// </summary> /// <param name="point">The point.</param> /// <returns></returns> public Point FindClosestPoint(Point point) { return(JunctionGeometryHelper.FindClosestPoint(GeneralizationJunction, point)); }