ConnectionPoint
open class ConnectionPoint
This class represents a connection between an edge and a node in a graph. It decouples the DiagramLink class from the DiagramNode class, allowing edges to connect different types of nodes without knowing anything of their implementation details. Each DiagramLink objects contains two ConnectionPoint instances describing the connections at both ends of the link.
-
The DiagramNode associated with this connection point.
Declaration
Swift
weak open var node: DiagramNode!
-
The DiagramLink associated with this connection point.
Declaration
Swift
weak open var link: DiagramLink!
-
Declaration
Swift
public init(node: DiagramNode, link: DiagramLink, incoming: Bool)
Parameters
node
The node whose connection to a link is managed by this ConnectionPoint.
link
incoming
Specifies which end of the link is represented by this ConnectionPoint.
Return Value
The newly created ConnectionPoint instance.
-
Moves the appropriate end of this ConnectionPoint to a DiagramNode border point, which is closest to the specified point.
Declaration
Swift
open func alignToNode(_ point: Point)
Parameters
point
The Point, against which the DiagramNode border position will be calculated.
-
Saves the relative position of the link associated with this ConnectionPoint.
Declaration
Swift
open func saveRelativePosition()
-
Gets the position of the DiagramLink according to the current DiagramNode position.
Declaration
Swift
open func positionFromNode() -> Point
-
Gets the AnchorPoint according to the AnchorPattern of the DiagramLink.
Declaration
Swift
open func getAnchorPoint() -> AnchorPoint?
Return Value
The AnchorPoint, which corresponds to the AnchorPattern of the link; nil if none is found.