Package com.mxgraph.sharing
Class mxSharedState
java.lang.Object
com.mxgraph.util.mxEventSource
com.mxgraph.sharing.mxSharedState
- Direct Known Subclasses:
mxSharedGraphModel
Implements a diagram that may be shared among multiple sessions. This
implementation is based only on string, it does not have a model instance.
The diagram is represented by its initial state and the sequence of edits
as applied to the diagram.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Defines the requirements for an object that listens to changes on the shared diagram.Nested classes/interfaces inherited from class com.mxgraph.util.mxEventSource
mxEventSource.mxIEventListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringBuffer
Holds the history of all changes of initial state.protected List
<mxSharedState.mxDiagramChangeListener> Holds a list of diagram change listeners.protected String
Holds the initial state of the diagram.Fields inherited from class com.mxgraph.util.mxEventSource
eventListeners, eventsEnabled, eventSource
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Adds the given listener to the list of diagram change listeners.getDelta()
Returns the history of all changes as a string.getState()
Returns the initial state of the diagram.void
processDelta
(Object sender, Node delta) Appends the given string to the history and dispatches the change to all sessions that are listening to this shared diagram.protected String
processEdit
(Node node) void
Removes the given listener from the list of diagram change listeners.void
Clears the history of all changes.Methods inherited from class com.mxgraph.util.mxEventSource
addListener, fireEvent, fireEvent, getEventSource, isEventsEnabled, removeListener, removeListener, setEventsEnabled, setEventSource
-
Field Details
-
diagramChangeListeners
Holds a list of diagram change listeners. -
state
Holds the initial state of the diagram. -
delta
Holds the history of all changes of initial state.
-
-
Constructor Details
-
mxSharedState
Constructs a new diagram with the given state.- Parameters:
state
- Initial state of the diagram.
-
-
Method Details
-
getState
Returns the initial state of the diagram. -
getDelta
Returns the history of all changes as a string. -
processDelta
Appends the given string to the history and dispatches the change to all sessions that are listening to this shared diagram.- Parameters:
sender
- Session where the change originated from.delta
- XML that represents the change.
-
processEdit
-
addDelta
-
resetDelta
public void resetDelta()Clears the history of all changes.
-