Class: RestoreGeometry
Command to restore element positions and link geometry (vertices) on a canvas.
Example:
const capturedGeometry = RestoreGeometry.capture(model);
// ... (move elements, change link vertices) ...
restoreGeometry = capturedGeometry.filterOutUnchanged();
if (restoreGeometry.hasChanges()) {
model.history.registerToUndo(restoreGeometry);
}
Implements
Accessors
title
get
title():TranslatedText
Command title to display in the UI.
Returns
Command title to display in the UI.
Implementation of
Defined in
Methods
filterOutUnchanged()
filterOutUnchanged():
RestoreGeometry
Creates a derived RestoreGeometry command by removing any geometry state which is equal to the current diagram content geometry state.
This is useful to avoid adding a command without actual changes to the command history and to reduce the amount of memory to store captured geometry withing the command.
Returns
Defined in
hasChanges()
hasChanges():
boolean
Returns true
if command contains any captured geometry state to restore,
otherwise false
.
Returns
boolean
Defined in
invoke()
invoke():
RestoreGeometry
Performs the command action.
Returns
Inverse command to reverse changes done by the action.
Implementation of
Defined in
capture()
static
capture(graph
):RestoreGeometry
Creates RestoreGeometry command with captured geometry for all diagram content.
Parameters
Parameter | Type |
---|---|
|
Returns
Defined in
capturePartial()
static
capturePartial(elements
,links
):RestoreGeometry
Creates RestoreGeometry command with captured geometry for the specified subset of a diagram content.
Parameters
Parameter | Type |
---|---|
| readonly |
| readonly |