BlockLayout

@objcMembers open class BlockLayout: Layout

Abstract class for storing information on how to render and position a Block on-screen.

  • Flag that should be used when self.highlighted has been updated

    Declaration

    Swift

    public static let Flag_UpdateHighlight = LayoutFlag(0)
  • Flag that should be used when self.visible has been updated

    Declaration

    Swift

    public static let Flag_UpdateVisible = LayoutFlag(1)
  • Flag that should be used when any direct connection on this block has updated its highlight value

    Declaration

    Swift

    public static let Flag_UpdateConnectionHighlight = LayoutFlag(2)
  • The Block to layout.

    Declaration

    Swift

    public final let block: Block
  • The corresponding layout objects for self.block.inputs[]

    Declaration

    Swift

    open fileprivate(set) var inputLayouts = [InputLayout]()
  • The corresponding layout object for self.block.mutator

    Declaration

    Swift

    open var mutatorLayout: MutatorLayout? = nil
  • A list of all FieldLayout objects belonging under this BlockLayout.

    Declaration

    Swift

    open var fieldLayouts: [FieldLayout]
  • The parent block group layout

    Declaration

    Swift

    open var parentBlockGroupLayout: BlockGroupLayout?
  • The top most block group layout for this block

    Declaration

    Swift

    open var rootBlockGroupLayout: BlockGroupLayout?
  • The first draggable BlockLayout up the layout tree. If there is no BlockLayout exists up the layout tree, this value is nil.

    Declaration

    Swift

    open var draggableBlockLayout: BlockLayout?
  • Flag if this block should be highlighted

    Declaration

    Swift

    open var highlighted: Bool = false
  • Flag indicating if this block should be visible

    Declaration

    Swift

    open var visible: Bool = true
  • Flag determining if user interaction should be enabled for the corresponding view.

    Declaration

    Swift

    open var userInteractionEnabled: Bool
  • The position of the block’s leading edge X offset, specified as a Workspace coordinate system unit.

    Declaration

    Swift

    open var leadingEdgeXOffset: CGFloat
  • The line height of the first line in the block layout, specified as a Workspace coordinate system unit. It is used for vertical alignment purposes and should be updated during performLayout(includeChildren:).

    Declaration

    Swift

    open var firstLineHeight: CGFloat = 0
  • Flag indicating if this block is disabled, which means it will be excluded from code generation.

    Declaration

    Swift

    open var disabled: Bool
  • Flag indicating if input connectors should be drawn inside a block (true) or on the edge of the block (false).

    Declaration

    Swift

    open var inputsInline: Bool
  • The comment text of the block.

    Declaration

    Swift

    open var comment: String
  • Appends an inputLayout to self.inputLayouts and sets its parentLayout to this instance.

    Declaration

    Swift

    open func appendInputLayout(_ inputLayout: InputLayout)
  • Removes self.inputLayouts[index], sets its parentLayout to nil, and returns it.

    Declaration

    Swift

    open func removeInputLayout(atIndex index: Int) -> InputLayout

    Return Value

    The BlockLayout that was removed.

  • Clears self.inputLayouts and self.mutatorLayout, and sets their parentLayout to nil.

    Declaration

    Swift

    open func reset(updateLayout: Bool = true)
  • Adds a highlight source to a given connection on this block.

    If there were no previous highlight sources for this connection, a Flag_UpdateHighlight change event is triggered in order to update connection highlighting for this block.

    Declaration

    Swift

    public func addHighlightSource(sourceUUID: String, forConnection connection: Connection)
  • Removes a highlight source from a given connection on this block.

    If there are no more highlight sources for the given connection (after this one is removed), a Flag_UpdateHighlight change event is triggered in order to update connection highlighting for this block.

    Declaration

    Swift

    public func removeHighlightSource(sourceUUID: String, forConnection connection: Connection)
  • Returns if a connection is highlighted on this block.

    Declaration

    Swift

    public func isConnectionHighlighted(_ connection: Connection) -> Bool

    Return Value

    true if the connection has at least one highlight source. false otherwise.

  • Returns if there are connections that have been highlighted on this block.

    Declaration

    Swift

    public func hasHighlightedConnections() -> Bool

    Return Value

    true if any connections have been highlighted on this block. false otherwise.