com.mxgraph.sharing
public class mxSharedDiagram extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
mxSharedDiagram.mxDiagramChangeListener
Defines the requirements for an object that listens to changes on the
shared diagram.
|
Modifier and Type | Field and Description |
---|---|
protected List<mxSharedDiagram.mxDiagramChangeListener> |
diagramChangeListeners
Holds a list of diagram change listeners.
|
protected StringBuffer |
history
Holds the history of all changes of initial state.
|
protected String |
initialState
Holds the initial state of the diagram.
|
Constructor and Description |
---|
mxSharedDiagram(String initialState)
Constructs a new diagram with the given initial state.
|
Modifier and Type | Method and Description |
---|---|
void |
addDiagramChangeListener(mxSharedDiagram.mxDiagramChangeListener listener)
Adds the given listener to the list of diagram change listeners.
|
void |
clearHistory()
Clears the history of all changes.
|
void |
dispatch(Object sender,
String xml)
Appends the given string to the history and dispatches the change to all
sessions that are listening to this shared diagram.
|
String |
getDelta()
Returns the history of all changes as a string.
|
String |
getInitialState()
Returns the initial state of the diagram.
|
void |
removeDiagramChangeListener(mxSharedDiagram.mxDiagramChangeListener listener)
Removes the given listener from the list of diagram change listeners.
|
protected List<mxSharedDiagram.mxDiagramChangeListener> diagramChangeListeners
protected String initialState
protected StringBuffer history
public mxSharedDiagram(String initialState)
initialState
- Initial state of the diagram.public String getInitialState()
public void clearHistory()
public String getDelta()
public void dispatch(Object sender, String xml)
sender
- Session where the change originated from.xml
- XML string that represents the change.public void addDiagramChangeListener(mxSharedDiagram.mxDiagramChangeListener listener)
listener
- Diagram change listener to be added.public void removeDiagramChangeListener(mxSharedDiagram.mxDiagramChangeListener listener)
listener
- Diagram change listener to be removed.Copyright (c) 2010 Gaudenz Alder. All rights reserved.