DiagramNode

open class DiagramNode : DiagramItem, InplaceEditable

Represents a node in the diagram.

  • Initializes a new instance of the DiagramNode class.

    Declaration

    Swift

    public override init()
  • Creates a connection point between this node and the specified link at the specified point.

    Declaration

    Swift

    open func createConnectionPoint(
        _ link: DiagramLink,
        point: Point,
        incoming: Bool)
        -> ConnectionPoint

    Parameters

    link

    A DiagramLink that should be connected to this node.

    point

    The point at which the link should be connected.

    incoming

    true if link is an incoming link, otherwise, false.

  • Gets the node point nearest to the specified point for the specified link.

    Declaration

    Swift

    open func getNearestAnchorPoint(_ point: Point, link: DiagramLink, incoming: Bool) -> (Point, Int)

    Parameters

    point

    The point to which a nearest node point is searched.

    link

    The DiagramLink, which comes / goes in/from the specified point.

    incoming

    true if the DiagramLink is incoming, otherwise false.

    Return Value

    The nearest anchor point and its index.

  • Gets the point at the border of this diagram node nearest to the specified point.

    Declaration

    Swift

    open func getNearestBorderPoint(_ point: Point) -> Point

    Parameters

    point

    The point to which a nearest border point is searched.

    Return Value

    The nearest border point.

  • Gets an array of points that represent the outline for this node.

    Declaration

    Swift

    open func getOutline() -> [Point]

    Return Value

    A list with points.

  • Undocumented

    Declaration

    Swift

    open func getTextToEdit() -> String
  • Undocumented

    Declaration

    Swift

    open func setEditedText(_ text: String)
  • Undocumented

    Declaration

    Swift

    open func getEditRect(_ item: DiagramItem?, pointerPosition: Point) -> Rect
  • Undocumented

    Declaration

    Swift

    open func raiseItemTextEditing(_ oldText: String, newText: String)
  • Undocumented

    Declaration

    Swift

    open func raiseItemTextEdited(_ oldText: String, newText: String)
  • Undocumented

    Declaration

    Swift

    open func getEditedItem() -> DiagramItem
  • Gets all diagram links connected to this node.

    Declaration

    Swift

    open func getAllLinks() -> [DiagramLink]

    Return Value

    An array of DiagramLink-s.

  • Gets all diagram links coming into this node.

    Declaration

    Swift

    open func getAllIncomingLinks() -> [DiagramLink]

    Return Value

    An array of DiagramLink-s.

  • Gets all diagram links going out of this node.

    Declaration

    Swift

    open func getAllOutgoingLinks() -> [DiagramLink]

    Return Value

    An array of DiagramLink-s.

  • Gets or sets a value indicating whether this node is considered an obstacle by the link-routing algorithm.

    Declaration

    Swift

    open var obstacle: Bool
  • Checks if any of the adjustment handles for this node contain the specified point.

    Declaration

    Swift

    open override func hitTestHandle(_ point: Point) -> AdjustmentHandle?

    Parameters

    point

    The point to test.

  • Draws this DiagramNode at the specified canvas with the specified render options. Overrides DiagramItem.draw.

    Declaration

    Swift

    open override func draw(_ canvas: Canvas, options: RenderOptions)

    Parameters

    canvas

    The canvas onto which the node is drawn.

    options

    The RenderOptions when the node is drawn.

  • Draws this DiagramNode at the specified canvas with the specified render options.

    Declaration

    Swift

    open func drawLocal(_ canvas: Canvas, options: RenderOptions)

    Parameters

    canvas

    The canvas onto which the node is drawn.

    options

    The RenderOptions when the node is drawn.

  • Draws the handles of this DiagramNode at the specified canvas.

    Declaration

    Swift

    open override func drawHandles(_ canvas: Canvas)

    Parameters

    canvas

    The canvas onto which the handles are drawn.

  • Draws the anchors of this DiagramNode at the specified canvas.

    Declaration

    Swift

    open func drawAnchors(_ canvas: Canvas)

    Parameters

    canvas

    The canvas onto which the anchors are drawn.

  • Draws the Manipulators of this DiagramNode at the specified canvas. Overrides DiagramItem.drawManipulators.

    Declaration

    Swift

    open override func drawManipulators(_ canvas: Canvas)

    Parameters

    canvas

    The canvas onto which the handles are drawn.

  • Collapses all child nodes of this node.

    Declaration

    Swift

    open func collapse(_ collapsedSet: inout Set<Weak<DiagramItem>>?)

    Parameters

    collapsedSet

    A collection of DiagramItem-s that are children of this item.

  • Expands all child nodes of this node.

    Declaration

    Swift

    open func expand()
  • Tests if the specified point falls within the bounds of any of the Manipulators of this node.

    Declaration

    Swift

    open override func hitTestManipulators(_ point: Point) -> Manipulator?

    Parameters

    point

    The point to test.

    Return Value

    The Manipulator within whose bounds the point falls.

  • Loads this diagram node from the specified XML context and element. Overrides DiagramItem.loadFromXml.

    Declaration

    Swift

    open override func loadFromXml(_ element: XmlElement, context: XmlContext)

    Parameters

    element

    The XmlElement, which contains this diagram node.

    context

    The XmlContext, which contains this diagram node.

  • Saves this diagram node into the specified XML context and element. Overrides DiagramItem.saveToXml.

    Declaration

    Swift

    open override func saveToXml(_ element: XmlElement, context: XmlContext)

    Parameters

    element

    The XmlElement, where the diagram node will be saved.

    context

    The XmlContext, where the diagram node will be saved.

  • Checks if this diagram node contains the specified point. Overrides DiagramItem.containsPoint.

    Declaration

    Swift

    open override func containsPoint(_ point: Point) -> Bool

    Parameters

    point

    The Point to check.

    Return Value

    true if the Point is within this diagram node; otherwise false.

  • Checks if this diagram node contains the specified point within the specified offset. Overrides DiagramItem.containsPoint.

    Declaration

    Swift

    open override func containsPoint(_ point: Point, threshold: Double) -> Bool

    Parameters

    point

    The Point to check.

    threshold

    The offset, within which a Point outside the diagram node would still be considered within the node’s bounds.

    Return Value

    true if the Point is within this diagram node; otherwise false.

  • Gets the id for the class. Overrides DiagramItem.getClassId.

    Declaration

    Swift

    open override func getClassId() -> String

    Return Value

    The id of the class.

  • Looks for a Style that defines an appearance property’s value in specified Theme. Overrides DiagramItem.resolveInheritedStyle(...).

    Declaration

    Swift

    open override func resolveInheritedStyle(_ check: StyleCheck, theme: Theme?) -> Style?

    Parameters

    check

    A StyleCheck predicate that verifies if property is set.

    Return Value

    The Style if resolved, or nil otherwise.

  • Attaches the specified node to this node.

    Declaration

    Swift

    open func attachToNode(_ node: DiagramNode, from: AttachToNode)

    Parameters

    node

    The DiagramNode to which this node is attached.

    from

    One of the AttachToNode enumeration values, which describe how the node gets attached.

  • Attaches the specified link to this node.

    Declaration

    Swift

    open func attachToLink(_ link: DiagramLink, from: AttachToLink)

    Parameters

    link

    The DiagramLink to which this node is attached.

    from

    One of the AttachToLink enumeration values, which describe how the link gets attached.

  • Detaches all links and nodes from the node.

    Declaration

    Swift

    open func detach()
  • Gets the container of this node.

    Declaration

    Swift

    open var container: ContainerNode? { get }

    Return Value

    The ContainerNode that contains this node or nil if none is found.

  • Create state storage for the diagram item.

    Declaration

    Swift

    open override func createState() -> DiagramItemState
  • Saves the state of the diagram item.

    Declaration

    Swift

    open override func saveState() -> DiagramItemState
  • Restores the state of the diagram item.

    Declaration

    Swift

    open override func restoreState(_ state: DiagramItemState)
  • Checks if the specified node is attached to this node.

    Declaration

    Swift

    open func containsAttachedNode(_ node: DiagramNode) -> Bool

    Parameters

    node

    The DiagramNode to check.

    Return Value

    true if the node is attached; otherwise false.

  • Gets the rotation angle of this node.

    Declaration

    Swift

    open func getRotationAngle() -> Double

    Return Value

    The rotation angle.

  • Gets the bounds of this diagram node. Overrides DiagramItem.getBounds().

    Declaration

    Swift

    open override func getBounds() -> Rect

    Return Value

    A rectangle that represents the bounds.

  • The bounds of this node.

    Declaration

    Swift

    open var bounds: Rect { get set }
  • Sets the bounds of this node.

    Declaration

    Swift

    open func setBounds(_ value: Rect, updateDependencies: Bool)

    Parameters

    value

    A rectangle that contains the bounds.

    updateDependencies

    true if the dependencies should be updated; otherwise false.

  • Undocumented

    Declaration

    Swift

    open func onUpdateBounds(_ oldRect: Rect, _ newRect: Rect)
  • Undocumented

    Declaration

    Swift

    open func move(x: Double, y: Double, updateDependencies: Bool)
  • Gets the intersection of the specified segment and this node.

    Declaration

    Swift

    public func getIntersection(_ segmentStart: Point, segmentEnd: Point) -> Point

    Parameters

    segmentStart

    The start Point of the segment.

    segmentEnd

    The end Point of the segment.

    Return Value

    The intersection Point.

  • A CompositeLinkArray with all links for this node.

    Declaration

    Swift

    open lazy var links: CompositeLinkArray { get set }
  • An array with all DiagramLink-s that come into this node.

    Declaration

    Swift

    open var incomingLinks: [DiagramLink]
  • An array with all DiagramLink-s that go out of this node.

    Declaration

    Swift

    open var outgoingLinks: [DiagramLink]
  • The Attachment of this node; nil if there is none.

    Declaration

    Swift

    open var attachment: Attachment?
  • The DiagramItem master of this node.

    Declaration

    Swift

    open var master: DiagramItem? { get }
  • The Constraints of this node.

    Declaration

    Swift

    open var constraints: Constraints?
  • The color used for filling this node.

    Declaration

    Swift

    open var fillColor: Color { get set }
  • The AnchorPattern of this node.

    Declaration

    Swift

    open var anchorPattern: AnchorPattern? { get set }
  • The angle of rotation of the node.

    Declaration

    Swift

    open var rotationAngle: Double { get set }
  • Specifies if this node can be expanded.

    Declaration

    Swift

    open var expandable: Bool { get set }
  • Specifies if this node is expanded.

    Declaration

    Swift

    open var expanded: Bool
  • Specifies the NodeExpander of the node.

    Declaration

    Swift

    open var expander: NodeExpander?
  • Specifies the collapsed DiagramItem-s that are children of this node.

    Declaration

    Swift

    open var collapsedSet: Set<Weak<DiagramItem>>?
  • Checks if this is a top level item. Overrides DiagramItem.isTopLevel.

    Declaration

    Swift

    open override func isTopLevel() -> Bool

    Return Value

    true if this is a top level item; otherwise false.