public class mxSharedDiagram
extends java.lang.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 java.util.List<mxSharedDiagram.mxDiagramChangeListener> |
diagramChangeListeners
Holds a list of diagram change listeners.
|
protected java.lang.StringBuffer |
history
Holds the history of all changes of initial state.
|
protected java.lang.String |
initialState
Holds the initial state of the diagram.
|
Constructor and Description |
---|
mxSharedDiagram(java.lang.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(java.lang.Object sender,
java.lang.String xml)
Appends the given string to the history and dispatches the change to all
sessions that are listening to this shared diagram.
|
java.lang.String |
getDelta()
Returns the history of all changes as a string.
|
java.lang.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 java.util.List<mxSharedDiagram.mxDiagramChangeListener> diagramChangeListeners
protected java.lang.String initialState
protected java.lang.StringBuffer history
public mxSharedDiagram(java.lang.String initialState)
initialState
- Initial state of the diagram.public java.lang.String getInitialState()
public void clearHistory()
public java.lang.String getDelta()
public void dispatch(java.lang.Object sender, java.lang.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.