Sprotty
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

Class. Web Socket Diagram Server Proxy

currentRoot

protected currentRoot: SModelRoot

Defined in: packages/sprotty/src/model-source/diagram-server.ts:61

Inherited from

DiagramServerProxy.currentRoot


lastSubmittedModelType

protected lastSubmittedModelType: string

Defined in: packages/sprotty/src/model-source/diagram-server.ts:66

Inherited from

DiagramServerProxy.lastSubmittedModelType


logger

protected logger: ILogger

Defined in: packages/sprotty/src/model-source/diagram-server.ts:56

Inherited from

DiagramServerProxy.logger


viewerOptions

protected viewerOptions: ViewerOptions

Defined in: packages/sprotty/src/model-source/model-source.ts:50

Inherited from

DiagramServerProxy.viewerOptions


webSocket?

protected optional webSocket: WebSocket

Defined in: packages/sprotty/src/model-source/websocket.ts:27

Accessors

model

Get Signature

get model(): SModelRoot

Defined in: packages/sprotty/src/model-source/diagram-server.ts:68

Returns

SModelRoot

Inherited from

DiagramServerProxy.model

Methods

commitModel()

commitModel(newRoot): SModelRoot | Promise<SModelRoot>

Defined in: packages/sprotty/src/model-source/diagram-server.ts:210

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.

Parameters

newRoot

SModelRoot

the new model.

Returns

SModelRoot | Promise<SModelRoot>

the previous model.

Inherited from

DiagramServerProxy.commitModel


disconnect()

disconnect(): void

Defined in: packages/sprotty/src/model-source/websocket.ts:39

Returns

void


forwardToServer()

protected forwardToServer(action): void

Defined in: packages/sprotty/src/model-source/diagram-server.ts:96

Parameters

action

Action

Returns

void

Inherited from

DiagramServerProxy.forwardToServer


handle()

handle(action): void | Action | ICommand

Defined in: packages/sprotty/src/model-source/diagram-server.ts:89

Parameters

action

Action

Returns

void | Action | ICommand

Inherited from

DiagramServerProxy.handle


handleComputedBounds()

protected handleComputedBounds(action): boolean

Defined in: packages/sprotty/src/model-source/diagram-server.ts:184

If the server requires to compute a layout, the computed bounds are forwarded. Otherwise they are applied to the current model locally and a model update is triggered.

Parameters

action

ComputedBoundsAction

Returns

boolean

Inherited from

DiagramServerProxy.handleComputedBounds


handleExportSvgAction()

protected handleExportSvgAction(action): boolean

Defined in: packages/sprotty/src/model-source/diagram-server.ts:200

Parameters

action

ExportSvgAction

Returns

boolean

Inherited from

DiagramServerProxy.handleExportSvgAction


handleLocally()

protected handleLocally(action): boolean

Defined in: packages/sprotty/src/model-source/diagram-server.ts:132

Check whether the given action should be handled locally. Returns true if the action should still be sent to the server, and false if it’s only handled locally.

Parameters

action

Action

Returns

boolean

Inherited from

DiagramServerProxy.handleLocally


handleRequestModel()

protected handleRequestModel(action): boolean

Defined in: packages/sprotty/src/model-source/diagram-server.ts:166

Parameters

action

RequestModelAction

Returns

boolean

Inherited from

DiagramServerProxy.handleRequestModel


handleServerStateAction()

protected handleServerStateAction(action): boolean

Defined in: packages/sprotty/src/model-source/diagram-server.ts:206

Parameters

action

ServerStatusAction

Returns

boolean

Inherited from

DiagramServerProxy.handleServerStateAction


initialize()

initialize(registry): void

Defined in: packages/sprotty/src/model-source/diagram-server.ts:72

Parameters

registry

ActionHandlerRegistry

Returns

void

Inherited from

DiagramServerProxy.initialize


listen()

listen(webSocket): void

Defined in: packages/sprotty/src/model-source/websocket.ts:29

Parameters

webSocket

WebSocket

Returns

void


messageReceived()

protected messageReceived(data): void

Defined in: packages/sprotty/src/model-source/diagram-server.ts:113

Called when a message is received from the remote diagram server.

Parameters

data

any

Returns

void

Inherited from

DiagramServerProxy.messageReceived


sendMessage()

protected sendMessage(message): void

Defined in: packages/sprotty/src/model-source/websocket.ts:46

Send a message to the remote diagram server.

Parameters

message

ActionMessage

Returns

void

Overrides

DiagramServerProxy.sendMessage


storeNewModel()

protected storeNewModel(action): void

Defined in: packages/sprotty/src/model-source/diagram-server.ts:152

Put the new model contained in the given action into the model storage, if there is any.

Parameters

action

Action

Returns

void

Inherited from

DiagramServerProxy.storeNewModel