Communicator.OperatorManager

 OperatorManager

Main interface into the Operator functionality of the viewer. The OperatorManager manages a number of operators in a stack and allows the user to register and unregister new operators.

Methods

clear

  • clear(): void
  • Removes all operators from the stack

    Returns void

getOperator

indexOf

  • Returns the index of an operator on the stack

    Parameters

    Returns number

    operator index or -1 if not found

injectEvent

peek

  • Returns OperatorId

    the operator id at the top of the stack

pop

  • Removes an operator from the top of the stack

    Returns OperatorId | undefined

    the operator id

push

  • Adds an operator on the stack if it's not already on the stack

    Parameters

    • operatorId: OperatorId

      id of the operator to add to the stack

    Returns boolean

    boolean indicating success or failure

registerCustomOperator

remove

  • Removes an operator from the stack

    Parameters

    • operatorId: OperatorId

      id of the operator to remove from the stack

    Returns void

replaceOperator

  • Replaces the operator that the specified id refers to. Returns a boolean indicating success or failure.

    Parameters

    • previousOperatorId: OperatorId

      operator id for the operator to be replaced.

    • newOperatorId: OperatorId

      operator id for the new operator.

    Returns boolean

set

  • set(operatorId: OperatorId, position: number): boolean
  • Sets a position on the stack to an operator if it's not already on the stack If there is already an operator in that position, it is replaced.

    Parameters

    • operatorId: OperatorId

      id of the operator to add to the stack

    • position: number

      position on the stack to assign

    Returns boolean

    boolean indicating success or failure

size

  • size(): number
  • Returns number

    the operator stack size

unregisterCustomOperator

  • unregisterCustomOperator(operatorId: OperatorId): void
  • Removes a custom operator from the registered operator list.

    Parameters

    Returns void