| 
 | JGraph X 2.1.0.7 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.mxgraph.util.mxEventSource
com.mxgraph.sharing.mxSharedState
public class mxSharedState
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 | |
|---|---|
| static interface | mxSharedState.mxDiagramChangeListenerDefines 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 | |
|---|---|
| protected  StringBuffer | deltaHolds the history of all changes of initial state. | 
| protected  List<mxSharedState.mxDiagramChangeListener> | diagramChangeListenersHolds a list of diagram change listeners. | 
| protected  String | stateHolds the initial state of the diagram. | 
| Fields inherited from class com.mxgraph.util.mxEventSource | 
|---|
| eventListeners, eventsEnabled, eventSource | 
| Constructor Summary | |
|---|---|
| mxSharedState(String state)Constructs a new diagram with the given state. | |
| Method Summary | |
|---|---|
|  void | addDelta(String xml) | 
|  void | addDiagramChangeListener(mxSharedState.mxDiagramChangeListener listener)Adds the given listener to the list of diagram change listeners. | 
|  String | getDelta()Returns the history of all changes as a string. | 
|  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 | removeDiagramChangeListener(mxSharedState.mxDiagramChangeListener listener)Removes the given listener from the list of diagram change listeners. | 
|  void | resetDelta()Clears the history of all changes. | 
| Methods inherited from class com.mxgraph.util.mxEventSource | 
|---|
| addListener, fireEvent, fireEvent, getEventSource, isEventsEnabled, removeListener, removeListener, setEventsEnabled, setEventSource | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected List<mxSharedState.mxDiagramChangeListener> diagramChangeListeners
protected String state
protected StringBuffer delta
| Constructor Detail | 
|---|
public mxSharedState(String state)
state - Initial state of the diagram.| Method Detail | 
|---|
public String getState()
public String getDelta()
public void processDelta(Object sender,
                         Node delta)
sender - Session where the change originated from.delta - XML that represents the change.protected String processEdit(Node node)
public void addDelta(String xml)
public void resetDelta()
public void addDiagramChangeListener(mxSharedState.mxDiagramChangeListener listener)
listener - Diagram change listener to be added.public void removeDiagramChangeListener(mxSharedState.mxDiagramChangeListener listener)
listener - Diagram change listener to be removed.| 
 | JGraph X 2.1.0.7 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||