Ejemplo n.º 1
0
 /// <ToBeCompleted></ToBeCompleted>
 public ShapeConnectionInfo(ControlPointId ownPointId, Shape otherShape, ControlPointId otherPointId)
 {
     this.ownPointId   = ownPointId;
     this.otherShape   = otherShape;
     this.otherPointId = otherPointId;
 }
Ejemplo n.º 2
0
 /// <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);
Ejemplo n.º 3
0
        /// <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);
        }
Ejemplo n.º 4
0
 /// <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);
Ejemplo n.º 5
0
 /// <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);
Ejemplo n.º 6
0
 /// <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);
Ejemplo n.º 7
0
 /// <summary>
 /// Retrieves the current control point position.
 /// </summary>
 /// <param name="controlPointId"></param>
 /// <returns></returns>
 public abstract Point GetControlPointPosition(ControlPointId controlPointId);
Ejemplo n.º 8
0
 /// <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);
Ejemplo n.º 9
0
        /// <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));
        }
Ejemplo n.º 10
0
 /// <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);
Ejemplo n.º 11
0
 /// <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);
Ejemplo n.º 12
0
 /// <summary>
 /// Disconnects a shape's glue point from its connected shape.
 /// </summary>
 public abstract void Disconnect(ControlPointId ownPointId);
Ejemplo n.º 13
0
 /// <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);
Ejemplo n.º 14
0
 /// <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);