Shape

open class Shape

Represents a diagram shape.

  • Draws this Shape on the specified canvas.

    Declaration

    Swift

    open func draw(_ canvas: Canvas, targetRect: Rect, flipX: Bool = false, flipY: Bool = false)

    Parameters

    canvas

    The canvas onto which the shape is drawn.

    targetRect

    The rectangle where the Shape is drawn.

  • Loads this Shape from the specified XML context and element.

    Declaration

    Swift

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

    Parameters

    element

    The XmlElement, which contains this Shape. The value can be nil.

    context

    The XmlContext, which contains this Shape.

  • Fills the Shape.

    Declaration

    Swift

    public func fillShape(_ canvas: Canvas, elements: [ShapeSegment?], targetRect: Rect)

    Parameters

    canvas

    The canvas where the Shape is drawn.

    elements

    An array with ShapeSegment objects that build this Shape.

    targetRect

    The rectangle where the Shape is drawn.

  • Loads the segments of this Shape from the specified XmlElement.

    Declaration

    Swift

    open func loadSegments(_ xmlRoot: XmlElement?, elementName: String) -> [ShapeSegment?]

    Parameters

    xmlRoot

    The XmlElement, which is the root.

    elementName

    The name of the element to load.

    Return Value

    An array with ShapeSegment objects; nil if none are loaded.

  • Undocumented

    Declaration

    Swift

    public static func fromId(id: String) -> Shape?
  • id

    Gets or sets the id of the Shape.

    Declaration

    Swift

    open var id: String
  • Gets or sets the outline of the Shape. An array of ShapeSegment objects.

    Declaration

    Swift

    open var outline: [ShapeSegment?]
  • Gets or sets the decorations of the Shape. An array of ShapeSegment objects.

    Declaration

    Swift

    open var decorations: [ShapeSegment?]
  • Gets or sets the filled decorations of the Shape. An array of ShapeSegment objects.

    Declaration

    Swift

    open var filledDecorations: [[ShapeSegment?]]
  • Gets or sets the brushes for the Shape. An array of Brush-es.

    Declaration

    Swift

    open var brushes: [Brush?]
  • Gets or sets the inset of the link segment.

    Declaration

    Swift

    open var linkSegmentInset: Double