Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AutoSaveManager

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

var mgr = new AutoSaveManager(editor.graph);
mgr.save()
{
MaxLog.show();
MaxLog.debug('save');
};

Hierarchy

Index

Constructors

constructor

Properties

autoSaveDelay

autoSaveDelay: number = 10

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 = 5

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 = 2

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 = true

Specifies if event handling is enabled. Default is true.

eventListeners

eventListeners: EventListenerObject[] = []

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: null | EventTarget = null

Optional source for events. Default is null.

eventsEnabled

eventsEnabled: boolean = true

Specifies if events can be fired. Default is true.

graph

graph: null | Graph = null

Reference to the enclosing Graph.

ignoredChanges

ignoredChanges: number = 0

Counter for ignored changes in autosave.

lastSnapshot

lastSnapshot: number = 0

Used for autosaving. See .

Methods

addListener

  • addListener(name: string, funct: Function): void
  • 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 EventObject.

    Parameters

    • name: string
    • funct: Function

    Returns void

destroy

  • destroy(): void

fireEvent

  • fireEvent(evt: EventObject, sender?: null | EventTarget): void
  • 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 {@link Utils#bind}).

    Example:

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

    Parameters

    • evt: EventObject

      EventObject that represents the event.

    • sender: null | EventTarget = null

      Optional sender to be passed to the listener. Default value is the return value of .

    Returns void

getEventSource

  • getEventSource(): null | EventTarget

graphModelChanged

  • graphModelChanged(changes: any): void

isEnabled

  • isEnabled(): boolean

isEventsEnabled

  • isEventsEnabled(): boolean

removeListener

  • removeListener(funct: Function): void

reset

  • reset(): void

save

  • save(): void

setEnabled

  • setEnabled(value: boolean): void

setEventSource

  • setEventSource(value: null | EventTarget): void

setEventsEnabled

  • setEventsEnabled(value: boolean): void

setGraph

  • setGraph(graph: null | Graph): void

Generated using TypeDoc