Class: EditorController
Defined in: src/editor/editorController.tsx:62
Stores, modifies and validates changes from the visual graph authoring (added, deleted or changed graph entities and/or relations).
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
| Events for the editor controller. |
Accessors
authoringState
Get Signature
get authoringState():
AuthoringState
Defined in: src/editor/editorController.tsx:152
Graph authoring state snapshot.
Returns
inAuthoringMode
Get Signature
get inAuthoringMode():
boolean
Defined in: src/editor/editorController.tsx:116
Returns true if the editor is in the graph authoring mode;
otherwise false.
Returns
boolean
metadataProvider
Get Signature
get metadataProvider():
undefined|MetadataProvider
Defined in: src/editor/editorController.tsx:138
Provides strategy for the graph authoring mode.
Returns
undefined | MetadataProvider
temporaryState
Get Signature
get temporaryState():
TemporaryState
Defined in: src/editor/editorController.tsx:194
Temporary (transient) state for the graph authoring.
Returns
validationProvider
Get Signature
get validationProvider():
undefined|ValidationProvider
Defined in: src/editor/editorController.tsx:145
Provides strategy to validate data changes from the graph authoring.
Returns
undefined | ValidationProvider
validationState
Get Signature
get validationState():
ValidationState
Defined in: src/editor/editorController.tsx:178
Validation state snapshot for the data changes from the graph authoring.
Returns
Methods
applyAuthoringChanges()
applyAuthoringChanges():
void
Defined in: src/editor/editorController.tsx:745
Applies changes from authoringState (including link deletion and entity IRI changes) to the diagram and resets the authoring state to AuthoringState.empty.
The operation puts a command to the command history.
Returns
void
changeEntity()
changeEntity(
target,newData):void
Defined in: src/editor/editorController.tsx:381
Changes an existing entity with graph authoring.
If target is specified as an IRI and no entities with that 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
| Parameter | Type |
|---|---|
| |
|
Returns
void
changeRelation()
changeRelation(
oldData,newData):void
Defined in: src/editor/editorController.tsx:489
Changes an existing relation with graph authoring.
The operation puts a command to the command history.
Parameters
| Parameter | Type |
|---|---|
| |
|
Returns
void
createEntity()
createEntity(
data,options):EntityElement
Defined in: src/editor/editorController.tsx:351
Creates a new entity with graph authoring.
The operation puts a command to the command history.
Parameters
| Parameter | Type |
|---|---|
| |
| { |
|
|
Returns
createRelation()
createRelation(
base,options):RelationLink
Defined in: src/editor/editorController.tsx:448
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
| Parameter | Type |
|---|---|
| |
| { |
|
|
Returns
deleteEntity()
deleteEntity(
target):void
Defined in: src/editor/editorController.tsx:412
Deletes an existing entity with graph authoring.
If target is specified as an IRI and no entities with that 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
| Parameter | Type |
|---|---|
|
Returns
void
deleteRelation()
deleteRelation(
data):void
Defined in: src/editor/editorController.tsx:572
Deletes an existing relation with graph authoring.
The operation puts a command to the command history.
Parameters
| Parameter | Type |
|---|---|
|
Returns
void
discardChange()
discardChange(
event):void
Defined in: src/editor/editorController.tsx:656
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
| Parameter | Type |
|---|---|
|
Returns
void
moveRelationSource()
moveRelationSource(
params):RelationLink
Defined in: src/editor/editorController.tsx:523
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
| Parameter | Type |
|---|---|
| { |
| |
|
Returns
moveRelationTarget()
moveRelationTarget(
params):RelationLink
Defined in: src/editor/editorController.tsx:548
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
| Parameter | Type |
|---|---|
| { |
| |
|
Returns
removeAllTemporaryCells()
removeAllTemporaryCells():
void
Defined in: src/editor/editorController.tsx:597
Removes all diagram cells from the temporary state for the graph authoring.
Returns
void
See
removeItems()
removeItems(
items):void
Defined in: src/editor/editorController.tsx:300
Removes the specified diagram cells from the diagram and discards any associated graph authoring state.
If the link is a relation, it will be removed only if it's marked as "added" in the graph authoring state.
The operation puts a command to the command history.
Parameters
| Parameter | Type |
|---|---|
|
Returns
void
removeSelectedElements()
removeSelectedElements():
void
Defined in: src/editor/editorController.tsx:282
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: src/editor/editorController.tsx:627
Removes the specified diagram cells from the temporary state for the graph authoring.
Parameters
| Parameter | Type |
|---|---|
|
Returns
void
See
revalidateEntities()
revalidateEntities(
entities):void
Defined in: src/editor/editorController.tsx:261
Forces re-validation for the specified entities.
Parameters
| Parameter | Type |
|---|---|
|
|
Returns
void
setAuthoringMode()
setAuthoringMode(
value):void
Defined in: src/editor/editorController.tsx:125
Toggles the graph authoring mode for the editor.
Does nothing if metadataProvider is not set.
Parameters
| Parameter | Type |
|---|---|
|
|
Returns
void
setAuthoringState()
setAuthoringState(
value):void
Defined in: src/editor/editorController.tsx:160
Sets graph authoring state.
The operation puts a command to the command history.
Parameters
| Parameter | Type |
|---|---|
|
Returns
void
setTemporaryState()
setTemporaryState(
value):void
Defined in: src/editor/editorController.tsx:200
Sets temporary (transient) state for the graph authoring.
Parameters
| Parameter | Type |
|---|---|
|
Returns
void
setValidationState()
setValidationState(
value):void
Defined in: src/editor/editorController.tsx:184
Sets validation state for the data changes from the graph authoring.
Parameters
| Parameter | Type |
|---|---|
|
Returns
void