Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SelfAdaptingMenus

Hierarchy

  • SelfAdaptingMenus

Index

Constructors

constructor

  • Create a new instance of SAM. This constructor is mainly meant for internal use only: for external uses, use static builder methods instead.

    Note: no more than one instance should be instanciated at the same time; running more at once may result in unexpected behaviours.

    Parameters

    • menuManager: MenuManager

      The menu manager instance to use.

    • Default value displayVisualControls: boolean = true

      Indicate whether to display the visual controls or not (visible on true).

    Returns SelfAdaptingMenus

Properties

VERSION

VERSION: string = "1.0.0"

Version of the library.

adaptationManager

adaptationManager: AdaptationManager

Adaptation manager single instance of the library.

Private dataManager

dataManager: DataManager

Data manager single instance of the library.

Private menuManager

menuManager: MenuManager

Menu manager single instance of the library.

Private visualControls

visualControls: VisualControls

Visual controls single instance of the library.

Methods

addMenu

  • addMenu(menu: Menu): void
  • Add a new adaptive menus, and update the current adaptation.

    Parameters

    • menu: Menu

      The menu to add.

    Returns void

clearHistory

  • clearHistory(): void
  • Clear all the recorded history, and update the current adaptation.

    Returns void

removeMenu

  • removeMenu(id: MenuID): void
  • Remove the adaptive menu with the given menu ID, and update the current adaptation. If there is no match for the given ID, nothing happens.

    Parameters

    • id: MenuID

      The ID of the menu to remove.

    Returns void

Static fromSelectors

  • Create a new instance of SAM from generic menu and item selectors.

    The menu node will also be the item group node. Item nodes are only searched inside the menu node.

    Parameters

    • menuSelector: Selector

      Selector of the menu (and group) node.

    • itemSelector: Selector

      Selector of all item nodes.

    Returns SelfAdaptingMenus

    A new instance of SAM.

  • Create a new instance of SAM from generic menu, group and item selectors.

    The menu node must not be a group node itself (see the variant of fromSelectors with two arguments instead).

    Group nodes are only searched inside the menu node. Item nodes are only searched inside the group node.

    Parameters

    • menuSelector: Selector

      Selector of the menu node.

    • groupSelector: Selector

      Selector of all group nodes.

    • itemSelector: Selector

      Selector of all item nodes.

    Returns SelfAdaptingMenus

    A new instance of SAM.

  • Create a new instance of SAM from specific selectors. See MenuSelectors for details on the expected structure of selectors.

    The menu node must not be a group node itself (see the variant of fromSelectors with two arguments instead).

    Group nodes are only searched inside the menu node. Item nodes are only searched inside the group node.

    Parameters

    • selectors: MenuSelectors

      Structure of selectors of menu, group and item nodes.

    Returns SelfAdaptingMenus

    A new instance of SAM.

Static fromStandardClasses

Generated using TypeDoc