Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Highlight

Hierarchy

  • Highlight

Implements

Index

Constructors

constructor

Properties

Protected itemsToHighlightAtHighLevel

itemsToHighlightAtHighLevel: Set<Item>

Set of items which must be highlighted at high level. The set must be emptied and recomputed each time the style is applied.

name

name: string = "Highlight"

Static HIGHLIGHTED_ELEMENT_CLASS

HIGHLIGHTED_ELEMENT_CLASS: string = "sam-highlighted"

HTML class of a highlighted element.

This class is generic, and complementary to level-specific classes (see HIGHLIGHTING_LEVELS_CLASSES).

Methods

apply

Private applyInGroup

  • applyInGroup(sameGroupItems: Item[]): void
  • Highlight all the given items, assuming they all belong to the same group.

    Parameters

    • sameGroupItems: Item[]

      The sorted list of items located in the same group.

    Returns void

cancel

  • cancel(): void

Private computeItemsToHighlightAtHighLevel

  • computeItemsToHighlightAtHighLevel(itemWithScores: ItemWithScore[]): void
  • Compute the set of items which must be highlighted at high level. The (internal) set is cleared beforehand.

    Parameters

    • itemWithScores: ItemWithScore[]

      Sorted list of items with their scores.

    Returns void

Private getFilteredSortedItemWithScores

  • Use the given policy to score and sort the items of all the menus to adapt, and filter out any item which has a null (0) score.

    Parameters

    • menuManager: MenuManager

      The menu manager containing the menus with items to highlight.

    • policy: TargetPolicy

      The policy to use to score the items.

    • Optional dataManager: DataManager

      The data manager containing data for the policy.

    Returns ItemWithScore[]

    A sorted and filtered list of items.

Private getMaxNbItemsToHighlight

  • getMaxNbItemsToHighlight(nbItems: number): number
  • Return the maximum number of items which can be highlighted in a menu.

    Parameters

    • nbItems: number

      The total number of items in the menu.

    Returns number

    The maximum number of items to highlight in the menu.

Private getMaxNbItemsToHighlightInGroup

  • getMaxNbItemsToHighlightInGroup(nbItemsInGroup: number): number
  • Return the maximum number of items which can be highlighted in a group.

    Parameters

    • nbItemsInGroup: number

      The total number of items in the group.

    Returns number

    The maximum number of items to highlight in the group.

Protected onAllItems

  • onAllItems(items: Item[]): void

Private onNode

Private splitAndApplyByGroup

  • splitAndApplyByGroup(items: Item[]): void

Generated using TypeDoc