Command

open class Command

Represents an action that changes the diagram and whose effects can be undone.

  • Initializes a new instance of the Command class.

    Declaration

    Swift

    public init(_ diagram: Diagram)

    Parameters

    diagram

    The Diagram modified by this command.

  • Carries out an action that changes the diagram or a diagram item.

    Declaration

    Swift

    open func execute()
  • Undoes an action, restoring the diagram to the state it was in before carrying out the action.

    Declaration

    Swift

    open func undo()
  • Repeats an action that has been undone.

    Declaration

    Swift

    open func redo()