Class. Local Model Source
protected
lastSubmittedModelType:string
Defined in: packages/sprotty/src/model-source/local-model-source.ts:58
The type
property of the model root is used to determine whether a model update
is a change of the previous model or a totally new one.
protected
optional
layoutEngine:IModelLayoutEngine
Defined in: packages/sprotty/src/model-source/local-model-source.ts:50
protected
readonly
logger:ILogger
Defined in: packages/sprotty/src/model-source/local-model-source.ts:47
protected
optional
popupModelProvider:IPopupModelProvider
Defined in: packages/sprotty/src/model-source/local-model-source.ts:49
protected
viewerOptions:ViewerOptions
Defined in: packages/sprotty/src/model-source/model-source.ts:50
get model():
SModelRoot
Defined in: packages/sprotty/src/model-source/local-model-source.ts:60
SModelRoot
set model(
root
):void
Defined in: packages/sprotty/src/model-source/local-model-source.ts:64
SModelRoot
void
addElements(
elements
):Promise
<void
>
Defined in: packages/sprotty/src/model-source/local-model-source.ts:194
Modify the current model by adding new elements.
(SModelElement
| { element
: SModelElement
; parentId
: string
; })[]
Promise
<void
>
applyMatches(
matches
):Promise
<void
>
Defined in: packages/sprotty/src/model-source/local-model-source.ts:185
Modify the current model with an array of matches.
Match
[]
Promise
<void
>
commitModel(
newRoot
):SModelRoot
|Promise
<SModelRoot
>
Defined in: packages/sprotty/src/model-source/local-model-source.ts:84
Commit changes from the internal SModel back to the currentModel.
This method is meant to be called only by CommitModelCommand and other commands
that need to feed the current internal model back to the model source. It does
not have any side effects such as triggering layout or bounds computation, as the
internal model is already current. See CommitModelAction
for details.
SModelRoot
the new model.
SModelRoot
| Promise
<SModelRoot
>
the previous model.
protected
doSubmitModel(newRoot
,update
,cause?
,index?
):Promise
<void
>
Defined in: packages/sprotty/src/model-source/local-model-source.ts:155
Submit the given model with an UpdateModelAction
or a SetModelAction
depending on the
update
argument. If available, the model layout engine is invoked first.
SModelRoot
boolean
| Match
[]
Action
SModelIndex
Promise
<void
>
getSelection():
Promise
<FluentIterable
<SModelElement
>>
Defined in: packages/sprotty/src/model-source/local-model-source.ts:107
Get the current selection from the model.
Promise
<FluentIterable
<SModelElement
>>
getViewport():
Promise
<Viewport
&object
>
Defined in: packages/sprotty/src/model-source/local-model-source.ts:128
Get the current viewport from the model.
Promise
<Viewport
& object
>
handle(
action
):void
Defined in: packages/sprotty/src/model-source/local-model-source.ts:246
Action
void
protected
handleExportSvgAction(action
):void
Defined in: packages/sprotty/src/model-source/local-model-source.ts:278
ExportSvgAction
void
protected
handleRequestModel(action
):void
Defined in: packages/sprotty/src/model-source/local-model-source.ts:263
RequestModelAction
void
protected
handleRequestPopupModel(action
):void
Defined in: packages/sprotty/src/model-source/local-model-source.ts:267
RequestPopupModelAction
void
initialize(
registry
):void
Defined in: packages/sprotty/src/model-source/local-model-source.ts:68
void
removeElements(
elements
):Promise
<void
>
Defined in: packages/sprotty/src/model-source/local-model-source.ts:216
Modify the current model by removing elements.
(string
| { elementId
: string
; parentId
: string
; })[]
Promise
<void
>
setModel(
newRoot
):Promise
<void
>
Defined in: packages/sprotty/src/model-source/local-model-source.ts:79
Set the model without incremental update.
SModelRoot
Promise
<void
>
protected
submitModel(newRoot
,update
,cause?
):Promise
<void
>
Defined in: packages/sprotty/src/model-source/local-model-source.ts:141
If client layout is active, run a RequestBoundsAction
and wait for the resulting
ComputedBoundsAction
, otherwise call doSubmitModel(…)
directly.
SModelRoot
boolean
| Match
[]
Action
Promise
<void
>
updateModel(
newRoot?
):Promise
<void
>
Defined in: packages/sprotty/src/model-source/local-model-source.ts:95
Apply an incremental update to the model with an animation showing the transition to
the new state. If newRoot
is undefined, the current root is submitted; in that case
it is assumed that it has been modified before.
SModelRoot
Promise
<void
>