ContainerNode
open class ContainerNode : DiagramNode, LayoutContainer
Implements nodes that can contain other nodes. Inherits DiagramNode and LayoutContainer.
-
Initializes a new instance of the ContainerNode class.
Declaration
Swift
public override init()Return Value
The newly created ContainerNode object.
-
Draws the contents of the current container onto the specified canvas with the specified RenderOptions.
Declaration
Swift
open override func draw(_ canvas: Canvas, options: RenderOptions)Parameters
canvasThe canvas onto which the contents is drawn.
optionsThe RenderOptions used by the drawing.
-
Draws the bounding rectangle of the current continer node onto the specified canvas with the specified RenderOptions.
Declaration
Swift
open override func drawLocal(_ canvas: Canvas, options: RenderOptions)Parameters
canvasThe canvas onto which the bounding rectangle is drawn.
optionsThe RenderOptions used by the drawing.
-
Draws the Manipulators for the current container onto the specified canvas.
Declaration
Swift
open override func drawManipulators(_ canvas: Canvas)Parameters
canvasThe canvas onto which the Manipulators are drawn.
-
Tests whether the specified point is within the Manipulator of a diagram object and triggers the manipulator.
Declaration
Swift
open override func hitTestManipulators(_ point: Point) -> Manipulator?Parameters
pointA Point instance specifying the point to test.
Return Value
The Manipulator at the specified location; nil if none is found.
-
Specifies if the ContainerNode is foldable.
Declaration
Swift
open var foldable: Bool { get set } -
Loads the contents of this ContainerNode from the specified XmlContext and under the specified XmlElement.
Declaration
Swift
open override func loadFromXml(_ element: XmlElement, context: XmlContext)Parameters
elementThe XmlElement to load the container from.
contextThe XmlContext that contains the element to load the contents of the container from.
-
Saves the contents of this ContainerNode in the specified XmlContext and under the specified XmlElement.
Declaration
Swift
open override func saveToXml(_ element: XmlElement, context: XmlContext)Parameters
elementThe XmlElement under which the container’s contents is saved.
contextThe XmlContext that will contain the newly created XML element that holds the contents of the container.
-
Gets the Id of the ContainerNode class.
Declaration
Swift
open override func getClassId() -> StringReturn Value
A string that contains the container.
-
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) -
Looks for a
Stylethat defines an appearance property’s value in specifiedTheme. OverridesDiagramNode.resolveInheritedStyle(...).Declaration
Swift
open override func resolveInheritedStyle( _ check: StyleCheck, theme: Theme?) -> Style?Parameters
checkA
StyleCheckpredicate that verifies if property is set.Return Value
The
Styleif resolved, or nil otherwise. -
Adds the specified node to this container.
Declaration
Swift
open func add(_ node: DiagramNode)Parameters
nodeThe DiagramNode to add.
-
Removes the specified node from this container.
Declaration
Swift
open func remove(_ node: DiagramNode)Parameters
nodeThe DiagramNode to remove.
-
Tests if the specified point is within the bounds of the specified DiagramItem.
Declaration
Swift
open override func hitTest(_ point: Point, filter: (DiagramItem) -> Bool) -> DiagramItem?Parameters
pointThe Point to test.
filterA lambda expression, which evaluates the DiagramItem to be returned as a result.
Return Value
The DiagramItem at the specified Point and filtered by the lambda expression; nil if none is found.
-
Tests if the specified point is within the bounding rectangle of this container.
Declaration
Swift
open override func hitTest (_ point: Point, threshold: Double, onlyNodes: Bool, onlyInteractive: Bool) -> DiagramItem?Parameters
pointThe Point to test.
thresholdA double value, which specifies an approximation within which the Point would still be considered as part of the container’s bounding rectangle.
onlyNodesSpecifies if only DiagramNode-s will be tested.
Return Value
The DiagramItem at the specified Point,
which fulfills the given requirements; nil if none is found. -
Performs initialization operations.
Declaration
Swift
open override func onLoad() -
Gets the height of the node’s caption.
Declaration
Swift
open var captionHeight: Double -
Gets a list with the DiagramNode objects that are children of this container.
Declaration
Swift
open var children: [DiagramNode] -
Checks if the container is visible.
Declaration
Swift
open override var visible: Bool { get set }Return Value
true if the this container node is visible; otherwise false.
-
Checks if the container is folded.
Declaration
Swift
open var folded: Bool { get set }Return Value
true if the this container node is foled; otherwise false.
-
Undocumented
Declaration
Swift
open func arrange(_ layout: Layout) -
Specifies if the children of the container must be clipped.
Declaration
Swift
open var clipChildren: Bool -
Specifies the unfolded size of this container.
Declaration
Swift
open var unfoldedSize: Size -
Specifies if the user can add nodes to the container.
Declaration
Swift
open var allowAddChildren: Bool -
Specifies if the user can remove nodes from the container.
Declaration
Swift
open var allowRemoveChildren: Bool -
Specifies the margin of the container.
Declaration
Swift
open var margin: Double -
Specifies if the container can automatically increase its size when needed.
Declaration
Swift
open var autoGrow: Bool
ContainerNode Class Reference