Constructor
new ChangeSegmentColourCommand(mask, segment, newColour, silentopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
mask | Image | The mask image. | |
segment | MaskSegment | The segment to modify. | |
newColour | RGB | | The new segment colour. | |
silent | boolean | <optional> | Whether to send a creation event or not. |
Classes
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:
Name | Type | Description |
---|---|---|
_event | object | The execute event with type and id. |
onUndo(_event)
Handle an undo event.
Parameters:
Name | Type | Description |
---|---|---|
_event | object | The undo event with type and id. |
undo()
Undo the command.
Events
changemasksegmentcolour
Segment delete event.
Type:
Properties- object
Name | Type | Description |
---|---|---|
segmentnumber | number | The segment number. |
changemasksegmentcolour
Segment redraw event.
Type:
Properties- object
Name | Type | Description |
---|---|---|
segmentnumber | number | The segment number. |