Last updated

API / geotoolkit / controls / tools / editors / commands / AbstractCommand / AbstractCommand

Class: AbstractCommand

commands.AbstractCommand.AbstractCommand

Abstract command to store information about actions made by AbstractEditor

Hierarchy

Table of contents

Constructors
Methods

Contents

Constructors

new AbstractCommand()

new AbstractCommand()

Methods

createInverse

createInverse(): AbstractCommand

Returns inverse command

Returns

AbstractCommand


getClassName

getClassName(): string

Returns

string


getEventName

getEventName(): string

Returns event to be fired when command is applied

Returns

string


getNode

getNode(): Node | Node[]

Returns target command node

Returns

Node | Node[]


getOptions

getOptions(): Record<string, any>

Returns command options

Returns

Record<string, any>


isRejected

isRejected(): boolean

Returns rejected state

Returns

boolean

the state


isSeparate

isSeparate(): boolean

Returns true if command is separate, false otherwise

Returns

boolean


merge

merge(command): boolean

Tries to merge current with another command. If successful, return true and second command won't be stored in history. Returns false otherwise.

Parameters

Name Type Description
commandAbstractCommandcommand to merge

Returns

boolean


reject

reject(): AbstractCommand

Rejects action

Returns

AbstractCommand

this


setNode

setNode(node): AbstractCommand

Sets target node for the command

Parameters

Name Type Description
nodeNode | Node[]node(s) for applying the command

Returns

AbstractCommand

this


setOptions

setOptions(options): AbstractCommand

Sets extra options to be stored in command

Parameters

Name Type Description
optionsRecord<string, any>some extra options for the command to store

Returns

AbstractCommand

this


setSeparate

setSeparate(isSeparate): AbstractCommand

Sets command to be separate or not (true by default). Not separate commands are ignored by history undo/redo actions and considered as a part of the last separate command.

Parameters

Name Type Description
isSeparatebooleantrue if command should be considered as a separate operation (in undo/redo history), false otherwise

Returns

AbstractCommand

this


getClassName

Static getClassName(): string

Returns

string