Class TreeUndoHistoryAbstract

Tree-based undo history. On adding undoables after an undo operation, the redoable objects are no more flush but kept in the history as a granch of the graph. Useful for exploration.

Hierarchy

Implements

Constructors

Accessors

  • get path(): readonly number[]
  • Returns the ordered sequence of undoable's ID that the user performed. This permits to keep traces of what the users did and how they arrived to the final state.

    Returns readonly number[]

Methods

  • Deletes the targeted node. Works only if the history does not keep the usage path (see path()).

    Parameters

    • id: number

      The node ID to remove. It removes all the branch from this node. Does not remove the branch if the current node is in it.

    Returns void

  • Computes the position (in the large) of each node. Useful for layouting.

    Returns Map<number, number>

  • Moves to the given node ID.

    Parameters

    • id: number

      The node ID contained in the tree. Moves to it if correct.

    Returns void

  • Imports the given DTO history. Flushes the current history.

    Parameters

    • dtoHistory: TreeUndoHistoryDTO

      The DTO history to import.

    • fn: ((dtoUndoable) => Undoable)

      The convertion fonction that transforms undoable DTO (of nodes) into Undoable.

    Returns void

Generated using TypeDoc