示例#1
0
 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());
     }
 }
示例#2
0
        /// <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 });
        }
示例#3
0
 /// <summary>
 /// Finds the closest point.
 /// </summary>
 /// <param name="point">The point.</param>
 /// <returns></returns>
 Point IPrimitiveJunctionTarget.FindClosestPoint(Point point)
 {
     return(JunctionGeometryHelper.FindClosestPoint(Junction, point));
 }
示例#4
0
 public Point FindClosestPoint(Point point)
 {
     return(JunctionGeometryHelper.FindClosestPoint(this, point));
 }
示例#5
0
 /// <summary>
 /// Finds the closest point.
 /// </summary>
 /// <param name="point">The point.</param>
 /// <returns></returns>
 public Point FindClosestPoint(Point point)
 {
     return(JunctionGeometryHelper.FindClosestPoint(GeneralizationJunction, point));
 }