mxAutoSaveManager

Manager for automatically saving diagrams.  The save hook must be implemented.

Example

let mgr = new mxAutoSaveManager(editor.graph);
mgr.save = function()
{
  mxLog.show();
  mxLog.debug('save');
};
Summary
mxAutoSaveManagerManager for automatically saving diagrams.
Functions
mxAutoSaveManagerConstructs a new automatic layout for the given graph.
Variables
graphReference to the enclosing mxGraph.
autoSaveDelayMinimum amount of seconds between two consecutive autosaves.
autoSaveThrottleMinimum amount of seconds between two consecutive autosaves triggered by more than <autoSaveThreshhold> changes within a timespan of less than autoSaveDelay seconds.
autoSaveThresholdMinimum amount of ignored changes before an autosave.
ignoredChangesCounter for ignored changes in autosave.
lastSnapshotUsed for autosaving.
enabledSpecifies if event handling is enabled.
changeHandlerHolds the function that handles graph model changes.
Functions
isEnabledReturns true if events are handled.
setEnabledEnables or disables event handling.
setGraphSets the graph that the layouts operate on.
saveEmpty hook that is called if the graph should be saved.
graphModelChangedInvoked when the graph model has changed.
resetResets all counters.
destroyRemoves all handlers from the graph and deletes the reference to it.

Functions

mxAutoSaveManager

function mxAutoSaveManager(graph)

Constructs a new automatic layout for the given graph.

Arguments

graphReference to the enclosing graph.

Variables

graph

mxAutoSaveManager.prototype.graph

Reference to the enclosing mxGraph.

autoSaveDelay

mxAutoSaveManager.prototype.autoSaveDelay

Minimum amount of seconds between two consecutive autosaves.  Eg. a value of 1 (s) means the graph is not stored more than once per second.  Default is 10.

autoSaveThrottle

mxAutoSaveManager.prototype.autoSaveThrottle

Minimum amount of seconds between two consecutive autosaves triggered by more than <autoSaveThreshhold> changes within a timespan of less than autoSaveDelay seconds.  Eg. a value of 1 (s) means the graph is not stored more than once per second even if there are more than autoSaveThreshold changes within that timespan.  Default is 2.

autoSaveThreshold

mxAutoSaveManager.prototype.autoSaveThreshold

Minimum amount of ignored changes before an autosave.  Eg. a value of 2 means after 2 change of the graph model the autosave will trigger if the condition below is true.  Default is 5.

ignoredChanges

mxAutoSaveManager.prototype.ignoredChanges

Counter for ignored changes in autosave.

lastSnapshot

mxAutoSaveManager.prototype.lastSnapshot

Used for autosaving.  See <autosave>.

enabled

mxAutoSaveManager.prototype.enabled

Specifies if event handling is enabled.  Default is true.

changeHandler

mxAutoSaveManager.prototype.changeHandler

Holds the function that handles graph model changes.

Functions

isEnabled

mxAutoSaveManager.prototype.isEnabled = function()

Returns true if events are handled.  This implementation returns enabled.

setEnabled

mxAutoSaveManager.prototype.setEnabled = function(value)

Enables or disables event handling.  This implementation updates enabled.

Parameters

enabledBoolean that specifies the new enabled state.

setGraph

mxAutoSaveManager.prototype.setGraph = function(graph)

Sets the graph that the layouts operate on.

save

mxAutoSaveManager.prototype.save = function()

Empty hook that is called if the graph should be saved.

graphModelChanged

mxAutoSaveManager.prototype.graphModelChanged = function(changes)

Invoked when the graph model has changed.

reset

mxAutoSaveManager.prototype.reset = function()

Resets all counters.

destroy

mxAutoSaveManager.prototype.destroy = function()

Removes all handlers from the graph and deletes the reference to it.

function mxAutoSaveManager(graph)
Constructs a new automatic layout for the given graph.
mxAutoSaveManager.prototype.graph
Reference to the enclosing mxGraph.
Extends mxEventSource to implement a graph component for the browser.
mxAutoSaveManager.prototype.autoSaveDelay
Minimum amount of seconds between two consecutive autosaves.
mxAutoSaveManager.prototype.autoSaveThrottle
Minimum amount of seconds between two consecutive autosaves triggered by more than autoSaveThreshhold changes within a timespan of less than autoSaveDelay seconds.
mxAutoSaveManager.prototype.autoSaveThreshold
Minimum amount of ignored changes before an autosave.
mxAutoSaveManager.prototype.ignoredChanges
Counter for ignored changes in autosave.
mxAutoSaveManager.prototype.lastSnapshot
Used for autosaving.
mxAutoSaveManager.prototype.enabled
Specifies if event handling is enabled.
mxAutoSaveManager.prototype.changeHandler
Holds the function that handles graph model changes.
mxAutoSaveManager.prototype.isEnabled = function()
Returns true if events are handled.
mxAutoSaveManager.prototype.setEnabled = function(value)
Enables or disables event handling.
mxAutoSaveManager.prototype.setGraph = function(graph)
Sets the graph that the layouts operate on.
mxAutoSaveManager.prototype.save = function()
Empty hook that is called if the graph should be saved.
mxAutoSaveManager.prototype.graphModelChanged = function(changes)
Invoked when the graph model has changed.
mxAutoSaveManager.prototype.reset = function()
Resets all counters.
mxAutoSaveManager.prototype.destroy = function()
Removes all handlers from the graph and deletes the reference to it.
Close