ShapeNode

open class ShapeNode : DiagramNode

ShapeNode instances are diagram nodes that represent geometric shapes.

  • Initializes a new instance of the ShapeNode class.

    Declaration

    Swift

    public override init()

    Return Value

    The newly created ShapeNode object.

  • Draws the node using the specified canvas object.

    Declaration

    Swift

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

    Parameters

    canvas

    A canvas object where the node should be rendered.

    options

    Provides options for the drawing operation.

  • Makes the shape node big enough to display its text without clipping.

    Declaration

    Swift

    public func resizeToFitText()
  • Loads this shape node from the specified XML context and element. Overrides DiagramNode.loadFromXml.

    Declaration

    Swift

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

    Parameters

    element

    The XmlElement, which contains this shape node.

    context

    The XmlContext, which contains this shape node.

  • Saves this shape node into the specified XML context and element. Overrides DiagramNode.saveToXml.

    Declaration

    Swift

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

    Parameters

    element

    The XmlElement, where the shape node will be saved.

    context

    The XmlContext, where the shape node will be saved.

  • 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)
  • Saves the state of this node. Overrides DiagramNode.saveState.

    Declaration

    Swift

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

    Declaration

    Swift

    open override func restoreLocationState(_ state: DiagramItemState)
  • Gets the id for the class. Overrides DiagramNode.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 DiagramNode.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.

  • Gets the outline of this shape node.

    Declaration

    Swift

    open override func getOutline() -> [Point]

    Return Value

    A list with Point-s that represent the outline.

  • Undocumented

    Declaration

    Swift

    public var flipX: Bool { get set }
  • Undocumented

    Declaration

    Swift

    public var flipY: Bool { get set }
  • Undocumented

    Declaration

    Swift

    public var allowFlip: Bool
  • Specifies the Shape of this ShapeNode. The value can be nil.

    Declaration

    Swift

    open var shape: Shape?
  • Specifies the image of this ShapeNode. The value can be nil.

    Declaration

    Swift

    open var image: UIImage?
  • Specifies the ImageAlign of this ShapeNode.

    Declaration

    Swift

    open var imageAlign: ImageAlign
  • Gets or sets a value indicating whether this shape node is transparent.

    Declaration

    Swift

    open var transparent: Bool