Skip to main content

Class: EditorController

Defined in: editor/editorController.tsx:59

Stores, modifies and validates changes from the visual graph authoring (added, deleted or changed graph entities and/or relations).

Properties

PropertyModifierTypeDescription

events

readonly

Events<EditorEvents>

Events for the editor controller.

Accessors

authoringState

Get Signature

get authoringState(): AuthoringState

Defined in: editor/editorController.tsx:148

Graph authoring state snapshot.

Returns

AuthoringState


inAuthoringMode

Get Signature

get inAuthoringMode(): boolean

Defined in: editor/editorController.tsx:112

Returns true if the editor is in the graph authoring mode; otherwise false.

Returns

boolean


metadataProvider

Get Signature

get metadataProvider(): undefined | MetadataProvider

Defined in: editor/editorController.tsx:134

Provides strategy for the graph authoring mode.

Returns

undefined | MetadataProvider


temporaryState

Get Signature

get temporaryState(): TemporaryState

Defined in: editor/editorController.tsx:190

Temporary (transient) state for the graph authoring.

Returns

TemporaryState


validationProvider

Get Signature

get validationProvider(): undefined | ValidationProvider

Defined in: editor/editorController.tsx:141

Provides strategy to validate data changes from the graph authoring.

Returns

undefined | ValidationProvider


validationState

Get Signature

get validationState(): ValidationState

Defined in: editor/editorController.tsx:174

Validation state snapshot for the data changes from the graph authoring.

Returns

ValidationState

Methods

changeEntity()

changeEntity(targetIri, newData): void

Defined in: editor/editorController.tsx:332

Changes an existing entity with graph authoring.

If no entities with target IRI found on the diagram, no changes will be applied to the graph authoring state.

The operation puts a command to the command history.

Parameters

ParameterType

targetIri

ElementIri

newData

ElementModel

Returns

void


changeRelation()

changeRelation(oldData, newData): void

Defined in: editor/editorController.tsx:441

Changes an existing relation with graph authoring.

The operation puts a command to the command history.

Parameters

ParameterType

oldData

LinkModel

newData

LinkModel

Returns

void


createEntity()

createEntity(data, options): EntityElement

Defined in: editor/editorController.tsx:301

Creates a new entity with graph authoring.

The operation puts a command to the command history.

Parameters

ParameterType

data

ElementModel

options

{ temporary?: boolean; }

options.temporary?

boolean

Returns

EntityElement


createRelation()

createRelation(base, options): RelationLink

Defined in: editor/editorController.tsx:400

Creates a new relation with graph authoring.

An error will be thrown if the relation with same identity already exists on the diagram.

The operation puts a command to the command history.

Parameters

ParameterType

base

RelationLink

options

{ temporary?: boolean; }

options.temporary?

boolean

Returns

RelationLink


deleteEntity()

deleteEntity(elementIri): void

Defined in: editor/editorController.tsx:362

Deletes an existing entity with graph authoring.

If no entities with target IRI found on the diagram, no changes will be applied to the graph authoring state.

The operation puts a command to the command history.

Parameters

ParameterType

elementIri

ElementIri

Returns

void


deleteRelation()

deleteRelation(data): void

Defined in: editor/editorController.tsx:524

Deletes an existing relation with graph authoring.

The operation puts a command to the command history.

Parameters

ParameterType

data

LinkModel

Returns

void


discardChange()

discardChange(event): void

Defined in: editor/editorController.tsx:608

Discards the specified graph authoring event from the state while reverting associated changes to the diagram:

  • new entities and links are removed;
  • changed entities and links have their data reverted back.

Parameters

ParameterType

event

AuthoringEvent

Returns

void


moveRelationSource()

moveRelationSource(params): RelationLink

Defined in: editor/editorController.tsx:475

Changes an existing relation with graph authoring by moving its source to another entity element.

The operation puts a command to the command history.

Parameters

ParameterType

params

{ link: RelationLink; newSource: EntityElement; }

params.link

RelationLink

params.newSource

EntityElement

Returns

RelationLink


moveRelationTarget()

moveRelationTarget(params): RelationLink

Defined in: editor/editorController.tsx:500

Changes an existing relation with graph authoring by moving its target to another entity element.

The operation puts a command to the command history.

Parameters

ParameterType

params

{ link: RelationLink; newTarget: EntityElement; }

params.link

RelationLink

params.newTarget

EntityElement

Returns

RelationLink


removeAllTemporaryCells()

removeAllTemporaryCells(): void

Defined in: editor/editorController.tsx:549

Removes all diagram cells from the temporary state for the graph authoring.

Returns

void

See

temporaryState


removeItems()

removeItems(items): void

Defined in: editor/editorController.tsx:254

Removes the specified diagram cells from the diagram and discards any associated graph authoring state.

The links are only removed when its a new relation added by the graph authoring.

The operation puts a command to the command history.

Parameters

ParameterType

items

readonly (Element | Link)[]

Returns

void


removeSelectedElements()

removeSelectedElements(): void

Defined in: editor/editorController.tsx:237

Removes all selected diagram elements from the diagram and discards any associated graph authoring state.

The operation puts a command to the command history.

Returns

void


removeTemporaryCells()

removeTemporaryCells(cells): void

Defined in: editor/editorController.tsx:579

Removes the specified diagram cells from the temporary state for the graph authoring.

Parameters

ParameterType

cells

readonly (Element | Link)[]

Returns

void

See

temporaryState


revalidateEntities()

revalidateEntities(entities): void

Defined in: editor/editorController.tsx:218

Forces re-validation for the specified entities.

Parameters

ParameterType

entities

ReadonlySet<ElementIri>

Returns

void


setAuthoringMode()

setAuthoringMode(value): void

Defined in: editor/editorController.tsx:121

Toggles the graph authoring mode for the editor.

Does nothing if metadataProvider is not set.

Parameters

ParameterType

value

boolean

Returns

void


setAuthoringState()

setAuthoringState(value): void

Defined in: editor/editorController.tsx:156

Sets graph authoring state.

The operation puts a command to the command history.

Parameters

ParameterType

value

AuthoringState

Returns

void


setTemporaryState()

setTemporaryState(value): void

Defined in: editor/editorController.tsx:196

Sets temporary (transient) state for the graph authoring.

Parameters

ParameterType

value

TemporaryState

Returns

void


setValidationState()

setValidationState(value): void

Defined in: editor/editorController.tsx:180

Sets validation state for the data changes from the graph authoring.

Parameters

ParameterType

value

ValidationState

Returns

void