/// <ToBeCompleted></ToBeCompleted> public ShapeConnectionInfo(ControlPointId ownPointId, Shape otherShape, ControlPointId otherPointId) { this.ownPointId = ownPointId; this.otherShape = otherShape; this.otherPointId = otherPointId; }
/// <summary> /// Called upon the passive shape of the connection by the active shape. /// If ownPointId is equal to ControlPointId.Reference, the global connection is meant. /// </summary> protected internal abstract void DetachGluePointFromConnectionPoint(ControlPointId ownPointId, Shape otherShape, ControlPointId gluePointId);
/// <ToBeCompleted></ToBeCompleted> public static ShapeConnectionInfo Create(ControlPointId ownPointId, Shape otherShape, ControlPointId otherPointId) { ShapeConnectionInfo result = ShapeConnectionInfo.Empty; result.ownPointId = ownPointId; result.otherShape = otherShape; result.otherPointId = otherPointId; return(result); }
/// <summary> /// Tests, whether a control point has at least one of a set of given capabilities. /// </summary> /// <param name="controlPointId"></param> /// <param name="controlPointCapability"></param> public abstract bool HasControlPointCapability(ControlPointId controlPointId, ControlPointCapabilities controlPointCapability);
/// <summary> /// Called upon the active shape of the connection, e.g. by a CurrentTool or a command. /// The active shape calculates the new position of it's GluePoint and moves it to the new position /// </summary> /// <param name="gluePointId">Id of the GluePoint connected to the moved ControlPoint</param> /// <param name="connectedShape">The passive shape of the connection</param> /// <param name="connectedPointId">Id of the ControlPoint that has moved</param> public abstract void FollowConnectionPointWithGluePoint(ControlPointId gluePointId, Shape connectedShape, ControlPointId connectedPointId);
/// <summary> /// Moves the given control point by the indicated distances if possible. /// </summary> /// <param name="pointId">Id of the point to move</param> /// <param name="deltaX">Distance on X axis</param> /// <param name="deltaY">Distance on Y axis</param> /// <param name="modifiers">Modifiers for the move action.</param> /// <returns>True, if the control point could be moved, else false.</returns> public abstract bool MoveControlPointBy(ControlPointId pointId, int deltaX, int deltaY, ResizeModifiers modifiers);
/// <summary> /// Retrieves the current control point position. /// </summary> /// <param name="controlPointId"></param> /// <returns></returns> public abstract Point GetControlPointPosition(ControlPointId controlPointId);
/// <summary> /// Tests, whether the shape is connected to a given other shape. /// </summary> /// <param name="ownPointId"> /// Id of shape's own connection point, which is to be tested. /// ControlPointId.Any, if any connection point is taken into account. /// </param> /// <param name="otherShape">Other shape. Null if any other shape is taken into account.</param> /// <returns>The ControlPointId of the connected shape.</returns> public abstract ControlPointId IsConnected(ControlPointId ownPointId, Shape otherShape);
/// <summary> /// Moves the given control point to the indicated coordinates if possible. /// </summary> /// <param name="pointId"></param> /// <param name="toX"></param> /// <param name="toY"></param> /// <param name="modifiers"></param> /// <returns>True, if the control point could be moved, else false.</returns> public bool MoveControlPointTo(ControlPointId pointId, int toX, int toY, ResizeModifiers modifiers) { Point ptPos = GetControlPointPosition(pointId); return(MoveControlPointBy(pointId, toX - ptPos.X, toY - ptPos.Y, modifiers)); }
/// <summary> /// Returns the connection info for given glue point or ShapeConnectionInfo.Empty if the given glue point is not connected. /// </summary> public abstract ShapeConnectionInfo GetConnectionInfo(ControlPointId gluePointId, Shape otherShape);
/// <summary> /// Retrieve information of the connection status of this shape. /// </summary> /// <param name="otherShape">Target shape of the connections to return. /// If null/Nothing, connections to all connected shapes are returned.</param> /// <param name="ownPointId">If a valid point id is given, all connections of this connection point are returned. /// If the constant ControlPointId.Any is given, connections of all connection points are returned.</param> public abstract IEnumerable <ShapeConnectionInfo> GetConnectionInfos(ControlPointId ownPointId, Shape otherShape);
/// <summary> /// Disconnects a shape's glue point from its connected shape. /// </summary> public abstract void Disconnect(ControlPointId ownPointId);
/// <summary> /// Called upon the active shape of the connection, e.g. by a tool or a command. /// If ownPointId is equal to ControlPointId.Reference, the global connection is meant. /// </summary> public abstract void Connect(ControlPointId ownPointId, Shape otherShape, ControlPointId otherPointId);
/// <summary> /// Returns true if the control point of this shape can be connected to the other shapes' control point. /// If the passive control point (the one the glue point is attached to) is equal to ControlPointId.Reference, /// the shape-to-shape connection is meant. /// </summary> public abstract bool CanConnect(ControlPointId ownPointId, Shape otherShape, ControlPointId otherPointId);