Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SGraphMoveCommand

item移动命令

author

panglixiang

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • new SGraphMoveCommand(scene: SGraphScene, item: SGraphItem, old: SPoint, pos: SPoint): SGraphMoveCommand
  • 构造函数

    Parameters

    • scene: SGraphScene

      当前场景

    • item: SGraphItem

      item对象

    • old: SPoint

      移动前位置

    • pos: SPoint

      移动后位置

    Returns SGraphMoveCommand

Properties

Readonly command

command: string

命令名称

desc

desc: string

item

item: SGraphItem

执行命令的item

old

old: SPoint

移动前位置

pos

pos: SPoint

移动后位置

scene

scene: SGraphScene | null = null

命令所属的场景类

Methods

id

  • id(): number
  • Returns number

mergeWith

  • mergeWith(command: SUndoCommand): boolean
  • 合并命令

    Parameters

    • command: SUndoCommand

      命令

    Returns boolean

    boolean 是否已执行合并命令

redo

  • redo(): void
  • 重做

    Returns void

toString

  • toString(): string
  • 命令细节描述

    Returns string

undo

  • undo(): void
  • 撤销

    Returns void