Options
All
  • Public
  • Public/Protected
  • All
Menu

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

example
var mgr = new mxAutoSaveManager(editor.graph);
mgr.save()
{
  mxLog.show();
  mxLog.debug('save');
};

Hierarchy

Index

Constructors

constructor

Properties

autoSaveDelay

autoSaveDelay: number

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.

autoSaveThreshold

autoSaveThreshold: number

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.

autoSaveThrottle

autoSaveThrottle: number

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

changeHandler

changeHandler: Function

Holds the function that handles graph model changes.

enabled

enabled: boolean

Specifies if event handling is enabled. Default is true.

eventListeners

eventListeners: any[]

Variable: eventListeners

Holds the event names and associated listeners in an array. The array contains the event name followed by the respective listener for each registered listener.

eventSource

eventSource: any

Variable: eventSource

Optional source for events. Default is null.

eventsEnabled

eventsEnabled: boolean

Variable: eventsEnabled

Specifies if events can be fired. Default is true.

graph

graph: mxGraph

Reference to the enclosing .

ignoredChanges

ignoredChanges: number

Counter for ignored changes in autosave.

lastSnapshot

lastSnapshot: number

Used for autosaving. See .

Methods

addListener

  • addListener(name: string, funct: (...args: any[]) => any): void
  • Function: addListener

    Binds the specified function to the given event name. If no event name is given, then the listener is registered for all events.

    The parameters of the listener are the sender and an .

    Parameters

    • name: string
    • funct: (...args: any[]) => any
        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    Returns void

destroy

  • destroy(): void

fireEvent

  • Function: fireEvent

    Dispatches the given event to the listeners which are registered for the event. The sender argument is optional. The current execution scope ("this") is used for the listener invocation (see <mxUtils.bind>).

    Example:

    (code) fireEvent(new mxEventObject("eventName", key1, val1, .., keyN, valN)) (end)

    Parameters:

    evt - that represents the event. sender - Optional sender to be passed to the listener. Default value is the return value of .

    Parameters

    Returns void

getEventSource

  • getEventSource(): any

graphModelChanged

  • graphModelChanged(changes: any): void

isEnabled

  • isEnabled(): boolean

isEventsEnabled

  • isEventsEnabled(): boolean

removeListener

  • removeListener(funct: (...args: any[]) => any): void
  • Function: removeListener

    Removes all occurrences of the given listener from .

    Parameters

    • funct: (...args: any[]) => any
        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    Returns void

reset

  • reset(): void

save

  • save(): void

setEnabled

  • setEnabled(value: boolean): void

setEventSource

  • setEventSource(value: any): void

setEventsEnabled

  • setEventsEnabled(value: boolean): void

setGraph

Generated using TypeDoc