ixfx
    Preparing search index...

    Class BoxAbstract

    Box

    Hierarchy (View Summary)

    Constructors

    • Constructor.

      If parent is provided, parent.onChildAdded(this) is called.

      Parameters

      • parent: undefined | Box

        parent box

      • id: string

        id of this box

      Returns Box

    Properties

    _layoutPosition: undefined | Geometry.Point
    _measuredSize: undefined | Geometry.Rect
    _needsDrawing: boolean = true
    _needsLayoutX: boolean = true
    _needsMeasuring: boolean = true
    _parent: undefined | Box
    _ready: boolean = true
    canvasRegion: Geometry.RectPositioned = RectsPlaceholderPositioned

    Rectangle Box occupies in canvas/etc

    children: Box[] = []
    debugHue: number = ...
    debugLayout: boolean = false
    id: string
    takesSpaceWhenInvisible: boolean = false

    Accessors

    • get desiredRegion(): undefined | BoxRect

      Gets the box's desired region, or undefined

      Returns undefined | BoxRect

    • set desiredRegion(v: undefined | BoxRect): void

      Sets the box's desired region. Calls onLayoutNeeded()

      Parameters

      Returns void

    • get root(): Box

      Returns the root box

      Returns Box

    • get visible(): boolean

      Gets visible state

      Returns boolean

    • set visible(v: boolean): void

      Sets visible state

      Parameters

      • v: boolean

      Returns void

    Methods

    • Debug log from this box context

      Parameters

      • m: any

      Returns void

    • Parameters

      • _reason: string

      Returns void

    • Returns Generator<never, ArrayIterator<[number, Box]>, unknown>

    • Returns true if box is a child

      Parameters

      Returns boolean

    • Parameters

      Returns boolean

    • Calls notifyChildLayoutNeeded

      Parameters

      • reason: string

      Returns void

    • Applies actual size, returning true if size is different than before

      1. Sets _needsLayout to false.
      2. Sets visual to m
      3. Calls measureApply on each child
      4. If there's a change or force, sets needsDrawing to true, and notifies root of measureApplied

      Parameters

      Returns boolean

    • Prepare for measuring

      Returns void

    • Start of measuring

      1. Keeps track of measurements in opts.measurements
      2. If this box takes space 2.1. Measure itself if needed 2.2. Use size
      3. Calls measureStart on each child

      Parameters

      Returns undefined | Measurement

      Measurement

    • Sends a message to all child boxes.

      This first calls onNotify on this instance, before calling notify() on each child.

      Parameters

      • message: string
      • source: Box

      Returns void

    • Notification a child box has been added

      Throws if

      • child has parent as its own child
      • child is same as this
      • child is already child of this

      Parameters

      Returns void

    • Handles a received message

      Parameters

      • _message: string
      • _source: Box

      Returns void

    • Sets _ready to ready. If includeChildren is true, setReady is called on each child

      Parameters

      • ready: boolean
      • includeChildren: boolean = false

      Returns void

    • Update

      1. Calls this.updateBegin() to initialise measurement state
      2. In a loop, run measureStart() and then measureApply if possible
      3. Call updateDone when finished

      Parameters

      • context: object
      • force: boolean = false

        Force update

      Returns void

    • Parameters

      • measureChanged: boolean
      • layoutChanged: boolean

      Returns void