JGraph X 1.3.0.0

## com.mxgraph.sharing
Class mxSharedDiagram

    java.lang.Object
      com.mxgraph.sharing.mxSharedDiagram

    public class mxSharedDiagram

extends java.lang.Object

Implements a diagram that may be shared among multiple sessions.

Nested Class Summary
`static interface` `mxSharedDiagram.mxDiagramChangeListener` Defines the requirements for an object that listens to changes on the shared diagram.

Field Summary
`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 Summary
`mxSharedDiagram(java.lang.String initialState)` Constructs a new diagram with the given initial state.

Method Summary
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### diagramChangeListeners

    protected java.util.List<mxSharedDiagram.mxDiagramChangeListener> diagramChangeListeners

  Holds a list of diagram change listeners.

### initialState

    protected java.lang.String initialState

  Holds the initial state of the diagram.

### history

    protected java.lang.StringBuffer history

  Holds the history of all changes of initial state.

Constructor Detail

### mxSharedDiagram

    public mxSharedDiagram(java.lang.String initialState)

  Constructs a new diagram with the given initial state.

  Parameters:
    `initialState` - Initial state of the diagram.

Method Detail

### getInitialState

    public java.lang.String getInitialState()

  Returns the initial state of the diagram.

### clearHistory

    public void clearHistory()

  Clears the history of all changes.

### getDelta

    public java.lang.String getDelta()

  Returns the history of all changes as a string.

### dispatch

    public 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.

  Parameters:
    `sender` - Session where the change originated from.
    `xml` - XML string that represents the change.

### addDiagramChangeListener

    public void addDiagramChangeListener(mxSharedDiagram.mxDiagramChangeListener listener)

  Adds the given listener to the list of diagram change listeners.

  Parameters:
    `listener` - Diagram change listener to be added.

### removeDiagramChangeListener

    public void removeDiagramChangeListener(mxSharedDiagram.mxDiagramChangeListener listener)

  Removes the given listener from the list of diagram change listeners.

  Parameters:
    `listener` - Diagram change listener to be removed.

JGraph X 1.3.0.0

Copyright (c) 2008 Gaudenz Alder. All rights reserved.