DeleteSegmentCommand

Delete segment command.

Constructor

new DeleteSegmentCommand(mask, segment, silentopt)

Parameters:
NameTypeAttributesDescription
maskImage

The mask image.

segmentobject

The segment to remove.

silentboolean<optional>

Whether to send a creation event or not.

Classes

DeleteSegmentCommand

Methods

execute()

Execute the command.

getName() → {string}

Get the command name.

Returns:

The command name.

Type: 
string

isValid() → {boolean}

Check if a command is valid and can be executed.

Returns:

True if the command is valid.

Type: 
boolean

onExecute(_event)

Handle an execute event.

Parameters:
NameTypeDescription
_eventobject

The execute event with type and id.

onUndo(_event)

Handle an undo event.

Parameters:
NameTypeDescription
_eventobject

The undo event with type and id.

undo()

Undo the command.

Events

masksegmentdelete

Segment delete event.

Type:
  • object
Properties
NameTypeDescription
segmentnumbernumber

The segment number.

masksegmentredraw

Segment redraw event.

Type:
  • object
Properties
NameTypeDescription
segmentnumbernumber

The segment number.