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.
-
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 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 specifiedTheme
. OverridesDiagramItem.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 }
-
Undocumented
Declaration
Swift
open func move(x: Double, y: Double, updateDependencies: Bool)
-
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 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.