Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LayoutModel

Hierarchy

  • TreeModel<Models.Layout.INode>
    • LayoutModel

Implements

  • IDisposable

Index

Constructors

Protected constructor

  • new LayoutModel(nodes: Models.Layout.INode[], dashboard: Dashboard): LayoutModel

Properties

Private dashboard

dashboard: Dashboard

Protected idCache

idCache: Map<string, Readonly<Models.Layout.INode>>

isDisposed

isDisposed: boolean

nodes

nodes: ReadonlyArray<Readonly<Models.Layout.INode>>

onUpdated

onUpdated: Observable<void>

Protected onUpdatedSrc

onUpdatedSrc: Subject<void>

Protected roots

roots: Models.Layout.INode[]

Methods

__@iterator

  • __@iterator(): Iterator<Readonly<Models.Layout.INode>>
  • Returns Iterator<Readonly<Models.Layout.INode>>

Private _onFocused

  • _onFocused(_sender: LayoutManager, focusedRegion: DashboardLayoutRegion<any> | null): void

addNewNode

  • addNewNode(node: TreeNode, newParent: string | undefined, index: number): Promise<void>
  • Parameters

    • node: TreeNode
    • newParent: string | undefined
    • index: number

    Returns Promise<void>

deleteNode

  • deleteNode(node: Models.Layout.INode): void

dispose

  • dispose(): void

Protected fillIdCache

  • fillIdCache(): void
  • Returns void

get

  • get(key: string): Readonly<Models.Layout.INode> | undefined
  • Parameters

    • key: string

    Returns Readonly<Models.Layout.INode> | undefined

Protected indexOfNode

  • indexOfNode(node: Models.Layout.INode): number
  • Parameters

    • node: Models.Layout.INode

    Returns number

Private insertNodeIntoParent

  • insertNodeIntoParent(toInsert: Models.Layout.INode, idx: number, parent?: _NodeData): Models.Layout.INode
  • Insert a childless node into a given parent.

    The parent must be different from the node's current parent.

    Parameters

    • toInsert: Models.Layout.INode

      The node to insert

    • idx: number

      The index to insert the node into

    • Optional parent: _NodeData

    Returns Models.Layout.INode

    The inserted node

moveNode

  • moveNode(node: Models.Layout.INode, newParent: string | undefined, index: number): Promise<void>
  • Parameters

    • node: Models.Layout.INode
    • newParent: string | undefined
    • index: number

    Returns Promise<void>

Private removeNodeFromParent

  • removeNodeFromParent(toRemove: Models.Layout.INode): Models.Layout.INode
  • Unmount a node from it's parent.

    Parameters

    • toRemove: Models.Layout.INode

      The node to remove from the tree

    Returns Models.Layout.INode

    The removed node, with it's parent corrected.

Protected replaceNode

  • replaceNode(oldNode: Models.Layout.INode, newNode: Models.Layout.INode): Models.Layout.INode
  • Parameters

    • oldNode: Models.Layout.INode
    • newNode: Models.Layout.INode

    Returns Models.Layout.INode

selectNode

  • selectNode(key: string): void

update

  • update(key: string, node: Readonly<Partial<Models.Layout.INode>>): void
  • Parameters

    • key: string
    • node: Readonly<Partial<Models.Layout.INode>>

    Returns void

Static Create

  • Create<_NodeData>(nodes: (object & object)[]): TreeModel<_NodeData>
  • Type parameters

    • _NodeData: TreeNode

    Parameters

    • nodes: (object & object)[]

    Returns TreeModel<_NodeData>

Static CreateModel

Static Protected InsertParentRefsAndDefaults

  • InsertParentRefsAndDefaults<T>(nodes: (object & object)[]): T[]
  • Type parameters

    • T: TreeNode

    Parameters

    • nodes: (object & object)[]

    Returns T[]

Static Protected IsValidUpdate

  • IsValidUpdate(node: Partial<TreeNode>): boolean
  • Parameters

    • node: Partial<TreeNode>

    Returns boolean

Static Protected VerifyNodeKeyUniqueness

  • VerifyNodeKeyUniqueness(nodes: (object & object)[]): boolean
  • Parameters

    • nodes: (object & object)[]

    Returns boolean

Generated using TypeDoc